Solved by albanD in post #2 
              
              
                Hi, 
The .backward() and .grad fields are built to work nicely with the torch.nn and torch.optim libraries. 
It allows you to handle computing the gradients and updating all the parameters without the user having to handle passing all the gradients by themselves. 
If you are not working with these l…