I am trying to apply Class Weights to BCEWithLogitsLoss.  I felt I had read every post on this and was well prepared to do so but apparently not.
I have two classes.
print(class_weights)
[ 0.50897302 28.36130137]
criterion = nn.BCEWithLogitsLoss(pos_weight=torch.tensor(class_weights, device=device))

Each batch is 136 items.
I get:
RuntimeError: output with shape [136, 1] doesn't match the broadcast shape [136, 2]
I am not sure what I am doing wrong