Skip to content

Commit

Permalink
Relax test tolerances, suppress warning messages. (jax-ml#2967)
Browse files Browse the repository at this point in the history
  • Loading branch information
hawkinsp authored May 5, 2020
1 parent 0eba939 commit 9612c52
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
5 changes: 2 additions & 3 deletions tests/lax_numpy_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -457,9 +457,8 @@ def f():
JAX_COMPOUND_OP_RECORDS)))
def testOp(self, onp_op, jnp_op, rng_factory, shapes, dtypes, check_dtypes,
tolerance, inexact):
if onp_op is onp.float_power:
onp_op = jtu.ignore_warning(category=RuntimeWarning,
message="invalid value.*")(onp_op)
onp_op = jtu.ignore_warning(category=RuntimeWarning,
message="invalid value.*")(onp_op)

rng = rng_factory(self.rng())
args_maker = self._GetArgsMaker(rng, shapes, dtypes, onp_arrays=False)
Expand Down
2 changes: 1 addition & 1 deletion tests/lax_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def op_record(op, nargs, dtypes, rng_factory, tol=None):
op_record("rsqrt", 1, float_dtypes + complex_dtypes, jtu.rand_positive),
op_record("square", 1, float_dtypes + complex_dtypes, jtu.rand_default),
op_record("reciprocal", 1, float_dtypes + complex_dtypes, jtu.rand_positive),
op_record("tan", 1, float_dtypes, jtu.rand_default, {onp.float32: 1e-5}),
op_record("tan", 1, float_dtypes, jtu.rand_default, {onp.float32: 3e-5}),
op_record("asin", 1, float_dtypes, jtu.rand_small),
op_record("acos", 1, float_dtypes, jtu.rand_small),
op_record("atan", 1, float_dtypes, jtu.rand_small),
Expand Down
3 changes: 2 additions & 1 deletion tests/scipy_stats_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,8 @@ def args_maker():

self._CheckAgainstNumpy(scipy_fun, lax_fun, args_maker, check_dtypes=False,
tol=1e-3)
self._CompileAndCheck(lax_fun, args_maker, check_dtypes=True, rtol=1e-4)
self._CompileAndCheck(lax_fun, args_maker, check_dtypes=True,
rtol={onp.float32: 2e-3, onp.float64: 1e-4})

@genNamedParametersNArgs(3, jtu.rand_default)
def testCauchyLogPdf(self, rng_factory, shapes, dtypes):
Expand Down

0 comments on commit 9612c52

Please sign in to comment.