From 42c53aba0c94e2c8d58f0205492f5b87b1bee0c6 Mon Sep 17 00:00:00 2001 From: Yossi Biton Date: Wed, 9 Sep 2020 11:21:31 +0300 Subject: [PATCH] better way to check if GPU is available or not during installation --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 7832e8a..8e83acb 100644 --- a/setup.py +++ b/setup.py @@ -22,7 +22,7 @@ def find_sources(root_dir, with_cuda=True): with open(path.join(here, "README.md"), encoding="utf-8") as f: long_description = f.read() -if torch.has_cuda: +if torch.cuda.is_available(): ext_modules = [ CUDAExtension( name="inplace_abn._backend",