Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@cgarciae
Copy link
Collaborator

@cgarciae cgarciae commented Sep 18, 2025

What does this PR do?

  • Variable(..., is_hijax=True) can now be used to HijaxVariable instances, which is type registered in the new Hijax system. HijaxVariable is a Mutable Hijax type meaning its instances will automatically propagate state through JAX transforms in a similar manner to jax.Ref.

  • nnx.using_refs and nnx.use_refs were dropped in favor of nnx.using_hijax and nnx.use_hijax.

  • Variable(..., is_mutable=False) can now be used to disallow any form of updates on the Variable instances. When is_mutable=False then neither is_hijax=True or has_ref=True are allowed.

  • Added APIs to create an updated copy of a Variable or structure of Variables with a new value for is_hijax, has_ref, or is_mutable:

    • as_immutable_vars: create copies of Variables with is_mutable set to False. is_hijax or had_ref will be set to False as well if they had been active.
    • as_mutable_vars: create copies of Variables with is_mutable set to True. is_hijax or had_ref will be set back to True if they had been if as_immutable_vars as previously set them to False.
    • as_hijax_vars: create copies of Variables with is_hijax set to True.
    • as_pytree_vars: create copies of Variables with is_hijax set to False.
    • as_ref_vars: create copies of Variables with has_ref set to True.
    • as_array_vars: create copies of Variables with has_ref set to False.

    Note: there is currently some coupling between is_hijax, has_ref, or is_mutable which will be removed in the near future as HijaxVariable improves.

@cgarciae cgarciae changed the base branch from main to fix-rngs-fork September 18, 2025 14:47
Base automatically changed from fix-rngs-fork to main September 18, 2025 22:33
@cgarciae cgarciae force-pushed the hijax-variable branch 4 times, most recently from a1b732e to de6bf6e Compare September 19, 2025 18:48
@cgarciae cgarciae changed the base branch from main to get-set-metadata September 19, 2025 19:09
@cgarciae cgarciae force-pushed the hijax-variable branch 7 times, most recently from 9740363 to f53986d Compare September 23, 2025 18:27
@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@cgarciae cgarciae force-pushed the hijax-variable branch 2 times, most recently from 0f512a6 to dca0349 Compare September 25, 2025 00:46
Base automatically changed from get-set-metadata to main September 25, 2025 22:39
@cgarciae cgarciae force-pushed the hijax-variable branch 2 times, most recently from fc3f617 to 8ffcc06 Compare September 26, 2025 19:44
@cgarciae cgarciae changed the base branch from main to no-setattr-metadata September 26, 2025 19:48
@cgarciae cgarciae force-pushed the no-setattr-metadata branch from 777a8e1 to c23304d Compare October 1, 2025 22:15
@cgarciae cgarciae changed the base branch from no-setattr-metadata to no-setattr-metadata-p2 October 1, 2025 22:33
@cgarciae cgarciae force-pushed the hijax-variable branch 4 times, most recently from b200679 to bd00f40 Compare October 3, 2025 01:38
@cgarciae cgarciae force-pushed the hijax-variable branch 14 times, most recently from d3b8a8e to 2ccb850 Compare October 20, 2025 17:24
@cgarciae cgarciae force-pushed the hijax-variable branch 13 times, most recently from 1f9fa0e to 803cd5d Compare October 27, 2025 21:45
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.

3 participants