(self)
| 78 | |
| 79 | @skip_if_no_cuda |
| 80 | def test_tensor_cuda_input(self): |
| 81 | test_data = torch.tensor([[1, 2], [3, 4]], dtype=torch.float32).cuda() |
| 82 | test_data = test_data.rot90() |
| 83 | self.assertFalse(test_data.is_contiguous()) |
| 84 | result = ToCupy()(test_data) |
| 85 | self.assertEqual(result.dtype, cp.float32) |
| 86 | self.assertIsInstance(result, cp.ndarray) |
| 87 | self.assertTrue(result.flags["C_CONTIGUOUS"]) |
| 88 | cp.testing.assert_allclose(result, test_data) |
| 89 | |
| 90 | @skip_if_no_cuda |
| 91 | def test_tensor_cuda_input_dtype(self): |