mindspore.ops.coo_isnan
- mindspore.ops.coo_isnan(x)[源代码]
- 判断COOTensor输入数据每个位置上的值是否是Nan。 \[\begin{split}out_i = \begin{cases} & \ True,\ \text{ if } x_{i} = \text{Nan} \\ & \ False,\ \text{ if } x_{i} \ne \text{Nan} \end{cases}\end{split}\]- 其中 \(Nan\) 表示非数字。 - 参数:
- x (COOTensor) - 任意维度的COOTensor。 
 
- 返回:
- COOTensor,输出的shape与输入相同,数据类型为bool。 
- 异常:
- TypeError - x 不是COOTensor。 
 
- 支持平台:
- Ascend- GPU- CPU
 - 样例: - >>> from mindspore import dtype as mstype >>> from mindspore import Tensor, ops, COOTensor >>> indices = Tensor([[0, 1], [1, 2]], dtype=mstype.int64) >>> values = Tensor([-1, 2], dtype=mstype.float32) >>> shape = (3, 4) >>> x = COOTensor(indices, values, shape) >>> output = ops.coo_isnan(x) >>> print(output.values) [False False]