def acti_f3
import bendtorch@1.3.0.0/main.bend as Bendtorchimport Base
import bend-ml-tensor-array@0.1.18.0/main.bend as TA
1053# an activation whose derivative needs its input (silu, gelu): saves a copy of the input
1054def acti_f3(~f: @+a: F32 -> F32, +n: Nat, +c: Nat, m: TA.MM2<n, c>) -> Fwd<Unit, TA.Mat<n, c>, TA.Mat<n, c>>:
1055 match m:
1056 case TA.MM2{x, s}:
1057 Fwd{Unit{}, Ew.map(~f, n, c, x), s}