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
991915d4
Commit
991915d4
authored
Jan 22, 2019
by
Shucai Xiao
Browse files
fix a bug in reshape.
parent
13122f11
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
1 deletion
+6
-1
src/include/migraphx/operators.hpp
src/include/migraphx/operators.hpp
+6
-1
No files found.
src/include/migraphx/operators.hpp
View file @
991915d4
...
@@ -581,11 +581,16 @@ struct reshape
...
@@ -581,11 +581,16 @@ struct reshape
{
{
if
(
dims
[
i
]
==
0
)
if
(
dims
[
i
]
==
0
)
rdims
[
i
]
=
idims
[
i
];
rdims
[
i
]
=
idims
[
i
];
// since rdims using size_t type, -1 is the max value
// is size_t that cause later compuation incorrect
if
(
dims
[
i
]
==
-
1
)
rdims
[
i
]
=
1
;
}
}
if
(
n_neg_dims
>
0
)
if
(
n_neg_dims
>
0
)
{
{
size_t
missing_dim
=
size_t
missing_dim
=
-
inputs
.
front
().
elements
()
/
inputs
.
front
().
elements
()
/
std
::
accumulate
(
rdims
.
begin
(),
rdims
.
end
(),
1
,
std
::
multiplies
<
int64_t
>
());
std
::
accumulate
(
rdims
.
begin
(),
rdims
.
end
(),
1
,
std
::
multiplies
<
int64_t
>
());
for
(
std
::
size_t
i
=
0
;
i
<
rdims
.
size
();
i
++
)
for
(
std
::
size_t
i
=
0
;
i
<
rdims
.
size
();
i
++
)
{
{
...
...
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