mindspore.Tensor.isfinite
- mindspore.Tensor.isfinite()
详情请参考
mindspore.ops.isfinite()
。- 支持平台:
Ascend
GPU
CPU
样例:
>>> import mindspore >>> import numpy as np >>> from mindspore import Tensor >>> x = Tensor(np.array([np.log(-1), 1, np.log(0)]), mindspore.float32) >>> output = Tensor.isfinite(x) >>> print(output) [False True False] >>> x = Tensor(2.1, mindspore.float64) >>> output = Tensor.isfinite(x) >>> print(output) True