I see. Just to clarify, the value of grad_f  won’t be changed by any other operations in the future, right? (By contrast, the .grad attribute can be potentially changed by other operations. )
So this sounds a much cleaner way to deal with this kind of issues. Thanks!