Skip to content

[CINN]Fix ReshapeOpInferSymbolicShape while target_shape contains 0 #65185

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

Merged
merged 1 commit into from
Jun 17, 2024

Conversation

Aurelius84
Copy link
Contributor

@Aurelius84 Aurelius84 commented Jun 14, 2024

PR Category

CINN

PR Types

Bug fixes

Description

Pcard-67164

Copy link

paddle-bot bot commented Jun 14, 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.

const auto &target_shape = [&] {
std::vector<symbol::DimExpr> target_shape;
for (size_t i = 0; i < shape.size(); ++i) {
if (shape[i] == 0) {
Copy link
Contributor Author

@Aurelius84 Aurelius84 Jun 17, 2024

Choose a reason for hiding this comment

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

对于target_shape=0 的场景,应该使用输入X对应的dim expr,而不是使用0。否则 line 182 行会出现除0的操作。
plush: line 183行的 out_dim_expr = IsZero(target_shape[i]) ? original_shape[i] : out_dim_expr; 应该可以删除,若有其他comment,则一并fix;若无,则单独PR 删除

@tc20042008 tc20042008 merged commit 780fe51 into PaddlePaddle:develop Jun 17, 2024
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.

3 participants