mars.tensor.isreal#

mars.tensor.isreal(x, **kwargs)[source]#

Returns a bool tensor, where True if input element is real.

If element has complex type with zero complex part, the return value for that element is True.

Parameters

x (array_like) – Input tensor.

Returns

out – Boolean tensor of same shape as x.

Return type

Tensor, bool

See also

iscomplex

isrealobj

Return True if x is not a complex type.

Examples

>>> import mars.tensor as mt
>>> mt.isreal([1+1j, 1+0j, 4.5, 3, 2, 2j]).execute()
array([False,  True,  True,  True,  True, False])