}
}
}
+
+ const auto original_graph = nodes.at(0)->graph();
+ const auto original_outputs = loco::output_nodes(const_cast<loco::Graph *>(original_graph));
+
// set graph output
for (auto &n : nodes)
{
break;
}
}
+
+ bool originalOutput = false;
+ for (const auto &o : outputs)
+ {
+ if (std::find(original_outputs.begin(), original_outputs.end(), o) != original_outputs.end())
+ {
+ originalOutput = true;
+ break;
+ }
+ }
+
// the node isn't graph output if it is an other node's output
- if (beingUsed)
+ if (beingUsed and not originalOutput)
continue;
IsMultiOutputNode multiout_visitor;
auto cnode = loco::must_cast<const luci::CircleNode *>(node);
std::string node_name = cnode->name();
- for (auto selected_name : tokens)
+ for (const auto &selected_name : tokens)
if (selected_name.compare(node_name) == 0) // find the selected name
selected_nodes.emplace_back(cnode);
}