评价此页

torch.cuda.set_sync_debug_mode#

torch.cuda.set_sync_debug_mode(debug_mode)[源码]#

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

参数

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

警告

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