-
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】add complex support for numel #56412
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
This comment was marked as resolved.
This comment was marked as resolved.
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_numel_op.py
Lines 25 to 30 in c76dea6
class TestNumelOp(OpTest): | |
def setUp(self): | |
self.op_type = "size" | |
self.python_api = paddle.numel | |
self.init() | |
x = np.random.random(self.shape).astype(self.dtype) |
在 L30 添加一下 dtype 为 complex 时的条件。按照目前 L30 的逻辑,最后 x 的虚部全为 0。建议:
if self.dtype == np.complex64 or self.dtype == np.complex128:
x = (np.random.random(self.shape) + 1j * np.random.random(self.shape)).astype(self.dtype)
可在本地 check 一下 x 的值,确保虚部也有值
This comment was marked as off-topic.
This comment was marked as off-topic.
这个会最后处理,不用担心这条流水线 |
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
* add complex numel * change test && add doc
PR types
New features
PR changes
OPs
Description
add complex support for numel
先完成 numel 的复数支持,才可以继续做之后的部分