@parameterized.named_parameters(jtu.cases_from_list(({'testcase_name': '_{}_amin={}_amax={}'.format(jtu.format_shape_dtype_string(shape, dtype), a_min, a_max), 'shape': shape, 'dtype': dtype, 'a_min': a_min, 'a_max': a_max, 'rng_factory': jtu.rand_default} for shape in all_shapes for dtype in number_dtypes for (a_min, a_max) in [((- 1), None), (None, 1), ((- 1), 1), ((- onp.ones(1)), None), (None, onp.ones(1)), ((- onp.ones(1)), onp.ones(1))])))
def testClipStaticBounds(self, shape, dtype, a_min, a_max, rng_factory):
    rng = rng_factory()
    onp_fun = (lambda x: onp.clip(x, a_min=a_min, a_max=a_max))
    jnp_fun = (lambda x: jnp.clip(x, a_min=a_min, a_max=a_max))
    args_maker = (lambda : [rng(shape, dtype)])
    self._CheckAgainstNumpy(onp_fun, jnp_fun, args_maker, check_dtypes=False)
    self._CompileAndCheck(jnp_fun, args_maker, check_dtypes=True)
@parameterized.named_parameters(jtu.cases_from_list(({'testcase_name': '_{}_amin={}_amax={}'.format(jtu.format_shape_dtype_string(shape, dtype), a_min, a_max), 'shape': shape, 'dtype': dtype, 'a_min': a_min, 'a_max': a_max, 'rng_factory': jtu.rand_default} for shape in all_shapes for dtype in number_dtypes for (a_min, a_max) in [((- 1), None), (None, 1), ((- 1), 1), ((- onp.ones(1)), None), (None, onp.ones(1)), ((- onp.ones(1)), onp.ones(1))])))
def testClipStaticBounds(self, shape, dtype, a_min, a_max, rng_factory):
    rng = rng_factory()
    onp_fun = (lambda x: onp.clip(x, a_min=a_min, a_max=a_max))
    jnp_fun = (lambda x: jnp.clip(x, a_min=a_min, a_max=a_max))
    args_maker = (lambda : [rng(shape, dtype)])
    self._CheckAgainstNumpy(onp_fun, jnp_fun, args_maker, check_dtypes=False)
    self._CompileAndCheck(jnp_fun, args_maker, check_dtypes=True)