mindspore.ops.FloatStatus

class mindspore.ops.FloatStatus(*args, **kwargs)[source]

Determines if the elements contain Not a Number(NaN), infinite or negative infinite. 0 for normal, 1 for overflow.

Inputs:
  • input_x (Tensor) - The input tensor. The data type must be float16 or float32.

Outputs:

Tensor, has the shape of (1,), and the dtype is mindspore.dtype.float32.

Raises

TypeError – If dtype of input_x is neither float16 nor float32.

Supported Platforms:

GPU

Examples

>>> float_status = ops.FloatStatus()
>>> input_x = Tensor(np.array([np.log(-1), 1, np.log(0)]), mindspore.float32)
>>> result = float_status(input_x)
>>> print(result)
[1.]