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
Iterations
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
Eclipse Projects
aidge
aidge_core
Commits
57dd2c6c
Commit
57dd2c6c
authored
1 year ago
by
Olivier BICHLER
Browse files
Options
Downloads
Patches
Plain Diff
Fixed binding issue and seg fault
parent
6fdf2ae6
No related branches found
No related tags found
2 merge requests
!105
version 0.2.0
,
!77
Support for recurrent networks
Pipeline
#40403
passed
1 year ago
Stage: static_analysis
Stage: build
Stage: test
Stage: coverage
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
python_binding/graph/pybind_GraphView.cpp
+13
-1
13 additions, 1 deletion
python_binding/graph/pybind_GraphView.cpp
src/recipes/FuseMulAdd.cpp
+8
-6
8 additions, 6 deletions
src/recipes/FuseMulAdd.cpp
with
21 additions
and
7 deletions
python_binding/graph/pybind_GraphView.cpp
+
13
−
1
View file @
57dd2c6c
...
@@ -89,7 +89,19 @@ void init_GraphView(py::module& m) {
...
@@ -89,7 +89,19 @@ void init_GraphView(py::module& m) {
:type to_tensor: int
:type to_tensor: int
)mydelimiter"
)
)mydelimiter"
)
.
def_static
(
"replace"
,
&
GraphView
::
replace
,
py
::
arg
(
"old_nodes"
),
py
::
arg
(
"new_nodes"
),
.
def_static
(
"replace"
,
py
::
overload_cast
<
const
std
::
shared_ptr
<
GraphView
>&
,
const
std
::
shared_ptr
<
GraphView
>&>
(
&
GraphView
::
replace
),
py
::
arg
(
"old_graph"
),
py
::
arg
(
"new_graph"
),
R"mydelimiter(
Replace the old set of Nodes in a GraphView with the new set of given Nodes in a GraphView if possible in every GraphView.
:param old_graph: GraphView of Nodes actually connected in GraphViews.
:type old_graph: GraphView
:param new_graph: GraphView of Nodes with inner connections already taken care of.
:type new_graph: GraphView
:return: Whether any replacement has been made.
:rtype: bool
)mydelimiter"
)
.
def_static
(
"replace"
,
py
::
overload_cast
<
const
std
::
set
<
NodePtr
>&
,
const
std
::
set
<
NodePtr
>&>
(
&
GraphView
::
replace
),
py
::
arg
(
"old_nodes"
),
py
::
arg
(
"new_nodes"
),
R"mydelimiter(
R"mydelimiter(
Replace the old set of Nodes with the new set of given Nodes if possible in every GraphView.
Replace the old set of Nodes with the new set of given Nodes if possible in every GraphView.
...
...
This diff is collapsed.
Click to expand it.
src/recipes/FuseMulAdd.cpp
+
8
−
6
View file @
57dd2c6c
...
@@ -47,18 +47,20 @@ void Aidge::fuseMulAdd(std::shared_ptr<Aidge::Node> matmulNode, std::shared_ptr<
...
@@ -47,18 +47,20 @@ void Aidge::fuseMulAdd(std::shared_ptr<Aidge::Node> matmulNode, std::shared_ptr<
}
}
std
::
shared_ptr
<
Node
>
weight
=
nullptr
;
std
::
shared_ptr
<
Node
>
weight
=
nullptr
;
if
(
matmulNode
->
getParent
(
1
)
->
getOperator
()
->
type
()
==
Producer_Op
::
Type
if
((
matmulNode
->
getParent
(
1
)
&&
!
matmulNode
->
getParent
(
0
))
&&
matmulNode
->
getParent
(
0
)
->
getOperator
()
->
type
()
!=
Producer_Op
::
Type
)
||
(
matmulNode
->
getParent
(
1
)
&&
matmulNode
->
getParent
(
1
)
->
getOperator
()
->
type
()
==
Producer_Op
::
Type
&&
matmulNode
->
getParent
(
0
)
&&
matmulNode
->
getParent
(
0
)
->
getOperator
()
->
type
()
!=
Producer_Op
::
Type
))
{
{
weight
=
matmulNode
->
getParent
(
1
)
->
cloneSharedOperators
();
weight
=
matmulNode
->
getParent
(
1
)
->
cloneSharedOperators
();
}
}
else
if
(
matmulNode
->
getParent
(
0
)
->
getOperator
()
->
type
()
==
Producer_Op
::
Type
else
if
((
matmulNode
->
getParent
(
0
)
&&
!
matmulNode
->
getParent
(
1
))
&&
matmulNode
->
getParent
(
1
)
->
getOperator
()
->
type
()
!=
Producer_Op
::
Type
)
||
(
matmulNode
->
getParent
(
0
)
&&
matmulNode
->
getParent
(
0
)
->
getOperator
()
->
type
()
==
Producer_Op
::
Type
&&
matmulNode
->
getParent
(
1
)
&&
matmulNode
->
getParent
(
1
)
->
getOperator
()
->
type
()
!=
Producer_Op
::
Type
))
{
{
weight
=
matmulNode
->
getParent
(
0
)
->
cloneSharedOperators
();
weight
=
matmulNode
->
getParent
(
0
)
->
cloneSharedOperators
();
}
}
else
if
(
matmulNode
->
getParent
(
0
)
->
getOperator
()
->
type
()
==
Producer_Op
::
Type
else
if
(
matmulNode
->
getParent
(
0
)
&&
matmulNode
->
getParent
(
0
)
->
getOperator
()
->
type
()
==
Producer_Op
::
Type
&&
matmulNode
->
getParent
(
1
)
->
getOperator
()
->
type
()
==
Producer_Op
::
Type
)
&&
matmulNode
->
getParent
(
1
)
&&
matmulNode
->
getParent
(
1
)
->
getOperator
()
->
type
()
==
Producer_Op
::
Type
)
{
{
// If both inputs are producers, there is an ambiguity, but both options
// If both inputs are producers, there is an ambiguity, but both options
// result in a correct solution.
// result in a correct solution.
...
...
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