-
#include "tensorstore/tensorstore.h" -
template <typename SourceTensorstore, typename TargetArray>
requires CanReadTensorstoreToArray<
UnwrapResultType<SourceTensorstore>,
UnwrapResultType<TargetArray>>
Future<void> tensorstore::Read(SourceTensorstore&& source,
TargetArray&& target,
ReadOptions options); -
template <typename SourceTensorstore,
typename TargetArray,
typename... Option>
requires IsCompatibleOptionSequence<ReadOptions, Option...> &&
CanReadTensorstoreToArray<
UnwrapResultType<SourceTensorstore>,
UnwrapResultType<TargetArray>>
Future<void> tensorstore::Read(SourceTensorstore&& source,
TargetArray&& target,
Option&&... option); Copies from
sourceTensorStore totargetarray.The domain of
sourceis resolved viaResolveBoundsand then aligned/broadcast to the domain oftargetviaAlignDomainTo.The
targetarray must be a SharedArray; it must remain valid until the Future has completed. If an error occurs while reading, thetargetarray may be left in a partially-written state.Options compatible with
ReadOptionsare specified in any order aftertarget. The meaning of each option is determined by its type.Supported option types are:
Example:
TensorReader<int32_t, 3> store = ...; auto array = AllocateArray<int32_t>({25, 30}); Read(store | AllDims().TranslateSizedInterval({100, 200}, {25, 30})), array).value();- Parameters:¶
- SourceTensorstore &&source¶
Source
TensorStoreobject that supports reading. May beResult-wrapped.- TargetArray &&target¶
ArrayorTransformedArraywith a non-constelement type. May beResult-wrapped. This array must remain valid until the returned future becomes ready.- ReadOptions options¶
Any option compatible with
ReadOptions.
- Returns:¶
A future that becomes ready when the read has completed successfully or has failed.
Related Types¶
- struct tensorstore::ReadProgress;
Specifies progress statistics for
Readoperations.
- struct tensorstore::ReadOptions;
Options for
tensorstore::Readinto an existing target array.
Related Constants¶
- constexpr bool tensorstore::CanReadTensorstoreToArray<Source, Dest>;
Evaluates whether the constraints required for
tensorstore::Readare satisfied.