def rows.of
import bend-blas-lapack@0.0.0.1/mat.bend as Matimport Base
66# xs cut into rows of cols
67def rows.of(rows: Nat, +cols: Nat, +xs: List<&2, F32>) -> List<&2, List<&2, F32>>:
68 match rows:
69 case 0n:
70 []
71 case 1n+p:
72 List.take(&2, F32, xs, cols) <> rows.of(p, cols, List.drop(&2, F32, xs, cols))