Created
May 22, 2020 20:15
-
-
Save karanpathak/5b8b135dd346d1ca040537383e72b366 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
# Create a new cache directory | |
cache_dir2 = "<path-to-your-directory>/sample_cache_dir2" | |
memory2 = Memory(cache_dir2, mmap_mode='c') | |
# Pass function to Memory.cache | |
@memory2.cache(verbose=0) | |
def func_memmap(x): | |
print("Example of Computationally intensive function!") | |
print("The result is not cached for this particular input") | |
sleep(4.0) | |
return np.square(x) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment