Skip to content

Instantly share code, notes, and snippets.

@williamFalcon
Created July 29, 2019 17:48
Show Gist options
  • Save williamFalcon/db7f6fb0d46db405b3470982836237d7 to your computer and use it in GitHub Desktop.
Save williamFalcon/db7f6fb0d46db405b3470982836237d7 to your computer and use it in GitHub Desktop.
# put model on GPU
model.cuda(0)
# put data on gpu (cuda on a variable returns a cuda copy)
x = x.cuda(0)
# runs on GPU now
model(x)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment