@parameterized.named_parameters(itertools.chain.from_iterable((jtu.cases_from_list(({'testcase_name': jtu.format_test_name_suffix(rec.test_name, shapes, dtypes), 'rng_factory': rec.rng_factory, 'shapes': shapes, 'dtypes': dtypes, 'onp_op': getattr(onp, rec.name), 'jnp_op': getattr(jnp, rec.name), 'check_dtypes': rec.check_dtypes, 'tolerance': rec.tolerance, 'inexact': rec.inexact} for shapes in filter(_shapes_are_broadcast_compatible, CombosWithReplacement(rec.shapes, rec.nargs)) for dtypes in itertools.product(*(_valid_dtypes_for_shape(s, rec.dtypes) for s in shapes)))) for rec in itertools.chain(JAX_ONE_TO_ONE_OP_RECORDS, 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)
    rng = rng_factory()
    args_maker = self._GetArgsMaker(rng, shapes, dtypes, onp_arrays=False)
    tol = max((jtu.tolerance(dtype, tolerance) for dtype in dtypes))
    tol = functools.reduce(jtu.join_tolerance, [tolerance, tol, jtu.default_tolerance()])
    self._CheckAgainstNumpy(_promote_like_jnp(onp_op, inexact), jnp_op, args_maker, check_dtypes=check_dtypes, tol=tol)
    self._CompileAndCheck(jnp_op, args_maker, check_dtypes=check_dtypes, atol=tol, rtol=tol)
@parameterized.named_parameters(itertools.chain.from_iterable((jtu.cases_from_list(({'testcase_name': jtu.format_test_name_suffix(rec.test_name, shapes, dtypes), 'rng_factory': rec.rng_factory, 'shapes': shapes, 'dtypes': dtypes, 'onp_op': getattr(onp, rec.name), 'jnp_op': getattr(jnp, rec.name), 'check_dtypes': rec.check_dtypes, 'tolerance': rec.tolerance, 'inexact': rec.inexact} for shapes in filter(_shapes_are_broadcast_compatible, CombosWithReplacement(rec.shapes, rec.nargs)) for dtypes in itertools.product(*(_valid_dtypes_for_shape(s, rec.dtypes) for s in shapes)))) for rec in itertools.chain(JAX_ONE_TO_ONE_OP_RECORDS, 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)
    rng = rng_factory()
    args_maker = self._GetArgsMaker(rng, shapes, dtypes, onp_arrays=False)
    tol = max((jtu.tolerance(dtype, tolerance) for dtype in dtypes))
    tol = functools.reduce(jtu.join_tolerance, [tolerance, tol, jtu.default_tolerance()])
    self._CheckAgainstNumpy(_promote_like_jnp(onp_op, inexact), jnp_op, args_maker, check_dtypes=check_dtypes, tol=tol)
    self._CompileAndCheck(jnp_op, args_maker, check_dtypes=check_dtypes, atol=tol, rtol=tol)