Check all CUDA API calls for errors in torch/ (#74923)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/74923
Test Plan: Sandcastle
Reviewed By: malfet
Differential Revision: D35194935
fbshipit-source-id: f5ec5be87cdf775eb9c99f8c3baed6b0366dda49
(cherry picked from commit 7284c4ed7d57261d4936055e0c1a3f8f911fb1f0)