Skip to content

Conversation

Hongqing-work
Copy link
Contributor

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

Copy link

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

Comment on lines +405 to +421
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);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

这个是不就算same input result类型的算子了?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

算,但是它其实还有一个输入,只不过没建立约束关系,我认为多输入的最好还是不要放在same input这类里面,感觉稍微有点歧义

Copy link
Contributor

Choose a reason for hiding this comment

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

如果是两个输入那是应该放在binary文件里吧?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

确认了下,FillDiagonalTensor为两个输入,FillDiagonal为单个输入

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

@Hongqing-work Hongqing-work merged commit 913b257 into PaddlePaddle:develop Jul 25, 2024
lixcli pushed a commit to lixcli/Paddle that referenced this pull request Aug 5, 2024
* [CINN]Add more infer_symbol_shape

* add interface in yaml

* fix
@Hongqing-work Hongqing-work deleted the add-infer-shape-func branch September 5, 2024 08:24
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.

3 participants