why does this have `/h` but the else doesn't?
given that this uses sum and the else uses mean, does this mean that weights needs to be normalized in a specific way?