diff --git a/ge/graph/passes/switch_dead_branch_elimination.cc b/ge/graph/passes/switch_dead_branch_elimination.cc index 9358c9c3..70105aea 100644 --- a/ge/graph/passes/switch_dead_branch_elimination.cc +++ b/ge/graph/passes/switch_dead_branch_elimination.cc @@ -18,8 +18,6 @@ #include #include -#include "common/ge_inner_error_codes.h" -#include "common/types.h" #include "framework/common/debug/ge_log.h" #include "graph/common/omg_util.h" #include "graph/passes/pass_utils.h" diff --git a/ge/graph/preprocess/graph_preprocess.cc b/ge/graph/preprocess/graph_preprocess.cc index 0bfec241..91fab280 100644 --- a/ge/graph/preprocess/graph_preprocess.cc +++ b/ge/graph/preprocess/graph_preprocess.cc @@ -52,6 +52,7 @@ #include "graph/passes/hccl_memcpy_pass.h" #include "graph/passes/identity_pass.h" #include "graph/passes/infershape_pass.h" +#include "graph/passes/merge_pass.h" #include "graph/passes/net_output_pass.h" #include "graph/passes/no_use_reshape_remove_pass.h" #include "graph/passes/parallel_concat_start_op_pass.h" @@ -67,6 +68,7 @@ #include "graph/passes/shape_operate_op_remove_pass.h" #include "graph/passes/snapshot_pass.h" #include "graph/passes/stop_gradient_pass.h" +#include "graph/passes/switch_dead_branch_elimination.h" #include "graph/passes/unused_const_pass.h" #include "graph/passes/var_is_initialized_op_pass.h" #include "graph/passes/variable_prepare_op_pass.h" @@ -1769,6 +1771,10 @@ Status GraphPrepare::InferShapeForPreprocess() { if (!options_.train_graph_flag) { names_to_passes.emplace_back("AssertPass", &assert_pass); } + SwitchDeadBranchElimination switch_dead_branch_elimination; + names_to_passes.emplace_back("SwitchDeadBranchElimination", &switch_dead_branch_elimination); + MergePass merge_pass; + names_to_passes.emplace_back("MergePass", &merge_pass); InferShapePass infer_shape_pass; names_to_passes.emplace_back("InferShapePass", &infer_shape_pass); ReplaceWithEmptyConstPass replace_with_empty_const_pass;