Skip to content
Snippets Groups Projects
Commit 32d3a670 authored by Cyril Moineau's avatar Cyril Moineau
Browse files

Update Connector to allow creation of incomplete graph (without a Producer at root)

parent 0686c4ed
No related branches found
No related tags found
No related merge requests found
......@@ -83,4 +83,4 @@ class Connector {
std::shared_ptr<GraphView> generateGraph(std::vector<Connector> ctors);
} // namespace Aidge
#endif /* AIDGE_CORE_GRAPH_CONNECTOR_H_ */
\ No newline at end of file
#endif /* AIDGE_CORE_GRAPH_CONNECTOR_H_ */
......@@ -41,6 +41,7 @@ std::shared_ptr<Aidge::GraphView> Aidge::generateGraph(std::vector<Connector> ct
std::vector<std::shared_ptr<Node>> parents = nodesToAdd.back()->getParents();
const std::set<std::shared_ptr<Node>>& alreadyAdded = graph->getNodes();
for (std::shared_ptr<Node> parent : parents) {
if (!parent) continue;
if (alreadyAdded.find(parent) == alreadyAdded.end()) {
buffer.push_back(parent);
}
......@@ -51,4 +52,4 @@ std::shared_ptr<Aidge::GraphView> Aidge::generateGraph(std::vector<Connector> ct
buffer = {};
}
return graph;
}
\ No newline at end of file
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment