_대문 | 방명록 | 최근글 | 홈피소개 | 주인놈
FrontPage › 병렬처리예제

참고: https://blog.dominodatalab.com/simple-parallelization/
from joblib import Parallel, delayed
import multiprocessing
     
# what are your inputs, and what operation do you want to 
# perform on each input. For example...
L1 = [1,2,3,4]
L2 = [5,6,7,8]
def processInput(i, j):
    return i * i + j
 
num_cores = multiprocessing.cpu_count()
results = Parallel(n_jobs=num_cores)(delayed(processInput)(i,j) for i,j in tuple(zip(L1, L2)))

댓글 남기기..
이름: : 오른쪽의 새로고침을 클릭해 주세요. 새로고침
EditText : Print : Mobile : FindPage : DeletePage : LikePages : Powered by MoniWiki : Last modified 2019-02-18 09:06:57

사랑은 서로를 마주 보는 것이 아니라 함께 같은 방향을 보는 것이다. (생텍쥐페리)