Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Hackathon No.5] add tril_indices op docs #4599

Merged
merged 17 commits into from
May 20, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions docs/api/paddle/tril_indices_cn.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
.. _cn_api_tensor_tril_indices:

tril_indices
--------------------------------

.. py:function:: paddle.tril_indices(row, col, offset=0, dtype='int64')

返回行数和列数已知的二维矩阵中下三角矩阵元素的行列坐标,其中下三角矩阵为原始矩阵某一对角线左下部分元素的子矩阵。

参数
:::::::::
- **row** (int) - 输入矩阵的行数。
- **col** (int) - 输入矩阵的列数。
- **offset** (int,可选) - 确定从指定二维平面中获取对角线的位置。

+ 如果 offset = 0, 取主对角线。
+ 如果 offset > 0, 取主对角线右上的对角线。
+ 如果 offset < 0, 取主对角线左下的对角线。

- **dtype** (int,可选) - 指定输出张量的数据类型,默认值为int64。

返回
:::::::::
Tensor,二维矩阵的下三角矩阵行坐标和列坐标。数据类型和参数dtype一致。

代码示例
:::::::::
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

代码示例使用copy-from的形式,参考文档


COPY-FROM: paddle.tril_indices:tril_indices-example