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
d6ed3a82
Commit
d6ed3a82
authored
1 year ago
by
Olivier BICHLER
Browse files
Options
Downloads
Patches
Plain Diff
Improved error messages
parent
57dd2c6c
No related branches found
No related tags found
2 merge requests
!105
version 0.2.0
,
!77
Support for recurrent networks
Pipeline
#40503
passed
1 year ago
Stage: static_analysis
Stage: build
Stage: test
Stage: coverage
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/graph/Node.cpp
+14
-17
14 additions, 17 deletions
src/graph/Node.cpp
with
14 additions
and
17 deletions
src/graph/Node.cpp
+
14
−
17
View file @
d6ed3a82
...
@@ -187,8 +187,12 @@ void Aidge::Node::setInputId(const IOIndex_t inId, const IOIndex_t newNodeoutId)
...
@@ -187,8 +187,12 @@ void Aidge::Node::setInputId(const IOIndex_t inId, const IOIndex_t newNodeoutId)
void
Aidge
::
Node
::
addChildOp
(
std
::
shared_ptr
<
Node
>
otherNode
,
const
IOIndex_t
outId
,
void
Aidge
::
Node
::
addChildOp
(
std
::
shared_ptr
<
Node
>
otherNode
,
const
IOIndex_t
outId
,
const
IOIndex_t
otherInId
)
{
const
IOIndex_t
otherInId
)
{
assert
((
otherInId
<
otherNode
->
nbInputs
())
&&
"Input index out of bound."
);
AIDGE_ASSERT
(
otherInId
<
otherNode
->
nbInputs
(),
assert
((
outId
<
nbOutputs
())
&&
"Output index out of bound."
);
"Input index (#{}) of the node {} (of type {}) is out of bound (it has {} inputs), when trying to add it as a child of node {} (of type {})"
,
otherInId
,
otherNode
->
name
(),
otherNode
->
type
(),
otherNode
->
nbInputs
(),
name
(),
type
());
AIDGE_ASSERT
(
outId
<
nbOutputs
(),
"Output index (#{}) of the node {} (of type {}) is out of bound (it has {} outputs), when trying to add the child node {} (of type {})"
,
outId
,
name
(),
type
(),
nbOutputs
(),
otherNode
->
name
(),
otherNode
->
type
());
if
(
otherNode
->
input
(
otherInId
).
second
!=
gk_IODefaultIndex
)
{
if
(
otherNode
->
input
(
otherInId
).
second
!=
gk_IODefaultIndex
)
{
fmt
::
print
(
"Warning, the {}-th Parent of the child node already existed.
\n
"
,
otherInId
);
fmt
::
print
(
"Warning, the {}-th Parent of the child node already existed.
\n
"
,
otherInId
);
}
}
...
@@ -203,18 +207,11 @@ void Aidge::Node::addChildOp(std::shared_ptr<Node> otherNode, const IOIndex_t ou
...
@@ -203,18 +207,11 @@ void Aidge::Node::addChildOp(std::shared_ptr<Node> otherNode, const IOIndex_t ou
void
Aidge
::
Node
::
addChildView
(
std
::
shared_ptr
<
GraphView
>
otherGraph
,
const
IOIndex_t
outId
,
void
Aidge
::
Node
::
addChildView
(
std
::
shared_ptr
<
GraphView
>
otherGraph
,
const
IOIndex_t
outId
,
std
::
pair
<
std
::
shared_ptr
<
Node
>
,
IOIndex_t
>
otherInId
)
{
std
::
pair
<
std
::
shared_ptr
<
Node
>
,
IOIndex_t
>
otherInId
)
{
assert
((
otherInId
.
second
<
otherInId
.
first
->
nbInputs
())
&&
const
auto
inNodes
=
otherGraph
->
inputNodes
();
"Other graph input index out of bound."
);
AIDGE_ASSERT
(
otherInId
.
first
!=
nullptr
&&
inNodes
.
find
(
otherInId
.
first
)
!=
inNodes
.
end
(),
assert
((
outId
<
nbOutputs
())
&&
"Output index out of bound."
);
"Node {} (of type {}) is not a valid input node of GraphView {}, when trying to add it as a child of node {} (of type {})"
,
std
::
set
<
std
::
shared_ptr
<
Node
>>
inNodes
=
otherGraph
->
inputNodes
();
(
otherInId
.
first
)
?
otherInId
.
first
->
name
()
:
"#nullptr"
,
(
otherInId
.
first
)
?
otherInId
.
first
->
type
()
:
""
,
otherGraph
->
name
(),
name
(),
type
());
if
(
inNodes
.
size
()
==
std
::
size_t
(
0
))
{
// no input Node
addChildOp
(
otherInId
.
first
,
outId
,
otherInId
.
second
);
fmt
::
print
(
"Cannot add GraphView to the Node. No input node detected.
\n
"
);
}
else
// inNodes.size() >= 1
{
assert
((
inNodes
.
find
(
otherInId
.
first
)
!=
inNodes
.
end
()));
// assert it really is an input node
addChildOp
(
otherInId
.
first
,
outId
,
otherInId
.
second
);
}
}
}
void
Aidge
::
Node
::
addChild
(
std
::
shared_ptr
<
Node
>
otherNode
,
const
IOIndex_t
outId
,
void
Aidge
::
Node
::
addChild
(
std
::
shared_ptr
<
Node
>
otherNode
,
const
IOIndex_t
outId
,
...
@@ -229,9 +226,9 @@ void Aidge::Node::addChild(std::shared_ptr<Node> otherNode, const IOIndex_t outI
...
@@ -229,9 +226,9 @@ void Aidge::Node::addChild(std::shared_ptr<Node> otherNode, const IOIndex_t outI
void
Aidge
::
Node
::
addChild
(
std
::
shared_ptr
<
GraphView
>
otherView
,
const
IOIndex_t
outId
,
void
Aidge
::
Node
::
addChild
(
std
::
shared_ptr
<
GraphView
>
otherView
,
const
IOIndex_t
outId
,
std
::
pair
<
std
::
shared_ptr
<
Node
>
,
IOIndex_t
>
otherInId
)
{
std
::
pair
<
std
::
shared_ptr
<
Node
>
,
IOIndex_t
>
otherInId
)
{
if
(
!
otherInId
.
first
)
{
if
(
!
otherInId
.
first
)
{
assert
(
(
otherView
->
inputNodes
().
size
()
==
1U
)
&&
AIDGE_ASSERT
(
otherView
->
inputNodes
().
size
()
==
1U
,
"Specify an i
nput
N
ode f
or the
GraphView
. More or less than one "
"I
nput
n
ode
o
f GraphView
{} need to be specified, because it has more than one input ({} inputs), when trying to add it as a child of node {} (of type {})"
,
"Node is not explicit."
);
otherView
->
name
(),
otherView
->
inputNodes
().
size
(),
name
(),
type
()
);
otherInId
.
first
=
*
(
otherView
->
inputNodes
().
begin
());
otherInId
.
first
=
*
(
otherView
->
inputNodes
().
begin
());
}
}
otherInId
.
second
=
(
otherInId
.
second
!=
gk_IODefaultIndex
)
otherInId
.
second
=
(
otherInId
.
second
!=
gk_IODefaultIndex
)
...
...
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