示例#1
0
 def test_tramsforms_numpy_batch(self, params, input, expected):
     input = {"image": input[cp.newaxis, ...]}
     expected = expected[cp.newaxis, ...]
     output = CuCIMd(keys="image", **params)(input)["image"]
     self.assertTrue(output.dtype == expected.dtype)
     self.assertTrue(isinstance(output, np.ndarray))
     cp.testing.assert_allclose(output, expected)
示例#2
0
 def test_tramsforms_cupy_single(self, params, input, expected):
     input = {"image": cp.asarray(input)}
     expected = cp.asarray(expected)
     output = CuCIMd(keys="image", **params)(input)["image"]
     self.assertTrue(output.dtype == expected.dtype)
     self.assertTrue(isinstance(output, cp.ndarray))
     cp.testing.assert_allclose(output, expected)