Your labels tensor seems to already contain class indices but has an additional unnecessary dimension.
The right approach would be to use labels = labels.squeeze(1) and pass it to the criterion.
Using torch.max(labels, dim=1)[0]  would yield the same output.
However, torch.max(labels, dim=1)[1] would return the indices in dim1 containing the max value, which would be a tensor full of zeros which is wrong and would thus explain the zero loss as your model would only learn to predict class0.