fix GetGraphInputNodes

This commit is contained in:
sunsuodong 2020-08-03 20:11:30 +08:00
parent 61639d9020
commit e85f3193fd
1 changed files with 6 additions and 2 deletions

View File

@ -34,7 +34,9 @@ std::vector<size_t> GetGraphInputNodes(const schema::MetaGraph *meta_graph) {
MS_ASSERT(nullptr != cNode);
for (size_t k = 0; k < cNode->inputIndex()->size(); k++) {
if (cNode->inputIndex()->GetAs<uint32_t>(k) == input_index) {
ret.emplace_back(j);
if (!IsContain<size_t>(ret, j)) {
ret.emplace_back(j);
}
break;
}
}
@ -53,7 +55,9 @@ std::vector<size_t> GetGraphOutputNodes(const schema::MetaGraph *meta_graph) {
MS_ASSERT(nullptr != cNode);
for (size_t k = 0; k < cNode->outputIndex()->size(); k++) {
if (cNode->outputIndex()->GetAs<uint32_t>(k) == output_index) {
ret.emplace_back(j);
if (!IsContain<size_t>(ret, j)) {
ret.emplace_back(j);
}
break;
}
}