Optim foreach cleanup for NAdam (#70229)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/70229
Test Plan: Imported from OSS
Reviewed By: anjali411
Differential Revision: D33767873
Pulled By: mikaylagawarecki
fbshipit-source-id: 833ead14c1d1659351ebfbeb41045a3c7eb96dad
(cherry picked from commit 9415df6b5c9620c9d53036c28fe3f297c6d4906c)