库multprocesing是否可以在sagemaker conda-python3上运行?

时间:2019-05-22 19:49:24

标签: python-3.x python-multiprocessing amazon-sagemaker

库Multprocesing在sagemaker conda-python3上是否工作正常?

1 个答案:

答案 0 :(得分:0)

这当然取决于您要考虑的用例,但是通常对于pool中的multiprocessing的函数的并行处理,它很好用,我经常使用它。例如:

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()