Skip to content

Instantly share code, notes, and snippets.

@ruotianluo
Created August 8, 2017 05:35
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 ruotianluo/3dc48899570a9ff7131788b714bdd9d0 to your computer and use it in GitHub Desktop.
Save ruotianluo/3dc48899570a9ff7131788b714bdd9d0 to your computer and use it in GitHub Desktop.
temp
import torch
import time
def timeit():
torch.cuda.synchronize()
start = time.time()
x = torch.cuda.FloatTensor(10000,10000)
torch.cuda.synchronize()
print(time.time() - start)
return x
y = timeit() #400m slow
y1 = timeit() #800m slow
del y1
y1 = timeit() #800m quick
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment