Fix generator exhaustion in SparseAdam (#47724)
Summary:
Fixes https://github.com/pytorch/pytorch/issues/47594
Pull Request resolved: https://github.com/pytorch/pytorch/pull/47724
Reviewed By: heitorschueroff
Differential Revision: D25304131
Pulled By: albanD
fbshipit-source-id: 67c058b0836b9b4fba4f7b966396e4f3fa61f939