Refactor dispatch structure so fallback code lives inline. (#26367)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/26367
This is necessary for boxed fallback, as boxed fallback must
live inside the templated code. Error reporting code never
has to be in templated code, so that stays in the C++ file.
Signed-off-by: Edward Z. Yang <ezyang@fb.com>
Test Plan: Imported from OSS
Differential Revision: D17448556
Pulled By: ezyang
fbshipit-source-id: 8244589251e359886dbfcd1c306ae6c033c7a222