MCPcopy Create free account
hub / github.com/Project-MONAI/MONAI / test_value

Method test_value

tests/transforms/test_rand_scale_crop.py:54–60  ·  view source on GitHub ↗
(self, input_param, input_data)

Source from the content-addressed store, hash-verified

52
53 @parameterized.expand(TEST_VALUES)
54 def test_value(self, input_param, input_data):
55 for im_type in TEST_NDARRAYS_ALL:
56 with self.subTest(im_type=im_type):
57 cropper = RandScaleCrop(**input_param)
58 result = cropper(im_type(input_data))
59 roi = [(2 - i // 2, 2 + i - i // 2) for i in cropper._size]
60 assert_allclose(result, input_data[:, roi[0][0] : roi[0][1], roi[1][0] : roi[1][1]], type_test="tensor")
61
62 @parameterized.expand(TEST_RANDOM_SHAPES)
63 def test_random_shape(self, input_param, input_shape, expected_shape):

Callers

nothing calls this directly

Calls 2

RandScaleCropClass · 0.90
assert_allcloseFunction · 0.90

Tested by

no test coverage detected