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
95b2a528
"sgl-router/vscode:/vscode.git/clone" did not exist on "9209b209be1ffed21300621c5645abb693ef3b46"
Commit
95b2a528
authored
Aug 19, 2019
by
Shucai Xiao
Browse files
fix review comments
parent
a392d84c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
14 deletions
+13
-14
src/onnx/onnx.cpp
src/onnx/onnx.cpp
+13
-14
No files found.
src/onnx/onnx.cpp
View file @
95b2a528
...
...
@@ -206,6 +206,16 @@ struct onnx_parser
return
out_lens
;
}
instruction_ref
make_contiguous
(
instruction_ref
ins
)
{
if
(
ins
->
get_shape
().
standard
())
{
return
ins
;
}
return
prog
.
add_instruction
(
op
::
contiguous
{},
ins
);
}
template
<
class
T
>
instruction_ref
add_broadcastable_binary_op
(
instruction_ref
arg0
,
instruction_ref
arg1
,
T
x
)
{
...
...
@@ -437,11 +447,7 @@ struct onnx_parser
s
.
visit
([
&
](
auto
v
)
{
copy
(
v
,
std
::
back_inserter
(
op
.
dims
));
});
}
if
(
!
args
[
0
]
->
get_shape
().
standard
())
{
args
[
0
]
=
prog
.
add_instruction
(
op
::
contiguous
{},
args
[
0
]);
}
args
[
0
]
=
make_contiguous
(
args
[
0
]);
return
prog
.
add_instruction
(
op
,
args
[
0
]);
}
...
...
@@ -490,15 +496,8 @@ struct onnx_parser
{
axis
=
parse_value
(
attributes
.
at
(
"axis"
)).
at
<
int
>
();
}
if
(
!
args
[
0
]
->
get_shape
().
standard
())
{
args
[
0
]
=
prog
.
add_instruction
(
op
::
contiguous
{},
args
[
0
]);
}
if
(
!
args
[
1
]
->
get_shape
().
standard
())
{
args
[
1
]
=
prog
.
add_instruction
(
op
::
contiguous
{},
args
[
1
]);
}
args
[
0
]
=
make_contiguous
(
args
[
0
]);
args
[
1
]
=
make_contiguous
(
args
[
1
]);
op
::
gather
op
{
axis
};
return
prog
.
add_instruction
(
op
,
std
::
move
(
args
));
...
...
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