-
#include "tensorstore/index_space/transformed_array.h"
-
template <ArrayOriginKind OriginKind = offset_origin,
typename ElementTag,
DimensionIndex Rank,
ContainerKind LayoutCKind>
Result<Array<ElementTag, Rank, OriginKind>>
tensorstore::TryConvertToArray(
const TransformedArray<ElementTag, Rank, LayoutCKind>&
transformed_array); -
template <ArrayOriginKind OriginKind = offset_origin,
typename ElementTag,
DimensionIndex Rank,
ContainerKind LayoutCKind>
Result<Array<ElementTag, Rank, OriginKind>>
tensorstore::TryConvertToArray(
TransformedArray<ElementTag, Rank, LayoutCKind>&&
transformed_array); -
template <ArrayOriginKind OriginKind = offset_origin>
auto tensorstore::TryConvertToArray(); Returns a view of the array as a regular strided
Array
.This never copies the data; the address of every element in the returned array is the same as in
transformed_array
.When this function succeeds, the result is always the same as
Materialize
when called withoutmust_allocate
.- Template Parameters:¶
- ArrayOriginKind OriginKind = offset_origin¶
Specifies whether to retain the origin offset.
- Error absl::StatusCode::kInvalidArgument:¶
if the array cannot be viewed as a strided array, i.e.
transformed_array.transform()
contains an index array map.