Confusing error using BCEWithLogitsLoss with weighted loss

Yeah, you are right. As @velikodniy explained in his post this is actually a bug.
However, I’m glad you’ve found a workaround! :slight_smile: