评价此页

torch.set_num_threads#

torch.set_num_threads(int)#

设置 CPU 上用于内部并行化的线程数。

警告

为确保使用正确的线程数,必须在运行 Eager、JIT 或 Autograd 代码之前调用 set_num_threads。