Browse Source

!11699 [MS][LITE]fix bug of expanding nested loop

From: @mengyuanli
Reviewed-by: @hangangqiang,@zhanghaibo5
Signed-off-by: @hangangqiang
tags/v1.2.0-rc1
mindspore-ci-bot Gitee 4 years ago
parent
commit
475e1080d6
1 changed files with 7 additions and 4 deletions
  1. +7
    -4
      mindspore/lite/tools/converter/legacy_optimizer/graph/nested_loop_expand_pass.cc

+ 7
- 4
mindspore/lite/tools/converter/legacy_optimizer/graph/nested_loop_expand_pass.cc View File

@@ -77,14 +77,17 @@ STATUS NestedLoopExpandPass::Run(schema::MetaGraphT *graph) {
graph_->subGraph.at(idx) = nullptr;
}



for (auto &node_idx : main_graph->nodeIndices) {
auto &node = graph_->nodes.at(node_idx);
if (node->primitive->value.type == PrimitiveType_Partial) {
auto &subgraph_idx = ((schema::PartialT *)(node->primitive->value.value))->subGraphIndex;
for (auto i = 0; i < subgraph_idx; ++i) {
if (graph_->subGraph.at(subgraph_idx) == nullptr) {
if (graph_->subGraph.at(subgraph_idx) == nullptr) {
node = nullptr;
continue;
}
auto tmp_subgraph_idx = subgraph_idx;
for (auto i = 0; i < tmp_subgraph_idx; ++i) {
if (graph_->subGraph.at(i) == nullptr) {
subgraph_idx--;
}
}


Loading…
Cancel
Save