From cc1c8e37c146906ed6aa492eee3193d793e2ccc9 Mon Sep 17 00:00:00 2001 From: Tomasz Patejko Date: Fri, 28 Sep 2018 13:53:25 +0200 Subject: [PATCH] MKLDNN conv + elementwise_add fusion: attributes in new conv op copied from old op --- .../framework/ir/conv_elementwise_add_mkldnn_fuse_pass.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 43b8f977cfc..4dd6e273bd3 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 @@ -87,7 +87,10 @@ graph_ptr ConvElementwiseAddMKLDNNFusePass::ApplyImpl(graph_ptr graph) const { op_desc.SetInput("ResidualData", {elementwise_add_x->Name()}); op_desc.SetOutput("Output", {conv_output->Name()}); - op_desc.SetAttr("use_mkldnn", true); + for (const auto& attr : conv_op->Op()->GetAttrMap()) { + op_desc.SetAttr(attr.first, attr.second); + } + op_desc.SetAttr("fuse_residual_connection", true); auto fused_conv_op = g->CreateOpNode(&op_desc); -- GitLab