Skip to content

Instantly share code, notes, and snippets.

@kylebgorman
Last active October 8, 2019 15:58
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kylebgorman/29d913dabf95d0f5590d652c31c3c29f to your computer and use it in GitHub Desktop.
Save kylebgorman/29d913dabf95d0f5590d652c31c3c29f to your computer and use it in GitHub Desktop.
Checks that PyTorch can reach CUDA
#!/usr/bin/env python
"""Checks that PyTorch can reach CUDA."""
import sys
import torch
if __name__ == "__main__":
if not torch.cuda.is_available():
print("FAIL", file=sys.stderr)
exit(1)
else:
print("OK", file=sys.stderr)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment