-
Notifications
You must be signed in to change notification settings - Fork 762
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
Changes from 14 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
3ab92b9
add remainder_ docs
zrr1999 3616f15
modified
zrr1999 3c5e2da
modified
zrr1999 2722aa5
modified
zrr1999 84d5e32
modified
zrr1999 9c42fab
modified
zrr1999 c0e9ca0
Update docs/api/paddle/remainder__cn.rst
zrr1999 648eb0d
Update docs/api/api_label
zrr1999 c3c0255
Update docs/api/paddle/remainder__cn.rst
zrr1999 ca70a0d
modified
zrr1999 a90d81b
modified
zrr1999 3000584
modified
zrr1999 e30a729
modified
zrr1999 8d641e1
modified
zrr1999 46bb64c
modified
zrr1999 af7cef5
modified
zrr1999 921b7d7
modified
zrr1999 85f8c45
modified
zrr1999 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
.. _cn_api_tensor_remainder_: | ||
|
||
remainder\_ | ||
------------------------------- | ||
|
||
.. py:function:: paddle.remainder_(x, y, name=None) | ||
|
||
Inplace 版本的 :ref:`cn_api_tensor_remainder` API,对输入 `x` 采用 Inplace 策略。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
.. _cn_api_tensor_remainder: | ||
|
||
remainder | ||
------------------------------- | ||
|
||
.. py:function:: paddle.remainder(x, y, name=None) | ||
|
||
|
||
逐元素取模算子。公式为: | ||
|
||
.. math:: | ||
\\out = x \% y\\ | ||
|
||
.. note:: | ||
``paddle.remainder`` 遵守 broadcasting,如您想了解更多,请参见 :ref:`cn_user_guide_broadcasting` 。 | ||
zrr1999 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
参数 | ||
::::::::: | ||
|
||
- **x**(Tensor)- 多维 Tensor。数据类型为 float32 、float64、int32 或 int64。 | ||
- **y**(Tensor)- 多维 Tensor。数据类型为 float32 、float64、int32 或 int64。 | ||
- **name**(str,可选) - 具体用法请参见 :ref:`api_guide_Name` ,一般无需设置,默认值为 None。 | ||
|
||
返回 | ||
::::::::: | ||
``Tensor``,存储运算后的结果。如果 x 和 y 有不同的 shape 且是可以广播的,返回 Tensor 的 shape 是 x 和 y 经过广播后的 shape。如果 x 和 y 有相同的 shape,返回 Tensor 的 shape 与 x,y 相同。 | ||
|
||
代码示例 | ||
::::::::: | ||
|
||
COPY-FROM: paddle.remainder |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
有点奇怪的是,这个页面(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 内容基本是一致的)
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.
这个很神奇,因为代码里就是这么写的:https://github.com/PaddlePaddle/Paddle/blob/develop/python/paddle/tensor/math.py#L787
也就是说这三个API拥有同一个ID,所以官网只会生成其中一个API文档,这个我之前提过,解决办法就是def 三个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.
这样?呃……好麻烦……