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
2a534555
Unverified
Commit
2a534555
authored
Oct 30, 2019
by
Scott Cyphers
Committed by
GitHub
Oct 30, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't leave output serialization shapes set. (#3824)
parent
b9af3723
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
1 deletion
+24
-1
serializer.cpp
src/ngraph/serializer.cpp
+5
-0
serializer.hpp
src/ngraph/serializer.hpp
+18
-0
serialize.cpp
test/serialize.cpp
+1
-1
No files found.
src/ngraph/serializer.cpp
View file @
2a534555
...
...
@@ -172,6 +172,11 @@ void ngraph::set_serialize_output_shapes(bool enable)
s_serialize_output_shapes_enabled
=
enable
;
}
bool
ngraph
::
get_serialize_output_shapes
()
{
return
s_serialize_output_shapes_enabled
;
}
// This expands the op list in op_tbl.hpp into a list of enumerations that look like this:
// Abs,
// Acos,
...
...
src/ngraph/serializer.hpp
View file @
2a534555
...
...
@@ -61,4 +61,22 @@ namespace ngraph
///
/// Option may be enabled by setting the environment variable NGRAPH_SERIALIZER_OUTPUT_SHAPES
void
set_serialize_output_shapes
(
bool
enable
);
bool
get_serialize_output_shapes
();
class
WithSerializeOutputShapesEnabled
{
public
:
WithSerializeOutputShapesEnabled
(
bool
enabled
=
true
)
{
m_serialize_output_shapes_enabled
=
get_serialize_output_shapes
();
set_serialize_output_shapes
(
enabled
);
}
~
WithSerializeOutputShapesEnabled
()
{
set_serialize_output_shapes
(
m_serialize_output_shapes_enabled
);
}
private
:
bool
m_serialize_output_shapes_enabled
;
};
}
test/serialize.cpp
View file @
2a534555
...
...
@@ -209,7 +209,7 @@ TEST(benchmark, serialize)
timer
.
stop
();
cout
<<
"deserialize took "
<<
timer
.
get_milliseconds
()
<<
"ms
\n
"
;
ngraph
::
set_serialize_output_shape
s
(
true
);
WithSerializeOutputShapesEnabled
serialize_output
s
(
true
);
ofstream
out
(
"test.json"
);
out
<<
serialize
(
f
,
4
);
}
...
...
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