Remove legacy from optional-related function names (#54101)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/54101
Test Plan: Imported from OSS
Reviewed By: ejguan
Differential Revision: D27117839
Pulled By: albanD
fbshipit-source-id: 1f50b06ff9b0be8301f6ea9eca14f73a3a5fa137