MCPcopy
hub / github.com/tinygrad/tinygrad / test_data_empty

Method test_data_empty

test/unit/test_tensor_data.py:28–33  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

26 assert dat[1] == 2
27
28 def test_data_empty(self):
29 a = Tensor([], dtype=dtypes.int32)
30 dat = a.data()
31 assert dat.itemsize == 4
32 assert list(dat) == []
33 assert dat.shape == (0,)
34
35 def test_data_empty_multi_dim(self):
36 a = Tensor([], dtype=dtypes.int32).reshape(0, 2)

Callers

nothing calls this directly

Calls 2

dataMethod · 0.95
TensorClass · 0.90

Tested by

no test coverage detected