diff --git a/paddle/fluid/framework/ir/preln_residual_bias_fuse_pass.cc b/paddle/fluid/framework/ir/preln_residual_bias_fuse_pass.cc index 8af2dd2427fb3a7a1d8c3eb5b5602be7d065e94b..13b7b4ac72f96b80ec66459b1f6763332d4aa8be 100644 --- a/paddle/fluid/framework/ir/preln_residual_bias_fuse_pass.cc +++ b/paddle/fluid/framework/ir/preln_residual_bias_fuse_pass.cc @@ -155,12 +155,14 @@ int PrelnResidualBiasFusePass::ApplyPattern(ir::Graph *graph, x = gpd.mutable_pattern() ->NewNode("preln_residual_bias_fuse/x") ->AsInput() - ->assert_is_op_input("elementwise_add", "X"); + ->assert_is_op_input("elementwise_add", "X") + ->assert_var_not_persistable(); y = gpd.mutable_pattern() ->NewNode("preln_residual_bias_fuse/y") ->AsInput() - ->assert_is_op_input("elementwise_add", "Y"); + ->assert_is_op_input("elementwise_add", "Y") + ->assert_var_not_persistable(); } patterns::PrelnResidualBias fused_pattern( gpd.mutable_pattern(), "preln_residual_bias_fuse", with_bias);