Check all CUDA API calls for errors in torch/ (#81560)
Summary:
Original commit changeset: 0bb770d2cdb2
Original Phabricator Diff: D35194935 (https://github.com/pytorch/pytorch/commit/79e5b053b690852b21d881357904bc5a4438d95b)
Differential Revision: D35291874
Pull Request resolved: https://github.com/pytorch/pytorch/pull/81560
Approved by: https://github.com/ezyang