Skip to content

Commit

Permalink
fixing recursion error
Browse files Browse the repository at this point in the history
  • Loading branch information
azrael417 committed Jan 22, 2025
1 parent 0a747ed commit d21c412
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions torch_harmonics/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#

from functools import lru_cache
import functools
from copy import deepcopy

# copying LRU cache decorator a la:
# https://stackoverflow.com/questions/54909357/how-to-get-functools-lru-cache-to-return-new-instances
def lru_cache(maxsize=20, typed=False, copy=False):
def decorator(f):
cached_func = lru_cache(maxsize=maxsize, typed=typed)(f)
cached_func = functools.lru_cache(maxsize=maxsize, typed=typed)(f)
def wrapper(*args, **kwargs):
res = cached_func(*args, **kwargs)
if copy:
Expand Down

0 comments on commit d21c412

Please sign in to comment.