Skip to content

Instantly share code, notes, and snippets.

@npinto
Created June 29, 2011 23:32
Show Gist options
  • Save npinto/1055274 to your computer and use it in GitHub Desktop.
Save npinto/1055274 to your computer and use it in GitHub Desktop.
Joblib Bug when using Parallel and Memory(...).cache'd functions
from math import sqrt
from joblib import Memory, Parallel, delayed
mem = Memory('tmp')
@mem.cache
def sqrt2(v):
return sqrt(v)
print Parallel(n_jobs=4, verbose=True)(delayed(sqrt2)(i**2) for i in range(10))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment