def head_full
import bendtorch@1.3.0.0/main.bend as Bendtorchimport Base
2950# ---- the same forward with every key visible. The leaf is the only new arithmetic: head_full builds P with fprobs
2951# instead of probs; the tree, the slices and the P·V are the causal path's own functions. Kept beside the causal ones
2952# rather than behind a flag so that no call into Attention changes and the laws attn_par_fwd / attn_par_bwd still
2953# compare the functions they name.
2954def head_full(+dm: Dm, +cols: HC, s: FS) -> FS:
2955 match dm cols s:
2956 case Dm{+t, +g, +hd, +w, +kvw, +sc} HC{+hc, +kc} FS{q, k, v, o}:
2957 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))