When you said:

Blockquote
Here I believe that labels starts out having shape [nBatch], with no
class dimension, as would be appropriate for a multi-class problem
using CrossEntropyLoss. However, BCELoss requires that pred
and labels have the same shape, and I believe that pred has
shape [nBatch, 1] (where the singleton dimension is not necessary,
but is also not incorrect).

I tried to change this, using:
pred = pred.squeeze(dim=1) # Output shape is [Batch size, 1], but we want [Batch size]

But it returned an error that the shape must be the same, so I removed, avoiding other problems 
Now, I did this:
# Compute accuracy
#pred_labels = pred.argmax(1) + 1
pred_labels = (pred >= 0.5).long() # Binarize predictions to 0 and 1
batch_accuracy = (pred_labels == labels).sum().item()/input.size(0)

And now, accuracy is over 97% 
Do you think is a good solution?