Compute type_equal() without reference to backend() (#53823)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/53823
Argument for correctness: type_equal previous compared if backends
are equal. Backend is computed by translation from dispatch key.
I verified that computeDispatchKey never computed a weird
dispatch key (e.g., AutogradXLA), so that dispatchKeyToBackend
was effectively injective. Then it is always valid to compare
the arguments of an injective function for equality, rather than
the output of the injective function.
Signed-off-by: Edward Z. Yang <ezyang@fb.com>
Test Plan: Imported from OSS
Reviewed By: mruberry
Differential Revision: D27036575
Pulled By: ezyang
fbshipit-source-id: 6aeafc89f287da0bc0065bd21c1adb5e272dbb81