MCPcopy
hub / github.com/tinygrad/tinygrad / to_np

Function to_np

extra/hip_large_kernel.py:21–21  ·  view source on GitHub ↗
(buf)

Source from the content-addressed store, hash-verified

19
20import numpy as np
21def to_np(buf): return np.frombuffer(buf.as_memoryview().cast(buf.dtype.base.fmt), dtype=_to_np_dtype(buf.dtype.base))
22
23big = to_np(buf0)
24print(big)

Callers 1

Calls 3

_to_np_dtypeFunction · 0.90
as_memoryviewMethod · 0.80
castMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…