Created
December 12, 2019 09:29
-
-
Save nithyadurai87/8eebce687ba439cd9b9691383c780dbe to your computer and use it in GitHub Desktop.
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 time | |
import torch | |
a = torch.rand(10000,10000) | |
b = torch.rand(10000,10000) | |
start = time.time() | |
a.matmul(b) | |
end = time.time() | |
print("{} seconds".format(end - start)) | |
print (torch.cuda.is_available()) | |
a = a.cuda() | |
b = b.cuda() | |
start = time.time() | |
a.matmul(b) | |
end = time.time() | |
print("{} seconds".format(end – start)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment