torch.cuda.set_sync_debug_mode¶ torch.cuda.set_sync_debug_mode(debug_mode)[原始碼][原始碼]¶ 設定 cuda 同步操作的偵錯模式。 參數 debug_mode (str 或 int) – 如果是 “default” 或 0,則同步操作不產生錯誤或警告;如果是 “warn” 或 1,則同步操作會產生警告;如果是 “error” 或 2,則同步操作會產生錯誤。 警告 這是一項實驗性功能,並非所有同步操作都會觸發警告或錯誤。 特別是,torch.distributed 和 torch.sparse 命名空間中的操作尚未涵蓋。