Skip to content

Instantly share code, notes, and snippets.

@aurora1625
Created March 2, 2020 07:55
Show Gist options
  • Save aurora1625/ff190da541ddba162abba6cf8147ba4a to your computer and use it in GitHub Desktop.
Save aurora1625/ff190da541ddba162abba6cf8147ba4a to your computer and use it in GitHub Desktop.
Pytorch
# PyTorch device
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
X = torch.randn(n_points, 2).to(device)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment