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

[CINN] Add symbolic select #63971

Merged
merged 5 commits into from May 10, 2024
Merged

[CINN] Add symbolic select #63971

merged 5 commits into from May 10, 2024

Conversation

hxzd5568
Copy link
Contributor

PR Category

CINN

PR Types

New features

Description

Pcard-83399
We add symbolic select.

Copy link

paddle-bot bot commented Apr 29, 2024

你的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.

@hxzd5568 hxzd5568 force-pushed the select branch 2 times, most recently from e0b4244 to 50500ec Compare May 8, 2024 02:56
@hxzd5568 hxzd5568 force-pushed the select branch 2 times, most recently from 182593f to b8bb79e Compare May 9, 2024 06:05
cond_dims.size(),
x_dims.size()));
size_t cond_dims_size = static_cast<size_t>(cond_dims.size());
for (size_t i = 0; i < cond_dims_size; ++i) {
Copy link
Contributor

Choose a reason for hiding this comment

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

这里对于cond_dim、x_dim、y_dim的比较逻辑看起来是一致的,可以考虑使用lambda函数服用逻辑

return paddle.tensor.where(cond, true_branch.sin(), false_branch)


class TestWhere(unittest.TestCase):
Copy link
Contributor

Choose a reason for hiding this comment

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

这里建议继承 base.py 里的TestBase,只重写 init函数逻辑即可。

@6clc 6clc merged commit 8b03a31 into PaddlePaddle:develop May 10, 2024
31 checks passed
co63oc pushed a commit to co63oc/Paddle that referenced this pull request May 11, 2024
* fix where op infer meta check

* convert where to cinn select

* convert where to cinn select

* [CINN] add symbolic select for where

---------

Co-authored-by: phlrain <phliuhongyu@126.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants