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
73e91069
Commit
73e91069
authored
Aug 14, 2018
by
Paul
Browse files
Merge branch 'master' of github.com:ROCmSoftwarePlatform/RTGLib
parents
dae49b65
11318d9c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
3 deletions
+17
-3
src/onnx/onnx.cpp
src/onnx/onnx.cpp
+17
-3
No files found.
src/onnx/onnx.cpp
View file @
73e91069
...
...
@@ -216,13 +216,27 @@ struct onnx_parser
void
parse_graph
(
const
onnx
::
GraphProto
&
graph
)
{
nodes
=
get_nodes
(
graph
);
std
::
unordered_map
<
std
::
string
,
onnx
::
TensorProto
>
initializer_data
;
for
(
auto
&&
f
:
graph
.
initializer
())
{
initializer_data
[
f
.
name
()]
=
f
;
}
for
(
auto
&&
input
:
graph
.
input
())
{
const
std
::
string
&
name
=
input
.
name
();
// Does the input have an initializer?
if
(
contains
(
initializer_data
,
name
))
{
auto
t
=
initializer_data
[
name
];
instructions
[
name
]
=
prog
.
add_literal
(
parse_tensor
(
t
));
}
else
{
// TODO: Get shape of input parameter
shape
s
=
parse_type
(
input
.
type
());
instructions
[
name
]
=
prog
.
add_parameter
(
name
,
s
);
}
}
for
(
auto
&&
p
:
nodes
)
{
this
->
parse_node
(
get_name
(
p
.
second
));
...
...
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