Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
机器未来
Paddle
提交
6efdea89
P
Paddle
项目概览
机器未来
/
Paddle
与 Fork 源项目一致
Fork自
PaddlePaddle / Paddle
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
6efdea89
编写于
4月 15, 2019
作者:
N
nhzlx
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
1. add shuffle_channel_detect
上级
8121b3ec
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
51 addition
and
0 deletion
+51
-0
paddle/fluid/framework/ir/CMakeLists.txt
paddle/fluid/framework/ir/CMakeLists.txt
+1
-0
paddle/fluid/framework/ir/graph_pattern_detector.cc
paddle/fluid/framework/ir/graph_pattern_detector.cc
+31
-0
paddle/fluid/framework/ir/graph_pattern_detector.h
paddle/fluid/framework/ir/graph_pattern_detector.h
+15
-0
paddle/fluid/inference/api/paddle_pass_builder.cc
paddle/fluid/inference/api/paddle_pass_builder.cc
+4
-0
未找到文件。
paddle/fluid/framework/ir/CMakeLists.txt
浏览文件 @
6efdea89
...
...
@@ -70,6 +70,7 @@ pass_library(sync_batch_norm_pass base)
pass_library
(
runtime_context_cache_pass base
)
pass_library
(
quant_conv2d_dequant_fuse_pass inference
)
pass_library
(
fillconstant_elementwisemul_fuse inference
)
pass_library
(
shuffle_channel_detect_pass inference
)
if
(
ANAKIN_FOUND
)
pass_library
(
simplify_anakin_priorbox_detection_out_pass inference
)
...
...
paddle/fluid/framework/ir/graph_pattern_detector.cc
浏览文件 @
6efdea89
...
...
@@ -1706,6 +1706,37 @@ void patterns::QuantDequantOpFuse::operator()(PDNode *quant_op_input,
}
}
void
patterns
::
ShuffleChannelPattern
::
operator
()(
PDNode
*
reshape1_in
)
{
auto
reshape1_op
=
pattern
->
NewNode
(
reshape1_op_repr
())
->
assert_is_op
(
"reshape2"
);
auto
reshape1_out
=
pattern
->
NewNode
(
reshape1_out_repr
())
->
assert_is_op_output
(
"reshape2"
,
"Out"
)
->
assert_is_op_input
(
"transpose2"
)
->
AsIntermediate
();
auto
transpose_op
=
pattern
->
NewNode
(
transpose_op_repr
())
->
assert_is_op
(
"transpose2"
);
auto
transpose_out
=
pattern
->
NewNode
(
transpose_out_repr
())
->
assert_is_op_output
(
"transpose2"
,
"Out"
)
->
assert_is_op_input
(
"reshape2"
)
->
AsIntermediate
();
auto
reshape2_op
=
pattern
->
NewNode
(
reshape2_op_repr
())
->
assert_is_op
(
"reshape2"
);
auto
reshape2_out
=
pattern
->
NewNode
(
reshape2_out_repr
())
->
assert_is_op_output
(
"reshape2"
,
"Out"
)
->
AsOutput
();
reshape1_op
->
LinksFrom
({
reshape1_in
});
reshape1_out
->
LinksFrom
({
reshape1_op
});
transpose_op
->
LinksFrom
({
reshape1_out
});
transpose_out
->
LinksFrom
({
transpose_op
});
reshape2_op
->
LinksFrom
({
transpose_out
});
reshape2_out
->
LinksFrom
({
reshape2_op
});
}
}
// namespace ir
}
// namespace framework
}
// namespace paddle
paddle/fluid/framework/ir/graph_pattern_detector.h
浏览文件 @
6efdea89
...
...
@@ -892,6 +892,21 @@ struct QuantDequantOpFuse : public PatternBase {
}
};
struct
ShuffleChannelPattern
:
public
PatternBase
{
ShuffleChannelPattern
(
PDPattern
*
pattern
,
const
std
::
string
&
name_scope
)
:
PatternBase
(
pattern
,
name_scope
,
"shufflechannel_pattern"
)
{}
void
operator
()(
PDNode
*
reshape1_in
);
PATTERN_DECL_NODE
(
reshape1_op
);
PATTERN_DECL_NODE
(
reshape1_out
);
PATTERN_DECL_NODE
(
transpose_op
);
PATTERN_DECL_NODE
(
transpose_out
);
PATTERN_DECL_NODE
(
reshape2_op
);
PATTERN_DECL_NODE
(
reshape2_out
);
};
}
// namespace patterns
// Link two ir::Nodes from each other.
...
...
paddle/fluid/inference/api/paddle_pass_builder.cc
浏览文件 @
6efdea89
...
...
@@ -79,7 +79,11 @@ const std::vector<std::string> kAnakinSubgraphPasses({
"fc_fuse_pass"
,
//
"conv_elementwise_add_fuse_pass"
,
//
"fc_gru_fuse_pass"
,
//
"graph_viz_pass"
,
//
"shuffle_channel_detect_pass"
,
//
"graph_viz_pass"
,
//
"anakin_subgraph_pass"
,
//
"graph_viz_pass"
,
//
"fc_gru_fuse_pass"
,
//
});
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录