mindspore.ops.coo_isinf

mindspore.ops.coo_isinf(x: COOTensor)[源代码]

确定输入COOTensor每个位置上的元素是否为无穷大或无穷小。

outi={ if xi=Inf,  True if xiInf,  False

其中 Inf 表示不是一个数字。

参数:
  • x (COOTensor) - IsInf的输入,shape: (N,) ,其中 表示任意数量的附加维度。

返回:

COOTensor,shape与相同的输入,数据的类型为bool。

异常:
  • TypeError - 如果 x 不是COOTensor。

支持平台:

CPU GPU

样例:

>>> 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_isinf(x)
>>> print(output.values)
[False False]