def gnf_rows

bendtorch@1.3.0.0 · main.bend:1907

import bendtorch@1.3.0.0/main.bend as Bendtorch
import Base

1907# y over the block's rows, one segment each (LayerNorm's lnf_w with the group's gains)
1908def gnf_rows(left: Nat, +off: U32, +j: U32, +c: U32, +cg: Nat, +mu: F32, +r: F32, s: R4) -> R4:
1909  match left s:
1910    case 0n R4{x, g, b, y}:
1911      lnf_w(Nat.sub(cg, 1n), j, off, mu, r, y, Array.get(F32, x, (off + j : U32)), Array.get(F32, g, j), Array.get(F32, b, j))
1912    case 1n+l R4{x, g, b, y}:
1913      gnf_rows(l, (off + c : U32), j, c, cg, mu, r, lnf_w(Nat.sub(cg, 1n), j, off, mu, r, y, Array.get(F32, x, (off + j : U32)), Array.get(F32, g, j), Array.get(F32, b, j)))

Uses (8)

Used by (1)