(self)
| 46 | assert_allclose(result, test_data, type_test=False) |
| 47 | |
| 48 | def test_tensor_input(self): |
| 49 | test_data = torch.tensor([[1, 2], [3, 4]]) |
| 50 | test_data = test_data.rot90() |
| 51 | self.assertFalse(test_data.is_contiguous()) |
| 52 | result = ToNumpy(dtype=torch.uint8)(test_data) |
| 53 | self.assertIsInstance(result, np.ndarray) |
| 54 | self.assertTrue(result.flags["C_CONTIGUOUS"]) |
| 55 | assert_allclose(result, test_data, type_test=False) |
| 56 | |
| 57 | @skip_if_no_cuda |
| 58 | def test_tensor_cuda_input(self): |
nothing calls this directly
no test coverage detected