Browse Source

!824 add SwitchDeadBranchElimination & MergePass in graph prepare

From: @chen_yemeng
Reviewed-by: @xchu42,@sheng-nan,@ji_chen,@sheng-nan
Signed-off-by: @ji_chen
tags/v1.2.0
mindspore-ci-bot Gitee 3 years ago
parent
commit
6fdfc71b4e
2 changed files with 6 additions and 2 deletions
  1. +0
    -2
      ge/graph/passes/switch_dead_branch_elimination.cc
  2. +6
    -0
      ge/graph/preprocess/graph_preprocess.cc

+ 0
- 2
ge/graph/passes/switch_dead_branch_elimination.cc View File

@@ -18,8 +18,6 @@

#include <string>
#include <vector>
#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"


+ 6
- 0
ge/graph/preprocess/graph_preprocess.cc View File

@@ -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;


Loading…
Cancel
Save