(self)
| 49 | |
| 50 | @unittest.skipUnless(HAS_CUPY, "CuPy is required.") |
| 51 | def test_cupy(self): |
| 52 | test_data = [[1, 2], [3, 4]] |
| 53 | cupy_array = cp.ascontiguousarray(cp.asarray(test_data)) |
| 54 | result = ToTensor()(cupy_array) |
| 55 | self.assertTrue(isinstance(result, torch.Tensor)) |
| 56 | assert_allclose(result, test_data, type_test=False) |
| 57 | |
| 58 | |
| 59 | if __name__ == "__main__": |
nothing calls this directly
no test coverage detected