| 8 | using namespace test; |
| 9 | |
| 10 | TEST_F(NAIVE, RELAYOUT_FORMAT_NCHW4_NCHW) { |
| 11 | Checker<RelayoutFormat> checker(handle(), /* check_dispatch */ false); |
| 12 | |
| 13 | { |
| 14 | auto tensor_nchw4 = TensorValue( |
| 15 | {1, 2, 1, 2, 4}, dtype::Float32(), |
| 16 | {1, 3, 5, 7, 2, 4, 6, 8, 9, 11, 13, 15, 10, 12, 14, 16}); |
| 17 | auto tensor_nchw = TensorValue( |
| 18 | {1, 8, 1, 2}, dtype::Float32(), |
| 19 | {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}); |
| 20 | |
| 21 | RelayoutFormat::Param param{RelayoutFormat::Param::Mode::NCHW4_NCHW}; |
| 22 | |
| 23 | checker.set_param(param).exect( |
| 24 | Testcase{tensor_nchw4, {}}, Testcase{{}, tensor_nchw}); |
| 25 | } |
| 26 | { |
| 27 | auto tensor_nchw4 = TensorValue( |
| 28 | {1, 2, 1, 2, 4}, dtype::Float32(), |
| 29 | {1, 3, 5, 7, 2, 4, 6, 8, 9, 11, 13, 15, 10, 12, 14, 16}); |
| 30 | auto tensor_nchw = TensorValue( |
| 31 | {1, 7, 1, 2}, dtype::Float32(), |
| 32 | {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14}); |
| 33 | |
| 34 | RelayoutFormat::Param param{RelayoutFormat::Param::Mode::NCHW4_NCHW}; |
| 35 | param.oc = 7; |
| 36 | |
| 37 | checker.set_param(param).exect( |
| 38 | Testcase{tensor_nchw4, {}}, Testcase{{}, tensor_nchw}); |
| 39 | } |
| 40 | { |
| 41 | auto tensor_nchw4 = TensorValue( |
| 42 | {1, 2, 1, 2, 4}, dtype::Float32(), |
| 43 | {1, 3, 5, 7, 2, 4, 6, 8, 9, 11, 13, 15, 10, 12, 14, 16}); |
| 44 | auto tensor_nchw = TensorValue( |
| 45 | {1, 6, 1, 2}, dtype::Float32(), |
| 46 | {1, 2, 3, 4, 5, 6, 9, 10, 11, 12, 13, 14}); |
| 47 | |
| 48 | RelayoutFormat::Param param{RelayoutFormat::Param::Mode::NCHW4_NCHW}; |
| 49 | param.oc = 6; |
| 50 | param.group = 2; |
| 51 | |
| 52 | checker.set_param(param).exect( |
| 53 | Testcase{tensor_nchw4, {}}, Testcase{{}, tensor_nchw}); |
| 54 | } |
| 55 | } |
| 56 | |
| 57 | TEST_F(NAIVE, RELAYOUT_FORMAT_NCHW_NCHW4_WEIGHT) { |
| 58 | Checker<RelayoutFormat> checker(handle(), /* check_dispatch */ false); |
nothing calls this directly
no test coverage detected