MCPcopy Create free account
hub / github.com/MegEngine/MegEngine / TEST_F

Function TEST_F

dnn/test/naive/sliding_window_transpose.cpp:9–51  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7using namespace test;
8
9TEST_F(NAIVE, SlidingWindowTranspose_FORWARD) {
10 Checker<SlidingWindowTranspose> checker(handle(), /* check_dispatch */ false);
11
12 SlidingWindowTranspose::Param param(3, 3, 0, 0, 1, 1, 1, 1, 2, 2);
13 checker.set_param(param).exect(
14 Testcase{
15 TensorValue(
16 {1, 1, 2, 2, 2, 2}, dtype::Uint8(),
17 {0, 1, 3, 4, 1, 2, 4, 5, 3, 4, 6, 7, 4, 5, 7, 8}),
18 {}},
19 Testcase{
20 {},
21 TensorValue(
22 {1, 1, 3, 3}, dtype::Uint8(),
23 {0, 2, 2, 6, 16, 10, 6, 14, 8})});
24
25 param.out_h = 6;
26 param.out_w = 7;
27 param.pad_h = 1;
28 param.pad_w = 1;
29 param.stride_h = 2;
30 param.stride_w = 2;
31 param.dilate_h = 2;
32 param.dilate_w = 2;
33 param.window_h = 3;
34 param.window_w = 3;
35 checker.set_param(param).exect(
36 Testcase{
37 TensorValue(
38 {1, 1, 2, 3, 3, 3}, dtype::Uint8(),
39 {0, 0, 0, 0, 8, 10, 0, 22, 24, 0, 0, 0, 8, 10,
40 12, 22, 24, 26, 0, 0, 0, 10, 12, 0, 24, 26, 0, 0,
41 8, 10, 0, 22, 24, 0, 36, 38, 8, 10, 12, 22, 24, 26,
42 36, 38, 40, 10, 12, 0, 24, 26, 0, 38, 40, 0}),
43 {}},
44 Testcase{
45 {},
46 TensorValue(
47 {1, 1, 6, 7}, dtype::Uint8(),
48 {0, 0, 0, 0, 0, 0, 0, 0, 32, 0, 60, 0, 48, 0,
49 0, 0, 0, 0, 0, 0, 0, 0, 88, 0, 144, 0, 104, 0,
50 0, 0, 0, 0, 0, 0, 0, 0, 72, 0, 114, 0, 80, 0})});
51}

Callers

nothing calls this directly

Calls 2

TensorValueFunction · 0.85
exectMethod · 0.80

Tested by

no test coverage detected