-
#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
sourceTensorStoretotargetTensorStore.The domains of
sourceandtargetare resolved viaResolveBounds, and then the domain ofsourceis aligned/broadcast to the domain oftargetviaAlignDomainTo.If an error occurs while copying, the
targetTensorStore may be left in a partially-written state.Options compatible with
CopyOptionsare 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
TensorStorethat supports reading. May beResult-wrapped. Thesourcemust remain valid until the returnedWriteFutures::copy_futurebecomes ready.- Target &&target¶
The target
TensorStorethat supports writing. May beResult-wrapped.- CopyOptions options¶
Any option compatible with
CopyOptions.
membergoup I/O
Related Types¶
- struct tensorstore::CopyProgress;
Specifies progress statistics for
Copyoperations.
- struct tensorstore::CopyOptions;
Options for
tensorstore::Copy.
Related Constants¶
-
constexpr bool
tensorstore::CanCopyTensorStoreToTensorStore<Source, Dest>; Evaluates whether the constraints required for
tensorstore::Copyare satisfied.