fix breakage from #99027 (#99245)
fix breakage from #99027
Summary:
There is a conditional branch that is not tested by OSS CI.
Test Plan: Run nightly binary builds that include CUDA-12
Pull Request resolved: https://github.com/pytorch/pytorch/pull/99245
Approved by: https://github.com/Skylion007, https://github.com/malfet, https://github.com/jansel, https://github.com/mihaimaruseac