Refactor jit::Operator to more clearly distinguish the two possible states (#33905)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/33905
jit::Operator is semantically either a c10 op or a jit-only op but that is represented in a set of member variables with intricate invariants about their values.
Making this explicitly represented in a c10::either reduces the number of possible states, removing many of the invalid ones.
Similarly, if it is a jit-only op, there were schema_string_ and schema_ of which only one could be set at any time. Using a c10::either there too.
ghstack-source-id: 102084054
Test Plan: unit tests
Differential Revision: D20147487
fbshipit-source-id: 50ce10b56f2b1f51c8279cef03077c861db3eaac