-
Notifications
You must be signed in to change notification settings - Fork 5.9k
[AMP OP&Test] pad3d add unittests of fp16 and bf16 #51015
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
[AMP OP&Test] pad3d add unittests of fp16 and bf16 #51015
Conversation
|
你的PR提交成功,感谢你对开源项目的贡献! |
| self.python_api = paddle.nn.functional.pad | ||
| self.inputs = {'X': np.random.random(self.shape).astype("float64")} | ||
| self.inputs = { | ||
| 'X': np.random.random(self.shape).astype("float32") |
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.
出于单测后续一致性的考虑,请使用uniform替换random,调用原语请参考https://numpy.org/doc/stable/reference/random/generated/numpy.random.rand.html 和 https://numpy.org/doc/stable/reference/random/generated/numpy.random.uniform.html
| self.check_output(check_eager=True, atol=1e-3) | ||
|
|
||
| def test_check_grad(self): | ||
| self.check_grad(['X'], 'Out', max_relative_error=0.3) |
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.
0.3这个值和规范所给阈值不同,这个值是本地测试出来的么?
|
LGTM |
PR types
Others
PR changes
Others
Describe