Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

torch.cuda.is_available bug #35

Closed
glenn-jocher opened this issue Jun 12, 2018 · 2 comments
Closed

torch.cuda.is_available bug #35

glenn-jocher opened this issue Jun 12, 2018 · 2 comments

Comments

@glenn-jocher
Copy link

glenn-jocher commented Jun 12, 2018

test.py and train.py always return cuda = True because boolean is reflecting function presence rather than cuda presence. Also redundant if statement. Suggest replace
cuda = True if torch.cuda.is_available else False

with
cuda = torch.cuda.is_available()

@alexandru-dinu
Copy link

If you want to be extra pedantic, I'd also suggest to add:

cuda = args.use_cuda and torch.cuda.is_available()

@eriklindernoren
Copy link
Owner

This is resolved in 84f3e13

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants