From fc5db55a39efe1891c6d4baadf27e97536950334 Mon Sep 17 00:00:00 2001 From: Wilber Date: Wed, 20 Oct 2021 15:59:00 +0800 Subject: [PATCH] fix fc fuse proble (#36568) --- paddle/fluid/framework/ir/fc_fuse_pass.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/paddle/fluid/framework/ir/fc_fuse_pass.cc b/paddle/fluid/framework/ir/fc_fuse_pass.cc index 4510aea925..bb78cdab67 100644 --- a/paddle/fluid/framework/ir/fc_fuse_pass.cc +++ b/paddle/fluid/framework/ir/fc_fuse_pass.cc @@ -51,7 +51,12 @@ FCFusePass::FCFusePass() { .IsTensor() .End() .AddAttr("axis") - .IsNumGE(1) + .IsNumMatch([](int axis) -> bool { + if (axis == -1 || axis >= 1) { + return true; + } + return false; + }) .End(); AddOpCompat(OpCompat("relu")) -- GitLab