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

Function TEST_CASE

test/insert_pad_test.cpp:68–91  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

66}
67
68TEST_CASE(rewrite_pad)
69{
70 migraphx::module m;
71 size_t img_dim[2] = {2, 2};
72 size_t channels = 1;
73 std::vector<int32_t> input(channels * img_dim[0] * img_dim[1]);
74 std::iota(input.begin(), input.end(), 0);
75
76 migraphx::shape s_img{migraphx::shape::int32_type, {1, channels, img_dim[0], img_dim[1]}};
77 auto l_img = m.add_literal(migraphx::literal{s_img, input});
78
79 auto l0 = create_im2col(l_img, channels, m);
80 auto l1 = create_conv(l_img, channels, m);
81 auto l2 = m.add_instruction(
82 migraphx::make_op("pooling",
83 {{"mode", migraphx::op::pooling_mode::max}, {"padding", {0, 0, 1, 1}}}),
84 l_img);
85 m.add_instruction(migraphx::make_op("identity"), l0, l1, l2);
86
87 run_pass(m);
88
89 EXPECT(std::any_of(
90 m.begin(), m.end(), [](const migraphx::instruction& ins) { return ins.name() == "pad"; }));
91}
92
93TEST_CASE(rewrite_pad_symmetric)
94{

Callers

nothing calls this directly

Calls 12

iotaFunction · 0.85
create_im2colFunction · 0.70
create_convFunction · 0.70
run_passFunction · 0.70
make_opFunction · 0.50
any_ofFunction · 0.50
none_ofFunction · 0.50
beginMethod · 0.45
endMethod · 0.45
add_literalMethod · 0.45
add_instructionMethod · 0.45
nameMethod · 0.45

Tested by

no test coverage detected