mindspore.ops.isfinite
- mindspore.ops.isfinite(input)[源代码]
逐元素返回输入tensor中元素是否是有限数。 有限数定义:非
NaN、-INF、INF的元素。- 参数:
input (Tensor) - 输入tensor。
- 返回:
Tensor
- 支持平台:
AscendGPUCPU
样例:
>>> 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])