| 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) |