Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
gaoqiong
MIGraphX
Commits
e8a997ed
Commit
e8a997ed
authored
Nov 07, 2018
by
Khalique
Browse files
add onnx parsing
parent
5b888363
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
0 deletions
+14
-0
src/onnx/onnx.cpp
src/onnx/onnx.cpp
+14
-0
No files found.
src/onnx/onnx.cpp
View file @
e8a997ed
...
...
@@ -74,6 +74,7 @@ struct onnx_parser
add_mem_op
(
"Unsqueeze"
,
&
onnx_parser
::
parse_unsqueeze
);
add_mem_op
(
"Slice"
,
&
onnx_parser
::
parse_slice
);
add_mem_op
(
"Concat"
,
&
onnx_parser
::
parse_concat
);
add_mem_op
(
"Transpose"
,
&
onnx_parser
::
parse_transpose
);
}
template
<
class
F
>
...
...
@@ -361,6 +362,19 @@ struct onnx_parser
return
prog
.
add_instruction
(
migraph
::
op
::
add
{},
img_scaled
,
bias_bcast
);
}
instruction_ref
parse_transpose
(
const
std
::
string
&
,
attribute_map
attributes
,
std
::
vector
<
instruction_ref
>
args
)
{
std
::
vector
<
int64_t
>
perm
{};
if
(
contains
(
attributes
,
"perm"
))
{
auto
&&
perm_vals
=
attributes
[
"perm"
].
ints
();
perm
=
std
::
vector
<
int64_t
>
(
perm_vals
.
begin
(),
perm_vals
.
end
());
}
return
prog
.
add_instruction
(
migraph
::
op
::
transpose
{
perm
},
args
.
front
());
}
void
parse_from
(
std
::
istream
&
is
)
{
onnx
::
ModelProto
model
;
...
...
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