-
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
add fusepass Reshape2MatmulFusePass AdaptivePool2dConvertGlobalPass #33555
Conversation
Thanks for your contribution! |
.AddAttr("adaptive") | ||
.IsBoolEQ(false) | ||
.End() | ||
.AddAttr("ceil_mode") |
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.
ceil_mode缺乏属性约束
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.
global pooling的时候ceil_mode不起作用了,增加了isOptional 约束
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.
ceil_mode需要条件IsType()约束
.End() | ||
.AddAttr("data_format") | ||
.End() | ||
.AddAttr("padding_algorithm") |
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.
padding_algorithm缺乏属性约束
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.
padding_algoritm需要补充一个IsStringIn()的约束
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.
Done
.End() | ||
.AddAttr("ceil_mode") | ||
.End() | ||
.AddAttr("data_format") |
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.
data_format缺乏属性约束
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.
增加了.IsStringIn({"NHWC", "NCHW"})约束
@@ -159,6 +159,58 @@ void Squeeze2MatmulFusePass::ApplyImpl(ir::Graph* graph) const { | |||
AddStatis(found_count); | |||
} | |||
|
|||
Reshape2MatmulFusePass::Reshape2MatmulFusePass() { | |||
AddOpCompat(OpCompat("reshape2")) | |||
.AddInput("X") |
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.
reshape2.pbtxt之前写的有点问题,请参考 #33614 更新reshape2的属性
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.
Thx,已修改
.End() | ||
.AddAttr("data_format") | ||
.End() | ||
.AddAttr("padding_algorithm") |
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.
padding_algoritm需要补充一个IsStringIn()的约束
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.
我们在兼容性判断中新添加了 IsType<@type@>()的类型约束,在此之后的pass的attribute的约束条件,除非已经有了 IsStringIn之类的已经约束了类型的前置条件,否则都需要添加 类型约束。
paddle/fluid/framework/ir/adaptive_pool2d_convert_global_pass.cc
Outdated
Show resolved
Hide resolved
.AddAttr("adaptive") | ||
.IsBoolEQ(false) | ||
.End() | ||
.AddAttr("ceil_mode") |
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.
ceil_mode需要条件IsType()约束
.IsTensor() | ||
.End() | ||
.AddAttr("shape") // ints | ||
.End(); |
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.
shape需要添加类型约束
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
Bug fixes
PR changes
Others
Describe
rename transpose.pbtxt