torch.get_num_threads()
返回用于并行化 CPU 操作的线程数,Paddle 无此 API,需要组合实现。
# PyTorch 写法 torch.get_num_threads() # Paddle 写法 os.environ['CPU_NUM']