#include "tensorstore/tensorstore.h"
template <typename Source, typename Target>
  
requires CanCopyTensorStoreToTensorStore<UnwrapResultType<Source>,
                                          
 UnwrapResultType<Target>>
WriteFutures tensorstore::Copy(Source&source,
                               
Target&target,
                               
CopyOptions options);
template <typename Source, typename Target, typename... Option>
  
requires IsCompatibleOptionSequence<CopyOptions, Option...> &&
          
 CanCopyTensorStoreToTensorStore<UnwrapResultType<Source>,
                                          
 UnwrapResultType<Target>>
WriteFutures tensorstore::Copy(Source&source,
                               
Target&target,
                               
Option&&... option);

Copies from source TensorStore to target TensorStore.

The domains of source and target are resolved via ResolveBounds, and then the domain of source is aligned/broadcast to the domain of target via AlignDomainTo.

If an error occurs while copying, the target TensorStore may be left in a partially-written state.

Options compatible with CopyOptions are specified in any order after target. The meaning of each option is determined by its type.

Supported option types are:

Example:

TensorReader<int32_t, 3> source = ...;
TensorWriter<int32_t, 3> target = ...;
Copy(
    store | AllDims().SizedInterval({100, 200}, {25, 30}),
    store | AllDims().SizedInterval({400, 500}, {25, 30})).
    commit_future.value();
Parameters:
Source &&source

The source TensorStore that supports reading. May be Result-wrapped. The source must remain valid until the returned WriteFutures::copy_future becomes ready.

Target &&target

The target TensorStore that supports writing. May be Result-wrapped.

CopyOptions options

Any option compatible with CopyOptions.

membergoup I/O

struct tensorstore::CopyProgress;

Specifies progress statistics for Copy operations.

struct tensorstore::CopyOptions;

Options for tensorstore::Copy.

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

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