-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
【Hackathon 6th No.31】paddle.standard_normal and paddle.randn support complex normal distribution -part #65032
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
if core.is_compiled_with_cuda() | ||
else paddle.CPUPlace() | ||
) | ||
paddle.disable_static(place) |
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.
动态图、静态图的切换建议使用dygraph_guard、static_guard,保证切换不会影响其他单测
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.
已修改
var_imag = out.numpy().imag.var() | ||
np.testing.assert_allclose(var, 1.0, rtol=0.2, atol=0.2) | ||
np.testing.assert_allclose(var_real, 0.5, rtol=0.2, atol=0.2) | ||
np.testing.assert_allclose(var_imag, 0.5, rtol=0.2, atol=0.2) |
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.
rtol=0.2, atol=0.2参考的是 test_normal 里 TestNormalAPI 类的设置。
改成rtol=0.02, atol=0.02了
paddle.set_device('gpu') | ||
test_complex64() | ||
test_complex128() | ||
paddle.set_device('cpu') |
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.
已修改
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
…complex normal distribution -part (PaddlePaddle#65032) * update standard_normal and randn * update standard_normal * revise code examples * update randn * update test * update test * fix test and docs example
PR Category
User Experience
PR Types
Improvements
Description
Upgrade paddle.standard_normal, paddle.randn to support complex normal distribution.
Also add code examples for paddle.normal