MCPcopy
hub / github.com/tinygrad/tinygrad / zero_bufs

Function zero_bufs

test/backend/test_graph.py:54–58  ·  view source on GitHub ↗
(bufs)

Source from the content-addressed store, hash-verified

52 run_linear(UOp(Ops.LINEAR, src=tuple(calls)))
53
54def zero_bufs(bufs):
55 for b in bufs:
56 mv = memoryview(bytearray(b.nbytes))
57 ctypes.memset(from_mv(mv), 0, len(mv))
58 b.copyin(mv)
59
60@unittest.skipUnless(Device[Device.DEFAULT].graph is not None, "graph support required")
61class TestGraph(unittest.TestCase):

Calls 2

from_mvFunction · 0.90
copyinMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…