Optim foreach cleanup for Adagrad (#69981)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/69981
Test Plan: Imported from OSS
Reviewed By: anjali411
Differential Revision: D33767863
Pulled By: mikaylagawarecki
fbshipit-source-id: 1c99abe4ac4eb2a9eb896dff4837b539b94f68e7
(cherry picked from commit 61c28d0645046b67050efaf0d4617203126cbd30)