MCPcopy
hub / github.com/tinygrad/tinygrad / view

Method view

tinygrad/device.py:217–219  ·  view source on GitHub ↗
(self, size:int, dtype:DType, offset:int)

Source from the content-addressed store, hash-verified

215 self.allocator._copyout(mv, self._buf)
216 return mv
217 def view(self, size:int, dtype:DType, offset:int) -> Buffer:
218 assert offset < self.nbytes, "offset must be less than nbytes"
219 return Buffer(self.device, size, dtype, base=self.base, offset=self.offset+offset)
220
221DeviceType = TypeVar('DeviceType', bound='Compiled')
222

Callers 15

handleFunction · 0.45
offsetMethod · 0.45
hcq_realizeFunction · 0.45
create_queueMethod · 0.45
_collect_interruptsMethod · 0.45
create_queueMethod · 0.45
loopback.pyFile · 0.45
test_view_zeroMethod · 0.45
test_noncontigMethod · 0.45
shapeMethod · 0.45
unshapeMethod · 0.45

Calls 1

BufferClass · 0.85

Tested by 15

test_view_zeroMethod · 0.36
test_noncontigMethod · 0.36
test_viewMethod · 0.36
test_viewMethod · 0.36
_test_bitcastFunction · 0.36
test_float_to_fp8e4m3Method · 0.36
test_float_to_fp8e5m2Method · 0.36
test_fp8e4m3_to_floatMethod · 0.36
test_fp8e5m2_to_floatMethod · 0.36