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

18 lines
587 B
ReStructuredText
Raw Normal View History

mindspore.ops.rank
===================
.. py:function:: mindspore.ops.rank(input_x)
返回输入Tensor的秩。
返回输入Tensor的秩是一个0维的数据类型为int32Tensor的秩是确定Tensor中每个元素所需的索引数。
参数:
- **input_x** (Tensor) - Tensor的shape为 :math:`(x_1,x_2,...,x_R)` 。数据类型为数值型。
返回:
Tensor表示输入的秩是一个0维的数据类型为int32:math:`R` 。数据类型为int。
异常:
- **TypeError** - 如果 `input_x` 不是Tensor。