From e85f3193fdc5b271e295ac259bfdcff84a5b5889 Mon Sep 17 00:00:00 2001 From: sunsuodong Date: Mon, 3 Aug 2020 20:11:30 +0800 Subject: [PATCH] fix GetGraphInputNodes --- mindspore/lite/src/common/graph_util.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/mindspore/lite/src/common/graph_util.cc b/mindspore/lite/src/common/graph_util.cc index c8472bd7f92..e094c744ab9 100755 --- a/mindspore/lite/src/common/graph_util.cc +++ b/mindspore/lite/src/common/graph_util.cc @@ -34,7 +34,9 @@ std::vector GetGraphInputNodes(const schema::MetaGraph *meta_graph) { MS_ASSERT(nullptr != cNode); for (size_t k = 0; k < cNode->inputIndex()->size(); k++) { if (cNode->inputIndex()->GetAs(k) == input_index) { - ret.emplace_back(j); + if (!IsContain(ret, j)) { + ret.emplace_back(j); + } break; } } @@ -53,7 +55,9 @@ std::vector GetGraphOutputNodes(const schema::MetaGraph *meta_graph) { MS_ASSERT(nullptr != cNode); for (size_t k = 0; k < cNode->outputIndex()->size(); k++) { if (cNode->outputIndex()->GetAs(k) == output_index) { - ret.emplace_back(j); + if (!IsContain(ret, j)) { + ret.emplace_back(j); + } break; } }