Fix cuda/cpu check on NoneType (Unit test) (#88970)
Summary: Fix cuda/cpu check on NoneType (unit test)
Test Plan: sabdcastle/ github CI/CD
Differential Revision: D41208798
Pull Request resolved: https://github.com/pytorch/pytorch/pull/88970
Approved by: https://github.com/Skylion007, https://github.com/cpuhrsch