Optim foreach cleanup for Adam (#70295)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/70295
Test Plan: Imported from OSS
Reviewed By: anjali411
Differential Revision: D33767870
Pulled By: mikaylagawarecki
fbshipit-source-id: f922f15ecb0307458c8ecee737325c42c4f3ce8b
(cherry picked from commit 66233a8a3eaa073acdaeaa16ca83413da8a2d969)