Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
aidge_core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Cyril Moineau
aidge_core
Commits
da735299
Commit
da735299
authored
1 year ago
by
Maxence Naud
Browse files
Options
Downloads
Patches
Plain Diff
[Upd] the replace function to use graph ordering
parent
dd23ae05
No related branches found
No related tags found
No related merge requests found
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/aidge/graph/GraphView.hpp
+15
-8
15 additions, 8 deletions
include/aidge/graph/GraphView.hpp
src/graph/GraphView.cpp
+152
-140
152 additions, 140 deletions
src/graph/GraphView.cpp
with
167 additions
and
148 deletions
include/aidge/graph/GraphView.hpp
+
15
−
8
View file @
da735299
...
...
@@ -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.
Click to expand it.
src/graph/GraphView.cpp
+
152
−
140
View file @
da735299
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment