Skip to content

【Infer Symbolic Shape BUAA No.70】Add lerp op #66837

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 5 commits into from
Aug 5, 2024

Conversation

Marcusryz
Copy link
Contributor

@Marcusryz Marcusryz commented Jul 31, 2024

PR Category

CINN

PR Types

Others

Description

Add lerp op.

考虑 x,y 和 w 的广播机制,推断出 output形状。

Copy link

paddle-bot bot commented Jul 31, 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.

@luotao1 luotao1 added contributor External developers HappyOpenSource Pro 进阶版快乐开源活动,更具挑战性的任务 labels Jul 31, 2024
Copy link
Contributor

@gongshaotian gongshaotian 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 5914bd9 into PaddlePaddle:develop Aug 5, 2024
31 checks passed
Comment on lines +864 to +874
if (x_ndims > y_ndims) {
out1_shape.assign(x_shape.begin(), x_shape.end());
} else if (x_ndims < y_ndims) {
out1_shape.assign(y_shape.begin(), y_shape.end());
} else {
symbol::DimExprBuilder builder;
for (size_t i = 0; i < x_ndims; ++i) {
out1_shape.emplace_back(builder.Broadcast(x_shape[i], y_shape[i]));
infer_context->AddBroadcastableCstr(x_shape[i], y_shape[i]);
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

rank不同也需要使用broadcast后的shape并且添加约束,对应于代码中前两个if的处理

Copy link
Contributor

Choose a reason for hiding this comment

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

不好意思,已经merge了,需要revert么

Copy link
Contributor Author

Choose a reason for hiding this comment

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

收到,要不我下个 PR 再添上去吧

Copy link
Contributor

Choose a reason for hiding this comment

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

不好意思,已经merge了,需要revert么
revert比较麻烦,泓清提示的是补充信息,不添加也能跑,我让一洲补充一个pr吧

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.

4 participants