Doing multi-label binary classification with BCEWithLogitsLoss, but I get a RunTimeError “RuntimeError: result type Float can’t be cast to the desired output type Long”.  Running 1.8.1 on Windows but the problem also occurred on 1.4. Am I doing something wrong with respect to multi-labels, perhaps?
from torch import FloatTensor, LongTensor
from torch.nn import BCEWithLogitsLoss


criterion = BCEWithLogitsLoss()

logits = FloatTensor([[ 0.1144, -0.3313, -0.1003],
                      [-0.0207, -0.2222, -0.0905],
                      [-0.1814, -0.0793, -0.1249],
                      [ 0.0079, -0.3403,  0.0057]])
labels = LongTensor([[0, 1, 0],
                     [0, 0, 1],
                     [0, 0, 1],
                     [0, 1, 1]])

loss = criterion(logits, labels)