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

19 lines
537 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(input, *, as_tuple=False)
返回所有非零元素下标位置。
参数:
- **input** (Tensor) - 输入tensor。
.. note::
- Ascend输入tensor的秩可以等于0GE后端除外。
- CPU/GPU输入tensor秩应大于等于1。
关键字参数:
- **as_tuple** (bool, 可选) - 是否以tuple形式输出默认 ``False``
返回:
Tensor或者由tensor组成的tuple。