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

【PaddlePaddle Hackathon 3 No.14】为 Paddle 新增 remainder_ API #5156

Merged
merged 18 commits into from
Aug 31, 2022

Conversation

zrr1999
Copy link
Member

@zrr1999 zrr1999 commented Aug 19, 2022

PaddlePaddle/Paddle#45266 的中文文档
PADDLEPADDLE_PR=45266

@paddle-bot
Copy link

paddle-bot bot commented Aug 19, 2022

感谢你贡献飞桨文档,文档预览构建中,Docs-New 跑完后即可预览,预览链接:http://preview-pr-5156.paddle-docs-preview.paddlepaddle.org.cn/documentation/docs/zh/api/index_cn.html
预览工具的更多说明,请参考:[Beta]飞桨文档预览工具

@Ligoml
Copy link
Collaborator

Ligoml commented Aug 26, 2022

paddle.remainder_的中文文档也需要单独创建一个文件

@zrr1999
Copy link
Member Author

zrr1999 commented Aug 26, 2022

paddle.remainder_的中文文档也需要单独创建一个文件

好的,已经添加

@Ligoml
Copy link
Collaborator

Ligoml commented Aug 26, 2022

paddle.remainder_的中文文档也需要单独创建一个文件

好的,已经添加

我指的是paddle.remainder_ ,inplace的这个API也需要自己的文档哈~ 另外paddle.remainder因为一些原因缺失了中文文档,感谢补充
inplace的文档可以参考这个:paddle.reshape_

@zrr1999
Copy link
Member Author

zrr1999 commented Aug 26, 2022

paddle.reshape_

好的,这部分也已经添加啦

docs/api/paddle/remainder__cn.rst Outdated Show resolved Hide resolved
docs/api/paddle/remainder__cn.rst Outdated Show resolved Hide resolved
docs/api/api_label Outdated Show resolved Hide resolved
docs/api/paddle/remainder_cn.rst Outdated Show resolved Hide resolved
docs/api/paddle/remainder_cn.rst Outdated Show resolved Hide resolved
@@ -0,0 +1,29 @@
.. _cn_api_tensor_remainder:
Copy link
Member

Choose a reason for hiding this comment

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

有点奇怪的是,这个页面(https://preview-pr-5156.paddle-docs-preview.paddlepaddle.org.cn/documentation/docs/zh/api/paddle/remainder_cn.html)无法渲染在侧边栏,在该页面也无法渲染侧边栏

https://github.com/PaddlePaddle/Paddle/blob/126940b344022c44cc220a7e0214fcf300957b7e/python/paddle/tensor/math.py#L787

另外 mod 和 remainder 只是 alias 关系,也许我们可以有一个规范来避免这种重复 @BrilliantYuKaimin (这个和 mod 内容基本是一致的)

Copy link
Collaborator

@Ligoml Ligoml Aug 30, 2022

Choose a reason for hiding this comment

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

这个很神奇,因为代码里就是这么写的:https://github.com/PaddlePaddle/Paddle/blob/develop/python/paddle/tensor/math.py#L787

mod = remainder  # noqa: F841
floor_mod = remainder  # noqa: F841

也就是说这三个API拥有同一个ID,所以官网只会生成其中一个API文档,这个我之前提过,解决办法就是def 三个API,然后分别管理文档

Copy link
Member

Choose a reason for hiding this comment

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

def mod(x, y, name=None):
    return remainder(x, y, name)

mod.__doc__ = remainder.__doc__

这样?呃……好麻烦……

Copy link
Member

@SigureMo SigureMo left a 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/remainder_cn.rst Outdated Show resolved Hide resolved
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 for docs

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