Add std::variant backport as c10::variant (#26836)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/26836
* **#26836 Add std::variant backport as c10::variant**
Test Plan: Imported from OSS
Differential Revision: D17649064
Pulled By: yf225
fbshipit-source-id: aa5ee26fe7078cc66d03663b9ff9e998e1d5839a