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
00fc1a25
Commit
00fc1a25
authored
Jan 17, 2019
by
Shucai Xiao
Browse files
clang format.
parent
04e01f74
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
4 deletions
+9
-4
src/include/migraphx/operators.hpp
src/include/migraphx/operators.hpp
+5
-2
test/op_shape_test.cpp
test/op_shape_test.cpp
+4
-2
No files found.
src/include/migraphx/operators.hpp
View file @
00fc1a25
...
@@ -653,9 +653,12 @@ struct gather
...
@@ -653,9 +653,12 @@ struct gather
}
}
template
<
class
T
>
template
<
class
T
>
void
compute_index
(
const
T
&
out_idx
,
const
std
::
vector
<
std
::
size_t
>&
vec_indices
,
const
std
::
size_t
max_dim
,
T
&
in_idx
)
const
void
compute_index
(
const
T
&
out_idx
,
const
std
::
vector
<
std
::
size_t
>&
vec_indices
,
const
std
::
size_t
max_dim
,
T
&
in_idx
)
const
{
{
in_idx
=
out_idx
;
in_idx
=
out_idx
;
std
::
size_t
idx
=
vec_indices
.
at
(
out_idx
[
axis
]);
std
::
size_t
idx
=
vec_indices
.
at
(
out_idx
[
axis
]);
if
(
idx
>=
max_dim
)
if
(
idx
>=
max_dim
)
{
{
...
...
test/op_shape_test.cpp
View file @
00fc1a25
...
@@ -212,14 +212,16 @@ TEST_CASE(multibroadcast)
...
@@ -212,14 +212,16 @@ TEST_CASE(multibroadcast)
}
}
}
}
TEST_CASE
(
gather
)
TEST_CASE
(
gather
)
{
{
{
{
migraphx
::
shape
input
{
migraphx
::
shape
::
float_type
,
{
2
,
3
,
4
,
5
}};
migraphx
::
shape
input
{
migraphx
::
shape
::
float_type
,
{
2
,
3
,
4
,
5
}};
migraphx
::
shape
indices
{
migraphx
::
shape
::
int32_type
,
{
2
,
3
}};
migraphx
::
shape
indices
{
migraphx
::
shape
::
int32_type
,
{
2
,
3
}};
std
::
size_t
axis
=
1
;
std
::
size_t
axis
=
1
;
expect_shape
(
migraphx
::
shape
{
migraphx
::
shape
::
float_type
,
{
2
,
6
,
4
,
5
}},
expect_shape
(
migraphx
::
shape
{
migraphx
::
shape
::
float_type
,
{
2
,
6
,
4
,
5
}},
migraphx
::
op
::
gather
{
axis
},
input
,
indices
);
migraphx
::
op
::
gather
{
axis
},
input
,
indices
);
}
}
{
{
...
...
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