Skip to content

Consolidate "view" functions with similar naming convention.#5376

Open
samanklesaria wants to merge 3 commits intogoogle:mainfrom
samanklesaria:view_renames
Open

Consolidate "view" functions with similar naming convention.#5376
samanklesaria wants to merge 3 commits intogoogle:mainfrom
samanklesaria:view_renames

Conversation

@samanklesaria
Copy link
Copy Markdown
Collaborator

This PR standardizes the naming conventions around NNX views, unifying behavior when possible. Ideally all view API names would now have a with_ or as_ prefix. Additionally all view functions will expose an only argument that accepts a filter, be implemented using nnx.map or nnx.recursive_map, and expose a graph argument.

Modified functions:

vars_as -> with_vars
view -> with_modules
pure -> as_pure
abstract_with_sharding -> as_abstract

@review-notebook-app
Copy link
Copy Markdown

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@vfdev-5
Copy link
Copy Markdown
Collaborator

vfdev-5 commented Mar 26, 2026

This is a BC-breaking change and I think we have stable releases with these functions. It would be better to go with deprecation cycle instead of just renaming ?

@samanklesaria
Copy link
Copy Markdown
Collaborator Author

@vfdev-5 true. @cgarciae argued for the renames, but we should keep the old names around with deprecations for a cycle.

@samanklesaria samanklesaria marked this pull request as ready for review March 27, 2026 20:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants