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

【Infer Symbolic Shape No.120】[BUAA] affine_grid #67364

Merged
merged 12 commits into from
Aug 23, 2024

Conversation

BHmingyang
Copy link
Contributor

PR Category

CINN

PR Types

Others

Description

add affine_grid op
check_pir已经打开,本地测试通过
截屏2024-08-13 11 36 34

Copy link

paddle-bot bot commented Aug 13, 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.

@BHmingyang BHmingyang closed this Aug 13, 2024
@BHmingyang BHmingyang reopened this Aug 13, 2024
@luotao1 luotao1 added contributor External developers HappyOpenSource Pro 进阶版快乐开源活动,更具挑战性的任务 labels Aug 13, 2024
Comment on lines 233 to 234
const int64_t output_shape_size =
static_cast<int64_t>(output_shape_or_data.data().value().size());
Copy link
Contributor

Choose a reason for hiding this comment

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

output_shape_or_data.shape().size()

Copy link
Contributor

Choose a reason for hiding this comment

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

修改后再重新review吧

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

Comment on lines 233 to 234
const int64_t output_shape_size =
static_cast<int64_t>(output_shape_or_data.data().value().size());
Copy link
Contributor

Choose a reason for hiding this comment

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

修改后再重新review吧

infer_context->GetShapeOrDataForValue(op->operand_source(0));
std::vector<symbol::DimExpr> input_dims = input_shape_or_data.shape();

const auto &output_shape_or_data =
Copy link
Contributor

Choose a reason for hiding this comment

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

output_shape 是IntArray类型有可能从attribute传过来,加一个逻辑判断

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

infer_context->GetShapeOrDataForValue(op->operand_source(1));

const int64_t output_shape_size =
static_cast<int64_t>(output_shape_or_data.shape().size());
Copy link
Contributor

Choose a reason for hiding this comment

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

非必要cast,为啥不直接用int接收

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

Comment on lines 251 to 262
if (output_shape_size == 4) {
// N * H * W * 2
output_dims.push_back(infer_context->GetNextSymName()); // H
output_dims.push_back(infer_context->GetNextSymName()); // W
output_dims.push_back(symbol::DimExpr(2)); // 2
} else {
// N * D * H * W * 3
output_dims.push_back(infer_context->GetNextSymName()); // D
output_dims.push_back(infer_context->GetNextSymName()); // H
output_dims.push_back(infer_context->GetNextSymName()); // W
output_dims.push_back(symbol::DimExpr(3)); // 3
}
Copy link
Contributor

Choose a reason for hiding this comment

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

D, H, W可以从output_shape中得到,再确认下吧

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

Comment on lines 245 to 246

output_shape_data = output_shape_or_data.shape();
Copy link
Contributor

Choose a reason for hiding this comment

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

这里应该是取data,可以用details::GetOrCreateExprVecFromData(output_shape_or_data, infer_context)

@luotao1 luotao1 merged commit 4d6d897 into PaddlePaddle:develop Aug 23, 2024
28 of 29 checks passed
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