Thank you for your answer!
My mistake was treating the output as probabilities, as the mathematical definition of cross entropy requires. I forgot, however, that PyTorch treats them as outputs that don’t need to be summed to 1 and need to be converted to probabilities first using the softmax function.