Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
gaoqiong
MIGraphX
Commits
47212d64
"include/vscode:/vscode.git/clone" did not exist on "6dfb4e7851a99eab605d239873b7eca777980fa8"
Commit
47212d64
authored
Jan 24, 2019
by
Paul
Browse files
Fix unknown test
parent
3d02e1dc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
8 deletions
+28
-8
src/onnx/onnx.cpp
src/onnx/onnx.cpp
+28
-8
No files found.
src/onnx/onnx.cpp
View file @
47212d64
...
@@ -685,8 +685,7 @@ struct onnx_parser
...
@@ -685,8 +685,7 @@ struct onnx_parser
}
}
for
(
auto
&&
p
:
nodes
)
for
(
auto
&&
p
:
nodes
)
{
{
for
(
auto
&&
output
:
p
.
second
.
output
())
this
->
parse_node
(
p
.
first
);
this
->
parse_node
(
output
);
}
}
}
}
...
@@ -720,12 +719,20 @@ struct onnx_parser
...
@@ -720,12 +719,20 @@ struct onnx_parser
{
{
result
=
ops
[
node
.
op_type
()](
get_attributes
(
node
),
args
);
result
=
ops
[
node
.
op_type
()](
get_attributes
(
node
),
args
);
}
}
assert
(
node
.
output
().
size
()
>=
result
.
size
());
// Even no output nodes produce output in migraphx
std
::
transform
(
result
.
begin
(),
if
(
node
.
output
().
empty
()
and
result
.
size
()
==
1
)
result
.
end
(),
{
node
.
output
().
begin
(),
instructions
[
name
]
=
result
.
front
();
std
::
inserter
(
instructions
,
instructions
.
end
()),
}
[](
auto
&&
x
,
auto
&&
y
)
{
return
std
::
make_pair
(
y
,
x
);
});
else
{
assert
(
node
.
output
().
size
()
>=
result
.
size
());
std
::
transform
(
result
.
begin
(),
result
.
end
(),
node
.
output
().
begin
(),
std
::
inserter
(
instructions
,
instructions
.
end
()),
[](
auto
&&
x
,
auto
&&
y
)
{
return
std
::
make_pair
(
y
,
x
);
});
}
}
}
}
}
...
@@ -755,8 +762,21 @@ struct onnx_parser
...
@@ -755,8 +762,21 @@ struct onnx_parser
static
node_map
get_nodes
(
const
onnx
::
GraphProto
&
graph
)
static
node_map
get_nodes
(
const
onnx
::
GraphProto
&
graph
)
{
{
std
::
unordered_map
<
std
::
string
,
onnx
::
NodeProto
>
result
;
std
::
unordered_map
<
std
::
string
,
onnx
::
NodeProto
>
result
;
std
::
size_t
n
=
0
;
for
(
auto
&&
node
:
graph
.
node
())
for
(
auto
&&
node
:
graph
.
node
())
{
{
if
(
node
.
output
().
empty
())
{
if
(
node
.
name
().
empty
())
{
result
[
"migraphx_unamed_node_"
+
std
::
to_string
(
n
)]
=
node
;
n
++
;
}
else
{
result
[
node
.
name
()]
=
node
;
}
}
for
(
auto
&&
output
:
node
.
output
())
for
(
auto
&&
output
:
node
.
output
())
{
{
result
[
output
]
=
node
;
result
[
output
]
=
node
;
...
...
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