Bendtorch.LayerNorm: def of bendtorch@1.3.0.0 Import: import bendtorch@1.3.0.0/main.bend as Bendtorch Lines 1872-1873 of bendtorch@1.3.0.0/main.bend: https://jend.leeeet.dev/read.txt?path=bendtorch@1.3.0.0/main.bend&start_line=1872&end_line=1873 import Base import bend-ml-tensor-array@0.1.18.0/main.bend as TA def LayerNorm(+n: Nat, +d: Nat, +eps: F32) -> Layer, TA.Mat, TA.Mat, TA.Mat>: Layer{p => x => ln_fwd(n, d, eps, p, x), p => s => dy => g => ln_bwd(n, d, eps, p, s, dy, g), op => p => g => st => ln_step(d, op, p, g, st), u => LN{TA.Mat.zeros(1n, d), TA.Mat.zeros(1n, d)}, p => ln_dump(d, p), p => xs => off => ln_load(d, p, xs, off), p => xs => off => ln_store(d, p, xs, off), u => U32.from_nat(Nat.mul(2n, d))} Uses (14): 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=Nat.mul https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.from_nat https://jend.leeeet.dev/definition.txt?path=bend-ml-tensor-array@0.1.19.0/main.bend&name=Mat https://jend.leeeet.dev/definition.txt?path=bend-ml-tensor-array@0.1.19.0/main.bend&name=Mat.zeros https://jend.leeeet.dev/definition.txt?path=bendtorch@1.3.0.0/main.bend&name=LN https://jend.leeeet.dev/definition.txt?path=bendtorch@1.3.0.0/main.bend&name=Layer https://jend.leeeet.dev/definition.txt?path=bendtorch@1.3.0.0/main.bend&name=ln_bwd https://jend.leeeet.dev/definition.txt?path=bendtorch@1.3.0.0/main.bend&name=ln_dump https://jend.leeeet.dev/definition.txt?path=bendtorch@1.3.0.0/main.bend&name=ln_fwd https://jend.leeeet.dev/definition.txt?path=bendtorch@1.3.0.0/main.bend&name=ln_load https://jend.leeeet.dev/definition.txt?path=bendtorch@1.3.0.0/main.bend&name=ln_step https://jend.leeeet.dev/definition.txt?path=bendtorch@1.3.0.0/main.bend&name=ln_store