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
c01e57f1
Commit
c01e57f1
authored
1 year ago
by
Olivier BICHLER
Browse files
Options
Downloads
Patches
Plain Diff
Minor changes
parent
13d0638c
No related branches found
No related tags found
2 merge requests
!105
version 0.2.0
,
!77
Support for recurrent networks
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
include/aidge/graph/GraphView.hpp
+5
-0
5 additions, 0 deletions
include/aidge/graph/GraphView.hpp
src/graph/GraphView.cpp
+6
-4
6 additions, 4 deletions
src/graph/GraphView.cpp
src/operator/OperatorTensor.cpp
+1
-0
1 addition, 0 deletions
src/operator/OperatorTensor.cpp
with
12 additions
and
4 deletions
include/aidge/graph/GraphView.hpp
+
5
−
0
View file @
c01e57f1
...
@@ -98,6 +98,11 @@ public:
...
@@ -98,6 +98,11 @@ public:
*/
*/
void
save
(
std
::
string
path
,
bool
verbose
=
false
,
bool
showProducers
=
true
)
const
;
void
save
(
std
::
string
path
,
bool
verbose
=
false
,
bool
showProducers
=
true
)
const
;
/**
* Check that a node is in the current GraphView.
* @param nodePtr Node to check
* @return bool True is nodePtr belongs to the GraphView.
*/
inline
bool
inView
(
NodePtr
nodePtr
)
const
{
inline
bool
inView
(
NodePtr
nodePtr
)
const
{
return
mNodes
.
find
(
nodePtr
)
!=
mNodes
.
end
();
return
mNodes
.
find
(
nodePtr
)
!=
mNodes
.
end
();
}
}
...
...
This diff is collapsed.
Click to expand it.
src/graph/GraphView.cpp
+
6
−
4
View file @
c01e57f1
...
@@ -401,6 +401,8 @@ void Aidge::GraphView::setInputId(Aidge::IOIndex_t /*inID*/,
...
@@ -401,6 +401,8 @@ void Aidge::GraphView::setInputId(Aidge::IOIndex_t /*inID*/,
}
}
void
Aidge
::
GraphView
::
add
(
std
::
shared_ptr
<
Node
>
node
,
bool
includeLearnableParam
)
{
void
Aidge
::
GraphView
::
add
(
std
::
shared_ptr
<
Node
>
node
,
bool
includeLearnableParam
)
{
AIDGE_ASSERT
(
node
!=
nullptr
,
"Trying to add non-existant node!"
);
// first node to be added to the graph is the root node by default
// first node to be added to the graph is the root node by default
if
(
mRootNode
==
nullptr
)
{
if
(
mRootNode
==
nullptr
)
{
mRootNode
=
node
;
mRootNode
=
node
;
...
@@ -442,7 +444,7 @@ std::pair<std::vector<Aidge::NodePtr>, size_t> Aidge::GraphView::getRankedNodes(
...
@@ -442,7 +444,7 @@ std::pair<std::vector<Aidge::NodePtr>, size_t> Aidge::GraphView::getRankedNodes(
for
(
auto
childs
:
curNode
->
getOrderedChildren
())
{
for
(
auto
childs
:
curNode
->
getOrderedChildren
())
{
for
(
auto
child
:
childs
)
{
for
(
auto
child
:
childs
)
{
if
(
nodesToRank
.
find
(
child
)
!=
nodesToRank
.
end
())
{
if
(
child
!=
nullptr
&&
nodesToRank
.
find
(
child
)
!=
nodesToRank
.
end
())
{
rankedNodes
.
push_back
(
child
);
rankedNodes
.
push_back
(
child
);
nodesToRank
.
erase
(
child
);
nodesToRank
.
erase
(
child
);
}
}
...
@@ -450,7 +452,7 @@ std::pair<std::vector<Aidge::NodePtr>, size_t> Aidge::GraphView::getRankedNodes(
...
@@ -450,7 +452,7 @@ std::pair<std::vector<Aidge::NodePtr>, size_t> Aidge::GraphView::getRankedNodes(
}
}
for
(
auto
parent
:
curNode
->
getParents
())
{
for
(
auto
parent
:
curNode
->
getParents
())
{
if
(
nodesToRank
.
find
(
parent
)
!=
nodesToRank
.
end
())
{
if
(
parent
!=
nullptr
&&
nodesToRank
.
find
(
parent
)
!=
nodesToRank
.
end
())
{
rankedNodes
.
push_back
(
parent
);
rankedNodes
.
push_back
(
parent
);
nodesToRank
.
erase
(
parent
);
nodesToRank
.
erase
(
parent
);
}
}
...
@@ -538,7 +540,7 @@ bool Aidge::GraphView::add(std::set<std::shared_ptr<Node>> otherNodes, bool incl
...
@@ -538,7 +540,7 @@ bool Aidge::GraphView::add(std::set<std::shared_ptr<Node>> otherNodes, bool incl
for
(
auto
childs
:
curNode
->
getOrderedChildren
())
{
for
(
auto
childs
:
curNode
->
getOrderedChildren
())
{
for
(
auto
child
:
childs
)
{
for
(
auto
child
:
childs
)
{
if
(
nodesToRank
.
find
(
child
)
!=
nodesToRank
.
end
())
{
if
(
child
!=
nullptr
&&
nodesToRank
.
find
(
child
)
!=
nodesToRank
.
end
())
{
rankedNodes
.
push_back
(
child
);
rankedNodes
.
push_back
(
child
);
nodesToRank
.
erase
(
child
);
nodesToRank
.
erase
(
child
);
...
@@ -551,7 +553,7 @@ bool Aidge::GraphView::add(std::set<std::shared_ptr<Node>> otherNodes, bool incl
...
@@ -551,7 +553,7 @@ bool Aidge::GraphView::add(std::set<std::shared_ptr<Node>> otherNodes, bool incl
}
}
for
(
auto
parent
:
curNode
->
getParents
())
{
for
(
auto
parent
:
curNode
->
getParents
())
{
if
(
nodesToRank
.
find
(
parent
)
!=
nodesToRank
.
end
())
{
if
(
parent
!=
nullptr
&&
nodesToRank
.
find
(
parent
)
!=
nodesToRank
.
end
())
{
rankedNodes
.
push_back
(
parent
);
rankedNodes
.
push_back
(
parent
);
nodesToRank
.
erase
(
parent
);
nodesToRank
.
erase
(
parent
);
...
...
This diff is collapsed.
Click to expand it.
src/operator/OperatorTensor.cpp
+
1
−
0
View file @
c01e57f1
...
@@ -152,6 +152,7 @@ void Aidge::OperatorTensor::setDataType(const DataType& dataType) const {
...
@@ -152,6 +152,7 @@ void Aidge::OperatorTensor::setDataType(const DataType& dataType) const {
}
}
for
(
IOIndex_t
i
=
nbData
();
i
<
nbInputs
();
++
i
)
{
for
(
IOIndex_t
i
=
nbData
();
i
<
nbInputs
();
++
i
)
{
AIDGE_ASSERT
(
getInput
(
i
)
!=
nullptr
,
"Missing input#{} for operator {}"
,
i
,
type
());
getInput
(
i
)
->
setDataType
(
dataType
);
getInput
(
i
)
->
setDataType
(
dataType
);
}
}
}
}
\ No newline at end of file
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