-
Notifications
You must be signed in to change notification settings - Fork 117
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
[PaddlePaddle Hackathon] add paddle.nn.ClipGradByGlobalNorm单测 #277
Conversation
…test_clip_grad_by_norm.py, modify test_pixel_shuffle.py
try: | ||
paddle_clip(paddle_data) | ||
except RuntimeError: | ||
pass |
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.
使用apibase里面的exception方法
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.
您好,apibase的exception运行时,425行代码 _check_params函数会把data通过paddle.to_tensor转换成tensor,但是paddle.nn.ClipGradByGlobalNorm实例调用时传入的参数类型是list[tuple, tuple, tuple...],会导致运行出错,所以才使用try except这种方式捕获异常。如果使用exception捕获异常的话,应该怎么修改呢?
PR types: New features
PR changes: APIs
Describe
Task: #35963
添加paddle.nn.ClipGradByNorm单测,PaddleTest\framework\api\nn\test_clip_grad_by_norm.py.