Which PyTorch version are you using?
This code:
criterion = nn.BCELoss()
output = torch.sigmoid(torch.randn(10, 1, 1))
target = torch.randint(0, 1, (10, 1)).float()
loss = criterion(output, target)

raises a warning:
UserWarning: Using a target size (torch.Size([10, 1])) that is different to the input size (torch.Size([10, 1, 1])) is deprecated. Please ensure they have the same size.

in a slightly old nightly build 1.2.0.dev20190718.
Regarding the nn.CrossEntropyLoss, the shapes are correct.
This loss function expects a model output containing the class logits in the shape [batch_size, nb_classes, *] and a target containing the class indices in the shape [batch_size, *], where the asterisk denotes additional dimensions.