forked from mindspore-Ecosystem/mindspore
16 lines
487 B
ReStructuredText
16 lines
487 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。 |