-
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
[AMP OP&Test] add fp16 test for linspace #52161
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
self.op_type = "linspace" | ||
self.python_api = paddle.linspace | ||
dtype = 'float32' | ||
super().setUp() |
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.
这个setUp可以直接删掉,下同
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.
下面需要input和output跟父类不一样,这个setUp还是留着吧
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.
那可以把input和ouput的赋值都抽出来,跟set_dtype结合一下
self.attrs = {'dtype': int(core.VarDesc.VarType.FP32)} | ||
|
||
self.outputs = {'Out': np.arange(10, -1, -1).astype(dtype)} | ||
self.outputs = {'Out': np.arange(10, -1, -1).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.attrs,下同
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.attrs定义写在 _set_dtype 里了
… into add_fp16_for_linspace
or not core.is_bfloat16_supported(core.CUDAPlace(0)), | ||
'not supported bf16', | ||
) | ||
class TestLinspaceOpCommonCaseBF16(TestLinspaceOpCommonCaseFP16): |
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.
直接继承的TestLinspaceOpCommonCase,里面调用了check_output,当前kernel没有注册CPU的bf16支持,所以会跑到CPU的place上,然后报错
PR types
Others
PR changes
Others
Describe
add fp16 test for linspace