Hi,
You should not use .data on the output of your model. It only returns the matrix of you tensor not the other atttributes like grad_fn.



 islamaymansais:

out = self.model(x).data


Use like this:
out = self.model(x)


By the way, you only need .data for initializing the weights and biases, not in training and eval methods.