Skip to content
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

Merged
merged 2 commits into from
Aug 21, 2023
Merged

【Complex op】add complex support for numel #56412

merged 2 commits into from
Aug 21, 2023

Conversation

DrRyanHuang
Copy link
Member

@DrRyanHuang DrRyanHuang commented Aug 17, 2023

PR types

New features

PR changes

OPs

Description

add complex support for numel

先完成 numel 的复数支持,才可以继续做之后的部分

@paddle-bot
Copy link

paddle-bot bot commented Aug 17, 2023

你的PR提交成功,感谢你对开源项目的贡献!
请关注后续CI自动化测试结果,详情请参考Paddle-CI手册
Your PR has been submitted. Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

@paddle-bot paddle-bot bot added the contributor External developers label Aug 17, 2023
@luotao1 luotao1 added the HappyOpenSource 快乐开源活动issue与PR label Aug 18, 2023
@DrRyanHuang

This comment was marked as resolved.

Copy link
Contributor

@ScottWong98 ScottWong98 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 的值,确保虚部也有值

@DrRyanHuang

This comment was marked as off-topic.

@luotao1
Copy link
Contributor

luotao1 commented Aug 18, 2023

打扰孙师傅了,麻烦孙师傅帮我 approve 一下

这个会最后处理,不用担心这条流水线

Copy link
Contributor

@ScottWong98 ScottWong98 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

PaddlePaddle-Gardener

This comment was marked as abuse.

Copy link
Contributor

@GGBond8488 GGBond8488 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@luotao1 luotao1 merged commit f8cba26 into PaddlePaddle:develop Aug 21, 2023
26 checks passed
@DrRyanHuang DrRyanHuang deleted the std branch August 21, 2023 06:53
@luotao1 luotao1 added HappyOpenSource Pro 进阶版快乐开源活动,更具挑战性的任务 and removed HappyOpenSource 快乐开源活动issue与PR labels Sep 6, 2023
BeingGod pushed a commit to BeingGod/Paddle that referenced this pull request Sep 9, 2023
* add complex numel

* change test && add doc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contributor External developers HappyOpenSource Pro 进阶版快乐开源活动,更具挑战性的任务
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants