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
bb95cf59
Commit
bb95cf59
authored
Aug 03, 2022
by
Ted Themistokleous
Browse files
fixup! First attempt at adding proper reshape for then/else modules in parse_if
parent
3e6eba01
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
6 deletions
+8
-6
src/onnx/parse_if.cpp
src/onnx/parse_if.cpp
+8
-6
No files found.
src/onnx/parse_if.cpp
View file @
bb95cf59
...
@@ -92,19 +92,21 @@ struct parse_if : op_parser<parse_if>
...
@@ -92,19 +92,21 @@ struct parse_if : op_parser<parse_if>
if
(
then_out_strides
.
size
()
>
else_out_strides
.
size
())
if
(
then_out_strides
.
size
()
>
else_out_strides
.
size
())
{
{
else_mdl
->
insert_instruction
(
auto
reshape_ins
=
else_mdl
->
insert_instruction
(
std
::
prev
(
else_mdl
->
end
()),
std
::
prev
(
else_mdl
->
end
()),
migraphx
::
make_op
(
migraphx
::
make_op
(
"reshape"
,
"reshape"
,
{{
"dims"
,
{
{
else_out_shapes
.
at
(
0
).
lens
().
at
(
0
),
1
}
,
{
1
,
1
}}
}}),
{{
"dims"
,
{
else_out_shapes
.
at
(
0
).
lens
().
at
(
0
),
1
}}}),
std
::
prev
(
else_mdl
->
end
())
->
inputs
().
front
());
std
::
prev
(
else_mdl
->
end
())
->
inputs
().
front
());
else_mdl
->
replace_return
({
reshape_ins
});
}
}
else
if
(
then_out_strides
.
size
()
<
else_out_strides
.
size
())
else
if
(
then_out_strides
.
size
()
<
else_out_strides
.
size
())
{
{
then_mdl
->
insert_instruction
(
auto
reshape_ins
=
then_mdl
->
insert_instruction
(
std
::
prev
(
then_mdl
->
end
()),
std
::
prev
(
then_mdl
->
end
()),
migraphx
::
make_op
(
migraphx
::
make_op
(
"reshape"
,
"reshape"
,
{{
"dims"
,
{
{
then_out_shapes
.
at
(
0
).
lens
().
at
(
0
),
1
}
,
{
1
,
1
}}
}}),
{{
"dims"
,
{
then_out_shapes
.
at
(
0
).
lens
().
at
(
0
),
1
}}}),
std
::
prev
(
then_mdl
->
end
())
->
inputs
().
front
());
std
::
prev
(
then_mdl
->
end
())
->
inputs
().
front
());
then_mdl
->
replace_return
({
reshape_ins
});
}
}
}
}
...
...
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