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

Conversation

xiaoguoguo626807
Copy link
Contributor

@xiaoguoguo626807 xiaoguoguo626807 commented Apr 11, 2022

PADDLEPADDLE_PR=41639

PaddlePaddle/Paddle#41639

@paddle-bot-old
Copy link

paddle-bot-old bot commented Apr 11, 2022

✅ This PR's description meets the template requirements!
Please wait for other CI results.

@paddle-bot-old
Copy link

Thanks for your contribution!

@CLAassistant
Copy link

CLAassistant commented Apr 11, 2022

CLA assistant check
All committers have signed the CLA.

.. py:function:: paddle.tril_indices(rows, cols, offset=0, dtype=3)


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

Choose a reason for hiding this comment

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

  • 去掉「这个op」的描述,python层面暴露出来的接口已经算api了~
  • 句尾要加句号

- 如果 offset < 0,则取主对角线左下的对角线。
:math:`\{(i, i)\}` for :math:`i \in [0, \min\{d_{1}, d_{2}\} - 1]` 其中
:math:`d_{1}, d_{2}` 是矩阵行列数.
- **dtype** (int,可选)- 指定输出张量的数据类型,默认值为int64。
Copy link
Collaborator

Choose a reason for hiding this comment

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

image

  • 预览格式乱掉了,需要调整一下markdown格式
  • 注意标点符号的正确使用

Copy link
Contributor Author

Choose a reason for hiding this comment

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

这个应该是冒号导致的,我在c178247里修改之后,预览文档那边还显示冒号,不知道是不是没有同步

Copy link
Collaborator

Choose a reason for hiding this comment

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

image

不是因为: ,空一行试试



代码示例
:::::::::
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的形式,参考文档

.. py:function:: paddle.tril_indices(rows, cols, offset=0, dtype='int64')


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

Choose a reason for hiding this comment

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

把「此API」删掉,不需要主语

- 如果 offset < 0,则取主对角线左下的对角线。
:math:`\{(i, i)\}` for :math:`i \in [0, \min\{d_{1}, d_{2}\} - 1]` 其中
:math:`d_{1}, d_{2}` 是矩阵行列数.
- **dtype** (int,可选)- 指定输出张量的数据类型,默认值为int64。
Copy link
Collaborator

Choose a reason for hiding this comment

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

image

不是因为: ,空一行试试


返回
:::::::::
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 link
Collaborator

@Ligoml Ligoml left a comment

Choose a reason for hiding this comment

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

LGTM

@Ligoml
Copy link
Collaborator

Ligoml commented May 10, 2022

需要在 docs/api/paddle/Overview 页面中,添加该API的索引

@Ligoml Ligoml merged commit 0fa9664 into PaddlePaddle:develop May 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants