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,則對非確定性操作報錯。