-
#include "tensorstore/strided_layout.h"
-
template <DimensionIndex SubRank = dynamic_rank,
DimensionIndex R,
ArrayOriginKind O,
ContainerKind C>
requires (SubRank == dynamic_rank)
StridedLayoutView<
RankConstraint::Subtract(RankConstraint::FromInlineRank(R),
SubRank),
O>
tensorstore::GetSubLayoutView(const StridedLayout<R, O, C>& layout,
DimensionIndex sub_rank); -
template <DimensionIndex SubRank,
DimensionIndex R,
ArrayOriginKind O,
ContainerKind C>
requires (SubRank != dynamic_rank)
StridedLayoutView<
RankConstraint::Subtract(RankConstraint::FromInlineRank(R),
SubRank),
O>
tensorstore::GetSubLayoutView(
const StridedLayout<R, O, C>& layout,
std::integral_constant<DimensionIndex, SubRank> sub_rank = {}); Returns a view with the leading
sub_rank
dimensions oflayout
removed.- Template Parameters:¶
- DimensionIndex SubRank = dynamic_rank¶
- DimensionIndex SubRank
Specifies the number of leading dimensions to remove at compile time, or
dynamic_rank
to specify the number of dimensions at run time.
- Parameters:¶
- const StridedLayout<R, O, C> &layout¶
The existing layout.
- DimensionIndex sub_rank¶
- std::integral_constant<DimensionIndex, SubRank> sub_rank = {}
Specifies the number of leading dimensions to remove. Optional if
SubRank != dynamic_rank
.
- Returns:¶
A view that references the same memory as
layout
.