Question 3/7 fast.ai v4 lecture 4

You have a tensor with requires_grad=True. How do you update its value without PyTorch keeping track of the calculation for calculating gradients?

Answer

You can achieve this by updating the tensor.data attribute of a tensor!.

Relevant part of lecture