mindspore.ops.real

View Source On Gitee
mindspore.ops.real(input)[source]

Return a tensor that is the real part of the input. If input is real, it is returned unchanged.

Parameters

input (Tensor) – The input tensor.

Returns

Tensor

Supported Platforms:

Ascend GPU CPU

Examples

>>> import mindspore
>>> input = mindspore.tensor(1.3+0.4j, mindspore.complex64)
>>> output = mindspore.ops.real(input)
>>> print(output)
1.3