Better way to set retain_graph
Is there a better way to set retain_graph, especially when using two optimizers?
I have read the issue  #356 and the corresponding fix, to set it by overriding the backward function.
However, this becomes messy especially when more than 1 optimizers are used, as the function doesn't have the optimizer_idx as an argument.
There are workarounds like naming the optimizer object and using that to set/reset the retain graph, but passing optimizer_idx would be great.
This shouldn't be difficult as the opt_idx variable is available inside the loop in which the backward function is called

Version [0.6.0]