Introduce LegacyTHDispatcher for dispatching to TH functions. (#14754)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/14754
This isn't hooked up to anything yet, this is just putting the skeleton in place.
The idea here is that the functions generated via Declarations.cwrap and nn.yaml are not actually operators, they are implementation details of operators, and thus don't need to participate in VariableType, JIT dispatch generation.
So, we will split these functions out from the usual Type/operator hierarchy; for now the dispatch will be done by a Type-like class called LegacyTHDispatcher. Once this is done this probably means we can collapse Type to be backend-specific, not Type/ScalarType specific, because all the ScalarType specific code will live in the LegacyTHDispatcher.
Reviewed By: ezyang
Differential Revision:
D13321605
fbshipit-source-id:
25d1bbc9827a42d6ab5d69aabbad3eac72bf364c