Skip to content

Commit

Permalink
Adjust output for simplify_split_add_relu_reshape
Browse files Browse the repository at this point in the history
Need to adjust the output of this for comparision. Since we're missing the contiguous we can't rely on find_split_reshape due to the lack of contiguous to gate off of
  • Loading branch information
TedThemistokleous committed Oct 11, 2023
1 parent dd21c0c commit dbc784e
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions test/simplify_algebra_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1880,12 +1880,17 @@ TEST_CASE(simplify_split_add_relu_reshape)
auto concatb = m2.add_instruction(b, concat);
auto sum = m2.add_instruction(migraphx::make_op("add"), input, concatb);
auto relu = m2.add_instruction(migraphx::make_op("relu"), sum);
auto rsp = m2.add_instruction(migraphx::make_op("reshape", {{"dims", {3, 8}}}), relu);
auto slc1 = m2.add_instruction(
migraphx::make_op("slice", {{"axes", {1}}, {"starts", {0}}, {"ends", {4}}}), rsp);
migraphx::make_op("slice", {{"axes", {1}}, {"starts", {0}}, {"ends", {1}}}), relu);

auto rsp1 = m2.add_instruction(migraphx::make_op("reshape", {{"dims", {3, 4}}}), slc1);

auto slc2 = m2.add_instruction(
migraphx::make_op("slice", {{"axes", {1}}, {"starts", {4}}, {"ends", {8}}}), rsp);
auto add = m2.add_instruction(migraphx::make_op("add"), slc1, slc2);
migraphx::make_op("slice", {{"axes", {1}}, {"starts", {1}}, {"ends", {2}}}), relu);

auto rsp2 = m2.add_instruction(migraphx::make_op("reshape", {{"dims", {3, 4}}}), slc2);

auto add = m2.add_instruction(migraphx::make_op("add"), rsp1, rsp2);
m2.add_instruction(pass_op{}, add);
}
EXPECT(m1.sort() == m2.sort());
Expand Down

0 comments on commit dbc784e

Please sign in to comment.