mindspore.numpy.isneginf

mindspore.numpy.isneginf(x)[源代码]

Tests element-wise for negative 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 negative 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.isneginf(np.array([-np.inf, 0., np.inf, np.nan], np.float32))
>>> print(output)
[ True False False False]