Download Latest Version 0.12.0 source code.tar.gz (5.0 MB)
Email in envelope

Get an email when there's a new version of Flax

Home / v0.11.2
Name Modified Size InfoDownloads / Week
Parent folder
0.11.2 source code.tar.gz 2025-08-28 5.2 MB
0.11.2 source code.zip 2025-08-28 5.6 MB
README.md 2025-08-28 3.9 kB
Totals: 3 Items   10.8 MB 0

What's Changed

nnx.merge now doesn't create a copy of the Variables in the incoming states by default, meaning that the new merged structures holds references to the incoming Variables. This enables new patterns, for example its now possible to create models with the same state but with different runtime behavior:

:::python
model = SomeModel(...)
# create eval model
eval_model = nnx.merge(*nnx.split(model))  # same Variables, different structure
eval_model.eval()

model and eval_model share the same Variables and are therefore kept in sync but have different runtime behavior, this avoids having to constantly mutate a single model back and forth between different runtime modes which can be error prone / cause unwanted recompilation.

To keep the old behavior use nnx.merge(..., copy=True).

PRs

New Contributors

Full Changelog: https://github.com/google/flax/compare/v0.11.1...v0.11.2

Source: README.md, updated 2025-08-28