-
#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
totarget
TensorStore
.The domains of
source
andtarget
are resolved viaResolveBounds
, and then the domain ofsource
is aligned/broadcast to the domain oftarget
viaAlignDomainTo
.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 aftertarget
. 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 beResult
-wrapped. Thesource
must remain valid until the returnedWriteFutures::copy_future
becomes ready.- Target &&target¶
The target
TensorStore
that supports writing. May beResult
-wrapped.- CopyOptions options¶
Any option compatible with
CopyOptions
.
membergoup I/O
Related Types¶
- struct tensorstore::CopyProgress;
Specifies progress statistics for
Copy
operations.
- struct tensorstore::CopyOptions;
Options for
tensorstore::Copy
.
Related Constants¶
-
constexpr bool
tensorstore::CanCopyTensorStoreToTensorStore<Source, Dest>; Evaluates whether the constraints required for
tensorstore::Copy
are satisfied.