Remove native_functions.yaml dependency from ScanKernels.cu (#66620)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/66620
This splits the Tensor-dependant code out into a cpp file.
A slight complicating factor is `scan_dim` using `copy_` to handle
non-contiguous out arguments. So, I've moved that code into the
caller which does introduce some duplication. Though it's only ~10
lines extra in total.
Test Plan: Imported from OSS
Reviewed By: VitalyFedyunin
Differential Revision: D31856106
Pulled By: dagitses
fbshipit-source-id: 91bb4ce5e7c6487e3ea0d5ec4d9f7a625d8ef978