-
Notifications
You must be signed in to change notification settings - Fork 5.8k
[PIR]Fix tests #65911
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
[PIR]Fix tests #65911
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
python/paddle/tensor/manipulation.py
Outdated
if convert_dtype(x.dtype) == 'bool' and not x.stop_gradient: | ||
raise ValueError( | ||
"When the data type of input 'x' for expand_as is bool, " | ||
"you must set its stop_gradient to be False by " | ||
"some_var.stop_gradient = True, supporting " | ||
"some_var as the input 'x'." | ||
) |
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.
这个检查最好只在pir mode下做,否则会影响动态图性能。
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.
这个我在CI的时候遇到了,现在是联系了泽宇,他修改了baseline。欢哥是希望不影响动态图的性能吗?
def TestRuntimeErrorStaticMode(): | ||
paddle.enable_static() | ||
input_pd = paddle.to_tensor( | ||
np.random.random([1, 2]).astype(np.float32) | ||
) | ||
input_pd.grad = paddle.to_tensor( | ||
np.random.random([1, 2]).astype(np.float32) | ||
) | ||
clip_grad_value_(input_pd, clip_value=1) | ||
paddle.disable_static() | ||
|
||
self.assertRaises(RuntimeError, TestRuntimeErrorStaticMode) |
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.
这个老静态图是在尝试验证什么类型的报错?TestRuntimeErrorStaticMode
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.
这个API是只在动态图下运行的,所以进入api后检测到静态题模式会报runtime error
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.
好的
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.
LGTM
* refine tests * fix op benchmark * fix op benchmark
PR Category
Execute Infrastructure
PR Types
Not User Facing
Description
pcard-67164
Fix tests