Skip to content

Commit

Permalink
Ignore RuntimeWarning "invalid value encountered in cast" for LaxBack…
Browse files Browse the repository at this point in the history
…edNumpyTests.testUniqueEqualNan

This is to fix Mac arm64 pytests on CI. The tests started failing after integrating ml-dtypes-0.5.0. Ignoring warnings is probably Ok, as it is inspired by a similar PR in ml-dtypes repo itself: jax-ml/ml_dtypes#186

PiperOrigin-RevId: 676277042
  • Loading branch information
vam-google authored and Google-ML-Automation committed Sep 19, 2024
1 parent 3b89a2e commit 4d48df4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/lax_numpy_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -2134,6 +2134,9 @@ def np_fun(x):
self._CheckAgainstNumpy(np_fun, jnp_fun, args_maker)

@jtu.sample_product(dtype=inexact_dtypes, equal_nan=[True, False])
@jtu.ignore_warning(
category=RuntimeWarning, message='invalid value encountered in cast'
)
def testUniqueEqualNan(self, dtype, equal_nan):
shape = (20,)
rng = jtu.rand_some_nan(self.rng())
Expand Down

0 comments on commit 4d48df4

Please sign in to comment.