Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add detail to make_with_state doc. #846

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion equinox/nn/_stateful.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,8 @@ def make_with_state(make_model: Callable[_P, _T]) -> Callable[_P, tuple[_T, Stat

`eqx.nn.make_with_state(Model)(*args, **kwargs)` simply calls
`model_with_state = Model(*args, **kwargs)`, and then partitions the resulting
PyTree into two pieces: the parameters, and the state.
PyTree into two pieces: the parameters, and the state, then calls
[`equinox.nn.delete_init_state`][] on the parameters.

**Arguments:**

Expand All @@ -344,6 +345,9 @@ def make_with_state(make_model: Callable[_P, _T]) -> Callable[_P, tuple[_T, Stat

```python
class Model(eqx.Module):
some_state_index: eqx.nn.StateIndex
...

def __init__(self, foo, bar):
...

Expand Down
Loading