Eliminate exception throwing code from dispatch call sites (#32168)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/32168
We move the exception raising into the function, saving us a
big pile of instructions for raising the stack.
After this stack of changes, the compiler is willing to inline, e.g.,
`c10::KernelFunction::callUnboxed<at::Tensor, at::Tensor const&>(c10::OperatorHandle const&, at::Tensor const&) const::__func__`
(whereas previously it refused to do so.)
Signed-off-by: Edward Z. Yang <ezyang@fb.com>
Test Plan: Imported from OSS
Differential Revision: D19392948
Pulled By: ezyang
fbshipit-source-id: d5edab00cae48444b308e74438a17a421532c08f