Skip to content

Conversation

@samanklesaria
Copy link
Collaborator

Closes #4943

Copy link
Collaborator

@vfdev-5 vfdev-5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!
I left few comments for improvements.
Apply the comments to both nnx.iter_modules and nnx.iter_children.
Please also expose new methods in the docs_nnx: https://github.com/google/flax/blob/main/docs_nnx/api_reference/flax.nnx/module.rst
and also in __init__ to be addressable as nnx.*.

However, we should confirm the submodule where to put these methods.
@cgarciae flax/nnx/module.py is ok or in graph.py ?

@cgarciae
Copy link
Collaborator

@vfdev-5 I think they should remain in module.py.

Copy link
Collaborator

@vfdev-5 vfdev-5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks @samanklesaria

@copybara-service copybara-service bot merged commit 771eadb into google:main Oct 3, 2025
14 of 15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make functional versions of iter_modules and iter_children and deprecate them as nnx.Module methods

3 participants