Skip to content

Commit 2cb66db

Browse files
authored
bugfix for latest jax, clear_mem() was giving error
1 parent 694c00b commit 2cb66db

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

colabdesign/shared/utils.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,10 @@ def clear_mem():
1919
for obj_name in dir(module):
2020
obj = getattr(module, obj_name)
2121
if hasattr(obj, "cache_clear"):
22-
obj.cache_clear()
22+
try:
23+
obj.cache_clear()
24+
except:
25+
pass
2326
gc.collect()
2427

2528
def update_dict(D, *args, **kwargs):
@@ -116,4 +119,4 @@ def copy_missing(a,b):
116119
if i not in b:
117120
b[i] = v
118121
elif isinstance(v,dict):
119-
copy_missing(v,b[i])
122+
copy_missing(v,b[i])

0 commit comments

Comments
 (0)