def store_cells
import bendtorch@1.3.0.0/main.bend as Bendtorchimport Base
import bend-ml-tensor-array@0.1.18.0/main.bend as TA
568# load_cells' inverse: copies the matrix's cells i.. into xs from `off`; both arrays come back (the matrix's first)
569def store_cells(left: Nat, +i: U32, +off: U32, rm: Array<F32> & F32, xs: Array<F32>) -> TA.P2:
570 match left rm:
571 case 0n Tuple{ma, v}: TA.P2{ma, xs}
572 case 1n+q Tuple{ma, v}:
573 store_cells(q, (i + 1 : U32), (off + 1 : U32), Array.get(F32, ma, (i + 1 : U32)), Array.set(F32, xs, off, v))