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