(self)
| 622 | np.testing.assert_allclose(a.grad.cpu().numpy(), expected_grad.numpy(), rtol=1e-5) |
| 623 | |
| 624 | def test_repeat_basic(self): |
| 625 | a = torch.tensor([1, 2, 3], dtype=torch.float32, device=device) |
| 626 | b = a.repeat(2, 1) |
| 627 | expected = torch.tensor([[1, 2, 3], [1, 2, 3]], dtype=torch.float32) |
| 628 | np.testing.assert_equal(b.cpu().numpy(), expected.numpy()) |
| 629 | |
| 630 | def test_repeat_multidim(self): |
| 631 | a = torch.arange(6, dtype=torch.float32, device=device).reshape(2, 3) |
nothing calls this directly
no test coverage detected