#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 to target 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 via ResolveBounds and then the domain of source is aligned/broadcast to it via AlignDomainTo.

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 after target. 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 or TransformedArray. May be Result-wrapped. This array must remain valid until the returned WriteFutures::copy_future becomes ready.

Target &&target

The target TensorStore. May be Result-wrapped.

WriteOptions options

Any option compatible with WriteOptions.

membergoup I/O

struct tensorstore::WriteProgress;

Specifies progress statistics for Write operations.

struct tensorstore::WriteOptions;

Options for tensorstore::Write.

constexpr bool tensorstore::CanWriteArrayToTensorStore<Source, Dest>;

Evaluates whether the constraints required for tensorstore::Write are satisfied.