Reland hardtanh ref (again) (#78914)
Fixes land race between https://github.com/pytorch/pytorch/commit/823ddb6e87e8111c9b5a99523503172e5bf62c49 and Ed's stack.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/78914
Approved by: https://github.com/wanchaol