def transpose.go
import bend-ml-tensor@0.1.2.0/main.bend as BendMlTensorimport Base
141# transpose of a matrix with `c` columns (c is the one that shrinks, so it comes first)
142def transpose.go(c: Nat, +rows: List<&2, List<&2, F32>>) -> List<&2, List<&2, F32>>:
143 match c:
144 case 0n:
145 Nil{}
146 case 1n+p:
147 heads(rows) <> transpose.go(p, tails(rows))