def ew1_loop
import bendtorch-gpu@1.3.0.0/main.bend as BendtorchGpuimport Base
70# out[i] = f(x[i]) for the leaf's cells
71def ew1_loop(~f: @+a: F32 -> F32, k: Nat, +i: U32, +l: U32, o: Array<F32>, r: Array<F32> & F32) -> Array<F32>:
72 match k r:
73 case 0n Tuple{a, +x}: o
74 case 1n+q Tuple{a, +x}: ew1_loop(~f, q, (i + l : U32), l, Array.set(F32, o, i, f(x)), Array.get(F32, a, (i + l : U32)))