What is the recommended way to re-assign/update values in a variable (or tensor)?

If you store indefinitely the history of computations, your computation graph will grow bigger at every iteration, and you will never free memory, leading to out of memory issues.

1 Like