mindspore.ops.tril_indices ========================== .. image:: https://mindspore-website.obs.cn-north-4.myhuaweicloud.com/website-images/br_base/resource/_static/logo_source.svg :target: https://gitee.com/mindspore/mindspore/blob/br_base/docs/api/api_python/ops/mindspore.ops.func_tril_indices.rst :alt: 查看源文件 .. py:function:: mindspore.ops.tril_indices(row, col, offset=0, *, dtype=mstype.int64) 返回一个二维的tensor,包含 `row` * `col` 矩阵的下三角元素的索引。第一行是所有索引的行坐标,第二行是所有索引的列坐标。 坐标先按行排序,后按列排序。 .. note:: 在CUDA上运行时, `row` * `col` 必须小于2^59,以防止计算时溢出。 参数: - **row** (int) - 二维tensor的行数。 - **col** (int) - 二维tensor的列数。 - **offset** (int, 可选) - 对角线偏移量。默认 ``0`` 。 - 当 `offset` 是正整数时,对角线向上方偏移。 - 当 `offset` 是负整数时,对角线向下方偏移。 关键字参数: - **dtype** (:class:`mindspore.dtype`, 可选) - 指定数据类型,支持 `mstype.int32` 和 `mstype.int64` ,默认 ``mstype.int64`` 。 返回: Tensor