Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
gaoqiong
MIGraphX
Commits
11efa851
Commit
11efa851
authored
Feb 24, 2019
by
Shucai Xiao
Browse files
clang format
parent
93db029b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
5 deletions
+6
-5
src/include/migraphx/operators.hpp
src/include/migraphx/operators.hpp
+6
-5
No files found.
src/include/migraphx/operators.hpp
View file @
11efa851
...
@@ -783,24 +783,25 @@ struct gather
...
@@ -783,24 +783,25 @@ struct gather
// max dimension in axis
// max dimension in axis
visit_all
(
result
,
args
[
0
])([
&
](
auto
output
,
auto
data
)
{
visit_all
(
result
,
args
[
0
])([
&
](
auto
output
,
auto
data
)
{
args
[
1
].
visit
([
&
](
auto
indices
)
{
args
[
1
].
visit
([
&
](
auto
indices
)
{
if
(
output_shape
.
scalar
())
if
(
output_shape
.
scalar
())
{
{
output
[
0
]
=
data
[
indices
.
front
()];
output
[
0
]
=
data
[
indices
.
front
()];
}
}
else
else
{
{
shape_for_each
(
output
.
get_shape
(),
[
&
](
const
auto
&
out_idx
)
{
shape_for_each
(
output
.
get_shape
(),
[
&
](
const
auto
&
out_idx
)
{
auto
data_idx
=
out_idx
;
auto
data_idx
=
out_idx
;
std
::
size_t
index
{};
std
::
size_t
index
{};
if
(
!
indices
.
get_shape
().
scalar
())
if
(
!
indices
.
get_shape
().
scalar
())
{
{
auto
start_it
=
data_idx
.
begin
()
+
axis_index
;
auto
start_it
=
data_idx
.
begin
()
+
axis_index
;
auto
end_it
=
data_idx
.
begin
()
+
axis_index
+
indices
.
get_shape
().
lens
().
size
();
auto
end_it
=
data_idx
.
begin
()
+
axis_index
+
indices
.
get_shape
().
lens
().
size
();
std
::
vector
<
std
::
size_t
>
ind_idx
(
start_it
,
end_it
);
std
::
vector
<
std
::
size_t
>
ind_idx
(
start_it
,
end_it
);
data_idx
.
erase
(
start_it
,
end_it
);
data_idx
.
erase
(
start_it
,
end_it
);
index
=
indices
(
ind_idx
.
begin
(),
ind_idx
.
end
());
index
=
indices
(
ind_idx
.
begin
(),
ind_idx
.
end
());
}
}
else
else
{
{
index
=
indices
.
front
();
index
=
indices
.
front
();
}
}
...
...
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