Skip to content

Instantly share code, notes, and snippets.

@williamFalcon
Created July 29, 2019 17:48
Show Gist options
  • Save williamFalcon/968be4bb04b036112df2a7002b5b1741 to your computer and use it in GitHub Desktop.
Save williamFalcon/968be4bb04b036112df2a7002b5b1741 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