If you set the number of output using to 1, you should use nn.BCEWithLogitsLoss as your criterion.
Also, your target should have the same shape ([batch_size, 1]), have values in [0, 1], and be a FloatTensor.
Alternatively, if you would like to stick to nn.CrossEntropyLoss, you should specify out_features=2, and your target should be a LongTensor, containing the class indices in [0, 1], and have the shape [batch_size].