mindspore/docs/api/api_python/numpy/mindspore.numpy.argwhere.rst

16 lines
562 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.numpy.argwhere
=================================
.. py:function:: mindspore.numpy.argwhere(a)
返回Tensor中非零元素的索引并按元素分组。
参数:
- **a** (Union[list, tuple, Tensor]) - 输入的Tensor。
返回:
Tensor非零元素的索引。索引按元素分组。Tensor的shape为 :math:`(N, a.ndim)` 其中 :math:`N` 为非零元素个数。
异常:
- **TypeError** - 如果输入的 ``a`` 不是类似数组的对象。
- **ValueError** - 如果 ``a`` 的维数为0。