Commit 86cf29ed authored by charlie's avatar charlie
Browse files

Formatting

parent 8ad792f6
...@@ -1986,9 +1986,10 @@ TEST_CASE(reshape_shape) ...@@ -1986,9 +1986,10 @@ TEST_CASE(reshape_shape)
TEST_CASE(reshape_dyn_shape) TEST_CASE(reshape_dyn_shape)
{ {
migraphx::shape input{migraphx::shape::float_type, {{1, 4, 0}, {24, 24, 0}, {1, 1, 0}, {1, 1, 0}}}; migraphx::shape input{migraphx::shape::float_type,
for(auto&& new_shape : {{1, 4, 0}, {24, 24, 0}, {1, 1, 0}, {1, 1, 0}}};
std::vector<std::vector<int64_t>>{{-1, 1, 1, 24}, {0, 8, 3, 1}, {-1, 3, 4, 2}, {0, 2, 4, 3}}) for(auto&& new_shape : std::vector<std::vector<int64_t>>{
{-1, 1, 1, 24}, {0, 8, 3, 1}, {-1, 3, 4, 2}, {0, 2, 4, 3}})
{ {
std::vector<migraphx::shape::dynamic_dimension> out_dyn_dims{}; std::vector<migraphx::shape::dynamic_dimension> out_dyn_dims{};
for(std::size_t i = 0; i < new_shape.size(); ++i) for(std::size_t i = 0; i < new_shape.size(); ++i)
...@@ -2010,21 +2011,24 @@ TEST_CASE(reshape_dyn_shape) ...@@ -2010,21 +2011,24 @@ TEST_CASE(reshape_dyn_shape)
TEST_CASE(reshape_multiple_non_fixed_error) TEST_CASE(reshape_multiple_non_fixed_error)
{ {
migraphx::shape input{migraphx::shape::float_type, {{1, 4, 0}, {24, 24, 0}, {10, 20, 0}, {1, 1, 0}}}; migraphx::shape input{migraphx::shape::float_type,
{{1, 4, 0}, {24, 24, 0}, {10, 20, 0}, {1, 1, 0}}};
std::vector<int64_t> new_shape = {0, 1, 0, 24}; std::vector<int64_t> new_shape = {0, 1, 0, 24};
throws_shape(migraphx::make_op("reshape", {{"dims", new_shape}}), input); throws_shape(migraphx::make_op("reshape", {{"dims", new_shape}}), input);
} }
TEST_CASE(reshape_fixed_ele_not_matching_error) TEST_CASE(reshape_fixed_ele_not_matching_error)
{ {
migraphx::shape input{migraphx::shape::float_type, {{1, 4, 0}, {24, 24, 0}, {10, 10, 0}, {1, 1, 0}}}; migraphx::shape input{migraphx::shape::float_type,
{{1, 4, 0}, {24, 24, 0}, {10, 10, 0}, {1, 1, 0}}};
std::vector<int64_t> new_shape = {0, 1, 5, 24}; std::vector<int64_t> new_shape = {0, 1, 5, 24};
throws_shape(migraphx::make_op("reshape", {{"dims", new_shape}}), input); throws_shape(migraphx::make_op("reshape", {{"dims", new_shape}}), input);
} }
TEST_CASE(reshape_non_fixed_not_matching_error) TEST_CASE(reshape_non_fixed_not_matching_error)
{ {
migraphx::shape input{migraphx::shape::float_type, {{1, 4, 0}, {24, 24, 0}, {1, 1, 0}, {1, 1, 0}}}; migraphx::shape input{migraphx::shape::float_type,
{{1, 4, 0}, {24, 24, 0}, {1, 1, 0}, {1, 1, 0}}};
std::vector<int64_t> new_shape = {2, 1, 1, 24}; std::vector<int64_t> new_shape = {2, 1, 1, 24};
throws_shape(migraphx::make_op("reshape", {{"dims", new_shape}}), input); throws_shape(migraphx::make_op("reshape", {{"dims", new_shape}}), input);
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment