Skip to content

Instantly share code, notes, and snippets.

@karanpathak
Last active May 23, 2020 11:25
# Define our function
def func(x):
print("Example of Computationally intensive function!")
print("The result is not cached for this particular input")
sleep(4.0)
return np.square(x)
# Pass it to Memory.cache method
func_mem = mem.cache(func, verbose=0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment