Hi,



 Mayuresh_Anand:

inpt = torch.randn(10,3,requires_grad=True)
target = torch.empty(10, dtype=torch.long).random_(5)


Your input data has 3 classes [10, 3] but output has labels from 0 to 5 so you get error for labels bigger than 2. .random_(3) can solve your issue.
Bests