评价此页

torch.cuda.set_sync_debug_mode#

torch.cuda.set_sync_debug_mode(debug_mode)[source]#

设置 CUDA 同步操作的调试模式。

参数

debug_mode (strint) – 如果是“default”或 0,则在同步操作时不出错或不警告;如果是“warn”或 1,则在同步操作时发出警告;如果是“error”或 2,则在同步操作时出错。

警告

这是一个实验性功能,并非所有同步操作都会触发警告或错误。特别是,torch.distributed 和 torch.sparse 命名空间中的操作尚未涵盖。