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
cf5aede1
Commit
cf5aede1
authored
Jul 09, 2019
by
Shucai Xiao
Browse files
Merge branch 'reduce_mean' of
https://github.com/ROCmSoftwarePlatform/AMDMIGraphX
into test_bert
parents
751e8f37
e61be020
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
9 deletions
+9
-9
src/include/migraphx/op/reduce_mean.hpp
src/include/migraphx/op/reduce_mean.hpp
+4
-4
src/include/migraphx/op/reduce_sum.hpp
src/include/migraphx/op/reduce_sum.hpp
+5
-5
No files found.
src/include/migraphx/op/reduce_mean.hpp
View file @
cf5aede1
...
...
@@ -34,16 +34,16 @@ struct reduce_mean
}
else
{
for
(
std
::
size_t
i
=
0
;
i
<
tuned_axes
.
size
();
++
i
)
for
(
auto
&
axis
:
tuned_axes
)
{
int64_t
s_dim
=
static_cast
<
int64_t
>
(
n_dim
);
if
(
tuned_axes
[
i
]
>=
s_dim
or
tuned_axes
[
i
]
<
-
s_dim
)
if
(
axis
>=
s_dim
or
axis
<
-
s_dim
)
{
MIGRAPHX_THROW
(
"REDUCE_MEAN: axis out of range"
);
}
if
(
tuned_axes
[
i
]
<
0
)
if
(
axis
<
0
)
{
tuned_axes
[
i
]
+=
n_dim
;
axis
+=
n_dim
;
}
}
}
...
...
src/include/migraphx/op/reduce_sum.hpp
View file @
cf5aede1
...
...
@@ -34,16 +34,16 @@ struct reduce_sum
}
else
{
for
(
std
::
size_t
i
=
0
;
i
<
tuned_axes
.
size
();
++
i
)
for
(
auto
&
axis
:
tuned_axes
)
{
int64_t
s_dim
=
static_cast
<
int64_t
>
(
n_dim
);
if
(
tuned_axes
[
i
]
>=
s_dim
or
tuned_axes
[
i
]
<
-
s_dim
)
if
(
axis
>=
s_dim
or
axis
<
-
s_dim
)
{
MIGRAPHX_THROW
(
"REDUCE_
SUM
: axis out of range"
);
MIGRAPHX_THROW
(
"REDUCE_
MEAN
: axis out of range"
);
}
if
(
tuned_axes
[
i
]
<
0
)
if
(
axis
<
0
)
{
tuned_axes
[
i
]
+=
n_dim
;
axis
+=
n_dim
;
}
}
}
...
...
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