Solved by ptrblck in post #2 
              
              
                Could you try to disable cuDNN using torch.backends.cudnn.enabled = False and run your code again? 
The code you’ve posted here runs fine on my machine, so the error might come from some setup issue on your machine or the way you are using your model. 
Here is a small code snippet which is working: 
…