Yeah, you are right! Thanks for pointing this out. I tried not to mix up both new threads about weighting and thought we are dealing with some classification loss like nn.NLLLoss.
@Skinish have a look at this thread 478 to see how to apply pos_weight instead.