-
#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
sourcearray totargetTensorStore.The
sourcearray must be a SharedArray; it must remain valid until the WriteFutures::copy_future has completed.The domain of
targetis resolved viaResolveBoundsand then the domain ofsourceis aligned/broadcast to it viaAlignDomainTo.If an error occurs while writing, the
targetTensorStore may be left in a partially-written state.Options compatible with
WriteOptionsare 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
ArrayorTransformedArray. May beResult-wrapped. This array must remain valid until the returnedWriteFutures::copy_futurebecomes 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
Writeoperations.
- struct tensorstore::WriteOptions;
Options for
tensorstore::Write.
Related Constants¶
- constexpr bool tensorstore::CanWriteArrayToTensorStore<Source, Dest>;
Evaluates whether the constraints required for
tensorstore::Writeare satisfied.