[jit] Split Union type and Optional type to separate impl file. (#69483)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/69483
To avoid accidental linking to Union type and Optional type in Edge runtimes, we can separate these types into different files, so that we don't accidentally link with them in type.cpp.
ghstack-source-id: 146670525
Test Plan: just code move.
Reviewed By: ejguan
Differential Revision: D32264607
fbshipit-source-id: c60b6246f21f3eb0a67f827a9782f70ce5200da7