Skip to content

Instantly share code, notes, and snippets.

@maxfil333
Created July 16, 2024 06:57
Show Gist options
  • Save maxfil333/7739c702b9725e41a41c7e47f1ec38b5 to your computer and use it in GitHub Desktop.
Save maxfil333/7739c702b9725e41a41c7e47f1ec38b5 to your computer and use it in GitHub Desktop.
from time import perf_counter
import torch
device = 'cpu' # cpu
a = torch.randn(7000,5000).to(device)
b = torch.randn(5000,7000).to(device)
print(a.device, b.device)
start = perf_counter()
a @ b
print(perf_counter() - start)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment