Last active
May 23, 2020 11:25
-
-
Save karanpathak/5e82fdfa9a0ac8edcbb7c2926f90ff4e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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