Yes exactly!
However, I have 5 classes and my batch size is 8.
I previously tried what you suggested and here’s what I got:
RuntimeError: The size of tensor a (5) must match the size of tensor b (8) at non-singleton dimension 1

torch.Size([8, 5])