Migrate minall, max, maxall from THC to ATen and cleanup THC (#39029)
Summary:
Fixes https://github.com/pytorch/pytorch/issues/36900 fixes https://github.com/pytorch/pytorch/issues/24594
Pull Request resolved: https://github.com/pytorch/pytorch/pull/39029
Differential Revision: D21747599
Pulled By: ngimel
fbshipit-source-id: 9c18876f2ceb0e36db4e043acdb813bfe7ccf6d1