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

【Hackathon 6th No.31】paddle Normal 分布支持复数 #893

Merged
merged 6 commits into from
May 23, 2024

Conversation

NKNaN
Copy link
Contributor

@NKNaN NKNaN commented May 7, 2024

No description provided.

Copy link

paddle-bot bot commented May 7, 2024

你的PR提交成功,感谢你对开源项目的贡献!
请检查PR提交格式和内容是否完备,具体请参考示例模版
Your PR has been submitted. Thanks for your contribution!
Please check its format and content. For this, you can refer to Template and Demo.

float mean,
float std,
int seed,
bool complex_gaussian,
Copy link
Contributor

Choose a reason for hiding this comment

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

不要给kernel新增参数,合理的设计是通过模板区分是否是复数类型,然后如果是复数类型则调用对应GaussianKernel 的复数特化,可以参考这种写法,https://github.com/PaddlePaddle/Paddle/pull/63720/files

template <typename T, typename Context>
void GaussianKernel(const Context& dev_ctx,
const IntArray& shape,
float mean,
Copy link
Contributor

Choose a reason for hiding this comment

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

同时这里的mean应该不是float表示了

Copy link
Contributor Author

@NKNaN NKNaN May 13, 2024

Choose a reason for hiding this comment

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

如果这里复数特化的时候mean用std::complex<float>类型的话,infermeta要怎么改呢

\end{aligned} $$

# 六、测试和验收的考量

Copy link
Contributor

Choose a reason for hiding this comment

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

测试可以写的更具体一点,要测试哪些性质,比如标准正态分布实部和虚部各自的方差是1/2等等这种

Copy link
Contributor Author

Choose a reason for hiding this comment

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

已更新

@zhiminzhang0830
Copy link

@NKNaN 可以先完善一下“测试和验收的考量” 这一部分

@NKNaN
Copy link
Contributor Author

NKNaN commented May 20, 2024

@NKNaN 可以先完善一下“测试和验收的考量” 这一部分

好的

Copy link

@zhiminzhang0830 zhiminzhang0830 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 160d0ce into PaddlePaddle:master May 23, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants