Reduce code duplication in OperatorEntry by keying hash map on optional<DispatchKey> (#33817)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/33817
Then, nullopt denotes catch all, whereas everything else is specific to
a DispatchKey. I can delete the second copy of methods when I do this.
This refactor should be pushed all the way to the frontend but I am doing
it one step at a time.
Signed-off-by: Edward Z. Yang <ezyang@fb.com>
Test Plan: Imported from OSS
Differential Revision: D20125163
Pulled By: ezyang
fbshipit-source-id: 026075a4bab81b0bd88b07f0800f6e6bbeb2166a