j-towns / craystack

Compression tools for machine learning researchers
Other
82 stars 8 forks source link

Fix LRU-Cache decorator usage #12

Closed Conzel closed 3 years ago

Conzel commented 3 years ago

Only writing "@lru_cache" over a function f causes python to call the decorator with "@lru_cache(f)", which results in the decorator assuming f to be the max_size argument.

More can be read here: https://stackoverflow.com/questions/47218313/use-functools-lru-cache-without-specifying-maxsize-parameter

This fixes a problem with the HiLLoC Notebook, where the 5th cell does not run due to the error described above: https://colab.research.google.com/drive/11967hjFQczjW21cLLTFhOnTurx3mSBVD#scrollTo=YxbS0ywnKKIg

Tests and example run as before :)

j-towns commented 3 years ago

Thanks! Sorry i took so long to get to this.