Skip to content

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.

评论看下是否需要完善

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

4 participants