(self)
| 67 | cp.testing.assert_allclose(result, test_data) |
| 68 | |
| 69 | def test_tensor_input(self): |
| 70 | test_data = torch.tensor([[1, 2], [3, 4]], dtype=torch.float32) |
| 71 | test_data = test_data.rot90() |
| 72 | self.assertFalse(test_data.is_contiguous()) |
| 73 | result = ToCupy()(test_data) |
| 74 | self.assertEqual(result.dtype, cp.float32) |
| 75 | self.assertIsInstance(result, cp.ndarray) |
| 76 | self.assertTrue(result.flags["C_CONTIGUOUS"]) |
| 77 | cp.testing.assert_allclose(result, test_data) |
| 78 | |
| 79 | @skip_if_no_cuda |
| 80 | def test_tensor_cuda_input(self): |