Skip to content

Commit 3687af0

Browse files
superbobryFlax Authors
authored andcommitted
Ensure that _hashable_filter does not convert strings to a tuple of letters
PiperOrigin-RevId: 588355403
1 parent 829e004 commit 3687af0

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

flax/core/lift.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1491,6 +1491,8 @@ def rematted(variable_groups, rng_groups, *args, **kwargs):
14911491

14921492
def _hashable_filter(x):
14931493
"""Hashable version of CollectionFilter."""
1494+
if isinstance(x, str):
1495+
return (x,)
14941496
if isinstance(x, Iterable):
14951497
return tuple(x) # convert un-hashable list & sets to tuple
14961498
if isinstance(x, DenyList):

0 commit comments

Comments
 (0)