mindspore.numpy.isposinf

View Source On Gitee
mindspore.numpy.isposinf(x)[source]

Tests element-wise for positive infinity, returns result as bool array.

Note

Numpy argument out is not supported. Only np.float32 is currently supported.

Parameters

x (Tensor) – Input values.

Returns

Tensor or scalar, true where x is positive infinity, false otherwise. This is a scalar if x is a scalar.

Raises

TypeError – If the input is not a tensor.

Supported Platforms:

GPU CPU

Examples

>>> import mindspore.numpy as np
>>> output = np.isposinf(np.array([-np.inf, 0., np.inf, np.nan], np.float32))
>>> print(output)
[False False  True False]