(self, input_param, expected_shape)
| 112 | |
| 113 | @parameterized.expand([TEST_CASE_0, TEST_CASE_1, TEST_CASE_2, TEST_CASE_2_1, TEST_CASE_3, TEST_CASE_4]) |
| 114 | def test_longest_shape(self, input_param, expected_shape): |
| 115 | input_data = np.random.randint(0, 2, size=[3, 4, 7, 10]) |
| 116 | input_param["size_mode"] = "longest" |
| 117 | result = Resize(**input_param)(input_data) |
| 118 | np.testing.assert_allclose(result.shape[1:], expected_shape) |
| 119 | |
| 120 | set_track_meta(False) |
| 121 | result = Resize(**input_param)(input_data) |
| 122 | self.assertNotIsInstance(result, MetaTensor) |
| 123 | np.testing.assert_allclose(result.shape[1:], expected_shape) |
| 124 | set_track_meta(True) |
| 125 | |
| 126 | def test_longest_infinite_decimals(self): |
| 127 | resize = Resize(spatial_size=1008, size_mode="longest", mode="bilinear", align_corners=False) |
nothing calls this directly
no test coverage detected