torch.cuda.synchronize¶
- torch.cuda.synchronize(device=None)[source][source]¶
等待 CUDA 裝置上所有流中的所有核心完成。
- 引數
device (torch.device 或 int, 可選) – 指定要同步的裝置。如果
device為None(預設),則使用current_device()返回的當前裝置。
等待 CUDA 裝置上所有流中的所有核心完成。
device (torch.device 或 int, 可選) – 指定要同步的裝置。如果 device 為 None (預設),則使用 current_device() 返回的當前裝置。