MCPcopy
hub / github.com/tinygrad/tinygrad / test_cat_all_empty

Method test_cat_all_empty

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

Source from the content-addressed store, hash-verified

820 assert ret is out
821
822 def test_cat_all_empty(self):
823 for test_device in device, "cpu":
824 a = torch.tensor([], device=device)
825 out = torch.empty((0,), device=device)
826 for dim in 0, -1:
827 ret = torch.cat([a, a], out=out, dim=dim)
828 np.testing.assert_equal(out.cpu().numpy(), [])
829 assert ret is out
830
831 def test_scatter_add_out(self):
832 src = torch.tensor([[1, 2, 3], [4, 5, 6]], device=device, dtype=torch.float32)

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