torch.set_num_interop_threads torch.set_num_interop_threads(int) 设置CPU上用于互操作并行性的线程数量,例如在JIT解释器中。 警告 只能在任何互操作并行工作启动之前(例如 JIT 执行)调用一次。