MCPcopy
hub / github.com/tinygrad/tinygrad / test_data_const

Method test_data_const

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

Source from the content-addressed store, hash-verified

58 assert dat[1, 1] == 4
59
60 def test_data_const(self):
61 a = Tensor(3, dtype=dtypes.int32)
62 dat = a.data()
63 assert dat.format == "i"
64 assert dat.itemsize == 4
65 assert dat.tolist() == 3
66 assert dat.shape == ()
67
68 def test_data_float32(self):
69 a = Tensor([[1,2.5],[3,4]], dtype=dtypes.float32)

Callers

nothing calls this directly

Calls 3

dataMethod · 0.95
TensorClass · 0.90
tolistMethod · 0.45

Tested by

no test coverage detected