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

Function _load

tinygrad/runtime/ops_python.py:15–18  ·  view source on GitHub ↗
(m, i, dtype: DType)

Source from the content-addressed store, hash-verified

13from tinygrad.renderer import Renderer
14
15def _load(m, i, dtype: DType):
16 if i is None: return 0.0
17 if i < 0 or i >= len(m): raise IndexError(f"load out of bounds, size is {len(m)} and access is {i}")
18 return from_storage_scalar(m[i], dtype)
19
20def load(inp, j, dtype: DType):
21 if len(inp) >= 3: return [_load(m, x+j if x is not None else None, dtype) if gate else default for (m,x),default,gate in zip(*inp[:3])]

Callers 1

loadFunction · 0.85

Calls 1

from_storage_scalarFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…