Skip to content

Instantly share code, notes, and snippets.

@omarsar
Created December 29, 2019 15:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save omarsar/03e70e7756c9b381a78ec7d6ef96fbc6 to your computer and use it in GitHub Desktop.
Save omarsar/03e70e7756c9b381a78ec7d6ef96fbc6 to your computer and use it in GitHub Desktop.
## configuration to detect cuda or cpu
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
print (device)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment