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
48cd6fa1
Commit
48cd6fa1
authored
Oct 28, 2022
by
Brian Pickrell
Browse files
cosmetic
parent
b0b02e63
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
6 deletions
+8
-6
src/include/migraphx/op/reduce_op.hpp
src/include/migraphx/op/reduce_op.hpp
+3
-3
test/op_shape_test.cpp
test/op_shape_test.cpp
+5
-3
No files found.
src/include/migraphx/op/reduce_op.hpp
View file @
48cd6fa1
...
@@ -109,9 +109,9 @@ struct reduce_op : op_name<Derived>
...
@@ -109,9 +109,9 @@ struct reduce_op : op_name<Derived>
/**
/**
* @brief returns a shape in which the axis or axes named
* @brief returns a shape in which the axis or axes named
* for reduction by this op are set to size 1.
* for reduction by this op are set to size 1.
*
*
* @param inputs list of input shapes
* @param inputs list of input shapes
* @return shape
* @return shape
*/
*/
shape
normalize_compute_shape
(
std
::
vector
<
shape
>
inputs
)
const
shape
normalize_compute_shape
(
std
::
vector
<
shape
>
inputs
)
const
{
{
...
@@ -120,7 +120,7 @@ struct reduce_op : op_name<Derived>
...
@@ -120,7 +120,7 @@ struct reduce_op : op_name<Derived>
if
(
s
.
dynamic
())
if
(
s
.
dynamic
())
{
{
auto
output_dyn_dims
=
s
.
dyn_dims
();
auto
output_dyn_dims
=
s
.
dyn_dims
();
auto
tuned_axes
=
tune_axes
(
output_dyn_dims
.
size
());
auto
tuned_axes
=
tune_axes
(
output_dyn_dims
.
size
());
for
(
const
auto
&
axis
:
tuned_axes
)
for
(
const
auto
&
axis
:
tuned_axes
)
{
{
output_dyn_dims
[
axis
]
=
{
1
,
1
};
output_dyn_dims
[
axis
]
=
{
1
,
1
};
...
...
test/op_shape_test.cpp
View file @
48cd6fa1
...
@@ -1397,7 +1397,7 @@ void test_reduce_ops()
...
@@ -1397,7 +1397,7 @@ void test_reduce_ops()
throws_shape
(
T
{{
4
}},
input
);
throws_shape
(
T
{{
4
}},
input
);
}
}
}
}
// dynamic shape
// dynamic shape
template
<
class
T
>
template
<
class
T
>
void
test_dyn_reduce_ops
()
void
test_dyn_reduce_ops
()
...
@@ -1405,14 +1405,16 @@ void test_dyn_reduce_ops()
...
@@ -1405,14 +1405,16 @@ void test_dyn_reduce_ops()
{
{
migraphx
::
shape
input
{
migraphx
::
shape
::
float_type
,
{{
2
,
3
,
3
},
{
2
,
4
,
4
}}};
migraphx
::
shape
input
{
migraphx
::
shape
::
float_type
,
{{
2
,
3
,
3
},
{
2
,
4
,
4
}}};
expect_shape
(
migraphx
::
shape
{
migraphx
::
shape
::
float_type
,
expect_shape
(
migraphx
::
shape
{
migraphx
::
shape
::
float_type
,
std
::
vector
<
migraphx
::
shape
::
dynamic_dimension
>
({{
2
,
3
,
3
},
{
1
,
1
,
0
}})},
std
::
vector
<
migraphx
::
shape
::
dynamic_dimension
>
(
{{
2
,
3
,
3
},
{
1
,
1
,
0
}})},
T
{{
-
1
}},
T
{{
-
1
}},
input
);
input
);
}
}
{
{
migraphx
::
shape
input
{
migraphx
::
shape
::
float_type
,
{{
2
,
3
,
3
},
{
2
,
4
,
4
}}};
migraphx
::
shape
input
{
migraphx
::
shape
::
float_type
,
{{
2
,
3
,
3
},
{
2
,
4
,
4
}}};
expect_shape
(
migraphx
::
shape
{
migraphx
::
shape
::
float_type
,
expect_shape
(
migraphx
::
shape
{
migraphx
::
shape
::
float_type
,
std
::
vector
<
migraphx
::
shape
::
dynamic_dimension
>
({{
1
,
1
,
0
},
{
2
,
4
,
4
}})},
std
::
vector
<
migraphx
::
shape
::
dynamic_dimension
>
(
{{
1
,
1
,
0
},
{
2
,
4
,
4
}})},
T
{{
0
}},
T
{{
0
}},
input
);
input
);
}
}
...
...
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