"docs/vscode:/vscode.git/clone" did not exist on "12a5e3de1c4b3e017286b68a5334a1e49870f0f5"
Commit 86cf29ed authored by charlie's avatar charlie
Browse files

Formatting

parent 8ad792f6
......@@ -56,7 +56,7 @@ struct reshape
auto s0 = inputs[0];
if(s0.dynamic())
{
auto dyn_dims = s0.dyn_dims();
auto dyn_dims = s0.dyn_dims();
int not_fixed_index = -1;
// track number of fixed elements in input and output
std::size_t num_dims_ele = 1;
......
......@@ -1986,9 +1986,10 @@ TEST_CASE(reshape_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}}};
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}})
migraphx::shape input{migraphx::shape::float_type,
{{1, 4, 0}, {24, 24, 0}, {1, 1, 0}, {1, 1, 0}}};
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{};
for(std::size_t i = 0; i < new_shape.size(); ++i)
......@@ -2010,21 +2011,24 @@ TEST_CASE(reshape_dyn_shape)
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};
throws_shape(migraphx::make_op("reshape", {{"dims", new_shape}}), input);
}
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};
throws_shape(migraphx::make_op("reshape", {{"dims", new_shape}}), input);
}
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};
throws_shape(migraphx::make_op("reshape", {{"dims", new_shape}}), input);
}
......
......@@ -6102,10 +6102,10 @@ TEST_CASE(reshape_dyn_test)
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}}};
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);
p.compile(migraphx::ref::target{});
std::vector<float> data(48);
std::iota(data.begin(), data.end(), -3);
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