Hey,
This is most likely because of the large number of calls to .backward().
Out of curiosity, how do you “# do something with the individual gradients” given that you don’t zero_grad() before? You do something with all the gradients accumulated up to now?