Browse Source

fix do fission when UnsegmentSum's input0 shape size is 1

tags/v0.7.0-beta
huanghui 5 years ago
parent
commit
71d839dec7
1 changed files with 4 additions and 0 deletions
  1. +4
    -0
      mindspore/ccsrc/backend/optimizer/ascend/ir_fission/unsorted_segment_sum_fission.cc

+ 4
- 0
mindspore/ccsrc/backend/optimizer/ascend/ir_fission/unsorted_segment_sum_fission.cc View File

@@ -94,6 +94,10 @@ const AnfNodePtr UnsortSegmentSumFission::Process(const FuncGraphPtr &graph, con
return nullptr;
}
auto input0_shape = AnfAlgo::GetPrevNodeOutputInferShape(origin_node, 0);
if (input0_shape.size() < 2) {
MS_LOG(INFO) << "Input0's shape size less than 2, not optimize";
return nullptr;
}
if (input0_shape[input0_shape.size() - 1] != 1) {
MS_LOG(INFO) << "UnsortedSegmentSum is not need fission. The last value of input0's shape is "
<< input0_shape[input0_shape.size() - 1];


Loading…
Cancel
Save