mindspore.ops.deepcopy

View Source On Gitee
mindspore.ops.deepcopy(input_x)[source]

Returns a deepcopy of input tensor.

Parameters

input_x (Tensor) – The shape of tensor is \((x_1, x_2, ..., x_R)\).

Returns

Tensor, a deepcopy of input_x.

Raises

TypeError – If input_x is not a Tensor.

Supported Platforms:

Ascend GPU CPU

Examples

>>> import mindspore
>>> from mindspore import Tensor, ops
>>> input = Tensor([[0, 1], [2, 1]], dtype=mindspore.int32)
>>> output = ops.deepcopy(input)
>>> print(output)
[[0 1]
[2 1]]