BendtorchFast.opt_leaf: def of bendtorch-fast@1.3.0.0 Import: import bendtorch-fast@1.3.0.0/main.bend as BendtorchFast Lines 69-73 of bendtorch-fast@1.3.0.0/main.bend: https://jend.leeeet.dev/read.txt?path=bendtorch-fast@1.3.0.0/main.bend&start_line=69&end_line=73 import Base import bend-ml-tensor-fork@0.1.5.0/main.bend as TF import bendtorch@1.3.0.0/main.bend as T def opt_leaf(+o: T.Opt, +i0: U32, +cnt: Nat, r: TF.B4) -> TF.B4: match o r: case T.Adam{+lr, +b1, +b2, +eps, +wd, +dec, +step, +bc2, +c1, +c2} TF.B4{w, g, m, v}: q4_b(T.adam_l(cnt, i0, lr, c1, b2, c2, eps, wd, dec, step, bc2, Array.get(F32, w, i0), Array.get(F32, g, i0), Array.get(F32, m, i0), Array.get(F32, v, i0))) case _ r: r Uses (8): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Array.get https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=F32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=bend-ml-tensor-fork@0.1.6.0/main.bend&name=B4 https://jend.leeeet.dev/definition.txt?path=bendtorch-fast@1.3.0.0/main.bend&name=q4_b https://jend.leeeet.dev/definition.txt?path=bendtorch@1.3.0.0/main.bend&name=Opt https://jend.leeeet.dev/definition.txt?path=bendtorch@1.3.0.0/main.bend&name=adam_l