mindspore/docs/api/api_python/ops/mindspore.ops.func_nonzero.rst

16 lines
487 B
ReStructuredText
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

mindspore.ops.nonzero
=====================
.. py:function:: mindspore.ops.nonzero(x)
计算x中非零元素的下标。
参数:
- **x** (Tensor) - nonzero的输入任意维度的Tensor秩应大于1。其数据类型为数值型和布尔型。
返回:
Tensor维度为2类型为int64表示输入中所有非零元素的下标。
异常:
- **TypeError** - `x` 不是Tensor。
- **ValueError** - `x` 的维度为0。