copy#

Copy an operator into a tensor. This is equivalent to (a = b), but may be optimized further since it cannot be chained with other expressions.

template<typename OutputTensor, typename InputTensor, typename Executor>
__MATX_INLINE__ void matx::copy(OutputTensor &out, const InputTensor &in, Executor exec)#

Make a deep copy of a view into another view

Copies the data from a view into another view. Views should normally be backed by different data objects, but it’s not necessary if there is no overlap between the soure and destination. If the source in destination overlap in any way, it is a race condition and the result of the operation is undefined.

Both tensor views must be the same rank and size in every dimension

Parameters:
  • out – Tensor to copy into

  • in – Tensor to copy from

  • exec – Executor to run copy in

template<typename OutputTensor, typename InputTensor>
__MATX_INLINE__ void matx::copy(OutputTensor &out, const InputTensor &in, cudaStream_t stream = 0)#
template<typename Tensor, typename Executor>
__MATX_INLINE__ Tensor matx::copy(const Tensor &in, Executor exec)#

Make a deep copy of a view into a new tensor.

Creates a new tensor of the same rank and dimension as the input view. Copies the data from the input view into the new tensor and returns it.

Parameters:
  • in – Tensor to copy from

  • exec – Executor to run copy in

Returns:

New tensor into which the input view has been copied

template<typename Tensor>
__MATX_INLINE__ Tensor matx::copy(const Tensor &in, cudaStream_t stream = 0)#

Examples#

matx::copy(i_pad_part_v, i, stream);