Solved by ptrblck in post #3 
              
              
                PyTorch uses float32 by default, while you are creating an input tensor with float64 (double). 
If you don’t specify the dtype or set it to torch.float, the code should work.