def weight

bend-ml-llama@0.2.1.0 · main.bend:1198

import bend-ml-llama@0.2.1.0/main.bend as BendMlLlama
import Base

1198# the weight of a logit v: exp(v/temp - top/temp), top the largest logit (its weight is 1)
1199def weight(+v: F32, +temp: F32, +top: F32) -> F32:
1200  F32.exp(F32.sub(F32.div(v, temp), F32.div(top, temp)))

Uses (4)

Used by (5)