torch.set_num_threads¶ torch.set_num_threads(int)¶ 設定 CPU 上用於運算內平行處理的線程數。 警告 為了確保使用正確的線程數,必須在執行 eager、JIT 或 autograd 程式碼之前呼叫 set_num_threads。