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
d0c53a98
Commit
d0c53a98
authored
Jun 24, 2019
by
Paul
Browse files
Formatting
parent
2ed09f15
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
src/include/migraphx/op/reduce_sum.hpp
src/include/migraphx/op/reduce_sum.hpp
+4
-4
No files found.
src/include/migraphx/op/reduce_sum.hpp
View file @
d0c53a98
...
@@ -28,7 +28,7 @@ struct reduce_sum
...
@@ -28,7 +28,7 @@ struct reduce_sum
check_shapes
{
inputs
,
*
this
}.
has
(
1
);
check_shapes
{
inputs
,
*
this
}.
has
(
1
);
auto
s
=
inputs
.
at
(
0
);
auto
s
=
inputs
.
at
(
0
);
auto
lens
=
s
.
lens
();
auto
lens
=
s
.
lens
();
for
(
auto
axis
:
axes
)
for
(
auto
axis
:
axes
)
lens
[
axis
]
=
1
;
lens
[
axis
]
=
1
;
return
{
s
.
type
(),
lens
};
return
{
s
.
type
(),
lens
};
}
}
...
@@ -36,10 +36,10 @@ struct reduce_sum
...
@@ -36,10 +36,10 @@ struct reduce_sum
argument
compute
(
const
shape
&
output_shape
,
std
::
vector
<
argument
>
args
)
const
argument
compute
(
const
shape
&
output_shape
,
std
::
vector
<
argument
>
args
)
const
{
{
argument
result
{
output_shape
};
argument
result
{
output_shape
};
visit_all
(
result
,
args
[
0
])([
&
](
auto
output
,
auto
input
){
visit_all
(
result
,
args
[
0
])([
&
](
auto
output
,
auto
input
)
{
shape_for_each
(
input
.
get_shape
(),
[
&
](
auto
&&
in_idx
)
{
shape_for_each
(
input
.
get_shape
(),
[
&
](
auto
&&
in_idx
)
{
auto
out_idx
=
in_idx
;
auto
out_idx
=
in_idx
;
for
(
auto
axis
:
axes
)
for
(
auto
axis
:
axes
)
out_idx
[
axis
]
=
0
;
out_idx
[
axis
]
=
0
;
output
(
out_idx
.
begin
(),
out_idx
.
end
())
+=
input
(
in_idx
.
begin
(),
in_idx
.
end
());
output
(
out_idx
.
begin
(),
out_idx
.
end
())
+=
input
(
in_idx
.
begin
(),
in_idx
.
end
());
});
});
...
...
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