-
Notifications
You must be signed in to change notification settings - Fork 764
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
Conversation
✅ This PR's description meets the template requirements! |
Thanks for your contribution! |
docs/api/paddle/tril_indices_cn.rst
Outdated
.. py:function:: paddle.tril_indices(rows, cols, offset=0, dtype=3) | ||
|
||
|
||
这个op返回行数和列数已知的二维矩阵中下三角形矩阵元素的行列坐标,其中下三角矩阵为原始矩阵某一对角线左下部分元素的子矩阵 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- 去掉「这个op」的描述,python层面暴露出来的接口已经算api了~
- 句尾要加句号
docs/api/paddle/tril_indices_cn.rst
Outdated
- 如果 offset < 0,则取主对角线左下的对角线。 | ||
:math:`\{(i, i)\}` for :math:`i \in [0, \min\{d_{1}, d_{2}\} - 1]` 其中 | ||
:math:`d_{1}, d_{2}` 是矩阵行列数. | ||
- **dtype** (int,可选)- 指定输出张量的数据类型,默认值为int64。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个应该是冒号导致的,我在c178247里修改之后,预览文档那边还显示冒号,不知道是不是没有同步
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
||
|
||
代码示例 | ||
::::::::: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
代码示例使用copy-from的形式,参考文档
docs/api/paddle/tril_indices_cn.rst
Outdated
.. py:function:: paddle.tril_indices(rows, cols, offset=0, dtype='int64') | ||
|
||
|
||
此API返回行数和列数已知的二维矩阵中下三角形矩阵元素的行列坐标,其中下三角矩阵为原始矩阵某一对角线左下部分元素的子矩阵。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
把「此API」删掉,不需要主语
docs/api/paddle/tril_indices_cn.rst
Outdated
- 如果 offset < 0,则取主对角线左下的对角线。 | ||
:math:`\{(i, i)\}` for :math:`i \in [0, \min\{d_{1}, d_{2}\} - 1]` 其中 | ||
:math:`d_{1}, d_{2}` 是矩阵行列数. | ||
- **dtype** (int,可选)- 指定输出张量的数据类型,默认值为int64。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
docs/api/paddle/tril_indices_cn.rst
Outdated
|
||
返回 | ||
::::::::: | ||
Tensor,二维矩阵的下三角矩阵行坐标和列坐标。数据类型和参数dtype一致。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
,
--> ,
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
需要在 docs/api/paddle/Overview 页面中,添加该API的索引 |
PADDLEPADDLE_PR=41639
PaddlePaddle/Paddle#41639