Anyway, the way I think of it, if I have ten samples, all with the same
loss, say, 1.23, I would like my “mean” loss, weighted or not, to be
this same loss value, 1.23. So dividing by the sum of the weights is,
for me, the “expected behavior,” even if the documentation says
otherwise.

Hello Frank, I think the example you gave is actually the expected behavior as described in the documentation. The mean should be divided by the number of samples, not by the sum of the weights of the expected class. That is what I expected from reading the documentation.