Makes test_type_promotion generic (#29417)
Summary:
Test type promotion was already running on CUDA with its own (tiny) version of a generic test framework. This PR makes it use the actual generic test framework.
In addition, the tests previously set the default dtype (and did not reset it). A new decorator replaces the previous style and resets the default dtype after each test. This is still not thread-safe, but at least there's a comment to that effect now.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/29417
Differential Revision: D18514545
Pulled By: mruberry
fbshipit-source-id: 5aad43481ae71124cba99fb2e4a946894f591d68