MCPcopy
hub / github.com/tinygrad/tinygrad / test_cat_out

Method test_cat_out

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

Source from the content-addressed store, hash-verified

801 assert ret_indices is indices
802
803 def test_cat_out(self):
804 a = torch.tensor([1, 2], device=device)
805 b = torch.tensor([3, 4], device=device)
806 out = torch.empty(4, device=device)
807 ret = torch.cat([a, b], out=out)
808 np.testing.assert_equal(out.cpu().numpy(), [1, 2, 3, 4])
809 assert ret is out
810
811 def test_cat_out_empty_1d(self):
812 # Test tiny and cpu to show test passes on torch cpu

Callers

nothing calls this directly

Calls 5

tensorMethod · 0.80
catMethod · 0.80
assert_equalMethod · 0.80
emptyMethod · 0.45
numpyMethod · 0.45

Tested by

no test coverage detected