Solved by ptrblck in post #3 
              
              
                Most likely your targets contain invalid values outside of the expected range [0, nb_classes-1]. 
I’m not sure, if you are using an older PyTorch version, as the stacktrace with blocking launches should show the indexing errors. 
In case you are already using the latest release, you could use TORCH_…