def gather_l
import bendtorch@1.3.0.0/tensor.bend as Tensorimport Base
181# o[j] = x[m(j)] for k positions from j
182def gather_l(k: Nat, +j: U32, +m: IMap, rx: Array<F32> & F32, o: Array<F32>) -> P2:
183 match k rx:
184 case 0n Tuple{x, u}:
185 P2{x, o}
186 case 1n+p Tuple{x, +u}:
187 gather_l(p, (j + 1 : U32), m, Array.get(F32, x, imap(m, (j + 1 : U32))), Array.set(F32, o, j, u))