BCELoss are unsafe to autocast

Thanks!
nn.BCEWithLogitsLoss expects FloatTensor targets, so use:

labels = torch.tensor(labels, dtype=torch.float32)

and it should work.

1 Like