Could you update to the latest PyTorch release, please?
The 1.5.0 release was missing device assert statements and based in the illegal memory access in nn.NLLLoss I assume your target is just out of bounds.