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

Method test_numpy_input

tests/transforms/test_to_cupy.py:49–57  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

47 cp.testing.assert_allclose(result, test_data)
48
49 def test_numpy_input(self):
50 test_data = np.array([[1, 2], [3, 4]], dtype=np.float32)
51 test_data = np.rot90(test_data)
52 self.assertFalse(test_data.flags["C_CONTIGUOUS"])
53 result = ToCupy()(test_data)
54 self.assertTrue(result.dtype == cp.float32)
55 self.assertTrue(isinstance(result, cp.ndarray))
56 self.assertTrue(result.flags["C_CONTIGUOUS"])
57 cp.testing.assert_allclose(result, test_data)
58
59 def test_numpy_input_dtype(self):
60 test_data = np.array([[1, 2], [3, 4]], dtype=np.float32)

Callers

nothing calls this directly

Calls 2

ToCupyClass · 0.90
arrayMethod · 0.80

Tested by

no test coverage detected