Solved by ptrblck in post #2 
              
              
                PyTorch assumes that the first argument to a method has the “right” dtype and thus claims that Long is expected in the model parameter. 
However, you should use FloatTensors to train the model in order to be able to calculate gradients (which are defined for floating point types). 
Transform the dat…