Add some missing cuda guards (#62100)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/62100
Test Plan: Sandcastle
Reviewed By: ngimel
Differential Revision: D29880330
fbshipit-source-id: 7089000ccbcaa70a13f0ab4531b032bd5326e539