Commit bdb6d6f5 authored by Ted Themistokleous's avatar Ted Themistokleous
Browse files

Fix testcase for if_else_trailing_one_shape

Update test for new generated onnx file, as well as using unsqueeze output
for when we parse in a network with mismatched shapes with a trailing 1
parent a1e889ca
......@@ -2383,10 +2383,10 @@ TEST_CASE(if_else_trailing_one_shape_test)
migraphx::shape sc{migraphx::shape::bool_type, {1}};
auto cond = mm->add_literal(migraphx::literal(sc, {0}));
migraphx::shape s{migraphx::shape::float_type, {2, 1}};
migraphx::shape s_trail{migraphx::shape::float_type, {2, 1}};
migraphx::shape s_trail{migraphx::shape::float_type, {2}};
std::vector<float> ones(s.elements(), 1.0f);
auto l1 = mm->add_literal(s, ones);
std::vector<float> rand = {-0.583375, 0.633757};
std::vector<float> rand = {0.0466969, 0.389311};
auto l2 = mm->add_literal(s_trail, rand);
auto x = mm->add_parameter("x", s);
auto y = mm->add_parameter("y", s_trail);
......@@ -2397,7 +2397,8 @@ TEST_CASE(if_else_trailing_one_shape_test)
auto* else_mod = p.create_module("If_5_else");
auto re = else_mod->add_instruction(migraphx::make_op("mul"), y, l2);
else_mod->add_return({re});
auto broad_re = else_mod->add_instruction(migraphx::make_op("unsqueeze", {{"axes", {1}}}), re);
else_mod->add_return({broad_re});
auto ret = mm->add_instruction(migraphx::make_op("if"), {cond}, {then_mod, else_mod});
auto r = mm->add_instruction(migraphx::make_op("get_tuple_elem", {{"index", 0}}), ret);
......
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