forked from mindspore-Ecosystem/mindspore
19 lines
441 B
ReStructuredText
19 lines
441 B
ReStructuredText
|
|
mindspore.ops.nonzero
|
|||
|
|
=====================
|
|||
|
|
|
|||
|
|
.. py:function:: mindspore.ops.nonzero(x)
|
|||
|
|
|
|||
|
|
计算x中非零元素的下标。
|
|||
|
|
|
|||
|
|
**参数:**
|
|||
|
|
|
|||
|
|
- **x** (Tensor) - nonzero的输入,任意维度的Tensor,秩应大于1。其数据类型为数值型和布尔型。
|
|||
|
|
|
|||
|
|
**返回:**
|
|||
|
|
|
|||
|
|
Tensor,维度为2,类型为int64。
|
|||
|
|
|
|||
|
|
**异常:**
|
|||
|
|
|
|||
|
|
- **TypeError** - `x` 不是Tensor。
|
|||
|
|
- **ValueError** - `x` 的维度为0。
|