When setting the label index to -100 (the same as the default ignore_index for NLLLoss), which is meaningless, the error occurs (RuntimeError: CUDA error: device-side assert triggered). But when setting both the ignore_index of NLLLoss and the meaningless label index to 255, no error is reported. I am completely confused.  What happens? Who can tell me. Thanks a lot.