mindspore.ops.imag
- mindspore.ops.imag(input)[source]
Return a new tensor containing imaginary value of the input tensor, element-wise. If element in the input tensor is real, it will return zero.
- Parameters
input (Tensor) – The input tensor.
- Returns
Tensor
- Supported Platforms:
Ascend
GPU
CPU
Examples
>>> import mindspore >>> input = mindspore.tensor([0.22+0.3511j, -0.55-0.6796j, -1.92-0.033j, -0.38-0.2991j]) >>> output = mindspore.ops.imag(input) >>> print(output) [ 0.3511 -0.6796 -0.033 -0.2991]