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() 獲取。