mindspore.ops.isfinite
- mindspore.ops.isfinite(input)[source]
Return a boolean tensor indicating which elements are finite.
An element is considered finite if it is not
NaN
,-INF
, orINF
.- Parameters
input (Tensor) – The input tensor.
- Returns
Tensor
- Supported Platforms:
Ascend
GPU
CPU
Examples
>>> import mindspore >>> input = mindspore.tensor([-1, 3, float("inf"), float("-inf"), float("nan")]) >>> mindspore.ops.isfinite(input) Tensor(shape=[5], dtype=Bool, value= [ True, True, False, False, False])