mindspore.numpy.isposinf
- mindspore.numpy.isposinf(x)[源代码]
Tests element-wise for positive infinity, returns result as bool array.
说明
Numpy argument out is not supported. Only np.float32 is currently supported.
- 参数
x (Tensor) – Input values.
- 返回
Tensor or scalar, true where x is positive infinity, false otherwise. This is a scalar if x is a scalar.
- 异常
TypeError – If the input is not a tensor.
- Supported Platforms:
GPU
CPU
样例
>>> 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]