Memory leak during backprop in Reinforcement Learning tutorial?

There seems to be a memory leak in the official Reinforcement Learning tutorial for pytorch 1.0.0.
I run the original python source code (cpu implementation), but increased num_episodes from 50 to 5000 to make the increasing RAM consumption visible.

(I had a custom reinforcement learning model, where I had a similar leak, and after eliminating other possible error sources I checked the ‘original’ code and there it is.)
It might be a major bug, could you check it?