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

Method setUp

test/backend/test_subbuffer.py:9–12  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

7@unittest.skipUnless(hasattr(Device[Device.DEFAULT].allocator, "_offset"), "subbuffer not supported")
8class TestSubBuffer(unittest.TestCase):
9 def setUp(self):
10 self.buf = Buffer(Device.DEFAULT, 10, dtypes.uint8).ensure_allocated()
11 self.buf.copyin(memoryview(bytearray(range(10))))
12 self.buf_unalloc = Buffer(Device.DEFAULT, 10, dtypes.uint8)
13
14 def test_subbuffer(self):
15 vbuf = self.buf.view(2, dtypes.uint8, offset=3).ensure_allocated()

Callers

nothing calls this directly

Calls 3

BufferClass · 0.90
ensure_allocatedMethod · 0.80
copyinMethod · 0.80

Tested by

no test coverage detected