From 9b63e7f2cbfb08bb1eae7a381a009fe6115f6f3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E6=98=8E=E5=86=AC?= <78149749+winter-wang@users.noreply.github.com> Date: Wed, 21 Jul 2021 16:20:08 +0800 Subject: [PATCH] [pass_enhance]fix the error in conv_bias_mkldnn_fuse_pass, test=develop (#34292) --- paddle/fluid/framework/ir/mkldnn/conv_bias_mkldnn_fuse_pass.cc | 2 +- .../framework/ir/mkldnn/conv_bias_mkldnn_fuse_pass_tester.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/paddle/fluid/framework/ir/mkldnn/conv_bias_mkldnn_fuse_pass.cc b/paddle/fluid/framework/ir/mkldnn/conv_bias_mkldnn_fuse_pass.cc index 74bbe24eb82..a7514038d40 100644 --- a/paddle/fluid/framework/ir/mkldnn/conv_bias_mkldnn_fuse_pass.cc +++ b/paddle/fluid/framework/ir/mkldnn/conv_bias_mkldnn_fuse_pass.cc @@ -70,7 +70,7 @@ ConvBiasFusePass::ConvBiasFusePass() { .IsTensor() .End() .AddAttr("axis") - .IsIntIn({-1, 0}) + .IsIntIn({1, 3}) .End(); } diff --git a/paddle/fluid/framework/ir/mkldnn/conv_bias_mkldnn_fuse_pass_tester.cc b/paddle/fluid/framework/ir/mkldnn/conv_bias_mkldnn_fuse_pass_tester.cc index 80a9ef7eda7..e41c35ba33f 100644 --- a/paddle/fluid/framework/ir/mkldnn/conv_bias_mkldnn_fuse_pass_tester.cc +++ b/paddle/fluid/framework/ir/mkldnn/conv_bias_mkldnn_fuse_pass_tester.cc @@ -52,7 +52,7 @@ void SetOp(ProgramDesc* prog, const std::string& type, const std::string& name, op->SetInput("Bias", {}); } else if (type == "elementwise_add") { op->SetAttr("use_mkldnn", true); - op->SetAttr("axis", -1); + op->SetAttr("axis", 1); op->SetInput("X", {inputs[0]}); op->SetInput("Y", {inputs[1]}); op->SetOutput("Out", outputs); -- GitLab