-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
support auto generate for prelu #51913
support auto generate for prelu #51913
Conversation
rerun一下相关CI,关注一下 |
@@ -1089,6 +1089,16 @@ | |||
data_type : x | |||
backward : pow_grad | |||
|
|||
- op : prelu |
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.
查看ci-coverage, 这个错误可能是由test_dropout_nd_op.py
引入的,目前已经屏蔽了这个单测,可以再rerun一下相关CI
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.
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.
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.
paddle/phi/api/yaml/backward.yaml
Outdated
args : (Tensor x, Tensor alpha, Tensor out_grad, str data_format, str mode) | ||
output : Tensor(x_grad), Tensor(alpha_grad) | ||
infer_meta : | ||
func : GeneralBinaryGradInferMeta |
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.
mkldnn失败的原因已确定,这里的不能直接使用GeneralBinaryGradInferMeta
,需要新增函数。建议如下:
- 这里修改为
PreluGradInferMeta
- 在
paddle/phi/infermeta/backward.cc
文件的PixelUnshuffleGradInferMeta
函数后面增加函数
void PreluGradInferMeta(const MetaTensor& x,
const MetaTensor& y,
MetaTensor* dx,
MetaTensor* dy) {
if (dx) {
dx->share_dims(x);
}
if (dy) {
dy->share_dims(y);
}
}
- 在头文件
paddle/phi/infermeta/backward.h
的PixelUnshuffleGradInferMeta
函数后面增加函数声明
void PreluGradInferMeta(const MetaTensor& x,
const MetaTensor& y,
MetaTensor* dx,
MetaTensor* dy);
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.
2. PixelUnshuffleGradInferMeta
收到,已添加
ci 已过,辛苦 @heavyrain-lzy review 一下~ |
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。这个难度较大,能够完成十分优秀 👍
PR types
Others
PR changes
Others
Describe
support auto generate for prelu