Skip to content

Commit

Permalink
Update usage of soon-to-be deprecated Chex assertions (#560)
Browse files Browse the repository at this point in the history
  • Loading branch information
junpenglao committed Jul 19, 2023
1 parent cf94b27 commit 1817ee9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion tests/mcmc/test_integrators.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ def test_integrator(self, example_name, integrator_name):
)

# We make sure that the particle moved from its initial position.
chex.assert_tree_all_close(final_state.position, example["q_final"], atol=1e-2)
chex.assert_trees_all_close(final_state.position, example["q_final"], atol=1e-2)

# We now check the conservation of energy, the property that matters the most in HMC.
energy = -neg_potential(q) + kinetic_energy(p)
Expand Down
4 changes: 2 additions & 2 deletions tests/mcmc/test_latent_gaussian.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@ def body(carry, key):
np.zeros((D,)), C, obs, R
)

chex.assert_tree_all_close(
chex.assert_trees_all_close(
np.mean(states.position, 0), expected_mean, atol=1e-1, rtol=1e-2
)
chex.assert_tree_all_close(
chex.assert_trees_all_close(
np.cov(states.position, rowvar=False), expected_cov, atol=1e-1, rtol=1e-1
)

Expand Down

0 comments on commit 1817ee9

Please sign in to comment.