• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1From 5d65239d88236e76fffe9900a1f58fbdc83e68c9 Mon Sep 17 00:00:00 2001
2From: zhangyanhui <zhangyanhui17@huawei.com>
3Date: Thu, 11 Apr 2024 17:14:06 +0800
4Subject: [PATCH] bugfix for onnx parser
5
6---
7 .../lite/tools/converter/parser/onnx/onnx_model_parser.cc     | 4 +++-
8 1 file changed, 3 insertions(+), 1 deletion(-)
9
10diff --git a/mindspore/lite/tools/converter/parser/onnx/onnx_model_parser.cc b/mindspore/lite/tools/converter/parser/onnx/onnx_model_parser.cc
11index 85d55445..30178ef0 100644
12--- a/mindspore/lite/tools/converter/parser/onnx/onnx_model_parser.cc
13+++ b/mindspore/lite/tools/converter/parser/onnx/onnx_model_parser.cc
14@@ -344,7 +344,9 @@ STATUS BuildOpOutputs(const onnx::NodeProto &onnx_node, const FuncGraphPtr &anf_
15     CHECK_NULL_RETURN(new_abstract_list);
16     cnode->set_abstract(new_abstract_list);
17   }
18-  anf_nodes_map->emplace(onnx_node.name(), cnode);
19+  if (onnx_node.op_type() == "Loop" || onnx_node.op_type() == "If") {
20+    anf_nodes_map->emplace(onnx_node.name(), cnode);
21+  }
22   return RET_OK;
23 }
24
25--
262.25.1
27
28