torch.set_num_threads(int)
设置用于 CPU 上的内部操作并行性的线程数,Paddle 无此 API,需要组合实现。
# PyTorch 写法 torch.set_num_threads(2) # Paddle 写法 os.environ['CPU_NUM'] = '2'