[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)
Merge request reports
Activity
changed milestone to %v0.1.0
assigned to @pineapple
- Resolved by Cyril Moineau
I think you should remove replaceWith or make it call the replace method. I would opt for the latest as some of our tutorials depend on replaceWith.
Furthermore, I think we should add a deprecation system in Aidge @olivierbichler , @pineapple
added 8 commits
-
5b97a6a5...daec3e64 - 6 commits from branch
main
- 835e17e7 - Merge remote-tracking branch 'origin/main' into fix/replaceWith
- 2e9f0013 - [Fix] replace() binding
-
5b97a6a5...daec3e64 - 6 commits from branch
added 1 commit
- ad28a0e8 - [Fix] replace() member function to run python tests successfully
requested review from @cmoineau, @thibaultallenet, and @vtemplier
mentioned in issue aidge#32 (closed)
added 1 commit
- 458c4ae9 - [MIN] make FuseMulAdd more resilient to edge cases
added 12 commits
-
458c4ae9...c8c16f2e - 10 commits from branch
main
- d076d8df - Merge remote-tracking branch 'origin/main' into fix/replaceWith
- ff19c397 - Completely remove replaceWith() member function from GraphView
-
458c4ae9...c8c16f2e - 10 commits from branch
enabled an automatic merge when the pipeline for ff19c397 succeeds
mentioned in commit 50f86506