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

21 lines
897 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.tril
===================
.. py:function:: mindspore.ops.tril(input_x, diagonal=0)
返回输入Tensor `input_x` 的下三角形部分(包含对角线和下面的元素)并将其他元素设置为0。
参数:
- **input_x** (Tensor) - 输入Tensor。shape为 :math:`(x_1, x_2, ..., x_R)` 其rank至少为2。
支持的数据类型有包括所有数值型和bool类型。
- **diagonal** (int可选) - 指定对角线位置默认值0指定主对角线。
返回:
Tensor其数据类型和shape维度与 `input_x` 相同。
异常:
- **TypeError** - 如果 `input_x` 不是Tensor。
- **TypeError** - 如果 `diagonal` 不是int类型。
- **TypeError** - 如果 `input_x` 的数据类型既不是数值型也不是bool。
- **ValueError** - 如果 `input_x` 的秩小于2。