gate static aten registerer with USE_STATIC_DISPATCH (#25815)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/25815
Don't need call these global registerers when USE_STATIC_DISPATCH is
set as they will keep all aten functions at link time.
Should solely rely on jit/generated/register_aten_ops* to keep "interface"
aten functions (which are directly called from JIT), and rely on
STATIC_DISPATCH + linker to keep all other aten functions that are
transitively needed by the "interface" functions.
Test Plan:
- build and run in the demo app;
- with stacked diff to shrink registered "interface" functions, linker
can strip out unused aten implementations;
Differential Revision: D17247236
Pulled By: ljk53
fbshipit-source-id: 1feb5fbb8b9cfa057b9ba8bf3f2967f40980c917