[Pytorch] Add basic c10::optional tests (#47014)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/47014
Some tests are better than zero tests.
ghstack-source-id: 115769678
Test Plan: Run new tests, passes
Reviewed By: smessmer
Differential Revision: D24558649
fbshipit-source-id: 50b8872f4f15c9a6e1f39b945124a31b57dd61d9