torch.set_num_threads¶ torch.set_num_threads(int)¶ 设置用于 CPU 上 intraop 并行性的线程数。 警告 为确保使用正确数量的线程,必须在运行 eager、JIT 或 autograd 代码之前调用 set_num_threads。