[optim] make functional api be private (#51316) (#51665)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/51665
This reverts commit 896f82aa92eb7557229053a21da786f5927e64e0.
Test Plan: Imported from OSS
Reviewed By: gchanan
Differential Revision: D26232608
Pulled By: vincentqb
fbshipit-source-id: ca006baf4fb672c11c1bb003c39a29cbadb63dd3