You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We've had some great success with dask for simple single-machine parallelization. I think the current version uses something a bit problematic right, requiring the script to be in a main section right? Dask does not require any of this.
The text was updated successfully, but these errors were encountered:
We've been using it to do operations in chunks, like this:
importnumpyasnpfromdaskimportdelayed, compute# This decorator tells dask to delay computation of this function@delayeddefsumnums(arr, num):
arr=arr+numreturnarrarr=np.zeros([20, 20])
res= []
forchunkinnp.split(arr, 2):
# This loop creates a list of 'delayed' functionsres.append(sumnums(chunk, 1))
temp=compute(res) # Here we tell dask to actually do the calc, in parallelnew_arr=np.vstack(temp[0]) # Now we massage the result back into an arrayassertnp.all(new_arr.shape==arr.shape)
We've had some great success with dask for simple single-machine parallelization. I think the current version uses something a bit problematic right, requiring the script to be in a main section right? Dask does not require any of this.
The text was updated successfully, but these errors were encountered: