"...resnet50_tensorflow.git" did not exist on "fd67924ca171d7f5a51c12188a6f52e2d0baa994"
Commit 86cf29ed authored by charlie's avatar charlie
Browse files

Formatting

parent 8ad792f6
...@@ -56,7 +56,7 @@ struct reshape ...@@ -56,7 +56,7 @@ struct reshape
auto s0 = inputs[0]; auto s0 = inputs[0];
if(s0.dynamic()) if(s0.dynamic())
{ {
auto dyn_dims = s0.dyn_dims(); auto dyn_dims = s0.dyn_dims();
int not_fixed_index = -1; int not_fixed_index = -1;
// track number of fixed elements in input and output // track number of fixed elements in input and output
std::size_t num_dims_ele = 1; std::size_t num_dims_ele = 1;
......
...@@ -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);
} }
......
...@@ -6102,10 +6102,10 @@ TEST_CASE(reshape_dyn_test) ...@@ -6102,10 +6102,10 @@ TEST_CASE(reshape_dyn_test)
auto* mm = p.get_main_module(); auto* mm = p.get_main_module();
migraphx::shape s{migraphx::shape::float_type, {{1, 4, 0}, {24, 24, 0}, {1, 1, 0}, {1, 1, 0}}}; migraphx::shape s{migraphx::shape::float_type, {{1, 4, 0}, {24, 24, 0}, {1, 1, 0}, {1, 1, 0}}};
std::vector<int64_t> new_shape = {0, 8, 3, 1}; std::vector<int64_t> new_shape = {0, 8, 3, 1};
auto input = mm->add_parameter("X", s); auto input = mm->add_parameter("X", s);
mm->add_instruction(migraphx::make_op("reshape", {{"dims", new_shape}}), input); mm->add_instruction(migraphx::make_op("reshape", {{"dims", new_shape}}), input);
p.compile(migraphx::ref::target{}); p.compile(migraphx::ref::target{});
std::vector<float> data(48); std::vector<float> data(48);
std::iota(data.begin(), data.end(), -3); std::iota(data.begin(), data.end(), -3);
migraphx::parameter_map params; migraphx::parameter_map params;
......
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