-
#include "tensorstore/strided_layout.h" -
template <typename LayoutOrder,
DimensionIndex Rank,
ArrayOriginKind OriginKind>
requires IsContiguousLayoutOrder<LayoutOrder, Rank>
void tensorstore::InitializeContiguousLayout(
LayoutOrder order,
Index element_stride,
std::type_identity_t<
span<const Index, RankConstraint::FromInlineRank(Rank)>>
shape,
StridedLayout<Rank, OriginKind>* layout); Initializes
*layoutto a contiguous layout with the specifiedshape.- Parameters:¶
- LayoutOrder order¶
The layout order to use.
- Index element_stride¶
The byte stride for the last dimension if
order == c_order, or for the first dimension iforder == fortran_order. Typically this is equal to the size of the data type. Ifspan(shape).size() == 0, this has no effect.- std::type_identity_t<span<const Index, RankConstraint::FromInlineRank(Rank)>> shape¶
The shape to assign to
*layout. Must be aspanwith a static extent compatible withRankand aspan::value_typeconvertible without narrowing toIndex.- out
- StridedLayout<Rank, OriginKind> *layout¶
Layout to update. The rank will be set to
std::size(shape), and any existing value is ignored.