Thanks for the update.
Could you post the shapes of all tensors used in the label_loss = torch.matmul(...) line of code, so that we could try to reproduce it?
PS: you can post code snippets by wrapping them into three backticks ```, which makes debugging easier.