Fix CUDA memory usage for CPU only compile (#163841)
Summary:
Fixes #150622. Copy from https://github.com/pytorch/pytorch/pull/150669.
X-link: https://github.com/pytorch/pytorch/pull/163841
Approved by: https://github.com/leslie-fang-intel, https://github.com/jansel
Reviewed By: seemethere
Differential Revision: D93054349
fbshipit-source-id: e7d3b4992f1a35541657d3941191b4251c7c3d82
Author
generatedunixname499836121