I’m sorry for the long delay. You aren’t misunderstanding.
If we’re using BCEWithLogitsLoss, it means we’re solving multi-label classification task. And we’re working with a number of independent classes. For example, imagine you’re classifying photographs by smile and eyeglasses presence. These classes are independent and you have to balance them independently too. So you have to put two coefficients to pos_weight.
If we have only one class, pos_weight should be a vector with a single element.
We don’t add neg_weight because, actually, pos_weight is enough to make CE formula asymmetric to balance classes.