Thank you @tom, I know that retain_graph=True should work, but
what I do not understand is why my example does not work while it
does work fine when the function is 3y? Also, I thought that zeroing
the gradient is a sufficient and safe way to do this - this is shown in
a number of tutorials I think.
Or is there simply no way to reset the graph and I have to retain it
(and zero it in addition in order to prevent accumulation of gradients)
if I want to call backward again? Then what is the point of not retaining
in the first place?
This is really confusing me.