(self, input_param, input_shape, expected_shape)
| 44 | class TestNetAdapter(unittest.TestCase): |
| 45 | @parameterized.expand([TEST_CASE_0, TEST_CASE_1, TEST_CASE_2, TEST_CASE_3, TEST_CASE_4]) |
| 46 | def test_shape(self, input_param, input_shape, expected_shape): |
| 47 | spatial_dims = input_param["dim"] |
| 48 | stride = (1, 2, 2)[:spatial_dims] |
| 49 | model = resnet18(spatial_dims=spatial_dims, conv1_t_stride=stride) |
| 50 | input_param["model"] = model |
| 51 | net = NetAdapter(**input_param).to(device) |
| 52 | with eval_mode(net): |
| 53 | result = net.forward(torch.randn(input_shape).to(device)) |
| 54 | self.assertEqual(result.shape, expected_shape) |
| 55 | |
| 56 | @parameterized.expand([TEST_CASE_0]) |
| 57 | def test_script(self, input_param, input_shape, expected_shape): |
nothing calls this directly
no test coverage detected