8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9b06b30 commit ddaace6Copy full SHA for ddaace6
torch/utils/benchmark/utils/timer.py
@@ -17,6 +17,10 @@
17
def timer() -> float:
18
torch.cuda.synchronize()
19
return timeit.default_timer()
20
+elif torch.xpu.is_available():
21
+ def timer() -> float:
22
+ torch.xpu.synchronize()
23
+ return timeit.default_timer()
24
elif torch._C._get_privateuse1_backend_name() != "privateuseone":
25
privateuse1_device_handler = getattr(torch, torch._C._get_privateuse1_backend_name(), None) \
26
if torch._C._get_privateuse1_backend_name() != "cpu" else None
0 commit comments