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
4285d37d
Commit
4285d37d
authored
Jan 23, 2019
by
Paul
Browse files
Avoid double add for onnx nodes
parent
2b697563
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
src/onnx/onnx.cpp
src/onnx/onnx.cpp
+8
-8
No files found.
src/onnx/onnx.cpp
View file @
4285d37d
...
@@ -685,7 +685,8 @@ struct onnx_parser
...
@@ -685,7 +685,8 @@ struct onnx_parser
}
}
for
(
auto
&&
p
:
nodes
)
for
(
auto
&&
p
:
nodes
)
{
{
this
->
parse_node
(
get_name
(
p
.
second
));
for
(
auto
&&
output
:
p
.
second
.
output
())
this
->
parse_node
(
output
);
}
}
}
}
...
@@ -701,7 +702,6 @@ struct onnx_parser
...
@@ -701,7 +702,6 @@ struct onnx_parser
{
{
if
(
nodes
.
count
(
input
)
>
0
)
if
(
nodes
.
count
(
input
)
>
0
)
{
{
// auto&& iname = get_name(nodes.at(input));
assert
(
name
!=
input
);
assert
(
name
!=
input
);
this
->
parse_node
(
input
);
this
->
parse_node
(
input
);
args
.
push_back
(
instructions
.
at
(
input
));
args
.
push_back
(
instructions
.
at
(
input
));
...
@@ -720,12 +720,13 @@ struct onnx_parser
...
@@ -720,12 +720,13 @@ struct onnx_parser
{
{
result
=
ops
[
node
.
op_type
()](
get_attributes
(
node
),
args
);
result
=
ops
[
node
.
op_type
()](
get_attributes
(
node
),
args
);
}
}
std
::
transform
(
node
.
output
().
begin
(),
assert
(
node
.
output
().
size
()
>=
result
.
size
());
node
.
output
().
end
(),
std
::
transform
(
result
.
begin
(),
result
.
begin
(),
result
.
end
(),
node
.
output
().
begin
(),
std
::
inserter
(
instructions
,
instructions
.
end
()),
std
::
inserter
(
instructions
,
instructions
.
end
()),
[](
auto
&&
onnx_out
,
auto
&&
parse_out
)
{
[](
auto
&&
x
,
auto
&&
y
)
{
return
std
::
make_pair
(
onnx_out
,
parse_out
);
return
std
::
make_pair
(
y
,
x
);
});
});
}
}
}
}
...
@@ -758,7 +759,6 @@ struct onnx_parser
...
@@ -758,7 +759,6 @@ struct onnx_parser
std
::
unordered_map
<
std
::
string
,
onnx
::
NodeProto
>
result
;
std
::
unordered_map
<
std
::
string
,
onnx
::
NodeProto
>
result
;
for
(
auto
&&
node
:
graph
.
node
())
for
(
auto
&&
node
:
graph
.
node
())
{
{
result
[
get_name
(
node
)]
=
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