-
#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
source
TensorStore totarget
array.The domain of
source
is resolved viaResolveBounds
and then aligned/broadcast to the domain oftarget
viaAlignDomainTo
.The
target
array must be a SharedArray; it must remain valid until the Future has completed. If an error occurs while reading, thetarget
array may be left in a partially-written state.Options compatible with
ReadOptions
are 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
TensorStore
object that supports reading. May beResult
-wrapped.- TargetArray &&target¶
Array
orTransformedArray
with a non-const
element 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
Read
operations.
- struct tensorstore::ReadOptions;
Options for
tensorstore::Read
into an existing target array.
Related Constants¶
- constexpr bool tensorstore::CanReadTensorstoreToArray<Source, Dest>;
Evaluates whether the constraints required for
tensorstore::Read
are satisfied.