[Upd] replace() instead of replaceWith() in GraphView
replaceWith()
Description of The replaceWith()
member function works as follow:
- Select a set of Nodes to replace
- Create a GraphView from this set. (let's call it
g
) - Select a set of new Nodes and solve their input connections (let's call it
newNodes
) - run
g.replaceWith(newNodes)
- Nodes are replaced in every GraphView pointing at them all
Issue
- It may be confusing to create a new GraphView from the set of Nodes to replace and replace it by another set of Nodes and not a GraphView
- Input connections are not handled at all
- Output connections are handled and authorized only if obvious
Solution
Change replaceWith()
by replace()
GraphView::replace(std::set<std::shared_ptr<Node>> oldNodes, std::set<std::shared_ptr<Node>> newNodes);
- symetric handling of old/new Nodes
- automatically recreate input AND output connections if obvious (one connection or every input pointing to the same Tensor)
Edited by Vincent Templier