Skip to content

Commit

Permalink
bugfix for latest jax, clear_mem() was giving error
Browse files Browse the repository at this point in the history
  • Loading branch information
sokrypton authored Oct 9, 2022
1 parent 694c00b commit 2cb66db
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions colabdesign/shared/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ def clear_mem():
for obj_name in dir(module):
obj = getattr(module, obj_name)
if hasattr(obj, "cache_clear"):
obj.cache_clear()
try:
obj.cache_clear()
except:
pass
gc.collect()

def update_dict(D, *args, **kwargs):
Expand Down Expand Up @@ -116,4 +119,4 @@ def copy_missing(a,b):
if i not in b:
b[i] = v
elif isinstance(v,dict):
copy_missing(v,b[i])
copy_missing(v,b[i])

0 comments on commit 2cb66db

Please sign in to comment.