Add tests for CUDAFuture (#56518)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/56518
I don't think we have any tests for CUDAFuture (I couldn't find any, and I didn't write any in the past). I think especially for the two latest features added by this stack we should have a test to ensure they properly work and to catch regressions. (These tests also add indirect coverage for the more "basic" features of CUDAFuture).
I didn't know how/where to add tests for C++ ATen stuff, so instead I added these tests to the Python RPC suite, using the torch.futures.Future wrapper. (It made sense in my mind because RPC is the main user of CUDAFuture). I'll gladly accept pointers to better ways of doing this.
ghstack-source-id: 127295022
Test Plan: The tests themselves.
Reviewed By: mrshenli
Differential Revision: D27887191
fbshipit-source-id: 4ad6d81e676fe486aa8d329591ee1a3818fea059