Bendtorch.head_full: def of bendtorch@1.3.0.0 Import: import bendtorch@1.3.0.0/main.bend as Bendtorch Lines 2950-2957 of bendtorch@1.3.0.0/main.bend: https://jend.leeeet.dev/read.txt?path=bendtorch@1.3.0.0/main.bend&start_line=2950&end_line=2957 import Base # ---- the same forward with every key visible. The leaf is the only new arithmetic: head_full builds P with fprobs # instead of probs; the tree, the slices and the P·V are the causal path's own functions. Kept beside the causal ones # rather than behind a flag so that no call into Attention changes and the laws attn_par_fwd / attn_par_bwd still # compare the functions they name. def head_full(+dm: Dm, +cols: HC, s: FS) -> FS: match dm cols s: case Dm{+t, +g, +hd, +w, +kvw, +sc} HC{+hc, +kc} FS{q, k, v, o}: head_f2(t, hd, w, kvw, hc, kc, v, o, fprobs(Nat.sub(t, 1n), hd, sc, U32.from_nat(w), hc, U32.from_nat(kvw), kc, q, k)) Uses (7): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.sub 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=Dm https://jend.leeeet.dev/definition.txt?path=bendtorch@1.3.0.0/main.bend&name=FS 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=fprobs https://jend.leeeet.dev/definition.txt?path=bendtorch@1.3.0.0/main.bend&name=head_f2