Bendtorch.head_bwd: def of bendtorch@1.3.0.0 Import: import bendtorch@1.3.0.0/main.bend as Bendtorch Lines 2685-2689 of bendtorch@1.3.0.0/main.bend: https://jend.leeeet.dev/read.txt?path=bendtorch@1.3.0.0/main.bend&start_line=2685&end_line=2689 import Base # one head's backward pass at head_cols' columns (no head index, as head_fwd) def head_bwd(+dm: Dm, +cols: HC, s: BS) -> BS: match dm cols s: case Dm{+t, +g, +hd, +w, +kvw, +sc} HC{+hc, +kc} BS{q, k, v, d, dq, dka, dva}: hb1(t, hd, w, kvw, sc, hc, kc, v, d, dq, dka, dva, probs(t, hd, sc, U32.from_nat(w), hc, U32.from_nat(kvw), kc, q, k)) Uses (6): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.from_nat https://jend.leeeet.dev/definition.txt?path=bendtorch@1.3.0.0/main.bend&name=BS https://jend.leeeet.dev/definition.txt?path=bendtorch@1.3.0.0/main.bend&name=Dm https://jend.leeeet.dev/definition.txt?path=bendtorch@1.3.0.0/main.bend&name=HC https://jend.leeeet.dev/definition.txt?path=bendtorch@1.3.0.0/main.bend&name=hb1 https://jend.leeeet.dev/definition.txt?path=bendtorch@1.3.0.0/main.bend&name=probs