MCPcopy Index your code
hub / github.com/tinygrad/tinygrad / test_simple_read

Method test_simple_read

test/unit/test_disk_tensor.py:240–245  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

238 Tensor.empty(100, 100, device=f"disk:{self.tmp('dt_empty')}")
239
240 def test_simple_read(self):
241 fn = pathlib.Path(self.tmp("dt_simple_read"))
242 fn.write_bytes(bytes(range(256)))
243 t = Tensor.empty(16, 16, device=f"disk:{self.tmp('dt_simple_read')}", dtype=dtypes.uint8)
244 out = t[1].to(Device.DEFAULT).tolist()
245 assert out == list(range(16, 32))
246
247 def test_simple_read_bitcast(self):
248 fn = pathlib.Path(self.tmp("dt_simple_read_bitcast"))

Callers

nothing calls this directly

Calls 4

tmpMethod · 0.80
emptyMethod · 0.45
tolistMethod · 0.45
toMethod · 0.45

Tested by

no test coverage detected