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
ec54c989
Commit
ec54c989
authored
Jun 23, 2022
by
Khalique Ahmed
Browse files
formatting
parent
8083e267
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
src/onnx/parse_reshape.cpp
src/onnx/parse_reshape.cpp
+5
-3
No files found.
src/onnx/parse_reshape.cpp
View file @
ec54c989
...
...
@@ -56,9 +56,10 @@ struct parse_reshape : op_parser<parse_reshape>
std
::
vector
<
size_t
>
orig_dims
=
args
[
0
]
->
get_shape
().
lens
();
auto
dims_acc
=
std
::
accumulate
(
dims
.
begin
(),
dims
.
end
(),
1
,
std
::
multiplies
<
int64_t
>
());
auto
orig_dims_acc
=
std
::
accumulate
(
orig_dims
.
begin
(),
orig_dims
.
end
(),
1
,
std
::
multiplies
<
int64_t
>
());
auto
orig_dims_acc
=
std
::
accumulate
(
orig_dims
.
begin
(),
orig_dims
.
end
(),
1
,
std
::
multiplies
<
int64_t
>
());
if
(
std
::
abs
(
dims_acc
)
==
orig_dims_acc
)
if
(
std
::
abs
(
dims_acc
)
==
orig_dims_acc
)
return
info
.
add_instruction
(
make_op
(
"reshape"
,
{{
"dims"
,
dims
}}),
info
.
make_contiguous
(
args
[
0
]));
if
(
parser
.
default_dim_value
*
std
::
abs
(
dims_acc
)
==
orig_dims_acc
)
...
...
@@ -67,7 +68,8 @@ struct parse_reshape : op_parser<parse_reshape>
return
info
.
add_instruction
(
make_op
(
"reshape"
,
{{
"dims"
,
dims
}}),
info
.
make_contiguous
(
args
[
0
]));
}
MIGRAPHX_THROW
(
"Reshape: incorrect number of elements: "
+
std
::
to_string
(
dims_acc
)
+
" versus "
+
std
::
to_string
(
orig_dims_acc
));
MIGRAPHX_THROW
(
"Reshape: incorrect number of elements: "
+
std
::
to_string
(
dims_acc
)
+
" versus "
+
std
::
to_string
(
orig_dims_acc
));
}
};
...
...
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