MCPcopy Create free account
hub / github.com/ROCm/AMDMIGraphX / expect_shape

Function expect_shape

test/op_shape_test.cpp:37–53  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

35
36template <class... Ts>
37static void expect_shape(const migraphx::shape& expected, const migraphx::operation& op, Ts... xs)
38{
39 migraphx::program p;
40 auto* mm = p.get_main_module();
41 std::vector<migraphx::shape> shapes{xs...};
42 std::vector<migraphx::instruction_ref> args(shapes.size());
43 std::transform(
44 shapes.begin(), shapes.end(), args.begin(), [&](auto&& s) { return mm->add_outline(s); });
45 mm->add_instruction(op, args);
46 if(p.get_output_shapes().back() != expected)
47 {
48 std::cout << "FAILED: Incorrect shape for " << op << ": ";
49 std::cout << expected << " != " << p.get_output_shapes().back() << std::endl;
50 for(auto&& s : shapes)
51 std::cout << " " << s << std::endl;
52 }
53}
54
55template <class... Ts>
56static void throws_shape(const migraphx::operation& op, Ts... xs)

Callers 5

TEST_CASEFunction · 0.85
test_softmax_variationsFunction · 0.85
test_reduce_opsFunction · 0.85
test_dyn_reduce_opsFunction · 0.85

Calls 9

get_main_moduleMethod · 0.80
add_outlineMethod · 0.80
backMethod · 0.80
transformFunction · 0.50
sizeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
add_instructionMethod · 0.45
get_output_shapesMethod · 0.45

Tested by

no test coverage detected