# bend-raw-cells Raw little-endian 32-bit cells between files and Bend 2 arrays (`Array`), in place, as foreign effects. Useful for loading weights, tensors or images that another tool wrote as flat binary. ```python import bend-raw-cells@/raw.bend as R ``` | Effect | What it does | | - | - | | `Raw.read(path, a, cells)` | fills the first `cells` cells of `a` from the file, which must hold exactly `cells * 4` bytes | | `Raw.write(path, a, cells)` | writes the first `cells` cells of `a` to the file | | `Raw.read_at(path, off_hi, off_lo, a, dst, cells)` | `cells` cells from byte offset `off_hi * 2^32 + off_lo` into `a` from cell `dst` on (a slice of a large file, such as one tensor of a safetensors checkpoint) | Each effect stops the program with a message on a missing file, a short read, or an array too small for the request. Native builds only (C); the JS stubs throw. Works in CPU and CUDA builds (the array lives in host-visible memory in both). The C code reads Bend runtime internals (`blk_loc`, `blk_cls`, `e.mem`); tested with Bend 2.0.40 only. Nothing here is proved.