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

21 lines
997 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.TriuIndices
==========================
.. py:class:: mindspore.ops.TriuIndices(row, col, offset=0, dtype=mstype.int32)
计算 `row` * `col` 行列矩阵的上三角元素的索引,并将它们作为一个 2xN 的Tensor返回。
.. warning::
这是一个实验性API后续可能修改或删除。
更多参考详见 :func:`mindspore.ops.triu_indices`
参数:
- **row** (int) - 2-D 矩阵的行数。
- **col** (int) - 2-D 矩阵的列数。
- **offset** (int可选) - 对角线偏移量。默认值: ``0``
- **dtype** (:class:`mindspore.dtype`,可选) - 指定输出Tensor数据类型支持的数据类型为 ``mstype.int32````mstype.int64`` ,默认值: ``mstype.int32``
输出:
- **y** (Tensor) - 矩阵的上三角形部分的索引。数据类型由 `dtype` 指定shape为 :math:`(2, triu\_size)` ,其中,:math:`triu\_size` 为上三角矩阵的元素总数。