MCPcopy
hub / github.com/tinygrad/tinygrad / test_data_uint8

Method test_data_uint8

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

Source from the content-addressed store, hash-verified

40 assert dat.shape == (0,)
41
42 def test_data_uint8(self):
43 a = Tensor([1,2,3,4], dtype=dtypes.uint8)
44 dat = a.data()
45 assert dat.format == "B"
46 assert dat.itemsize == 1
47 assert dat[0] == 1
48 assert dat[1] == 2
49
50 def test_data_nested(self):
51 a = Tensor([[1,2],[3,4]], dtype=dtypes.int32)

Callers

nothing calls this directly

Calls 2

dataMethod · 0.95
TensorClass · 0.90

Tested by

no test coverage detected