diff --git a/ge/graph/preprocess/graph_preprocess.cc b/ge/graph/preprocess/graph_preprocess.cc index b899ee83..932e6784 100644 --- a/ge/graph/preprocess/graph_preprocess.cc +++ b/ge/graph/preprocess/graph_preprocess.cc @@ -1740,6 +1740,8 @@ Status GraphPrepare::PrepareOptimize() { IdentityPass identity_pass(false); AssignPass assign_pass; SnapshotPass snapshot_pass; + SwitchDeadBranchElimination switch_dead_branch_elimination; + MergePass merge_pass; if (!options_.train_graph_flag) { names_to_passes.emplace_back("DropOutPass", &dropout_pass); names_to_passes.emplace_back("AssertPass", &assert_pass); @@ -1753,6 +1755,8 @@ Status GraphPrepare::PrepareOptimize() { names_to_passes.emplace_back("VarIsInitializedOpPass", &var_is_initialized_pass); names_to_passes.emplace_back("ParallelConcatStartOpPass", ¶llel_concat_start_op_pass); names_to_passes.emplace_back("IdentityPass", &identity_pass); + names_to_passes.emplace_back("SwitchDeadBranchElimination", &switch_dead_branch_elimination); + names_to_passes.emplace_back("MergePass", &merge_pass); if (GetContext().GetHostExecFlag()) { names_to_passes.emplace_back("AssignPass", &assign_pass); }