Skip to content

Commit 76cdc32

Browse files
committed
Fixed deprecated .value usage failing CI tests
1 parent 09537f4 commit 76cdc32

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

flax/nnx/variablelib.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1712,25 +1712,25 @@ def __contains__(self, item) -> bool:
17121712

17131713
def __eq__(self, other) -> bool:
17141714
if isinstance(other, Variable):
1715-
other = other.value
1716-
return self.value.__eq__(other) # type: ignore
1715+
other = other[...]
1716+
return self[...].__eq__(other) # type: ignore
17171717

17181718
def __iadd__(self: V, other) -> V:
17191719
raise NotImplementedError(
17201720
'In-place operations are no longer supported for Variable.\n'
1721-
'Use `variable.value += x` instead.'
1721+
'Use `variable[...] += x` instead.'
17221722
)
17231723

17241724
def __isub__(self: V, other) -> V:
17251725
raise NotImplementedError(
17261726
'In-place operations are no longer supported for Variable.\n'
1727-
'Use `variable.value -= x` instead.'
1727+
'Use `variable[...] -= x` instead.'
17281728
)
17291729

17301730
def __imul__(self: V, other) -> V:
17311731
raise NotImplementedError(
17321732
'In-place operations are no longer supported for Variable.\n'
1733-
'Use `variable.value *= x` instead.'
1733+
'Use `variable[...] *= x` instead.'
17341734
)
17351735

17361736
def __imatmul__(self: V, other) -> V:

0 commit comments

Comments
 (0)