Skip to content
Merged
Show file tree
Hide file tree
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
104 changes: 57 additions & 47 deletions notebooks/source/nnx_example.ipynb

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion numpyro/infer/svi.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def _make_loss_fn(
):
def loss_fn(params):
params = constrain_fn(params)
if mutable_state is not None:
if jax.tree.leaves(mutable_state):
params.update(jax.lax.stop_gradient(mutable_state))
result = elbo.loss_with_mutable_state(
rng_key, params, model, guide, *args, **kwargs, **static_kwargs
Expand Down