[resubmit] Use TensorMethods.cpp (#39385)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/39385
see https://github.com/pytorch/pytorch/pull/37639
Test Plan:
https://github.com/pytorch/pytorch/pull/37639
Imported from OSS
Differential Revision: D21833287
fbshipit-source-id: 9928d3f4122903d0de67ad312e349352d5f5c19c