I’d probably use reduce=False in the loss and do the weighting and summing myself. I don’t think you will notice the performance difference if you have any nontrivial computation in the model you waant to train.
Best regard
Thomas