MCPcopy
hub / github.com/tinygrad/tinygrad / test_repeat_basic

Method test_repeat_basic

extra/torch_backend/test.py:624–628  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

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)

Callers

nothing calls this directly

Calls 4

tensorMethod · 0.80
repeatMethod · 0.80
assert_equalMethod · 0.80
numpyMethod · 0.45

Tested by

no test coverage detected