Created
August 8, 2017 05:35
-
-
Save ruotianluo/3dc48899570a9ff7131788b714bdd9d0 to your computer and use it in GitHub Desktop.
temp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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