def weight
import bend-ml-llama@0.2.1.0/main.bend as BendMlLlamaimport 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)))