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] add paddle.nn.ClipGradByGlobalNorm单测 #277

Merged
merged 41 commits into from
Oct 29, 2021
Merged

[PaddlePaddle Hackathon] add paddle.nn.ClipGradByGlobalNorm单测 #277

merged 41 commits into from
Oct 29, 2021

Conversation

justld
Copy link
Contributor

@justld justld commented Oct 25, 2021

PR types: New features

PR changes: APIs

Describe
Task: #35963
添加paddle.nn.ClipGradByNorm单测,PaddleTest\framework\api\nn\test_clip_grad_by_norm.py.

justld and others added 30 commits October 10, 2021 07:31
…test_clip_grad_by_norm.py, modify test_pixel_shuffle.py
@justld justld changed the title [PaddlePaddle Hackathon] add paddle.nn.ClipGradByNorm单测 [PaddlePaddle Hackathon] add paddle.nn.ClipGradByGlobalNorm单测 Oct 25, 2021
try:
paddle_clip(paddle_data)
except RuntimeError:
pass
Copy link
Collaborator

Choose a reason for hiding this comment

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

使用apibase里面的exception方法

Copy link
Contributor Author

Choose a reason for hiding this comment

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

您好,apibase的exception运行时,425行代码 _check_params函数会把data通过paddle.to_tensor转换成tensor,但是paddle.nn.ClipGradByGlobalNorm实例调用时传入的参数类型是list[tuple, tuple, tuple...],会导致运行出错,所以才使用try except这种方式捕获异常。如果使用exception捕获异常的话,应该怎么修改呢?

@DDDivano DDDivano merged commit ed6d4f1 into PaddlePaddle:develop Oct 29, 2021
@justld justld deleted the test_ClipGradByGlobalNorm branch November 4, 2021 10:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants