From e32ff656a350e7974cfcc782de35a332885cc15d Mon Sep 17 00:00:00 2001 From: Zhang Jun Date: Thu, 2 Feb 2023 10:48:57 +0800 Subject: [PATCH] [cherry-pick][pass] Upgrade Constant Folding Pass (#50105) * constant folding/trt subgrash pass debug * constant folding set persistalbe var in OP block, and remove unsed log * set node var persistalbe --- paddle/fluid/framework/ir/constant_folding_pass.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/paddle/fluid/framework/ir/constant_folding_pass.cc b/paddle/fluid/framework/ir/constant_folding_pass.cc index feba2242ad6..ac82c6b73f3 100644 --- a/paddle/fluid/framework/ir/constant_folding_pass.cc +++ b/paddle/fluid/framework/ir/constant_folding_pass.cc @@ -142,6 +142,9 @@ void ConstantFoldingPass::ApplyImpl(ir::Graph *graph) const { } out_desc->SetShape(out_shape); out_desc->SetPersistable(true); + auto *var_desc_out = op_node->Op()->Block()->Var(out_name); + var_desc_out->SetShape(out_shape); + var_desc_out->SetPersistable(true); auto *global_out_tensor = scope->Var(out_name)->GetMutable(); *global_out_tensor = *local_out_tensor; } -- GitLab