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

Method test_single_input

tests/transforms/test_to_tensor.py:44–48  ·  view source on GitHub ↗
(self, test_data)

Source from the content-addressed store, hash-verified

42
43 @parameterized.expand(TESTS_SINGLE)
44 def test_single_input(self, test_data):
45 result = ToTensor(track_meta=True)(test_data)
46 self.assertTrue(isinstance(result, torch.Tensor))
47 assert_allclose(result, test_data, type_test=False)
48 self.assertEqual(result.ndim, 0)
49
50 @unittest.skipUnless(HAS_CUPY, "CuPy is required.")
51 def test_cupy(self):

Callers

nothing calls this directly

Calls 2

ToTensorClass · 0.90
assert_allcloseFunction · 0.90

Tested by

no test coverage detected