库多进程在sagemaker conda-python3上运行良好吗?
发布于 2019-05-23 05:19:00
这当然取决于您脑海中的用例,但通常对于使用来自multiprocessing
的pool
的函数的并行处理,它工作得很好,我经常使用它。例如:
import multiprocessing as mp
pool = mp.Pool(mp.cpu_count())
# f is your function and L the list of items you want to apply f to
result = pool.map(f, L)
pool.quit()
pool.join()
https://stackoverflow.com/questions/56263995
复制相似问题