diff --git a/paddle/fluid/framework/ir/identity_scale_op_clean_pass.cc b/paddle/fluid/framework/ir/identity_scale_op_clean_pass.cc index 96f115b28225077efbb8ceb753775a8926e8f496..e6c20ce36d461dcb18f37eec2431048375f5e012 100644 --- a/paddle/fluid/framework/ir/identity_scale_op_clean_pass.cc +++ b/paddle/fluid/framework/ir/identity_scale_op_clean_pass.cc @@ -35,6 +35,7 @@ void IdentityScaleOpCleanPass::ApplyImpl(ir::Graph* graph) const { ->NewNode("scale_in") ->assert_is_op_input("scale") ->assert_has_n_outputs(1) + ->assert_var_not_persistable() ->assert_more([](Node* x) { for (auto* op : x->inputs) { auto op_type = op->Op()->Type();