-
#include "tensorstore/tensorstore.h"
-
template <typename SourceArray, typename Target>
requires CanWriteArrayToTensorStore<UnwrapResultType<SourceArray>,
UnwrapResultType<Target>>
WriteFutures tensorstore::Write(SourceArray&& source,
Target&& target,
WriteOptions options); -
template <typename SourceArray, typename Target, typename... Option>
requires IsCompatibleOptionSequence<WriteOptions, Option...> &&
CanWriteArrayToTensorStore<UnwrapResultType<SourceArray>,
UnwrapResultType<Target>>
WriteFutures tensorstore::Write(SourceArray&& source,
Target&& target,
Option&&... option); Copies from a
source
array totarget
TensorStore.The
source
array must be a SharedArray; it must remain valid until the WriteFutures::copy_future has completed.The domain of
target
is resolved viaResolveBounds
and then the domain ofsource
is aligned/broadcast to it viaAlignDomainTo
.If an error occurs while writing, the
target
TensorStore may be left in a partially-written state.Options compatible with
WriteOptions
are specified in any order aftertarget
. The meaning of each option is determined by its type.Supported option types are:
Example:
TensorWriter<int32_t, 3> store = ...; SharedArray<int32_t, 3> array = ...; Write(store | AllDims().TranslateSizedInterval({100, 200}, {25, 30}), array).commit_future.value();
- Parameters:¶
- SourceArray &&source¶
The source
Array
orTransformedArray
. May beResult
-wrapped. This array must remain valid until the returnedWriteFutures::copy_future
becomes ready.- Target &&target¶
The target
TensorStore
. May beResult
-wrapped.- WriteOptions options¶
Any option compatible with
WriteOptions
.
membergoup I/O
Related Types¶
- struct tensorstore::WriteProgress;
Specifies progress statistics for
Write
operations.
- struct tensorstore::WriteOptions;
Options for
tensorstore::Write
.
Related Constants¶
- constexpr bool tensorstore::CanWriteArrayToTensorStore<Source, Dest>;
Evaluates whether the constraints required for
tensorstore::Write
are satisfied.