(self)
| 425 | self.assertEqual(view.sum().item(), 20) |
| 426 | |
| 427 | def test_permute_contiguous(self): |
| 428 | a = torch.tensor([[1, 2], [3, 4]], device=device) |
| 429 | b = a.permute(1, 0) |
| 430 | c = b.contiguous() |
| 431 | expected = [[1, 3], [2, 4]] |
| 432 | np.testing.assert_equal(c.cpu().numpy(), expected) |
| 433 | |
| 434 | def test_diag_2d_extract_diagonal(self): |
| 435 | a = torch.tensor([[1, 2], [3, 4]], device=device) |
nothing calls this directly
no test coverage detected