Skip to content

Conversation

@jiahy0825
Copy link
Contributor

@jiahy0825 jiahy0825 commented Dec 21, 2023

PR types

Bug fixes

PR changes

Others

Description

pcard-76996

[DimExpr] value_shape->data_shape && Fix symbol_dim_expr_test compile error

@paddle-bot
Copy link

paddle-bot bot commented Dec 21, 2023

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

@paddle-bot
Copy link

paddle-bot bot commented Dec 21, 2023

❌ The PR is not created using PR's template. You can refer to this Demo.
Please use PR's template, it helps save our maintainers' time so that more developers get helped.

Comment on lines -59 to -81
// 1. Init pir::program and pir::builder
::pir::IrContext* ctx = ::pir::IrContext::Instance();
::pir::Program program(ctx);
ctx->GetOrRegisterDialect<paddle::dialect::OperatorDialect>();
::pir::Builder builder = ::pir::Builder(ctx, program.block());

// 2. Show fake network, assume calling x.shape correspond to ShapeOp
const std::vector<int64_t> x_shape = {-1, 2};
const std::vector<int64_t> y_shape = {1, -1, 2};
auto x = builder
.Build<paddle::dialect::DataOp>(
"input_x", x_shape, phi::DataType::FLOAT32, phi::GPUPlace())
.result(0);
auto y = builder
.Build<paddle::dialect::DataOp>(
"input_y", y_shape, phi::DataType::FLOAT32, phi::GPUPlace())
.result(0);

auto shape_op = builder.Build<paddle::dialect::ShapeOp>(x);
::pir::Value extend_x = shape_op.out();
paddle::dialect::ReshapeOp reshape_op =
builder.Build<paddle::dialect::ReshapeOp>(y, extend_x);
::pir::Value out = reshape_op.out();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

暂时删掉这部分代码,这部分代码会引入编译符号问题。剩余 code 已经可以展示 ShapeOrData 的用法了

@jiahy0825 jiahy0825 merged commit 1815b99 into PaddlePaddle:develop Dec 22, 2023
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.

2 participants