def chunk.l

bend-ml-tensor@0.1.2.0 · main.bend:221

import bend-ml-tensor@0.1.2.0/main.bend as BendMlTensor
import Base

221# splits a list into r rows of c numbers
222def chunk.l(r: Nat, +c: Nat, +xs: List<&2, F32>) -> List<&2, List<&2, F32>>:
223  match r:
224    case 0n:
225      Nil{}
226    case 1n+p:
227      List.take(&2, F32, xs, c) <> chunk.l(p, c, List.drop(&2, F32, xs, c))

Uses (5)

Used by (3)