-
#include "tensorstore/tensorstore.h"
-
template <ArrayOriginKind OriginKind = offset_origin,
typename SourceTensorstore>
Future<
SharedArray<typename UnwrapResultType<SourceTensorstore>::Element,
UnwrapResultType<SourceTensorstore>::static_rank,
OriginKind>>
tensorstore::Read(SourceTensorstore&& source,
ReadIntoNewArrayOptions options); -
template <ArrayOriginKind OriginKind = offset_origin,
typename SourceTensorstore,
typename... Option>
requires IsCompatibleOptionSequence<ReadIntoNewArrayOptions,
Option...>
Future<
SharedArray<typename UnwrapResultType<SourceTensorstore>::Element,
UnwrapResultType<SourceTensorstore>::static_rank,
OriginKind>>
tensorstore::Read(SourceTensorstore&& source, Option&&... option); Copies from a
source
TensorStore
to a newly-allocated targetArray
.Options compatible with
ReadIntoNewArrayOptions
are specified in any order aftersource
. The meaning of each option is determined by its type.Supported option types are:
ContiguousLayoutOrder
, specifying the layout of the returned array. If not specified, defaults toc_order
.
Example:
TensorReader<int32_t, 3> store = ...; auto array = Read( store | AllDims().SizedInterval({100, 200}, {25, 30})) .value();
- Template Parameters:¶
- ArrayOriginKind OriginKind = offset_origin¶
If equal to
offset_origin
(the default), the returned array has the same origin assource
. Otherwise, the returned array is translated to have an origin of zero for all dimensions.
- Parameters:¶
- SourceTensorstore &&source¶
Source TensorStore object that supports reading. May be
Result
-wrapped.- ReadIntoNewArrayOptions options¶
Any option compatible with
ReadIntoNewArrayOptions
.
- Returns:¶
A future that becomes ready when the read has completed successfully or has failed.
Related Types¶
- struct tensorstore::ReadIntoNewArrayOptions;
Options for
tensorstore::Read
into new array.