def gather2_l

bendtorch@1.3.0.0 · tensor.bend:173

import bendtorch@1.3.0.0/tensor.bend as Tensor
import Base

173# o[j] = f(x[m(j)], y[n(j)]) for k positions from j; rx and ry hold x[m(j)] and y[n(j)], already read
174def gather2_l(~f: @+a: F32 -> @+b: F32 -> F32, k: Nat, +j: U32, +m: IMap, +n: IMap, rx: Array<F32> & F32, ry: Array<F32> & F32, o: Array<F32>) -> P3:
175  match k rx ry:
176    case 0n Tuple{x, u} Tuple{y, v}:
177      P3{x, y, o}
178    case 1n+p Tuple{x, +u} Tuple{y, +v}:
179      gather2_l(~f, p, (j + 1 : U32), m, n, Array.get(F32, x, imap(m, (j + 1 : U32))), Array.get(F32, y, imap(n, (j + 1 : U32))), Array.set(F32, o, j, f(u, v)))

Uses (12)

Used by (1)