-
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
【PaddlePaddle Hackathon 4】No.63 add fp16 and bf16 for eye and frame #51819
Conversation
or not core.is_bfloat16_supported(core.CUDAPlace(0)), | ||
"core is not complied with CUDA and not support the bfloat16", | ||
) | ||
class TestEyeBF16(OpTest): |
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.
修改类名TestEyeBF16为TestEyeBF16OP
or not core.is_bfloat16_supported(core.CUDAPlace(0)), | ||
"core is not complied with CUDA and not support the bfloat16", | ||
) | ||
class TestFrameBF16(OpTest): |
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.
修改类名TestFrameBF16为TestFrameBF16OP
def setUp(self): | ||
self.op_type = "frame" | ||
self.python_api = paddle.signal.frame | ||
self.__class__.op_type = self.op_type |
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.
这个应该不用在这里设置,OpTest框架里有对应的设置
@Vvsmile 好的,还想问下这个报错需要解决吗? |
这个是前向精度问题,请看一下相关实现里有没有需要转换FP32计算的地方,目前ReRun也可以显示前向差异大小,可用做参考 |
'num_rows': 219, | ||
'num_columns': 319, | ||
} | ||
self.outputs = {'Out': convert_float_to_uint16(np.eye(219, 319))} |
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.
这个我看报错,应该也没必要convert了
def setUp(self): | ||
self.op_type = "frame" | ||
self.python_api = paddle.signal.frame | ||
self.shape, self.dtype, self.attrs = self.initTestCase() |
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=uint16?
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.
@ZzSean 有的,initTestCase()会返回 np.uint16
self.python_api = paddle.signal.frame | ||
self.shape, self.dtype, self.attrs = self.initTestCase() | ||
x = np.random.random(size=self.shape).astype(np.float32) | ||
out = frame_from_librosa(x, **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.
与diagonal问题类似,这里也需要加个.copy()
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
相关链接:
#51281
原来的PR:#51531