Add std::variant backport as torch::variant
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/26836
Test Plan: Imported from OSS
Differential Revision: D17579439
Pulled By: yf225
fbshipit-source-id: 6416521047f5b93c01514e3cd153c9abc3ad3417