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
a1269685
Unverified
Commit
a1269685
authored
Mar 28, 2018
by
Robert Kimball
Committed by
GitHub
Mar 28, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add exception handing in deserializer to tell which op actually caused the exception (#756)
parent
71c2055c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
2 deletions
+21
-2
serializer.cpp
src/ngraph/serializer.cpp
+21
-2
No files found.
src/ngraph/serializer.cpp
View file @
a1269685
...
...
@@ -338,6 +338,8 @@ static shared_ptr<ngraph::Function>
vector
<
string
>
func_result
=
func_js
.
at
(
"result"
).
get
<
vector
<
string
>>
();
unordered_map
<
string
,
shared_ptr
<
Node
>>
node_map
;
for
(
json
node_js
:
func_js
.
at
(
"ops"
))
{
try
{
string
node_name
=
node_js
.
at
(
"name"
).
get
<
string
>
();
string
node_op
=
node_js
.
at
(
"op"
).
get
<
string
>
();
...
...
@@ -642,8 +644,11 @@ static shared_ptr<ngraph::Function>
{
auto
padding_below
=
padding_below_maybe
.
get
<
vector
<
size_t
>>
();
auto
padding_above
=
padding_above_maybe
.
get
<
vector
<
size_t
>>
();
node
=
make_shared
<
op
::
MaxPool
>
(
args
[
0
],
window_shape
,
window_movement_strides
,
padding_below
,
padding_above
);
node
=
make_shared
<
op
::
MaxPool
>
(
args
[
0
],
window_shape
,
window_movement_strides
,
padding_below
,
padding_above
);
}
else
{
...
...
@@ -857,6 +862,20 @@ static shared_ptr<ngraph::Function>
// the serialization for debugging.
// node->set_name(node_name);
}
catch
(...)
{
string
node_name
;
try
{
node_name
=
node_js
.
at
(
"name"
).
get
<
string
>
();
}
catch
(...)
{
node_name
=
"UNKNOWN"
;
}
throw
runtime_error
(
"Error parsing json at node '"
+
node_name
+
"'"
);
}
}
//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
...
...
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