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
3 changes: 3 additions & 0 deletions test/contrib/test_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,9 @@ def nnx_model_eager(x, y):
@pytest.mark.parametrize(
argnames="batchnorm", argvalues=[True, False], ids=["batchnorm", "no_batchnorm"]
)
@pytest.mark.xfail(
reason="Temporary marking to pass CI. Bug fixed in https://github.com/pyro-ppl/numpyro/pull/2067"
)
def test_nnx_state_dropout_smoke(dropout, batchnorm):
from flax import nnx

Expand Down
8 changes: 7 additions & 1 deletion test/test_distributions.py
Original file line number Diff line number Diff line change
Expand Up @@ -1605,7 +1605,13 @@ def test_entropy_samples(jax_dist, sp_dist, params):
samples = jax_dist.sample(jax.random.key(8), (1000,))
neg_log_probs = -jax_dist.log_prob(samples)
mean = neg_log_probs.mean(axis=0)
stderr = neg_log_probs.std(axis=0) / jnp.sqrt(neg_log_probs.shape[-1] - 1)
neg_log_probs_std = neg_log_probs.std(axis=0)
safe_neg_log_probs_std = jnp.where(
jnp.equal(neg_log_probs_std, 0.0),
jnp.finfo(jnp.result_type(float)).tiny,
neg_log_probs_std,
)
stderr = safe_neg_log_probs_std / jnp.sqrt(neg_log_probs.shape[-1] - 1)
z = (actual - mean) / stderr

# Check the z-score is small or that all values are close. This happens, for
Expand Down