Skip to content

Commit

Permalink
improve readme
Browse files Browse the repository at this point in the history
  • Loading branch information
cgarciae committed Feb 21, 2023
1 parent f304457 commit 08a9635
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ foo = jax.tree_map(lambda x: -x, foo) # y is not modified
assert foo.x == -1 and foo.y == 2
```

Static fields are not included in the pytree leaves, they
are passed as pytree metadata instead.

### Dataclasses
You can seamlessly use the `dataclasses.dataclass` decorator with `Pytree` classes.
Since `static_field` returns instances of `dataclasses.Field` these it will work as expected:
Expand Down

0 comments on commit 08a9635

Please sign in to comment.