-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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 No57】 add fp16 & bf16 for flip, fp16 for gaussian #52380
【Hackathon No57】 add fp16 & bf16 for flip, fp16 for gaussian #52380
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
@@ -74,9 +74,21 @@ def setUp(self): | |||
self.op_type = 'flip' | |||
self.python_api = paddle.tensor.flip | |||
self.init_test_case() | |||
self.inputs = {'X': np.random.random(self.in_shape).astype('float64')} | |||
self.input = np.random.random(self.in_shape).astype(self.dtype) |
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.
在使用self.dtype之前没有调用init_dtype函数
self.inputs = {'X': self.input.astype(self.dtype)} | ||
output = output.astype(self.dtype) | ||
|
||
self.outputs = {'Out': output} |
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.
BF16的情况下,outputs部分应当也是用convert_float_to_uint16做类型转换
修改好PR描述后可以重新Close-reopen 一下该PR,让他通过一下CheckPRTemplate 检测 |
3a15ca4
to
cab8b6b
Compare
cab8b6b
to
9e10224
Compare
done,辛苦再review下~ |
LGTM |
self.init_attrs() | ||
self.outputs = {'Out': self.calc_ref_res()} | ||
self.init_dtype() | ||
self.input = np.random.random(self.in_shape).astype(self.dtype) |
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.
当dtype==np.uint16时候self.dtype
需要改成np.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.
done,,辛苦再review下~
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
PR types
Others
PR changes
APIs
Describe
gaussian, 完善FP16单测,确认误差阈值设置是否合理
flip, 增加BF16支持,完善FP16, BF16单测