You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

infershape_pass.cc 14 kB

5 years ago
modified: ge/graph/passes/base_pass.cc modified: ge/graph/passes/base_pass.h modified: ge/graph/passes/folding_pass.cc modified: ge/graph/passes/infershape_pass.cc modified: ge/graph/passes/infershape_pass.h modified: ge/graph/passes/switch_dead_branch_elimination.cc modified: ge/graph/preprocess/graph_preprocess.cc modified: ge/graph/passes/base_pass.cc modified: ge/graph/passes/base_pass.h modified: ge/graph/passes/folding_pass.cc modified: ge/graph/passes/infer_base_pass.h modified: ge/graph/passes/infer_value_range_pass.cc modified: ge/graph/passes/infer_value_range_pass.h modified: ge/graph/passes/infershape_pass.cc modified: ge/graph/passes/infershape_pass.h modified: ge/graph/passes/switch_dead_branch_elimination.cc modified: ge/graph/preprocess/graph_preprocess.cc modified: ge/graph/passes/base_pass.cc modified: ge/graph/passes/base_pass.h modified: ge/graph/passes/folding_pass.cc modified: ge/graph/passes/infer_base_pass.h modified: ge/graph/passes/infer_value_range_pass.cc modified: ge/graph/passes/infer_value_range_pass.h modified: ge/graph/passes/infershape_pass.cc modified: ge/graph/passes/infershape_pass.h modified: ge/graph/passes/merge_pass.cc modified: ge/graph/passes/switch_dead_branch_elimination.cc modified: ge/graph/preprocess/graph_preprocess.cc modified: ge/graph/passes/base_pass.cc modified: ge/graph/passes/base_pass.h modified: ge/graph/passes/folding_pass.cc modified: ge/graph/passes/infer_base_pass.h modified: ge/graph/passes/infer_value_range_pass.cc modified: ge/graph/passes/infer_value_range_pass.h modified: ge/graph/passes/infershape_pass.cc modified: ge/graph/passes/infershape_pass.h modified: ge/graph/passes/merge_pass.cc modified: ge/graph/passes/switch_dead_branch_elimination.cc modified: ge/graph/preprocess/graph_preprocess.cc modified: ge/graph/passes/base_pass.cc modified: ge/graph/passes/base_pass.h modified: ge/graph/passes/folding_pass.cc modified: ge/graph/passes/infer_base_pass.h modified: ge/graph/passes/infer_value_range_pass.cc modified: ge/graph/passes/infer_value_range_pass.h modified: ge/graph/passes/infershape_pass.cc modified: ge/graph/passes/infershape_pass.h modified: ge/graph/passes/merge_pass.cc modified: ge/graph/passes/switch_dead_branch_elimination.cc modified: ge/graph/preprocess/graph_preprocess.cc
4 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
modified: ge/graph/passes/base_pass.cc modified: ge/graph/passes/base_pass.h modified: ge/graph/passes/folding_pass.cc modified: ge/graph/passes/infershape_pass.cc modified: ge/graph/passes/infershape_pass.h modified: ge/graph/passes/switch_dead_branch_elimination.cc modified: ge/graph/preprocess/graph_preprocess.cc modified: ge/graph/passes/base_pass.cc modified: ge/graph/passes/base_pass.h modified: ge/graph/passes/folding_pass.cc modified: ge/graph/passes/infer_base_pass.h modified: ge/graph/passes/infer_value_range_pass.cc modified: ge/graph/passes/infer_value_range_pass.h modified: ge/graph/passes/infershape_pass.cc modified: ge/graph/passes/infershape_pass.h modified: ge/graph/passes/switch_dead_branch_elimination.cc modified: ge/graph/preprocess/graph_preprocess.cc modified: ge/graph/passes/base_pass.cc modified: ge/graph/passes/base_pass.h modified: ge/graph/passes/folding_pass.cc modified: ge/graph/passes/infer_base_pass.h modified: ge/graph/passes/infer_value_range_pass.cc modified: ge/graph/passes/infer_value_range_pass.h modified: ge/graph/passes/infershape_pass.cc modified: ge/graph/passes/infershape_pass.h modified: ge/graph/passes/merge_pass.cc modified: ge/graph/passes/switch_dead_branch_elimination.cc modified: ge/graph/preprocess/graph_preprocess.cc modified: ge/graph/passes/base_pass.cc modified: ge/graph/passes/base_pass.h modified: ge/graph/passes/folding_pass.cc modified: ge/graph/passes/infer_base_pass.h modified: ge/graph/passes/infer_value_range_pass.cc modified: ge/graph/passes/infer_value_range_pass.h modified: ge/graph/passes/infershape_pass.cc modified: ge/graph/passes/infershape_pass.h modified: ge/graph/passes/merge_pass.cc modified: ge/graph/passes/switch_dead_branch_elimination.cc modified: ge/graph/preprocess/graph_preprocess.cc modified: ge/graph/passes/base_pass.cc modified: ge/graph/passes/base_pass.h modified: ge/graph/passes/folding_pass.cc modified: ge/graph/passes/infer_base_pass.h modified: ge/graph/passes/infer_value_range_pass.cc modified: ge/graph/passes/infer_value_range_pass.h modified: ge/graph/passes/infershape_pass.cc modified: ge/graph/passes/infershape_pass.h modified: ge/graph/passes/merge_pass.cc modified: ge/graph/passes/switch_dead_branch_elimination.cc modified: ge/graph/preprocess/graph_preprocess.cc
4 years ago
4 years ago
modified: ge/graph/passes/base_pass.cc modified: ge/graph/passes/base_pass.h modified: ge/graph/passes/folding_pass.cc modified: ge/graph/passes/infershape_pass.cc modified: ge/graph/passes/infershape_pass.h modified: ge/graph/passes/switch_dead_branch_elimination.cc modified: ge/graph/preprocess/graph_preprocess.cc modified: ge/graph/passes/base_pass.cc modified: ge/graph/passes/base_pass.h modified: ge/graph/passes/folding_pass.cc modified: ge/graph/passes/infer_base_pass.h modified: ge/graph/passes/infer_value_range_pass.cc modified: ge/graph/passes/infer_value_range_pass.h modified: ge/graph/passes/infershape_pass.cc modified: ge/graph/passes/infershape_pass.h modified: ge/graph/passes/switch_dead_branch_elimination.cc modified: ge/graph/preprocess/graph_preprocess.cc modified: ge/graph/passes/base_pass.cc modified: ge/graph/passes/base_pass.h modified: ge/graph/passes/folding_pass.cc modified: ge/graph/passes/infer_base_pass.h modified: ge/graph/passes/infer_value_range_pass.cc modified: ge/graph/passes/infer_value_range_pass.h modified: ge/graph/passes/infershape_pass.cc modified: ge/graph/passes/infershape_pass.h modified: ge/graph/passes/merge_pass.cc modified: ge/graph/passes/switch_dead_branch_elimination.cc modified: ge/graph/preprocess/graph_preprocess.cc modified: ge/graph/passes/base_pass.cc modified: ge/graph/passes/base_pass.h modified: ge/graph/passes/folding_pass.cc modified: ge/graph/passes/infer_base_pass.h modified: ge/graph/passes/infer_value_range_pass.cc modified: ge/graph/passes/infer_value_range_pass.h modified: ge/graph/passes/infershape_pass.cc modified: ge/graph/passes/infershape_pass.h modified: ge/graph/passes/merge_pass.cc modified: ge/graph/passes/switch_dead_branch_elimination.cc modified: ge/graph/preprocess/graph_preprocess.cc modified: ge/graph/passes/base_pass.cc modified: ge/graph/passes/base_pass.h modified: ge/graph/passes/folding_pass.cc modified: ge/graph/passes/infer_base_pass.h modified: ge/graph/passes/infer_value_range_pass.cc modified: ge/graph/passes/infer_value_range_pass.h modified: ge/graph/passes/infershape_pass.cc modified: ge/graph/passes/infershape_pass.h modified: ge/graph/passes/merge_pass.cc modified: ge/graph/passes/switch_dead_branch_elimination.cc modified: ge/graph/preprocess/graph_preprocess.cc
4 years ago
4 years ago
modified: ge/graph/passes/base_pass.cc modified: ge/graph/passes/base_pass.h modified: ge/graph/passes/folding_pass.cc modified: ge/graph/passes/infershape_pass.cc modified: ge/graph/passes/infershape_pass.h modified: ge/graph/passes/switch_dead_branch_elimination.cc modified: ge/graph/preprocess/graph_preprocess.cc modified: ge/graph/passes/base_pass.cc modified: ge/graph/passes/base_pass.h modified: ge/graph/passes/folding_pass.cc modified: ge/graph/passes/infer_base_pass.h modified: ge/graph/passes/infer_value_range_pass.cc modified: ge/graph/passes/infer_value_range_pass.h modified: ge/graph/passes/infershape_pass.cc modified: ge/graph/passes/infershape_pass.h modified: ge/graph/passes/switch_dead_branch_elimination.cc modified: ge/graph/preprocess/graph_preprocess.cc modified: ge/graph/passes/base_pass.cc modified: ge/graph/passes/base_pass.h modified: ge/graph/passes/folding_pass.cc modified: ge/graph/passes/infer_base_pass.h modified: ge/graph/passes/infer_value_range_pass.cc modified: ge/graph/passes/infer_value_range_pass.h modified: ge/graph/passes/infershape_pass.cc modified: ge/graph/passes/infershape_pass.h modified: ge/graph/passes/merge_pass.cc modified: ge/graph/passes/switch_dead_branch_elimination.cc modified: ge/graph/preprocess/graph_preprocess.cc modified: ge/graph/passes/base_pass.cc modified: ge/graph/passes/base_pass.h modified: ge/graph/passes/folding_pass.cc modified: ge/graph/passes/infer_base_pass.h modified: ge/graph/passes/infer_value_range_pass.cc modified: ge/graph/passes/infer_value_range_pass.h modified: ge/graph/passes/infershape_pass.cc modified: ge/graph/passes/infershape_pass.h modified: ge/graph/passes/merge_pass.cc modified: ge/graph/passes/switch_dead_branch_elimination.cc modified: ge/graph/preprocess/graph_preprocess.cc modified: ge/graph/passes/base_pass.cc modified: ge/graph/passes/base_pass.h modified: ge/graph/passes/folding_pass.cc modified: ge/graph/passes/infer_base_pass.h modified: ge/graph/passes/infer_value_range_pass.cc modified: ge/graph/passes/infer_value_range_pass.h modified: ge/graph/passes/infershape_pass.cc modified: ge/graph/passes/infershape_pass.h modified: ge/graph/passes/merge_pass.cc modified: ge/graph/passes/switch_dead_branch_elimination.cc modified: ge/graph/preprocess/graph_preprocess.cc
4 years ago
4 years ago
modified: ge/graph/passes/base_pass.cc modified: ge/graph/passes/base_pass.h modified: ge/graph/passes/folding_pass.cc modified: ge/graph/passes/infershape_pass.cc modified: ge/graph/passes/infershape_pass.h modified: ge/graph/passes/switch_dead_branch_elimination.cc modified: ge/graph/preprocess/graph_preprocess.cc modified: ge/graph/passes/base_pass.cc modified: ge/graph/passes/base_pass.h modified: ge/graph/passes/folding_pass.cc modified: ge/graph/passes/infer_base_pass.h modified: ge/graph/passes/infer_value_range_pass.cc modified: ge/graph/passes/infer_value_range_pass.h modified: ge/graph/passes/infershape_pass.cc modified: ge/graph/passes/infershape_pass.h modified: ge/graph/passes/switch_dead_branch_elimination.cc modified: ge/graph/preprocess/graph_preprocess.cc modified: ge/graph/passes/base_pass.cc modified: ge/graph/passes/base_pass.h modified: ge/graph/passes/folding_pass.cc modified: ge/graph/passes/infer_base_pass.h modified: ge/graph/passes/infer_value_range_pass.cc modified: ge/graph/passes/infer_value_range_pass.h modified: ge/graph/passes/infershape_pass.cc modified: ge/graph/passes/infershape_pass.h modified: ge/graph/passes/merge_pass.cc modified: ge/graph/passes/switch_dead_branch_elimination.cc modified: ge/graph/preprocess/graph_preprocess.cc modified: ge/graph/passes/base_pass.cc modified: ge/graph/passes/base_pass.h modified: ge/graph/passes/folding_pass.cc modified: ge/graph/passes/infer_base_pass.h modified: ge/graph/passes/infer_value_range_pass.cc modified: ge/graph/passes/infer_value_range_pass.h modified: ge/graph/passes/infershape_pass.cc modified: ge/graph/passes/infershape_pass.h modified: ge/graph/passes/merge_pass.cc modified: ge/graph/passes/switch_dead_branch_elimination.cc modified: ge/graph/preprocess/graph_preprocess.cc modified: ge/graph/passes/base_pass.cc modified: ge/graph/passes/base_pass.h modified: ge/graph/passes/folding_pass.cc modified: ge/graph/passes/infer_base_pass.h modified: ge/graph/passes/infer_value_range_pass.cc modified: ge/graph/passes/infer_value_range_pass.h modified: ge/graph/passes/infershape_pass.cc modified: ge/graph/passes/infershape_pass.h modified: ge/graph/passes/merge_pass.cc modified: ge/graph/passes/switch_dead_branch_elimination.cc modified: ge/graph/preprocess/graph_preprocess.cc
4 years ago
4 years ago
modified: ge/graph/passes/base_pass.cc modified: ge/graph/passes/base_pass.h modified: ge/graph/passes/folding_pass.cc modified: ge/graph/passes/infershape_pass.cc modified: ge/graph/passes/infershape_pass.h modified: ge/graph/passes/switch_dead_branch_elimination.cc modified: ge/graph/preprocess/graph_preprocess.cc modified: ge/graph/passes/base_pass.cc modified: ge/graph/passes/base_pass.h modified: ge/graph/passes/folding_pass.cc modified: ge/graph/passes/infer_base_pass.h modified: ge/graph/passes/infer_value_range_pass.cc modified: ge/graph/passes/infer_value_range_pass.h modified: ge/graph/passes/infershape_pass.cc modified: ge/graph/passes/infershape_pass.h modified: ge/graph/passes/switch_dead_branch_elimination.cc modified: ge/graph/preprocess/graph_preprocess.cc modified: ge/graph/passes/base_pass.cc modified: ge/graph/passes/base_pass.h modified: ge/graph/passes/folding_pass.cc modified: ge/graph/passes/infer_base_pass.h modified: ge/graph/passes/infer_value_range_pass.cc modified: ge/graph/passes/infer_value_range_pass.h modified: ge/graph/passes/infershape_pass.cc modified: ge/graph/passes/infershape_pass.h modified: ge/graph/passes/merge_pass.cc modified: ge/graph/passes/switch_dead_branch_elimination.cc modified: ge/graph/preprocess/graph_preprocess.cc modified: ge/graph/passes/base_pass.cc modified: ge/graph/passes/base_pass.h modified: ge/graph/passes/folding_pass.cc modified: ge/graph/passes/infer_base_pass.h modified: ge/graph/passes/infer_value_range_pass.cc modified: ge/graph/passes/infer_value_range_pass.h modified: ge/graph/passes/infershape_pass.cc modified: ge/graph/passes/infershape_pass.h modified: ge/graph/passes/merge_pass.cc modified: ge/graph/passes/switch_dead_branch_elimination.cc modified: ge/graph/preprocess/graph_preprocess.cc modified: ge/graph/passes/base_pass.cc modified: ge/graph/passes/base_pass.h modified: ge/graph/passes/folding_pass.cc modified: ge/graph/passes/infer_base_pass.h modified: ge/graph/passes/infer_value_range_pass.cc modified: ge/graph/passes/infer_value_range_pass.h modified: ge/graph/passes/infershape_pass.cc modified: ge/graph/passes/infershape_pass.h modified: ge/graph/passes/merge_pass.cc modified: ge/graph/passes/switch_dead_branch_elimination.cc modified: ge/graph/preprocess/graph_preprocess.cc
4 years ago
4 years ago
modified: ge/graph/passes/base_pass.cc modified: ge/graph/passes/base_pass.h modified: ge/graph/passes/folding_pass.cc modified: ge/graph/passes/infershape_pass.cc modified: ge/graph/passes/infershape_pass.h modified: ge/graph/passes/switch_dead_branch_elimination.cc modified: ge/graph/preprocess/graph_preprocess.cc modified: ge/graph/passes/base_pass.cc modified: ge/graph/passes/base_pass.h modified: ge/graph/passes/folding_pass.cc modified: ge/graph/passes/infer_base_pass.h modified: ge/graph/passes/infer_value_range_pass.cc modified: ge/graph/passes/infer_value_range_pass.h modified: ge/graph/passes/infershape_pass.cc modified: ge/graph/passes/infershape_pass.h modified: ge/graph/passes/switch_dead_branch_elimination.cc modified: ge/graph/preprocess/graph_preprocess.cc modified: ge/graph/passes/base_pass.cc modified: ge/graph/passes/base_pass.h modified: ge/graph/passes/folding_pass.cc modified: ge/graph/passes/infer_base_pass.h modified: ge/graph/passes/infer_value_range_pass.cc modified: ge/graph/passes/infer_value_range_pass.h modified: ge/graph/passes/infershape_pass.cc modified: ge/graph/passes/infershape_pass.h modified: ge/graph/passes/merge_pass.cc modified: ge/graph/passes/switch_dead_branch_elimination.cc modified: ge/graph/preprocess/graph_preprocess.cc modified: ge/graph/passes/base_pass.cc modified: ge/graph/passes/base_pass.h modified: ge/graph/passes/folding_pass.cc modified: ge/graph/passes/infer_base_pass.h modified: ge/graph/passes/infer_value_range_pass.cc modified: ge/graph/passes/infer_value_range_pass.h modified: ge/graph/passes/infershape_pass.cc modified: ge/graph/passes/infershape_pass.h modified: ge/graph/passes/merge_pass.cc modified: ge/graph/passes/switch_dead_branch_elimination.cc modified: ge/graph/preprocess/graph_preprocess.cc modified: ge/graph/passes/base_pass.cc modified: ge/graph/passes/base_pass.h modified: ge/graph/passes/folding_pass.cc modified: ge/graph/passes/infer_base_pass.h modified: ge/graph/passes/infer_value_range_pass.cc modified: ge/graph/passes/infer_value_range_pass.h modified: ge/graph/passes/infershape_pass.cc modified: ge/graph/passes/infershape_pass.h modified: ge/graph/passes/merge_pass.cc modified: ge/graph/passes/switch_dead_branch_elimination.cc modified: ge/graph/preprocess/graph_preprocess.cc
4 years ago
4 years ago
modified: ge/graph/passes/base_pass.cc modified: ge/graph/passes/base_pass.h modified: ge/graph/passes/folding_pass.cc modified: ge/graph/passes/infershape_pass.cc modified: ge/graph/passes/infershape_pass.h modified: ge/graph/passes/switch_dead_branch_elimination.cc modified: ge/graph/preprocess/graph_preprocess.cc modified: ge/graph/passes/base_pass.cc modified: ge/graph/passes/base_pass.h modified: ge/graph/passes/folding_pass.cc modified: ge/graph/passes/infer_base_pass.h modified: ge/graph/passes/infer_value_range_pass.cc modified: ge/graph/passes/infer_value_range_pass.h modified: ge/graph/passes/infershape_pass.cc modified: ge/graph/passes/infershape_pass.h modified: ge/graph/passes/switch_dead_branch_elimination.cc modified: ge/graph/preprocess/graph_preprocess.cc modified: ge/graph/passes/base_pass.cc modified: ge/graph/passes/base_pass.h modified: ge/graph/passes/folding_pass.cc modified: ge/graph/passes/infer_base_pass.h modified: ge/graph/passes/infer_value_range_pass.cc modified: ge/graph/passes/infer_value_range_pass.h modified: ge/graph/passes/infershape_pass.cc modified: ge/graph/passes/infershape_pass.h modified: ge/graph/passes/merge_pass.cc modified: ge/graph/passes/switch_dead_branch_elimination.cc modified: ge/graph/preprocess/graph_preprocess.cc modified: ge/graph/passes/base_pass.cc modified: ge/graph/passes/base_pass.h modified: ge/graph/passes/folding_pass.cc modified: ge/graph/passes/infer_base_pass.h modified: ge/graph/passes/infer_value_range_pass.cc modified: ge/graph/passes/infer_value_range_pass.h modified: ge/graph/passes/infershape_pass.cc modified: ge/graph/passes/infershape_pass.h modified: ge/graph/passes/merge_pass.cc modified: ge/graph/passes/switch_dead_branch_elimination.cc modified: ge/graph/preprocess/graph_preprocess.cc modified: ge/graph/passes/base_pass.cc modified: ge/graph/passes/base_pass.h modified: ge/graph/passes/folding_pass.cc modified: ge/graph/passes/infer_base_pass.h modified: ge/graph/passes/infer_value_range_pass.cc modified: ge/graph/passes/infer_value_range_pass.h modified: ge/graph/passes/infershape_pass.cc modified: ge/graph/passes/infershape_pass.h modified: ge/graph/passes/merge_pass.cc modified: ge/graph/passes/switch_dead_branch_elimination.cc modified: ge/graph/preprocess/graph_preprocess.cc
4 years ago
5 years ago
modified: ge/graph/passes/base_pass.cc modified: ge/graph/passes/base_pass.h modified: ge/graph/passes/folding_pass.cc modified: ge/graph/passes/infershape_pass.cc modified: ge/graph/passes/infershape_pass.h modified: ge/graph/passes/switch_dead_branch_elimination.cc modified: ge/graph/preprocess/graph_preprocess.cc modified: ge/graph/passes/base_pass.cc modified: ge/graph/passes/base_pass.h modified: ge/graph/passes/folding_pass.cc modified: ge/graph/passes/infer_base_pass.h modified: ge/graph/passes/infer_value_range_pass.cc modified: ge/graph/passes/infer_value_range_pass.h modified: ge/graph/passes/infershape_pass.cc modified: ge/graph/passes/infershape_pass.h modified: ge/graph/passes/switch_dead_branch_elimination.cc modified: ge/graph/preprocess/graph_preprocess.cc modified: ge/graph/passes/base_pass.cc modified: ge/graph/passes/base_pass.h modified: ge/graph/passes/folding_pass.cc modified: ge/graph/passes/infer_base_pass.h modified: ge/graph/passes/infer_value_range_pass.cc modified: ge/graph/passes/infer_value_range_pass.h modified: ge/graph/passes/infershape_pass.cc modified: ge/graph/passes/infershape_pass.h modified: ge/graph/passes/merge_pass.cc modified: ge/graph/passes/switch_dead_branch_elimination.cc modified: ge/graph/preprocess/graph_preprocess.cc modified: ge/graph/passes/base_pass.cc modified: ge/graph/passes/base_pass.h modified: ge/graph/passes/folding_pass.cc modified: ge/graph/passes/infer_base_pass.h modified: ge/graph/passes/infer_value_range_pass.cc modified: ge/graph/passes/infer_value_range_pass.h modified: ge/graph/passes/infershape_pass.cc modified: ge/graph/passes/infershape_pass.h modified: ge/graph/passes/merge_pass.cc modified: ge/graph/passes/switch_dead_branch_elimination.cc modified: ge/graph/preprocess/graph_preprocess.cc modified: ge/graph/passes/base_pass.cc modified: ge/graph/passes/base_pass.h modified: ge/graph/passes/folding_pass.cc modified: ge/graph/passes/infer_base_pass.h modified: ge/graph/passes/infer_value_range_pass.cc modified: ge/graph/passes/infer_value_range_pass.h modified: ge/graph/passes/infershape_pass.cc modified: ge/graph/passes/infershape_pass.h modified: ge/graph/passes/merge_pass.cc modified: ge/graph/passes/switch_dead_branch_elimination.cc modified: ge/graph/preprocess/graph_preprocess.cc
4 years ago
modified: ge/graph/passes/base_pass.cc modified: ge/graph/passes/base_pass.h modified: ge/graph/passes/folding_pass.cc modified: ge/graph/passes/infershape_pass.cc modified: ge/graph/passes/infershape_pass.h modified: ge/graph/passes/switch_dead_branch_elimination.cc modified: ge/graph/preprocess/graph_preprocess.cc modified: ge/graph/passes/base_pass.cc modified: ge/graph/passes/base_pass.h modified: ge/graph/passes/folding_pass.cc modified: ge/graph/passes/infer_base_pass.h modified: ge/graph/passes/infer_value_range_pass.cc modified: ge/graph/passes/infer_value_range_pass.h modified: ge/graph/passes/infershape_pass.cc modified: ge/graph/passes/infershape_pass.h modified: ge/graph/passes/switch_dead_branch_elimination.cc modified: ge/graph/preprocess/graph_preprocess.cc modified: ge/graph/passes/base_pass.cc modified: ge/graph/passes/base_pass.h modified: ge/graph/passes/folding_pass.cc modified: ge/graph/passes/infer_base_pass.h modified: ge/graph/passes/infer_value_range_pass.cc modified: ge/graph/passes/infer_value_range_pass.h modified: ge/graph/passes/infershape_pass.cc modified: ge/graph/passes/infershape_pass.h modified: ge/graph/passes/merge_pass.cc modified: ge/graph/passes/switch_dead_branch_elimination.cc modified: ge/graph/preprocess/graph_preprocess.cc modified: ge/graph/passes/base_pass.cc modified: ge/graph/passes/base_pass.h modified: ge/graph/passes/folding_pass.cc modified: ge/graph/passes/infer_base_pass.h modified: ge/graph/passes/infer_value_range_pass.cc modified: ge/graph/passes/infer_value_range_pass.h modified: ge/graph/passes/infershape_pass.cc modified: ge/graph/passes/infershape_pass.h modified: ge/graph/passes/merge_pass.cc modified: ge/graph/passes/switch_dead_branch_elimination.cc modified: ge/graph/preprocess/graph_preprocess.cc modified: ge/graph/passes/base_pass.cc modified: ge/graph/passes/base_pass.h modified: ge/graph/passes/folding_pass.cc modified: ge/graph/passes/infer_base_pass.h modified: ge/graph/passes/infer_value_range_pass.cc modified: ge/graph/passes/infer_value_range_pass.h modified: ge/graph/passes/infershape_pass.cc modified: ge/graph/passes/infershape_pass.h modified: ge/graph/passes/merge_pass.cc modified: ge/graph/passes/switch_dead_branch_elimination.cc modified: ge/graph/preprocess/graph_preprocess.cc
4 years ago
modified: ge/graph/passes/base_pass.cc modified: ge/graph/passes/base_pass.h modified: ge/graph/passes/folding_pass.cc modified: ge/graph/passes/infershape_pass.cc modified: ge/graph/passes/infershape_pass.h modified: ge/graph/passes/switch_dead_branch_elimination.cc modified: ge/graph/preprocess/graph_preprocess.cc modified: ge/graph/passes/base_pass.cc modified: ge/graph/passes/base_pass.h modified: ge/graph/passes/folding_pass.cc modified: ge/graph/passes/infer_base_pass.h modified: ge/graph/passes/infer_value_range_pass.cc modified: ge/graph/passes/infer_value_range_pass.h modified: ge/graph/passes/infershape_pass.cc modified: ge/graph/passes/infershape_pass.h modified: ge/graph/passes/switch_dead_branch_elimination.cc modified: ge/graph/preprocess/graph_preprocess.cc modified: ge/graph/passes/base_pass.cc modified: ge/graph/passes/base_pass.h modified: ge/graph/passes/folding_pass.cc modified: ge/graph/passes/infer_base_pass.h modified: ge/graph/passes/infer_value_range_pass.cc modified: ge/graph/passes/infer_value_range_pass.h modified: ge/graph/passes/infershape_pass.cc modified: ge/graph/passes/infershape_pass.h modified: ge/graph/passes/merge_pass.cc modified: ge/graph/passes/switch_dead_branch_elimination.cc modified: ge/graph/preprocess/graph_preprocess.cc modified: ge/graph/passes/base_pass.cc modified: ge/graph/passes/base_pass.h modified: ge/graph/passes/folding_pass.cc modified: ge/graph/passes/infer_base_pass.h modified: ge/graph/passes/infer_value_range_pass.cc modified: ge/graph/passes/infer_value_range_pass.h modified: ge/graph/passes/infershape_pass.cc modified: ge/graph/passes/infershape_pass.h modified: ge/graph/passes/merge_pass.cc modified: ge/graph/passes/switch_dead_branch_elimination.cc modified: ge/graph/preprocess/graph_preprocess.cc modified: ge/graph/passes/base_pass.cc modified: ge/graph/passes/base_pass.h modified: ge/graph/passes/folding_pass.cc modified: ge/graph/passes/infer_base_pass.h modified: ge/graph/passes/infer_value_range_pass.cc modified: ge/graph/passes/infer_value_range_pass.h modified: ge/graph/passes/infershape_pass.cc modified: ge/graph/passes/infershape_pass.h modified: ge/graph/passes/merge_pass.cc modified: ge/graph/passes/switch_dead_branch_elimination.cc modified: ge/graph/preprocess/graph_preprocess.cc
4 years ago
modified: ge/graph/passes/base_pass.cc modified: ge/graph/passes/base_pass.h modified: ge/graph/passes/folding_pass.cc modified: ge/graph/passes/infershape_pass.cc modified: ge/graph/passes/infershape_pass.h modified: ge/graph/passes/switch_dead_branch_elimination.cc modified: ge/graph/preprocess/graph_preprocess.cc modified: ge/graph/passes/base_pass.cc modified: ge/graph/passes/base_pass.h modified: ge/graph/passes/folding_pass.cc modified: ge/graph/passes/infer_base_pass.h modified: ge/graph/passes/infer_value_range_pass.cc modified: ge/graph/passes/infer_value_range_pass.h modified: ge/graph/passes/infershape_pass.cc modified: ge/graph/passes/infershape_pass.h modified: ge/graph/passes/switch_dead_branch_elimination.cc modified: ge/graph/preprocess/graph_preprocess.cc modified: ge/graph/passes/base_pass.cc modified: ge/graph/passes/base_pass.h modified: ge/graph/passes/folding_pass.cc modified: ge/graph/passes/infer_base_pass.h modified: ge/graph/passes/infer_value_range_pass.cc modified: ge/graph/passes/infer_value_range_pass.h modified: ge/graph/passes/infershape_pass.cc modified: ge/graph/passes/infershape_pass.h modified: ge/graph/passes/merge_pass.cc modified: ge/graph/passes/switch_dead_branch_elimination.cc modified: ge/graph/preprocess/graph_preprocess.cc modified: ge/graph/passes/base_pass.cc modified: ge/graph/passes/base_pass.h modified: ge/graph/passes/folding_pass.cc modified: ge/graph/passes/infer_base_pass.h modified: ge/graph/passes/infer_value_range_pass.cc modified: ge/graph/passes/infer_value_range_pass.h modified: ge/graph/passes/infershape_pass.cc modified: ge/graph/passes/infershape_pass.h modified: ge/graph/passes/merge_pass.cc modified: ge/graph/passes/switch_dead_branch_elimination.cc modified: ge/graph/preprocess/graph_preprocess.cc modified: ge/graph/passes/base_pass.cc modified: ge/graph/passes/base_pass.h modified: ge/graph/passes/folding_pass.cc modified: ge/graph/passes/infer_base_pass.h modified: ge/graph/passes/infer_value_range_pass.cc modified: ge/graph/passes/infer_value_range_pass.h modified: ge/graph/passes/infershape_pass.cc modified: ge/graph/passes/infershape_pass.h modified: ge/graph/passes/merge_pass.cc modified: ge/graph/passes/switch_dead_branch_elimination.cc modified: ge/graph/preprocess/graph_preprocess.cc
4 years ago
modified: ge/graph/passes/base_pass.cc modified: ge/graph/passes/base_pass.h modified: ge/graph/passes/folding_pass.cc modified: ge/graph/passes/infershape_pass.cc modified: ge/graph/passes/infershape_pass.h modified: ge/graph/passes/switch_dead_branch_elimination.cc modified: ge/graph/preprocess/graph_preprocess.cc modified: ge/graph/passes/base_pass.cc modified: ge/graph/passes/base_pass.h modified: ge/graph/passes/folding_pass.cc modified: ge/graph/passes/infer_base_pass.h modified: ge/graph/passes/infer_value_range_pass.cc modified: ge/graph/passes/infer_value_range_pass.h modified: ge/graph/passes/infershape_pass.cc modified: ge/graph/passes/infershape_pass.h modified: ge/graph/passes/switch_dead_branch_elimination.cc modified: ge/graph/preprocess/graph_preprocess.cc modified: ge/graph/passes/base_pass.cc modified: ge/graph/passes/base_pass.h modified: ge/graph/passes/folding_pass.cc modified: ge/graph/passes/infer_base_pass.h modified: ge/graph/passes/infer_value_range_pass.cc modified: ge/graph/passes/infer_value_range_pass.h modified: ge/graph/passes/infershape_pass.cc modified: ge/graph/passes/infershape_pass.h modified: ge/graph/passes/merge_pass.cc modified: ge/graph/passes/switch_dead_branch_elimination.cc modified: ge/graph/preprocess/graph_preprocess.cc modified: ge/graph/passes/base_pass.cc modified: ge/graph/passes/base_pass.h modified: ge/graph/passes/folding_pass.cc modified: ge/graph/passes/infer_base_pass.h modified: ge/graph/passes/infer_value_range_pass.cc modified: ge/graph/passes/infer_value_range_pass.h modified: ge/graph/passes/infershape_pass.cc modified: ge/graph/passes/infershape_pass.h modified: ge/graph/passes/merge_pass.cc modified: ge/graph/passes/switch_dead_branch_elimination.cc modified: ge/graph/preprocess/graph_preprocess.cc modified: ge/graph/passes/base_pass.cc modified: ge/graph/passes/base_pass.h modified: ge/graph/passes/folding_pass.cc modified: ge/graph/passes/infer_base_pass.h modified: ge/graph/passes/infer_value_range_pass.cc modified: ge/graph/passes/infer_value_range_pass.h modified: ge/graph/passes/infershape_pass.cc modified: ge/graph/passes/infershape_pass.h modified: ge/graph/passes/merge_pass.cc modified: ge/graph/passes/switch_dead_branch_elimination.cc modified: ge/graph/preprocess/graph_preprocess.cc
4 years ago
modified: ge/graph/passes/base_pass.cc modified: ge/graph/passes/base_pass.h modified: ge/graph/passes/folding_pass.cc modified: ge/graph/passes/infershape_pass.cc modified: ge/graph/passes/infershape_pass.h modified: ge/graph/passes/switch_dead_branch_elimination.cc modified: ge/graph/preprocess/graph_preprocess.cc modified: ge/graph/passes/base_pass.cc modified: ge/graph/passes/base_pass.h modified: ge/graph/passes/folding_pass.cc modified: ge/graph/passes/infer_base_pass.h modified: ge/graph/passes/infer_value_range_pass.cc modified: ge/graph/passes/infer_value_range_pass.h modified: ge/graph/passes/infershape_pass.cc modified: ge/graph/passes/infershape_pass.h modified: ge/graph/passes/switch_dead_branch_elimination.cc modified: ge/graph/preprocess/graph_preprocess.cc modified: ge/graph/passes/base_pass.cc modified: ge/graph/passes/base_pass.h modified: ge/graph/passes/folding_pass.cc modified: ge/graph/passes/infer_base_pass.h modified: ge/graph/passes/infer_value_range_pass.cc modified: ge/graph/passes/infer_value_range_pass.h modified: ge/graph/passes/infershape_pass.cc modified: ge/graph/passes/infershape_pass.h modified: ge/graph/passes/merge_pass.cc modified: ge/graph/passes/switch_dead_branch_elimination.cc modified: ge/graph/preprocess/graph_preprocess.cc modified: ge/graph/passes/base_pass.cc modified: ge/graph/passes/base_pass.h modified: ge/graph/passes/folding_pass.cc modified: ge/graph/passes/infer_base_pass.h modified: ge/graph/passes/infer_value_range_pass.cc modified: ge/graph/passes/infer_value_range_pass.h modified: ge/graph/passes/infershape_pass.cc modified: ge/graph/passes/infershape_pass.h modified: ge/graph/passes/merge_pass.cc modified: ge/graph/passes/switch_dead_branch_elimination.cc modified: ge/graph/preprocess/graph_preprocess.cc modified: ge/graph/passes/base_pass.cc modified: ge/graph/passes/base_pass.h modified: ge/graph/passes/folding_pass.cc modified: ge/graph/passes/infer_base_pass.h modified: ge/graph/passes/infer_value_range_pass.cc modified: ge/graph/passes/infer_value_range_pass.h modified: ge/graph/passes/infershape_pass.cc modified: ge/graph/passes/infershape_pass.h modified: ge/graph/passes/merge_pass.cc modified: ge/graph/passes/switch_dead_branch_elimination.cc modified: ge/graph/preprocess/graph_preprocess.cc
4 years ago
modified: ge/graph/passes/base_pass.cc modified: ge/graph/passes/base_pass.h modified: ge/graph/passes/folding_pass.cc modified: ge/graph/passes/infershape_pass.cc modified: ge/graph/passes/infershape_pass.h modified: ge/graph/passes/switch_dead_branch_elimination.cc modified: ge/graph/preprocess/graph_preprocess.cc modified: ge/graph/passes/base_pass.cc modified: ge/graph/passes/base_pass.h modified: ge/graph/passes/folding_pass.cc modified: ge/graph/passes/infer_base_pass.h modified: ge/graph/passes/infer_value_range_pass.cc modified: ge/graph/passes/infer_value_range_pass.h modified: ge/graph/passes/infershape_pass.cc modified: ge/graph/passes/infershape_pass.h modified: ge/graph/passes/switch_dead_branch_elimination.cc modified: ge/graph/preprocess/graph_preprocess.cc modified: ge/graph/passes/base_pass.cc modified: ge/graph/passes/base_pass.h modified: ge/graph/passes/folding_pass.cc modified: ge/graph/passes/infer_base_pass.h modified: ge/graph/passes/infer_value_range_pass.cc modified: ge/graph/passes/infer_value_range_pass.h modified: ge/graph/passes/infershape_pass.cc modified: ge/graph/passes/infershape_pass.h modified: ge/graph/passes/merge_pass.cc modified: ge/graph/passes/switch_dead_branch_elimination.cc modified: ge/graph/preprocess/graph_preprocess.cc modified: ge/graph/passes/base_pass.cc modified: ge/graph/passes/base_pass.h modified: ge/graph/passes/folding_pass.cc modified: ge/graph/passes/infer_base_pass.h modified: ge/graph/passes/infer_value_range_pass.cc modified: ge/graph/passes/infer_value_range_pass.h modified: ge/graph/passes/infershape_pass.cc modified: ge/graph/passes/infershape_pass.h modified: ge/graph/passes/merge_pass.cc modified: ge/graph/passes/switch_dead_branch_elimination.cc modified: ge/graph/preprocess/graph_preprocess.cc modified: ge/graph/passes/base_pass.cc modified: ge/graph/passes/base_pass.h modified: ge/graph/passes/folding_pass.cc modified: ge/graph/passes/infer_base_pass.h modified: ge/graph/passes/infer_value_range_pass.cc modified: ge/graph/passes/infer_value_range_pass.h modified: ge/graph/passes/infershape_pass.cc modified: ge/graph/passes/infershape_pass.h modified: ge/graph/passes/merge_pass.cc modified: ge/graph/passes/switch_dead_branch_elimination.cc modified: ge/graph/preprocess/graph_preprocess.cc
4 years ago
modified: ge/graph/passes/base_pass.cc modified: ge/graph/passes/base_pass.h modified: ge/graph/passes/folding_pass.cc modified: ge/graph/passes/infershape_pass.cc modified: ge/graph/passes/infershape_pass.h modified: ge/graph/passes/switch_dead_branch_elimination.cc modified: ge/graph/preprocess/graph_preprocess.cc modified: ge/graph/passes/base_pass.cc modified: ge/graph/passes/base_pass.h modified: ge/graph/passes/folding_pass.cc modified: ge/graph/passes/infer_base_pass.h modified: ge/graph/passes/infer_value_range_pass.cc modified: ge/graph/passes/infer_value_range_pass.h modified: ge/graph/passes/infershape_pass.cc modified: ge/graph/passes/infershape_pass.h modified: ge/graph/passes/switch_dead_branch_elimination.cc modified: ge/graph/preprocess/graph_preprocess.cc modified: ge/graph/passes/base_pass.cc modified: ge/graph/passes/base_pass.h modified: ge/graph/passes/folding_pass.cc modified: ge/graph/passes/infer_base_pass.h modified: ge/graph/passes/infer_value_range_pass.cc modified: ge/graph/passes/infer_value_range_pass.h modified: ge/graph/passes/infershape_pass.cc modified: ge/graph/passes/infershape_pass.h modified: ge/graph/passes/merge_pass.cc modified: ge/graph/passes/switch_dead_branch_elimination.cc modified: ge/graph/preprocess/graph_preprocess.cc modified: ge/graph/passes/base_pass.cc modified: ge/graph/passes/base_pass.h modified: ge/graph/passes/folding_pass.cc modified: ge/graph/passes/infer_base_pass.h modified: ge/graph/passes/infer_value_range_pass.cc modified: ge/graph/passes/infer_value_range_pass.h modified: ge/graph/passes/infershape_pass.cc modified: ge/graph/passes/infershape_pass.h modified: ge/graph/passes/merge_pass.cc modified: ge/graph/passes/switch_dead_branch_elimination.cc modified: ge/graph/preprocess/graph_preprocess.cc modified: ge/graph/passes/base_pass.cc modified: ge/graph/passes/base_pass.h modified: ge/graph/passes/folding_pass.cc modified: ge/graph/passes/infer_base_pass.h modified: ge/graph/passes/infer_value_range_pass.cc modified: ge/graph/passes/infer_value_range_pass.h modified: ge/graph/passes/infershape_pass.cc modified: ge/graph/passes/infershape_pass.h modified: ge/graph/passes/merge_pass.cc modified: ge/graph/passes/switch_dead_branch_elimination.cc modified: ge/graph/preprocess/graph_preprocess.cc
4 years ago
4 years ago
modified: ge/graph/passes/base_pass.cc modified: ge/graph/passes/base_pass.h modified: ge/graph/passes/folding_pass.cc modified: ge/graph/passes/infershape_pass.cc modified: ge/graph/passes/infershape_pass.h modified: ge/graph/passes/switch_dead_branch_elimination.cc modified: ge/graph/preprocess/graph_preprocess.cc modified: ge/graph/passes/base_pass.cc modified: ge/graph/passes/base_pass.h modified: ge/graph/passes/folding_pass.cc modified: ge/graph/passes/infer_base_pass.h modified: ge/graph/passes/infer_value_range_pass.cc modified: ge/graph/passes/infer_value_range_pass.h modified: ge/graph/passes/infershape_pass.cc modified: ge/graph/passes/infershape_pass.h modified: ge/graph/passes/switch_dead_branch_elimination.cc modified: ge/graph/preprocess/graph_preprocess.cc modified: ge/graph/passes/base_pass.cc modified: ge/graph/passes/base_pass.h modified: ge/graph/passes/folding_pass.cc modified: ge/graph/passes/infer_base_pass.h modified: ge/graph/passes/infer_value_range_pass.cc modified: ge/graph/passes/infer_value_range_pass.h modified: ge/graph/passes/infershape_pass.cc modified: ge/graph/passes/infershape_pass.h modified: ge/graph/passes/merge_pass.cc modified: ge/graph/passes/switch_dead_branch_elimination.cc modified: ge/graph/preprocess/graph_preprocess.cc modified: ge/graph/passes/base_pass.cc modified: ge/graph/passes/base_pass.h modified: ge/graph/passes/folding_pass.cc modified: ge/graph/passes/infer_base_pass.h modified: ge/graph/passes/infer_value_range_pass.cc modified: ge/graph/passes/infer_value_range_pass.h modified: ge/graph/passes/infershape_pass.cc modified: ge/graph/passes/infershape_pass.h modified: ge/graph/passes/merge_pass.cc modified: ge/graph/passes/switch_dead_branch_elimination.cc modified: ge/graph/preprocess/graph_preprocess.cc modified: ge/graph/passes/base_pass.cc modified: ge/graph/passes/base_pass.h modified: ge/graph/passes/folding_pass.cc modified: ge/graph/passes/infer_base_pass.h modified: ge/graph/passes/infer_value_range_pass.cc modified: ge/graph/passes/infer_value_range_pass.h modified: ge/graph/passes/infershape_pass.cc modified: ge/graph/passes/infershape_pass.h modified: ge/graph/passes/merge_pass.cc modified: ge/graph/passes/switch_dead_branch_elimination.cc modified: ge/graph/preprocess/graph_preprocess.cc
4 years ago
modified: ge/graph/passes/base_pass.cc modified: ge/graph/passes/base_pass.h modified: ge/graph/passes/folding_pass.cc modified: ge/graph/passes/infershape_pass.cc modified: ge/graph/passes/infershape_pass.h modified: ge/graph/passes/switch_dead_branch_elimination.cc modified: ge/graph/preprocess/graph_preprocess.cc modified: ge/graph/passes/base_pass.cc modified: ge/graph/passes/base_pass.h modified: ge/graph/passes/folding_pass.cc modified: ge/graph/passes/infer_base_pass.h modified: ge/graph/passes/infer_value_range_pass.cc modified: ge/graph/passes/infer_value_range_pass.h modified: ge/graph/passes/infershape_pass.cc modified: ge/graph/passes/infershape_pass.h modified: ge/graph/passes/switch_dead_branch_elimination.cc modified: ge/graph/preprocess/graph_preprocess.cc modified: ge/graph/passes/base_pass.cc modified: ge/graph/passes/base_pass.h modified: ge/graph/passes/folding_pass.cc modified: ge/graph/passes/infer_base_pass.h modified: ge/graph/passes/infer_value_range_pass.cc modified: ge/graph/passes/infer_value_range_pass.h modified: ge/graph/passes/infershape_pass.cc modified: ge/graph/passes/infershape_pass.h modified: ge/graph/passes/merge_pass.cc modified: ge/graph/passes/switch_dead_branch_elimination.cc modified: ge/graph/preprocess/graph_preprocess.cc modified: ge/graph/passes/base_pass.cc modified: ge/graph/passes/base_pass.h modified: ge/graph/passes/folding_pass.cc modified: ge/graph/passes/infer_base_pass.h modified: ge/graph/passes/infer_value_range_pass.cc modified: ge/graph/passes/infer_value_range_pass.h modified: ge/graph/passes/infershape_pass.cc modified: ge/graph/passes/infershape_pass.h modified: ge/graph/passes/merge_pass.cc modified: ge/graph/passes/switch_dead_branch_elimination.cc modified: ge/graph/preprocess/graph_preprocess.cc modified: ge/graph/passes/base_pass.cc modified: ge/graph/passes/base_pass.h modified: ge/graph/passes/folding_pass.cc modified: ge/graph/passes/infer_base_pass.h modified: ge/graph/passes/infer_value_range_pass.cc modified: ge/graph/passes/infer_value_range_pass.h modified: ge/graph/passes/infershape_pass.cc modified: ge/graph/passes/infershape_pass.h modified: ge/graph/passes/merge_pass.cc modified: ge/graph/passes/switch_dead_branch_elimination.cc modified: ge/graph/preprocess/graph_preprocess.cc
4 years ago
5 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329
  1. /**
  2. * Copyright 2020-2021 Huawei Technologies Co., Ltd
  3. *+
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. #include "graph/passes/infershape_pass.h"
  17. #include "common/util/error_manager/error_manager.h"
  18. #include "framework/common/debug/ge_log.h"
  19. #include "analyzer/analyzer.h"
  20. #include "framework/common/util.h"
  21. #include "graph/shape_refiner.h"
  22. #include "graph/utils/graph_utils.h"
  23. #include "graph/utils/node_utils.h"
  24. #include "graph/debug/ge_attr_define.h"
  25. #include "graph/utils/tensor_utils.h"
  26. #include "graph/utils/type_utils.h"
  27. #include "external/graph/operator_factory.h"
  28. namespace ge {
  29. namespace {
  30. constexpr int kSwitchExitAnchorIndex = 0;
  31. constexpr int kSwitchPredAnchorIndex = 1;
  32. void SerialShapeRange(const GeTensorDescPtr &desc, std::string &desc_str) {
  33. desc_str += "[";
  34. std::vector<std::pair<int64_t, int64_t>> shape_range;
  35. (void)desc->GetShapeRange(shape_range);
  36. for (const auto &pair : shape_range) {
  37. desc_str += "{";
  38. desc_str += std::to_string(pair.first) + "," + std::to_string(pair.second);
  39. desc_str += "},";
  40. }
  41. desc_str += "]";
  42. shape_range.clear();
  43. (void)desc->GetOriginShapeRange(shape_range);
  44. for (const auto &pair : shape_range) {
  45. desc_str += ",{";
  46. desc_str += std::to_string(pair.first) + "," + std::to_string(pair.second);
  47. desc_str += "},";
  48. }
  49. }
  50. void UpdateShapeAndDType(const GeTensorDescPtr &src, GeTensorDescPtr &dst) {
  51. dst->SetOriginShape(src->GetOriginShape());
  52. dst->SetShape(src->GetShape());
  53. dst->SetDataType(src->GetDataType());
  54. dst->SetOriginDataType(src->GetOriginDataType());
  55. vector<pair<int64_t, int64_t>> src_shape_range;
  56. src->GetShapeRange(src_shape_range);
  57. dst->SetShapeRange(src_shape_range);
  58. dst->SetOriginShapeRange(src_shape_range);
  59. ge::TensorUtils::SetRealDimCnt(*dst, static_cast<uint32_t>(src->GetShape().GetDims().size()));
  60. }
  61. } // namespace
  62. std::string InferShapePass::SerialTensorInfo(const GeTensorDescPtr &tensor_desc) const {
  63. std::stringstream ss;
  64. ss << "(shape:[" << tensor_desc->MutableShape().ToString() << "]),";
  65. ss << "(format:" << TypeUtils::FormatToSerialString(tensor_desc->GetFormat()) << "),";
  66. ss << "(dtype:" << TypeUtils::DataTypeToSerialString(tensor_desc->GetDataType()) << "),";
  67. ss << "(origin_shape:" << tensor_desc->GetOriginShape().ToString() << "),";
  68. ss << "(origin_format:" << TypeUtils::FormatToSerialString(tensor_desc->GetOriginFormat()) << "),";
  69. ss << "(origin_dtype:" << TypeUtils::DataTypeToSerialString(tensor_desc->GetOriginDataType()) << "),";
  70. string range_str;
  71. SerialShapeRange(tensor_desc, range_str);
  72. ss << "(shape_range:" << range_str << ")";
  73. return ss.str();
  74. }
  75. Status InferShapePass::SuspendV1LoopExitNodes(const NodePtr &node) {
  76. if (node->GetType() != SWITCH) {
  77. return SUCCESS;
  78. }
  79. auto pred_node = NodeUtils::GetInDataNodeByIndex(*node, kSwitchPredAnchorIndex);
  80. GE_CHECK_NOTNULL(pred_node);
  81. if (pred_node->GetType() != LOOPCOND) {
  82. return SUCCESS;
  83. }
  84. for (const auto &anchor_2_node : NodeUtils::GetOutDataNodesWithAnchorByIndex(*node, kSwitchExitAnchorIndex)) {
  85. GELOGI("Found v1 loop when infershape, suspend Exit node %s, type %s.", anchor_2_node.second->GetName().c_str(),
  86. anchor_2_node.second->GetType().c_str());
  87. auto iter = graphs_2_suspend_nodes_.find(GetCurrentGraphName());
  88. auto &suspend_nodes = graphs_2_suspend_nodes_[GetCurrentGraphName()];
  89. if (suspend_nodes.nodes_set.insert(anchor_2_node.second).second) {
  90. suspend_nodes.nodes.push(anchor_2_node.second);
  91. AddNodeSuspend(anchor_2_node.second);
  92. }
  93. }
  94. return SUCCESS;
  95. }
  96. Status InferShapePass::Infer(NodePtr &node) {
  97. auto ret = SuspendV1LoopExitNodes(node);
  98. if (ret != SUCCESS) {
  99. //todo LOG
  100. return ret;
  101. }
  102. bool is_unknown_graph = node->GetOwnerComputeGraph()->GetGraphUnknownFlag();
  103. auto opdesc = node->GetOpDesc();
  104. if (node->Verify() != GRAPH_SUCCESS) {
  105. REPORT_CALL_ERROR("E19999", "Verifying %s failed.", node->GetName().c_str());
  106. GELOGE(GRAPH_FAILED, "[Call][Verify] Verifying %s failed.", node->GetName().c_str());
  107. return GRAPH_FAILED;
  108. }
  109. Operator op = OpDescUtils::CreateOperatorFromNode(node);
  110. if (!is_unknown_graph) {
  111. auto inference_context = ShapeRefiner::CreateInferenceContext(node);
  112. GE_CHECK_NOTNULL(inference_context);
  113. GELOGD("create context for node:%s, marks %zu", node->GetName().c_str(), inference_context->GetMarks().size());
  114. op.SetInferenceContext(inference_context);
  115. }
  116. graphStatus status = CallInferShapeFunc(node, op);
  117. if (status != GRAPH_NODE_NEED_REPASS && status != GRAPH_PARAM_INVALID && status != GRAPH_SUCCESS) {
  118. // node like netoutput return param_invalid, but valid ?
  119. REPORT_CALL_ERROR("E19999", "%s call infer function failed.", node->GetName().c_str());
  120. GELOGE(GRAPH_FAILED, "[Call][InferFunction] failed, node:%s.", node->GetName().c_str());
  121. return GRAPH_FAILED;
  122. }
  123. if (!is_unknown_graph) {
  124. auto ctx_after_infer = op.GetInferenceContext();
  125. if (ctx_after_infer != nullptr) {
  126. GELOGD("[%s] after infershape. mark:%zu", node->GetName().c_str(), ctx_after_infer->GetMarks().size());
  127. if (!ctx_after_infer->GetOutputHandleShapesAndTypes().empty() || !ctx_after_infer->GetMarks().empty()) {
  128. GELOGD("[%s] set inference context after. mark:%zu", node->GetName().c_str(),
  129. ctx_after_infer->GetMarks().size());
  130. ShapeRefiner::PushToContextMap(node, ctx_after_infer);
  131. }
  132. }
  133. }
  134. return (status == GRAPH_NODE_NEED_REPASS) ? GRAPH_NODE_NEED_REPASS : GRAPH_SUCCESS;
  135. }
  136. bool InferShapePass::SameTensorDesc(const GeTensorDescPtr &src, const GeTensorDescPtr &dst) {
  137. // check shape range
  138. vector<std::pair<int64_t, int64_t>> src_shape_range;
  139. vector<std::pair<int64_t, int64_t>> dst_shape_range;
  140. src->GetShapeRange(src_shape_range);
  141. dst->GetShapeRange(dst_shape_range);
  142. if (src_shape_range.size() != dst_shape_range.size()) {
  143. GELOGI("Src shape range size is %zu, dst shape range size is %zu, not same.", src_shape_range.size(),
  144. dst_shape_range.size());
  145. return false;
  146. }
  147. for (size_t i = 0; i < src_shape_range.size(); ++i) {
  148. if (src_shape_range[i].first != dst_shape_range[i].first ||
  149. src_shape_range[i].second != dst_shape_range[i].second) {
  150. GELOGI("Current dim %zu. Src shape range is [%lu-%lu], dst shape range is [%lu-%lu], not same.",
  151. i, src_shape_range[i].first, src_shape_range[i].second, dst_shape_range[i].first, dst_shape_range[i].second);
  152. return false;
  153. }
  154. }
  155. // check shape
  156. auto src_shape = src->GetShape();
  157. auto dst_shape = dst->GetShape();
  158. if (src_shape.GetDims() != dst_shape.GetDims() || src->GetOriginShape().GetDims() != dst->GetOriginShape().GetDims() ||
  159. src->GetDataType() != dst->GetDataType() || src->GetOriginDataType() != dst->GetOriginDataType()) {
  160. GELOGD(
  161. "Src shape is %s, origin_shape is %s, data_type is %s, origin data_type is %s; "
  162. "Dst shape is %s, origin_shape is %s, data_type is %s, original data_type is %s, not same.",
  163. src_shape.ToString().c_str(), src->GetOriginShape().ToString().c_str(),
  164. TypeUtils::DataTypeToSerialString(src->GetDataType()).c_str(),
  165. TypeUtils::DataTypeToSerialString(src->GetOriginDataType()).c_str(), dst_shape.ToString().c_str(),
  166. dst->GetOriginShape().ToString().c_str(), TypeUtils::DataTypeToSerialString(dst->GetDataType()).c_str(),
  167. TypeUtils::DataTypeToSerialString(dst->GetOriginDataType()).c_str());
  168. return false;
  169. }
  170. return true;
  171. }
  172. graphStatus InferShapePass::UpdateTensorDesc(GeTensorDescPtr &src, GeTensorDescPtr &dst, bool &changed) {
  173. // refresh src itself
  174. src->SetOriginShape(src->GetShape());
  175. src->SetOriginDataType(src->GetDataType());
  176. TensorUtils::SetRealDimCnt(*src, static_cast<uint32_t>(src->GetOriginShape().GetDims().size()));
  177. vector<pair<int64_t, int64_t>> src_shape_range;
  178. src->GetShapeRange(src_shape_range);
  179. src->SetOriginShapeRange(src_shape_range);
  180. changed = false;
  181. if (SameTensorDesc(src, dst)) {
  182. GELOGD("Peer dst tensor_desc is same as src tensor_desc. No need update.");
  183. return SUCCESS;
  184. }
  185. changed = true;
  186. UpdateShapeAndDType(src, dst);
  187. GELOGD(
  188. "UpdatePeerInputDesc from src Node: shape: [%s], datatype: %s, original datatype is %s."
  189. "To dst Node: shape: [%s], datatype: %s, original datatype is %s.",
  190. src->GetShape().ToString().c_str(), TypeUtils::DataTypeToSerialString(src->GetDataType()).c_str(),
  191. TypeUtils::DataTypeToSerialString(src->GetOriginDataType()).c_str(), dst->GetShape().ToString().c_str(),
  192. TypeUtils::DataTypeToSerialString(dst->GetDataType()).c_str(),
  193. TypeUtils::DataTypeToSerialString(dst->GetOriginDataType()).c_str());
  194. return SUCCESS;
  195. }
  196. graphStatus InferShapePass::CallInferShapeFunc(NodePtr &node, Operator &op) {
  197. auto op_desc = node->GetOpDesc();
  198. const auto &op_type = op_desc->GetType();
  199. auto ret = op_desc->CallInferFunc(op);
  200. if (ret == GRAPH_PARAM_INVALID) {
  201. // Op ir no infer func, try to get infer func from operator factory
  202. auto node_op = ge::OperatorFactory::CreateOperator("node_op", op_desc->GetType());
  203. if (node_op.IsEmpty()) {
  204. GELOGW("get op from OperatorFactory fail. opType: %s", op_type.c_str());
  205. return ret;
  206. }
  207. GELOGD("get op from OperatorFactory success. opType: %s", op_type.c_str());
  208. auto temp_op_desc = ge::OpDescUtils::GetOpDescFromOperator(node_op);
  209. node_op.BreakConnect();
  210. if (temp_op_desc == nullptr) {
  211. REPORT_CALL_ERROR("E19999", "GetOpDescFromOperator failed, return nullptr.");
  212. GELOGE(GRAPH_FAILED, "[Get][OpDesc] temp op desc is null");
  213. return GRAPH_FAILED;
  214. }
  215. if (!op_desc->UpdateInputName(temp_op_desc->GetAllInputName())) {
  216. GELOGW("InferShapeAndType UpdateInputName failed");
  217. for (const auto &out_desc : op_desc->GetAllOutputsDescPtr()) {
  218. if (out_desc != nullptr && out_desc->GetShape().GetDims().empty()) {
  219. break;
  220. }
  221. return GRAPH_SUCCESS;
  222. }
  223. }
  224. if (!op_desc->UpdateOutputName(temp_op_desc->GetAllOutputName())) {
  225. GELOGW("InferShapeAndType UpdateOutputName failed");
  226. }
  227. op_desc->AddInferFunc(temp_op_desc->GetInferFunc());
  228. ret = op_desc->CallInferFunc(op);
  229. GELOGI("op CallInferFunc second. ret: %u", ret);
  230. }
  231. return ret;
  232. }
  233. graphStatus InferShapePass::UpdateOutputFromSubgraphs(const std::vector<GeTensorDescPtr> &src, GeTensorDescPtr &dst) {
  234. GELOGD("Enter update parent node shape for class branch op process");
  235. // check sub_graph shape.If not same ,do unknown shape process
  236. auto ref_out_tensor = src.at(0);
  237. ge::GeShape &ref_out_tensor_shape = ref_out_tensor->MutableShape();
  238. for (auto &tensor : src) {
  239. if (ref_out_tensor->GetDataType() != tensor->GetDataType()) {
  240. REPORT_INNER_ERROR("E19999", "Does not support diff dtype among all ref output, shape:%s",
  241. ref_out_tensor_shape.ToString().c_str());
  242. GELOGE(GRAPH_FAILED, "[Check][Param] node does not support diff dtype output");
  243. return GRAPH_FAILED;
  244. }
  245. auto shape = tensor->MutableShape();
  246. if (shape.GetDims().size() != ref_out_tensor_shape.GetDims().size()) {
  247. GELOGD("Shape from subgraph size: %lu, ref_out_tensor_shape size: %lu", shape.GetShapeSize(),
  248. ref_out_tensor_shape.GetShapeSize());
  249. ref_out_tensor_shape = GeShape(UNKNOWN_RANK);
  250. break;
  251. }
  252. for (size_t j = 0; j < ref_out_tensor_shape.GetDims().size(); j++) {
  253. if (ref_out_tensor_shape.GetDim(j) == shape.GetDim(j)) {
  254. continue;
  255. }
  256. GELOGD("j: %zu ,shape from subgraph size: %lu, ref_out_tensor_shape size: %lu", j, shape.GetShapeSize(),
  257. ref_out_tensor_shape.GetShapeSize());
  258. (void)ref_out_tensor_shape.SetDim(j, UNKNOWN_DIM);
  259. }
  260. }
  261. UpdateShapeAndDType(ref_out_tensor, dst);
  262. return GRAPH_SUCCESS;
  263. }
  264. graphStatus InferShapePass::UpdateOutputFromSubgraphsForMultiDims(const std::vector<GeTensorDescPtr> &src,
  265. GeTensorDescPtr &dst) {
  266. // check sub_graph shape. Get max for update.
  267. if (src.empty()) {
  268. // TODO LOG
  269. return SUCCESS;
  270. }
  271. int64_t max_size = 0;
  272. size_t max_shape_index = 0;
  273. auto &ref_out_tensor = src.at(0);
  274. for (size_t j = 0; j < src.size(); ++j) {
  275. auto &tensor = src.at(j);
  276. if (ref_out_tensor->GetDataType() != tensor->GetDataType()) {
  277. REPORT_INNER_ERROR("E19999", "node does not support diff dtype among all ref output");
  278. GELOGE(GRAPH_FAILED, "[Check][Param] node does not support diff dtype among all ref output");
  279. return GRAPH_FAILED;
  280. }
  281. auto shape = tensor->MutableShape();
  282. int64_t size = 1;
  283. for (auto dim : shape.GetDims()) {
  284. if (dim != 0 && INT64_MAX / dim < size) {
  285. REPORT_INNER_ERROR("E19999", "The shape:%s size overflow", shape.ToString().c_str());
  286. GELOGE(PARAM_INVALID, "[Check][Overflow] The shape size overflow");
  287. return PARAM_INVALID;
  288. }
  289. size *= dim;
  290. }
  291. if (size > max_size) {
  292. max_size = size;
  293. max_shape_index = j;
  294. }
  295. }
  296. UpdateShapeAndDType(src.at(max_shape_index), dst);
  297. return GRAPH_SUCCESS;
  298. }
  299. Status InferShapePass::OnSuspendNodesLeaked() {
  300. auto iter = graphs_2_suspend_nodes_.find(GetCurrentGraphName());
  301. if (iter == graphs_2_suspend_nodes_.end()) {
  302. // todo log warn
  303. return SUCCESS;
  304. }
  305. if (!iter->second.nodes.empty()) {
  306. AddNodeResume(iter->second.PopSuspendedNode());
  307. }
  308. return SUCCESS;
  309. }
  310. } // namespace ge

图引擎模块(GE)是MindSpore的一个子模块,其代码由C++实现,位于前端模块ME和底层硬件之间,起到承接作用。图引擎模块以ME下发的图作为输入,然后进行一系列的深度图优化操作,最后输出一张可以在底层硬件上高效运行的图。GE针对昇腾AI处理器的硬件结构特点,做了特定的优化工作,以此来充分发挥出昇腾AI处理器的强大算力。在进行模型训练/推理时,GE会被自动调用而用户并不感知。GE主要由GE API和GE Core两部分组成,详细的架构图如下所示