Browse Source

add switch/merge pass in graph prepare

tags/v1.2.0
chenyemeng 4 years ago
parent
commit
f0f6f49ea4
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

@@ -53,6 +53,7 @@
#include "graph/passes/hccl_group_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"
@@ -68,6 +69,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"
@@ -1606,6 +1608,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