diff --git a/tests/test_optim.py b/tests/test_optim.py index 2b53a6c3..38f625fb 100644 --- a/tests/test_optim.py +++ b/tests/test_optim.py @@ -106,7 +106,7 @@ def _test_state_dict(weight, bias, input, constructor): # to a different type and move to a different device. if torch_device == 'cpu': return - elif torch_device == 'cuda' and not torch.cuda.is_available: + elif torch_device == 'cuda' and not torch.cuda.is_available(): return with torch.no_grad():