Solved by KFrank in post #5 
              
              
                Hi Josep! 
First, could you clarify what version of pytorch you are using? 

What type of data structure are your X_train, Y_train, etc., 
before you wrap them in numpy arrays? 

Just to clean things up a little, I would (try to) convert directly 
from your original X_train, etc., to pytorch tensors…