def ewc_l
import bendtorch@1.3.0.0/tensor.bend as Tensorimport Base
326# a[j] = f(a[j]) for k positions from j, with a constant c
327def ewc_l(~f: @+a: F32 -> @+c: F32 -> F32, k: Nat, +j: U32, +c: F32, ra: Array<F32> & F32) -> Array<F32>:
328 match k ra:
329 case 0n Tuple{a, v}:
330 a
331 case 1n+p Tuple{a, +v}:
332 ewc_l(~f, p, (j + 1 : U32), c, Array.get(F32, Array.set(F32, a, j, f(v, c)), (j + 1 : U32)))