-
Notifications
You must be signed in to change notification settings - Fork 5.8k
[CINN]Add more infer shape funcs #65889
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
[CINN]Add more infer shape funcs #65889
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
bool FillDiagonalOpInferSymbolicShape( | ||
pir::Operation *op, pir::InferSymbolicShapeContext *infer_context) { | ||
const auto &x_shape_or_data = | ||
infer_context->GetShapeOrDataForValue(op->operand_source(0)); | ||
std::vector<symbol::DimExpr> x_dims = x_shape_or_data.shape(); | ||
|
||
infer_context->SetShapeOrDataForValue( | ||
op->result(0), | ||
symbol::ShapeOrDataDimExprs{symbol::TensorShapeOrDataDimExprs(x_dims)}); | ||
|
||
return true; | ||
} | ||
|
||
bool FillDiagonal_OpInferSymbolicShape( | ||
pir::Operation *op, pir::InferSymbolicShapeContext *infer_context) { | ||
return FillDiagonalOpInferSymbolicShape(op, infer_context); | ||
} |
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.
这个是不就算same input result类型的算子了?
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.
算,但是它其实还有一个输入,只不过没建立约束关系,我认为多输入的最好还是不要放在same input这类里面,感觉稍微有点歧义
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.
如果是两个输入那是应该放在binary文件里吧?
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.
确认了下,FillDiagonalTensor为两个输入,FillDiagonal为单个输入
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.
LGTM
* [CINN]Add more infer_symbol_shape * add interface in yaml * fix
PR Category
CINN
PR Types
Improvements
Description
Pcard-67164
This PR adds InferSymbolicShapeInterface for
fft_c2c
,fft_c2r
,fft_r2c
,fill
,fill_diagonal
,fill_diagonal_tensor