mindspore.ops.isreal

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

Return a boolean tensor indicating which elements are real.

A complex value is considered real when its imaginary part is 0.

Parameters

input (Tensor) – The input tensor.

Returns

Tensor

Supported Platforms:

GPU CPU

Examples

>>> import mindspore
>>> input = mindspore.tensor([False, 0j, 1, 2.1, 1+2j])
>>> mindspore.ops.isreal(input)
Tensor(shape=[5], dtype=Bool, value= [ True,  True,  True,  True, False])