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

Method test_array_input

tests/transforms/test_to_tensor.py:37–41  ·  view source on GitHub ↗
(self, test_data, expected_shape)

Source from the content-addressed store, hash-verified

35class TestToTensor(unittest.TestCase):
36 @parameterized.expand(TESTS)
37 def test_array_input(self, test_data, expected_shape):
38 result = ToTensor(dtype=torch.float32, device="cpu", wrap_sequence=True)(test_data)
39 self.assertTrue(isinstance(result, torch.Tensor))
40 assert_allclose(result, test_data, type_test=False)
41 self.assertTupleEqual(result.shape, expected_shape)
42
43 @parameterized.expand(TESTS_SINGLE)
44 def test_single_input(self, test_data):

Callers

nothing calls this directly

Calls 2

ToTensorClass · 0.90
assert_allcloseFunction · 0.90

Tested by

no test coverage detected