From e287d4a8ea4cc32cd2431082ce2cf4d9c6ee2115 Mon Sep 17 00:00:00 2001 From: chenyemeng Date: Tue, 1 Dec 2020 10:09:03 +0800 Subject: [PATCH] add switch & merge pass in graph prepare --- ge/graph/preprocess/graph_preprocess.cc | 4 ++++ 1 file changed, 4 insertions(+) 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); }