These doubts arised for me in lesson 4 of the book.
I do not understand the concept of updating gradients with the help of .data attribute.
Jeremy says that, when we use the .data attribute, it tells Pytorch not to update the gradients using the calculation.
I’m a beginner to coding too, so can anyone please shine light to what he meant by that?
Along with this question,
weights[0] *= 1.0001
seemed to not work. It raised an error:
Leaf variable was used in an inplace operation
So I cloned the parameters to another variable and detached it seeing a similar statement for ‘params’ variable used earlier in the lesson. But I haven’t yet precisely understood why it didn’t work and I seemed to think that this too arised because it’s somewhat similar to my first doubt.