Skip to content
Snippets Groups Projects
Commit da735299 authored by Maxence Naud's avatar Maxence Naud
Browse files

[Upd] the replace function to use graph ordering

parent dd23ae05
No related branches found
No related tags found
No related merge requests found
......@@ -391,17 +391,24 @@ public:
IOIndex_t newParentInputTensorIdx,
IOIndex_t newParentOutputTensorIdx);
/**
* @brief Replace a set of Nodes in every available GraphView with a new set of Nodes if possible.
* Both sets should include all the necessary Producers.
* @details Replaced Nodes are removed from any GraphView pointing at them all.
* The oldNodes set should have only one input/output
* Tensor for automatic connections of newNodes set.
* @param oldNodes actual set of shared_ptr<Node> to replace.
* @param newNodes new set of shared_ptr<Node>.
* @return true
* @return false
* @details There are 3 cases of replacement:
* Case 1: same number of input/output connections for oldNodes and newNodes sets.
* - input/output connections are replacated according to their IDs.
* Case 2: different number of input/output connections for oldNodes and newNodes sets.
* - only a single parent/child node for the newNodes set, every input/output is
* connected to it.
* - several parents/children nodes for newNodes set => impossible to know, return false
* Case 3: newNodes set is empty
* - same number of input/output connections in oldNodes, parents and children are linked according
* to these connections IDs
* - different number of input/output connections in oldNodes => return false
* @param oldNodes
* @param newNodes
* @return true replacement has been performed
* @return false no replacement has been performed
*/
static bool replace(const std::set<NodePtr>& oldNodes, const std::set<NodePtr>& newNodes);
......
This diff is collapsed.
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