Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
90e9a486
P
Paddle
项目概览
PaddlePaddle
/
Paddle
接近 1 年 前同步成功
通知
2292
Star
20931
Fork
5422
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1423
列表
看板
标记
里程碑
合并请求
543
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1,423
Issue
1,423
列表
看板
标记
里程碑
合并请求
543
合并请求
543
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
90e9a486
编写于
12月 22, 2021
作者:
W
wenbin
提交者:
GitHub
12月 22, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
CE fix (#38324)
* CE fix * more format
上级
c9bc2758
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
26 addition
and
6 deletion
+26
-6
paddle/fluid/framework/ir/conv_affine_channel_fuse_pass.cc
paddle/fluid/framework/ir/conv_affine_channel_fuse_pass.cc
+17
-4
paddle/fluid/framework/ir/conv_elementwise_add2_act_fuse_pass.cc
...fluid/framework/ir/conv_elementwise_add2_act_fuse_pass.cc
+1
-1
paddle/fluid/framework/ir/conv_elementwise_add_fuse_pass.cc
paddle/fluid/framework/ir/conv_elementwise_add_fuse_pass.cc
+8
-1
未找到文件。
paddle/fluid/framework/ir/conv_affine_channel_fuse_pass.cc
浏览文件 @
90e9a486
...
...
@@ -130,7 +130,7 @@ ConvAffineChannelFusePass::ConvAffineChannelFusePass() {
.
IsType
<
std
::
vector
<
int
>>
()
.
End
()
.
AddAttr
(
"data_format"
)
.
IsStringIn
({
"NCHW"
/*, "NHWC", "AnyLayout"*/
})
.
IsStringIn
({
"NCHW"
,
"AnyLayout"
})
.
End
();
AddOpCompat
(
OpCompat
(
"affine_channel"
))
...
...
@@ -148,7 +148,7 @@ ConvAffineChannelFusePass::ConvAffineChannelFusePass() {
.
IsTensor
()
.
End
()
.
AddAttr
(
"data_layout"
)
.
IsStringIn
({
"NCHW"
/*, "NHWC", "AnyLayout"*/
})
.
IsStringIn
({
"NCHW"
,
"AnyLayout"
})
.
End
();
AddOpCompat
(
OpCompat
(
"elementwise_add"
))
...
...
@@ -197,6 +197,13 @@ void ConvAffineChannelFusePass::ApplyImpl(ir::Graph* graph) const {
GET_CONV_BN_NODES
(
conv_ac_pattern
);
auto
data_format
=
conv
->
Op
()
->
GetAttrIfExists
<
std
::
string
>
(
"data_format"
);
if
(
data_format
==
"AnyLayout"
)
{
LOG_FIRST_N
(
WARNING
,
1
)
<<
"conv_affine_channel_fuse_pass is enabled, "
"it's wrong if data_format of conv is not "
"NCHW."
;
}
// Get affine_channel bias for resizing eltwise_y!
auto
*
ac_bias_tensor
=
scope
->
FindVar
(
ac_bias
->
Name
())
->
GetMutable
<
LoDTensor
>
();
...
...
@@ -282,7 +289,7 @@ ConvEltwiseAddAffineChannelFusePass::ConvEltwiseAddAffineChannelFusePass() {
.
IsType
<
std
::
vector
<
int
>>
()
.
End
()
.
AddAttr
(
"data_format"
)
.
IsStringIn
({
"NCHW"
/*, "NHWC", "AnyLayout"*/
})
.
IsStringIn
({
"NCHW"
,
"AnyLayout"
})
.
End
();
AddOpCompat
(
OpCompat
(
"affine_channel"
))
.
AddInput
(
"X"
)
...
...
@@ -299,7 +306,7 @@ ConvEltwiseAddAffineChannelFusePass::ConvEltwiseAddAffineChannelFusePass() {
.
IsTensor
()
.
End
()
.
AddAttr
(
"data_layout"
)
.
IsStringIn
({
"NCHW"
/*, "NHWC", "AnyLayout"*/
})
.
IsStringIn
({
"NCHW"
,
"AnyLayout"
})
.
End
();
AddOpCompat
(
OpCompat
(
"elementwise_add"
))
.
AddInput
(
"X"
)
...
...
@@ -347,6 +354,12 @@ void ConvEltwiseAddAffineChannelFusePass::ApplyImpl(ir::Graph* graph) const {
VLOG
(
4
)
<<
"handle ConvBN fuse"
;
GET_CONV_BN_NODES
(
conv_ac_pattern
);
auto
data_format
=
conv
->
Op
()
->
GetAttrIfExists
<
std
::
string
>
(
"data_format"
);
if
(
data_format
==
"AnyLayout"
)
{
LOG_FIRST_N
(
WARNING
,
1
)
<<
"conv_eltwiseadd_affine_channel_fuse_pass is "
"enabled, it's wrong if data_format of conv "
"is not NCHW."
;
}
// OPERATORS
GET_IR_NODE_FROM_SUBGRAPH
(
eltwise
,
eltwise
,
conv_ac_pattern
);
// BIAS inputs
...
...
paddle/fluid/framework/ir/conv_elementwise_add2_act_fuse_pass.cc
浏览文件 @
90e9a486
...
...
@@ -77,7 +77,7 @@ ConvElementwiseAdd2ActFusePass::ConvElementwiseAdd2ActFusePass() {
.
AddAttr
(
"dilations"
)
.
End
()
.
AddAttr
(
"data_format"
)
.
IsStringIn
({
"NHWC"
,
"NCHW"
})
.
IsStringIn
({
"NHWC"
,
"NCHW"
,
"AnyLayout"
})
.
End
();
AddOpCompat
(
OpCompat
(
"elementwise_add"
))
...
...
paddle/fluid/framework/ir/conv_elementwise_add_fuse_pass.cc
浏览文件 @
90e9a486
...
...
@@ -57,7 +57,7 @@ ConvElementwiseAddFusePass::ConvElementwiseAddFusePass() {
.
AddAttr
(
"dilations"
)
.
End
()
.
AddAttr
(
"data_format"
)
.
IsStringIn
({
"NCHW"
/*, "NHWC", "AnyLayout"*/
})
.
IsStringIn
({
"NCHW"
,
"AnyLayout"
})
.
End
();
AddOpCompat
(
OpCompat
(
"elementwise_add"
))
...
...
@@ -97,6 +97,13 @@ void ConvElementwiseAddFusePass::ApplyImpl(ir::Graph* graph) const {
GET_NODES
;
auto
base_op_desc
=
*
conv_op
->
Op
()
->
Proto
();
auto
data_format
=
conv_op
->
Op
()
->
GetAttrIfExists
<
std
::
string
>
(
"data_format"
);
if
(
data_format
==
"AnyLayout"
)
{
LOG_FIRST_N
(
WARNING
,
1
)
<<
"conv_elementwise_add_fuse_pass is enabled, "
"it's wrong if data_format of conv is not "
"NCHW."
;
}
std
::
string
bias_name
=
elementwise_add_in_y
->
Name
();
std
::
string
output_name
=
elementwise_add_out
->
Name
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录