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
de60dfd0
Commit
de60dfd0
authored
Jan 28, 2018
by
Robert Kimball
Committed by
Adam Procter
Jan 28, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
much faster deserialize (#422)
parent
b76f3f33
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
8 deletions
+17
-8
serializer.cpp
src/ngraph/serializer.cpp
+0
-6
serialize.cpp
test/serialize.cpp
+17
-2
No files found.
src/ngraph/serializer.cpp
View file @
de60dfd0
...
...
@@ -308,12 +308,6 @@ static shared_ptr<ngraph::Function>
args
.
push_back
(
node_map
.
at
(
name
));
}
vector
<
string
>
known_nodes
;
for
(
auto
x
:
node_map
)
{
known_nodes
.
push_back
(
x
.
first
);
}
if
(
node_op
==
"Abs"
)
{
node
=
make_shared
<
op
::
Abs
>
(
args
[
0
]);
...
...
test/serialize.cpp
View file @
de60dfd0
...
...
@@ -99,7 +99,22 @@ TEST(serialize, existing_models)
{
const
string
json_path
=
file_util
::
path_join
(
SERIALIZED_ZOO
,
model
);
const
string
json_string
=
file_util
::
read_file_to_string
(
json_path
);
stringstream
ss
(
json_string
);
shared_ptr
<
Function
>
f
=
ngraph
::
deserialize
(
ss
);
shared_ptr
<
Function
>
f
=
ngraph
::
deserialize
(
json_string
);
}
}
TEST
(
benchmark
,
serialize
)
{
stopwatch
timer
;
string
model
=
"mxnet/LSTM_backward.json"
;
const
string
json_path
=
file_util
::
path_join
(
SERIALIZED_ZOO
,
model
);
timer
.
start
();
const
string
json_string
=
file_util
::
read_file_to_string
(
json_path
);
timer
.
stop
();
cout
<<
"file read took "
<<
timer
.
get_milliseconds
()
<<
"ms
\n
"
;
timer
.
start
();
shared_ptr
<
Function
>
f
=
ngraph
::
deserialize
(
json_string
);
timer
.
stop
();
cout
<<
"deserialize took "
<<
timer
.
get_milliseconds
()
<<
"ms
\n
"
;
}
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