From a1fa20328725cc54a5aafe1035eab3b85c43ef26 Mon Sep 17 00:00:00 2001 From: Tomasz Patejko Date: Tue, 9 Oct 2018 10:41:26 +0200 Subject: [PATCH] MKLDNN conv + elementwise_add fusion: name of the pass reused with name_scope_ --- .../framework/ir/conv_elementwise_add_mkldnn_fuse_pass.cc | 7 +++---- .../framework/ir/conv_elementwise_add_mkldnn_fuse_pass.h | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/paddle/fluid/framework/ir/conv_elementwise_add_mkldnn_fuse_pass.cc b/paddle/fluid/framework/ir/conv_elementwise_add_mkldnn_fuse_pass.cc index 0f3f1572f..2612a1041 100644 --- a/paddle/fluid/framework/ir/conv_elementwise_add_mkldnn_fuse_pass.cc +++ b/paddle/fluid/framework/ir/conv_elementwise_add_mkldnn_fuse_pass.cc @@ -54,16 +54,15 @@ void CorrectGraphEdges(Graph* graph, Node* from, Node* to) { using graph_ptr = std::unique_ptr; graph_ptr ConvElementwiseAddMKLDNNFusePass::ApplyImpl(graph_ptr graph) const { - FusePassBase::Init("conv_elementwise_add_mkldnn_fuse_pass", graph.get()); + FusePassBase::Init(name_scope_, graph.get()); GraphPatternDetector gpd; auto pattern = gpd.mutable_pattern(); - patterns::Conv conv_pattern{pattern, "skip_connections_fusion"}; + patterns::Conv conv_pattern{pattern, name_scope_}; auto conv_output = conv_pattern(); - patterns::ElementwiseAdd elementwise_add_pattern{pattern, - "skip_connections_fusion"}; + patterns::ElementwiseAdd elementwise_add_pattern{pattern, name_scope_}; elementwise_add_pattern(conv_output); conv_output->AsIntermediate(); diff --git a/paddle/fluid/framework/ir/conv_elementwise_add_mkldnn_fuse_pass.h b/paddle/fluid/framework/ir/conv_elementwise_add_mkldnn_fuse_pass.h index e8e407350..f4a899f1a 100644 --- a/paddle/fluid/framework/ir/conv_elementwise_add_mkldnn_fuse_pass.h +++ b/paddle/fluid/framework/ir/conv_elementwise_add_mkldnn_fuse_pass.h @@ -30,7 +30,7 @@ class ConvElementwiseAddMKLDNNFusePass : public FusePassBase { protected: std::unique_ptr ApplyImpl(std::unique_ptr graph) const; - const std::string name_scope_{"conv_elementwise_add_mkldnn_fuse_pass"}; + const std::string name_scope_{"residual_connections_fuse_pass"}; }; } // namespace ir -- GitLab