Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
N
ngraph
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ngraph
Commits
0cad670b
Commit
0cad670b
authored
Mar 22, 2018
by
Nick Korovaiko
Committed by
adstraw
Mar 22, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make sure deserializer doesn't add op::Result twice (#714)
* make sure deserializer doesn't add op::Result twice
parent
5394ad2d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
2 deletions
+22
-2
serializer.cpp
src/ngraph/serializer.cpp
+22
-2
No files found.
src/ngraph/serializer.cpp
View file @
0cad670b
...
...
@@ -859,11 +859,31 @@ static shared_ptr<ngraph::Function>
// node->set_name(node_name);
}
std
::
vector
<
std
::
shared_ptr
<
Node
>>
result
;
//This handles both graphs w/ `op::Result` and legacy graphs w/o it
//If we are dealing w/ a legacy graph, add op::Result for each output node
ResultVector
result
;
size_t
results
=
0
;
for
(
auto
result_name
:
func_result
)
{
result
.
push_back
(
node_map
.
at
(
result_name
));
auto
fr
=
node_map
.
at
(
result_name
);
if
(
auto
res
=
std
::
dynamic_pointer_cast
<
op
::
Result
>
(
fr
))
{
result
.
push_back
(
res
);
//make sure we have `op::Result` on top of all outputs
results
++
;
}
else
{
result
.
push_back
(
std
::
make_shared
<
op
::
Result
>
(
fr
));
}
}
if
(
results
!=
0
&&
results
!=
func_result
.
size
())
{
throw
ngraph_error
(
" Graph serialization is inconsistent. Some op::Results appear to be missing"
);
}
std
::
vector
<
std
::
shared_ptr
<
op
::
Parameter
>>
params
;
for
(
auto
param_name
:
func_parameters
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment