Clone

Function Usage

Prototype 1:

Performs a deep copy on a tensor and returns the copied tensor.

Prototype 2:

Performs deep copy on the specified region of a tensor. The content of the src region is copied to the region to which the tensor is assigned. The requirements are as follows:

Prototype

1
2
3
4
// Prototype 1:
Tensor Tensor::Clone(AscendStream &stream=AscendStream::DefaultStream()) const;
// Prototype 2 (not supported by Atlas inference products):
APP_ERROR Tensor::Clone(const Tensor &src, AscendStream &stream = AscendStream::DefaultStream());

Parameters

Parameter

Input/Output

Description

src

Input

Assigns the reference specified region of src to the reference region of the tensor that executes the method.

stream

Input

AscendStream type. The default value is AscendStream::DefaultStream(). When the parameter value is the default value, the API calling is a synchronous operation. In other cases, the API calling is an asynchronous operation.

Response Parameters

Prototype 1:

Data Structure

Description

Tensor

Tensor class. For details, see Tensor.

Prototype 2:

Data Structure

Description

APP_ERROR

For details about the returned error codes, see APP_ERROR Description.