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

[xdoctest] reformat example code with google style in No.297、298、302 #56861

Merged
merged 15 commits into from
Sep 6, 2023

Conversation

yuchen202
Copy link
Contributor

PR types

Others

PR changes

Others

Description

修改如下文件的示例代码,使其通过 xdoctest 检查:

Related links

@paddle-bot
Copy link

paddle-bot bot commented Sep 1, 2023

你的PR提交成功,感谢你对开源项目的贡献!
请关注后续CI自动化测试结果,详情请参考Paddle-CI手册
Your PR has been submitted. Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

@paddle-bot paddle-bot bot added the contributor External developers label Sep 1, 2023
@luotao1 luotao1 added the HappyOpenSource Pro 进阶版快乐开源活动,更具挑战性的任务 label Sep 1, 2023
Copy link
Member

Choose a reason for hiding this comment

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

这个文件 #56826 已经改过了,需要恢复

@@ -515,6 +515,7 @@ class Conv1DTranspose(_ConvNd):
>>> print(y)
Tensor(shape=[1, 1, 5], dtype=float32, place=Place(cpu), stop_gradient=False,
[[[60., 16., 99., 75., 4. ]]])

Copy link
Member

Choose a reason for hiding this comment

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

这里为什么要改?需要恢复

@SigureMo SigureMo changed the title [xdoctest] reformat example code with google style in No.291、297、298、201、302、306 [xdoctest] reformat example code with google style in No.297、298、301、302、306 Sep 4, 2023
@SigureMo SigureMo changed the title [xdoctest] reformat example code with google style in No.297、298、301、302、306 [xdoctest] reformat example code with google style in No.297、298、301、302 Sep 4, 2023
Comment on lines 472 to 481
>>> import paddle
>>> from paddle.fluid.ir import RegisterPass

>>> @RegisterPass
>>> def multi_add_to_addn():
... def pattern(x, y, z):
... return paddle.add(paddle.add(x, y), z)
... def replace(x, y, z):
... return paddle.add_n([x, y, z])
... return pattern, replace
Copy link
Member

Choose a reason for hiding this comment

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

需要加缩进

Copy link
Member

Choose a reason for hiding this comment

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

是我看错了么,这个文件没恢复啊

Copy link
Contributor Author

Choose a reason for hiding this comment

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

恢复了,因为不需要改

Copy link
Member

Choose a reason for hiding this comment

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

这个文件仍然有 diff,需要 merge develop 确保没有 diff

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sure?我是直接用的paddle官方的py文件替换的

@SigureMo SigureMo changed the title [xdoctest] reformat example code with google style in No.297、298、301、302 [xdoctest] reformat example code with google style in No.297、298、302 Sep 5, 2023
@SigureMo
Copy link
Member

SigureMo commented Sep 5, 2023

是解决冲突、恢复修改,不是删文件 python/paddle/incubate/operators/unzip.pypython/paddle/incubate/optimizer/modelaverage.py 两个文件做的都不对,学习一下吧

... # Call the bfgs method to optimize the loss, note that the third parameter returned represents the weight
... w_update = paddle.incubate.optimizer.functional.minimize_bfgs(loss, w)[2]
... # Use paddle.assign to update parameters in place
... paddle. assign(w_update, w)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
... paddle. assign(w_update, w)
... paddle.assign(w_update, w)

python/paddle/incubate/optimizer/functional/bfgs.py Outdated Show resolved Hide resolved
python/paddle/incubate/optimizer/functional/lbfgs.py Outdated Show resolved Hide resolved
python/paddle/incubate/optimizer/functional/lbfgs.py Outdated Show resolved Hide resolved
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.

LGTMeow 🐾

@luotao1 luotao1 merged commit 7daffbf into PaddlePaddle:develop Sep 6, 2023
25 of 26 checks passed
BeingGod pushed a commit to BeingGod/Paddle that referenced this pull request Sep 9, 2023
…addlePaddle#56861)

* 更改相关文件

* Update ir.py

* 恢复相关文件

* Update ir.py

* Delete python/paddle/incubate/optimizer/modelaverage.py

* Delete modelaverage.py

* 尝试恢复文件

* Revert "尝试恢复文件"

This reverts commit 8a263cf.

* Revert "恢复相关文件"

This reverts commit 24249b8.

* Revert "Revert "尝试恢复文件""

This reverts commit 1b833d6.

* Revert "Revert "Revert "尝试恢复文件"""

This reverts commit 64b3a81.

* Revert "Delete python/paddle/incubate/optimizer/modelaverage.py"

This reverts commit 6198629.

* Revert "更改相关文件"

This reverts commit a5ba675.

* Apply suggestions from code review

---------

Co-authored-by: Nyakku Shigure <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contributor External developers HappyOpenSource Pro 进阶版快乐开源活动,更具挑战性的任务
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants