Hi,
This looks like a good way to maintain them.
What you need to make sure is how big your computational graph is. In particular, if intermediate_result requires gradients, then next_result will also and will keep track of its history (which contains intermediate_result).