In that case, you could use nn.CrossEntropyLoss and the target tensor should only contain the class indices.
Given the target shape of [batch_size, nb_classes], you can just call
target = torch.argmax(target, 1)

to get the class indices.
Also note that nn.CrossEntropyLoss expects logits as the model output, so remove any non-linearity for the last layer in case you are using some.