torch.xpu.synchronize
- torch.xpu.synchronize(device=None)[源代码]
-
等待XPU设备上所有流中的所有内核完成执行。
- 参数
-
device (torch.device 或 int, 可选) – 同步的目标设备。如果
device
为None
(默认值),则使用当前设备,即由current_device()
给出的设备。
等待XPU设备上所有流中的所有内核完成执行。
device (torch.device 或 int, 可选) – 同步的目标设备。如果 device
为 None
(默认值),则使用当前设备,即由 current_device()
给出的设备。