Optim foreach cleanup for Adamax (#69982)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/69982
Test Plan: Imported from OSS
Reviewed By: anjali411
Differential Revision: D33767865
Pulled By: mikaylagawarecki
fbshipit-source-id: c5efd351e359825d38b71f57a2c61a2055c3c114
(cherry picked from commit 37bb80c2d7b441c5718cee6f1b37653d4937e20a)