def head_fwd

bendtorch@1.3.0.0 · main.bend:2571

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

2571# one head's forward pass at the columns hc (its queries) and kc (its key/value head) that head_cols gives; it has no
2572# head index, so it reads no other columns
2573def head_fwd(+dm: Dm, +cols: HC, s: FS) -> FS:
2574  match dm cols s:
2575    case Dm{+t, +g, +hd, +w, +kvw, +sc} HC{+hc, +kc} FS{q, k, v, o}:
2576      head_f2(t, hd, w, kvw, hc, kc, v, o, probs(t, hd, sc, U32.from_nat(w), hc, U32.from_nat(kvw), kc, q, k))

Uses (6)

Used by (1)