CARVIEW |
Navigation Menu
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
[CINN] 【Infer Symbolic Shape BUAA 】Add crop op #67957
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
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
修改下title和description,参考之前review过的pr评论 |
paddle/fluid/pir/dialect/operator/interface/infer_symbolic_shape/unary_infer_sym.cc
Outdated
Show resolved
Hide resolved
paddle/fluid/pir/dialect/operator/interface/infer_symbolic_shape/unary_infer_sym.cc
Outdated
Show resolved
Hide resolved
补充描述下单测状态 |
} else { | ||
const auto &offsets_shape_or_data = | ||
infer_context->GetShapeOrDataForValue(op->operand_source(2)); | ||
offsets = offsets_shape_or_data.data().has_value() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里应该改成GetOrCreateExprVecFromData()
infer_context->GetShapeOrDataForValue(op->operand_source(0)); | ||
const std::vector<symbol::DimExpr> &x_shape = x_shape_or_data.shape(); | ||
std::vector<symbol::DimExpr> offsets; | ||
std::vector<symbol::DimExpr> shape; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shape 和下面 689行的命名重复了
} else { | ||
const auto &shape_or_data = | ||
infer_context->GetShapeOrDataForValue(op->operand_source(1)); | ||
shape = shape_or_data.data().has_value() ? shape_or_data.data().value() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
同上
} | ||
|
||
if (op->HasAttribute("shape")) { | ||
std::vector<int64_t> shape = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里换个命名吧
if (op->HasAttribute("shape")) { | ||
std::vector<int64_t> shape = | ||
paddle::dialect::details::GetVectorAttr<int64_t>(op, "shape"); | ||
for (const auto &i : shape) out_dims.emplace_back(symbol::DimExpr{i}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
是不是应该shape.emplace_back
顺便拉一下develop分支 |
PR Category
CINN
PR Types
improvements
Description
添加 crop算子符号推导接口
本算子包含optest并且已经测试。
部分测试点在infersymbolic shape中传递的是动态的shape,无法实时推导,原始单测会挂,因此关闭单测中部分测试点的symbol_check
Pcard-67164