(self)
| 66 | np.testing.assert_equal(a[1:].cpu().numpy(), [2,3,4]) |
| 67 | |
| 68 | def test_as_strided(self): |
| 69 | a = torch.arange(70, device=device).reshape(1,1,10,7) |
| 70 | a = a.as_strided((1,1,10,5), (0,0,7,1), storage_offset=0) |
| 71 | a = a.as_strided((1,1,5,5), (50,50,7,1), storage_offset=21) |
| 72 | np.testing.assert_equal(a.cpu().numpy().sum(-1), [[[115,150,185,220,255]]]) |
| 73 | |
| 74 | def test_plus_inplace(self): |
| 75 | a = torch.ones(4, device=device) |
nothing calls this directly
no test coverage detected