(inp, j, dtype: DType)
| 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])] |
| 22 | return [_load(m, x+j if x is not None else None, dtype) for m,x in inp[0]] |
| 23 | |
| 24 | def _store(m, i, v, dtype: DType): |
| 25 | if i < 0 or i >= len(m): raise IndexError(f"store out of bounds, size is {len(m)}, access is {i}, value is {v}") |