(self)
| 448 | np.testing.assert_equal(a.cpu().numpy(), [3, 6, 6, 8]) |
| 449 | |
| 450 | def test_chained_slice_column(self): |
| 451 | a = torch.arange(16, dtype=torch.float32, device=device).reshape(4, 4) |
| 452 | torch_res = a[:, 1:2][:, 0:1].cpu().numpy() |
| 453 | cpu_res = torch.arange(16, dtype=torch.float32).reshape(4, 4)[:, 1:2][:, 0:1].numpy() |
| 454 | np.testing.assert_equal(torch_res, cpu_res) |
| 455 | |
| 456 | def test_slice_with_step(self): |
| 457 | a = torch.arange(20, dtype=torch.float32, device=device) |
nothing calls this directly
no test coverage detected