-a, b = torch.rand(d1, d2).to(device), torch.rand(d2, d3).to(device)
-
-sync
-start_time = time.perf_counter()
-for k in range(nb_runs):
- c = a @ b
-sync
-duration = time.perf_counter() - start_time
+for t in [ torch.float32, torch.float16 ]:
+ a = torch.rand(d1, d2, device = device, dtype = t)
+ b = torch.rand(d2, d3, device = device, dtype = t)