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
651ff9ff
Unverified
Commit
651ff9ff
authored
Oct 15, 2018
by
Robert Kimball
Committed by
GitHub
Oct 15, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
handle unsupported ops (#1816)
parent
15afe106
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
15 deletions
+16
-15
cpio.cpp
src/ngraph/cpio.cpp
+5
-10
cpio.hpp
src/ngraph/cpio.hpp
+0
-1
serializer.cpp
src/ngraph/serializer.cpp
+11
-4
No files found.
src/ngraph/cpio.cpp
View file @
651ff9ff
...
...
@@ -152,7 +152,11 @@ cpio::Writer::Writer(const string& filename)
cpio
::
Writer
::~
Writer
()
{
close
();
write
(
"TRAILER!!!"
,
nullptr
,
0
);
if
(
m_my_stream
.
is_open
())
{
m_my_stream
.
close
();
}
}
void
cpio
::
Writer
::
open
(
ostream
&
out
)
...
...
@@ -166,15 +170,6 @@ void cpio::Writer::open(const string& filename)
m_my_stream
.
open
(
filename
,
ios_base
::
binary
|
ios_base
::
out
);
}
void
cpio
::
Writer
::
close
()
{
write
(
"TRAILER!!!"
,
nullptr
,
0
);
if
(
m_my_stream
.
is_open
())
{
m_my_stream
.
close
();
}
}
void
cpio
::
Writer
::
write
(
const
string
&
record_name
,
const
void
*
data
,
uint32_t
size_in_bytes
)
{
if
(
m_stream
)
...
...
src/ngraph/cpio.hpp
View file @
651ff9ff
...
...
@@ -88,7 +88,6 @@ public:
void
open
(
std
::
ostream
&
out
);
void
open
(
const
std
::
string
&
filename
);
void
close
();
void
write
(
const
std
::
string
&
file_name
,
const
void
*
data
,
uint32_t
size_in_bytes
);
private
:
...
...
src/ngraph/serializer.cpp
View file @
651ff9ff
...
...
@@ -109,6 +109,7 @@ using const_data_callback_t = shared_ptr<Node>(const string&, const element::Typ
enum
class
OP_TYPEID
{
#include "ngraph/op/op_tbl.hpp"
UnknownOp
};
#undef NGRAPH_OP
...
...
@@ -123,7 +124,13 @@ static OP_TYPEID get_typeid(const string& s)
#include "ngraph/op/op_tbl.hpp"
};
#undef NGRAPH_OP
return
typeid_map
.
at
(
s
);
OP_TYPEID
rc
=
OP_TYPEID
::
UnknownOp
;
auto
it
=
typeid_map
.
find
(
s
);
if
(
it
!=
typeid_map
.
end
())
{
rc
=
it
->
second
;
}
return
rc
;
}
template
<
typename
T
>
...
...
@@ -208,8 +215,6 @@ void ngraph::serialize(ostream& out, shared_ptr<ngraph::Function> func, size_t i
},
true
);
});
writer
.
close
();
}
static
string
serialize
(
shared_ptr
<
ngraph
::
Function
>
func
,
size_t
indent
,
bool
binary_constant_data
)
...
...
@@ -1024,7 +1029,7 @@ static shared_ptr<ngraph::Function>
node
=
make_shared
<
op
::
StopGradient
>
(
args
[
0
]);
break
;
}
default
:
case
OP_TYPEID
:
:
UnknownOp
:
{
stringstream
ss
;
ss
<<
"unsupported op "
<<
node_op
;
...
...
@@ -1514,6 +1519,8 @@ static json write(const Node& n, bool binary_constant_data)
node
[
"compute_max"
]
=
tmp
->
get_compute_max
();
break
;
}
case
OP_TYPEID
:
:
UnknownOp
:
{
break
;
}
}
#pragma GCC diagnostic pop
...
...
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