mindspore.ops.view_as_real

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

Return a real tensor with the last dimension of size 2, composed of the real and imaginary parts of the complex elements in the input tensor.

Parameters

input (Tensor) – The complex input tensor.

Returns

A real tensor.

Supported Platforms:

GPU CPU

Examples

>>> import mindspore
>>> input = mindspore.tensor([2+1j,2+3j,2-1j,2])
>>> output = mindspore.ops.view_as_real(input)
>>> print(output)
[[ 2.  1.]
 [ 2.  3.]
 [ 2. -1.]
 [ 2.  0.]]