-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
【complex op】No.6 add complex support for logical_and/or/xor/not #56323
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
@jinyouzhi 可以先在本地看下 test/legacy_test/test_logical_op.py 是否能通过测试 |
87e3cbb
to
a0febdc
Compare
@ScottWong98 改完了 |
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.
Paddle/test/legacy_test/test_logical_op.py
Lines 123 to 130 in a0febdc
def np_data_generator(np_shape, dtype, *args, **kwargs): | |
if dtype == bool: | |
return np.random.choice(a=[True, False], size=np_shape).astype(bool) | |
elif dtype == np.uint16: | |
x = np.random.uniform(0.0, 1.0, np_shape).astype(np.float32) | |
return convert_float_to_uint16(x) | |
else: | |
return np.random.normal(0, 1, np_shape).astype(dtype) |
需判断 dtype 为 np.complex64 或 np.complex128 的情况,否则 L130 最终返回复数的虚部全为0
已添加。 |
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
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
@jinyouzhi 中文文档也要修复一下 |
…lePaddle#56323) * 【complex op】No.6 add complex support for logical_and/or/xor/not * fix dtype check * modify the docs * add special condition for not raise when x.dtype is complex * add random generate for complex dtype * fix generate for complex * fix * fix * add corner case for complex type * fix ut * fix ut
PR types
New features
PR changes
OPs
Description
#56145