torch.set_deterministic_debug_mode¶ torch.set_deterministic_debug_mode(debug_mode)[原始碼][原始碼]¶ 設定決定性運算的偵錯模式。 注意 這是 torch.use_deterministic_algorithms() 的替代介面。有關受影響運算的詳細資訊,請參閱該函數的文件。 參數 debug_mode (str 或 int) – 如果是「default」或 0,則在非決定性運算時不產生錯誤或警告。 如果是「warn」或 1,則在非決定性運算時發出警告。如果是「error」或 2,則在非決定性運算時產生錯誤。