(m, i, dtype: DType)
| 13 | from tinygrad.renderer import Renderer |
| 14 | |
| 15 | def _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 | |
| 20 | def 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])] |
no test coverage detected
searching dependent graphs…