I agree that the error message

y_pred must have shape (batch_size, num_categories, ...) and y  must have shape of (batch_size, ...), but given torch.Size([5, 1]) vs  torch.Size([5, 1])

is not clear enough as it intends to say the following:

y_pred must have shape (batch_size, num_categories, …) and given torch.Size([5, 1]) = OK
y must have shape of (batch_size, …) and given torch.Size([5, 1]) => Wrong

y should have the shape : (5, ) without 1
Could you please open an issue to improve the docs please on the github repository ?