Skip to content

Commit f20b375

Browse files
fix(qwix): Remove explicit leaf assignment
1 parent 741c59f commit f20b375

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

src/maxtext/layers/nnx_wrappers.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,7 @@ def maybe_unbox(x):
496496

497497
if unknown_state_flat:
498498
paths_str = ""
499-
for path, value_state in unknown_state_flat.items():
499+
for path, _ in unknown_state_flat.items():
500500
paths_str += f"\n - {'/'.join(map(str, path))}"
501501

502502
# Dynamically reconstruct the unknown variables
@@ -505,10 +505,8 @@ def maybe_unbox(x):
505505
if not hasattr(curr, p):
506506
setattr(curr, p, nnx.Module())
507507
curr = getattr(curr, p)
508-
if not hasattr(curr, path[-1]):
509-
setattr(curr, path[-1], value_state.type(value_state.value))
510508

511-
warnings.warn(f"Found unknown module paths in incoming state:{paths_str}. They have been dynamically reconstructed.")
509+
warnings.warn(f"Found unknown module paths in incoming state:{paths_str}. Intermediate modules have been reconstructed.")
512510

513511
nnx.update(module, new_state)
514512
_refresh_variable_trace_state(module)

0 commit comments

Comments
 (0)