def qrow

bendtorch@1.3.0.0 · main.bend:2383

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

2383# the scores of the query at position i (row i of q, qs apart, the head's hd columns from qc) against keys 0..i (rows
2384# of k, ks apart, from kc): the one place attention reads keys, i + 1 of them (the law causal_keys)
2385def qrow(+i: Nat, +hd: Nat, +qs: U32, +qc: U32, +ks: U32, +kc: U32, q: Array<F32>, k: Array<F32>) -> DR:
2386  drow(i, hd, ((U32.from_nat(i) * qs : U32) + qc : U32), kc, ks, Nil{}, dot0(hd, ((U32.from_nat(i) * qs : U32) + qc : U32), kc, 1, 1, q, k))

Uses (11)

Used by (2)