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

[PHI] Remove infershape of set_value op #40636

Merged
merged 2 commits into from
Mar 17, 2022

Conversation

zyfncg
Copy link
Contributor

@zyfncg zyfncg commented Mar 16, 2022

PR types

Others

PR changes

Others

Describe

Remove infershape of set_value op and add infermeta for set_value in phi

Copy link
Contributor

@chenwhql chenwhql left a comment

Choose a reason for hiding this comment

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

评论看下是否需要完善

@@ -1090,6 +1090,16 @@ void RollInferMeta(const MetaTensor& x,
out->set_dtype(x.dtype());
}

void SetValueInferMeta(const MetaTensor& x, MetaTensor* out) {
Copy link
Contributor

Choose a reason for hiding this comment

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

这个infermeta的参数和kernel参数也不一致吧,后续自动生成到generator.h/cc中的infermeta会和这个函数重名吗

Copy link
Contributor

Choose a reason for hiding this comment

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

这里需要补充下对out dims和dtype的推断吗?虽然原来的没写,但这里应该有?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

这里是先绕过了给算子注册两个InferMeta函数的问题,参数不一致的问题可以在自动生成的时候处理,函数名重名的问题到时候一并解决。
set_value算子是inplace的,正常的话InferMeta里确实也不需要设置,为了稳妥起见迁过来也没有设置dim和dtype,后面有时间再把这里补上测试下

@zyfncg zyfncg merged commit c335288 into PaddlePaddle:develop Mar 17, 2022
@zyfncg zyfncg deleted the remove_set_value_infershape branch March 17, 2022 06:20
liqitong-a pushed a commit to liqitong-a/Paddle that referenced this pull request Mar 17, 2022
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.

4 participants