mindspore.ops.isinf

View Source On Gitee
mindspore.ops.isinf(input)[source]

Return a boolean tensor indicating which elements are +/- inifnity.

Warning

  • This is an experimental API that is subject to change.

  • For Ascend, it is only supported on platforms above Atlas A2.

Parameters

input (Tensor) – The input tensor.

Returns

Tensor

Supported Platforms:

Ascend CPU GPU

Examples

>>> import mindspore
>>> input = mindspore.tensor([-1, 3, float("inf"), float("-inf"), float("nan")])
>>> mindspore.ops.isinf(input)
Tensor(shape=[5], dtype=Bool, value= [False, False,  True,  True, False])