Skip to content

Conversation

@copybara-service
Copy link

maintain data/static definition in split / state

nnx.graph APIs now follow the data / static definitions for nnx.Pytree instances. Previously nnx.graph.flatten match the default definitions for Pytree most of the time but deviated on edcases, now they always match. Example

    class Foo(nnx.Pytree):
      def __init__(self, data, static):
        self.data = nnx.data(data)
        self.static = nnx.static(static)

    tree = Foo(1, 2)
    state = nnx.state(tree)

    # previously this was false
    assert 'data' in state

@copybara-service copybara-service bot force-pushed the test_866680531 branch 3 times, most recently from 323edee to de71485 Compare February 10, 2026 19:05
`nnx.graph` APIs now follow the data / static definitions for `nnx.Pytree` instances. Previously `nnx.graph.flatten` match the default definitions for Pytree most of the time but deviated on edcases, now they always match. Example

```python
    class Foo(nnx.Pytree):
      def __init__(self, data, static):
        self.data = nnx.data(data)
        self.static = nnx.static(static)

    tree = Foo(1, 2)
    state = nnx.state(tree)

    # previously this was false
    assert 'data' in state
```

PiperOrigin-RevId: 868239931
@copybara-service copybara-service bot merged commit 404a420 into main Feb 10, 2026
@copybara-service copybara-service bot deleted the test_866680531 branch February 10, 2026 19:26
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.

0 participants