MCPcopy
hub / github.com/tinygrad/tinygrad / test_repeat_multidim

Method test_repeat_multidim

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

Source from the content-addressed store, hash-verified

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)
632 b = a.repeat(2, 3)
633 expected = torch.arange(6, dtype=torch.float32).reshape(2, 3).repeat(2, 3)
634 np.testing.assert_equal(b.cpu().numpy(), expected.numpy())
635
636 def test_repeat_backward(self):
637 a = torch.tensor([[1.0, 2.0]], dtype=torch.float32, device=device, requires_grad=True)

Callers

nothing calls this directly

Calls 5

reshapeMethod · 0.80
arangeMethod · 0.80
repeatMethod · 0.80
assert_equalMethod · 0.80
numpyMethod · 0.45

Tested by

no test coverage detected