Commit 83181ddc authored by Shucai Xiao's avatar Shucai Xiao
Browse files

clang format

parent 7cd27a5f
...@@ -103,14 +103,15 @@ TEST_CASE(after_param_broadcast) ...@@ -103,14 +103,15 @@ TEST_CASE(after_param_broadcast)
TEST_CASE(two_transpose_gather) TEST_CASE(two_transpose_gather)
{ {
auto create_module = [] auto create_module = [] {
{
migraphx::module m; migraphx::module m;
auto data = m.add_parameter("2x2", {migraphx::shape::float_type, {2, 3, 4, 5}}); auto data = m.add_parameter("2x2", {migraphx::shape::float_type, {2, 3, 4, 5}});
auto ind = m.add_parameter("ind", {migraphx::shape::float_type, {2, 3}}); auto ind = m.add_parameter("ind", {migraphx::shape::float_type, {2, 3}});
auto td = m.add_instruction(migraphx::make_op("transpose", {{"permutation", {0, 2, 3, 1}}}), data); auto td = m.add_instruction(migraphx::make_op("transpose", {{"permutation", {0, 2, 3, 1}}}),
data);
auto sd = m.add_instruction(migraphx::make_op("softmax", {{"axis", 2}}), td); auto sd = m.add_instruction(migraphx::make_op("softmax", {{"axis", 2}}), td);
auto bd = m.add_instruction(migraphx::make_op("transpose", {{"permutation", {0, 3, 1, 2}}}), sd); auto bd =
m.add_instruction(migraphx::make_op("transpose", {{"permutation", {0, 3, 1, 2}}}), sd);
auto r = m.add_instruction(migraphx::make_op("gather", {{"axis", 2}}), bd, ind); auto r = m.add_instruction(migraphx::make_op("gather", {{"axis", 2}}), bd, ind);
m.add_return({r}); m.add_return({r});
...@@ -120,17 +121,18 @@ TEST_CASE(two_transpose_gather) ...@@ -120,17 +121,18 @@ TEST_CASE(two_transpose_gather)
auto m = create_module(); auto m = create_module();
run_pass(m); run_pass(m);
auto create_cont_module = [] auto create_cont_module = [] {
{
migraphx::module m; migraphx::module m;
auto data = m.add_parameter("2x2", {migraphx::shape::float_type, {2, 3, 4, 5}}); auto data = m.add_parameter("2x2", {migraphx::shape::float_type, {2, 3, 4, 5}});
auto ind = m.add_parameter("ind", {migraphx::shape::float_type, {2, 3}}); auto ind = m.add_parameter("ind", {migraphx::shape::float_type, {2, 3}});
auto td = m.add_instruction(migraphx::make_op("transpose", {{"permutation", {0, 2, 3, 1}}}), data); auto td = m.add_instruction(migraphx::make_op("transpose", {{"permutation", {0, 2, 3, 1}}}),
data);
auto ctd = m.add_instruction(migraphx::make_op("contiguous"), td); auto ctd = m.add_instruction(migraphx::make_op("contiguous"), td);
auto sd = m.add_instruction(migraphx::make_op("softmax", {{"axis", 2}}), ctd); auto sd = m.add_instruction(migraphx::make_op("softmax", {{"axis", 2}}), ctd);
auto bd = m.add_instruction(migraphx::make_op("transpose", {{"permutation", {0, 3, 1, 2}}}), sd); auto bd =
m.add_instruction(migraphx::make_op("transpose", {{"permutation", {0, 3, 1, 2}}}), sd);
auto cbd = m.add_instruction(migraphx::make_op("contiguous"), bd); auto cbd = m.add_instruction(migraphx::make_op("contiguous"), bd);
auto r = m.add_instruction(migraphx::make_op("gather", {{"axis", 2}}), cbd, ind); auto r = m.add_instruction(migraphx::make_op("gather", {{"axis", 2}}), cbd, ind);
m.add_return({r}); m.add_return({r});
return m; return m;
......
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