Skip to content

Commit e32ff65

Browse files
authored
[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
1 parent dddc5d9 commit e32ff65

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

paddle/fluid/framework/ir/constant_folding_pass.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,9 @@ void ConstantFoldingPass::ApplyImpl(ir::Graph *graph) const {
142142
}
143143
out_desc->SetShape(out_shape);
144144
out_desc->SetPersistable(true);
145+
auto *var_desc_out = op_node->Op()->Block()->Var(out_name);
146+
var_desc_out->SetShape(out_shape);
147+
var_desc_out->SetPersistable(true);
145148
auto *global_out_tensor = scope->Var(out_name)->GetMutable<LoDTensor>();
146149
*global_out_tensor = *local_out_tensor;
147150
}

0 commit comments

Comments
 (0)