For what it’s worth: I ran into a similar problem 18. For some reason the objects stored using self.save_for_backward() were accumulating.
To fix it, I used static methods for forward and backward, as illustrated here 28.