Browse Source

!15606 [control flow]handle same label id in labelswitch

From: @liangzelang
Reviewed-by: @zhoufeng54,@kisnwang
Signed-off-by: @kisnwang
pull/15606/MERGE
mindspore-ci-bot Gitee 4 years ago
parent
commit
94a4a1beac
1 changed files with 2 additions and 1 deletions
  1. +2
    -1
      mindspore/ccsrc/backend/session/ascend_auto_monad.cc

+ 2
- 1
mindspore/ccsrc/backend/session/ascend_auto_monad.cc View File

@@ -1308,13 +1308,14 @@ class ExecuteOrderGenerator {
// Use new label if find repeated label.
if (iter == labels->end()) {
new_labels.emplace_back(label_id);
labels->emplace_back(label_id);
continue;
}
new_labels.emplace_back(++max_label_);
labels_multimap->insert(std::pair<uint32_t, uint32_t>(*iter, max_label_));
labels->emplace_back(max_label_);
is_new_labels = true;
}
labels->insert(labels->end(), new_labels.begin(), new_labels.end());
switch_labels->insert(switch_labels->end(), new_labels.begin(), new_labels.end());
if (is_new_labels) {
AnfAlgo::SetNodeAttr(kAttrLabelSwitchList, MakeValue(new_labels), node);


Loading…
Cancel
Save