@parameterized.named_parameters(jtu.cases_from_list(({'testcase_name': '_inshape={}_filldtype={}_outdtype={}'.format(jtu.format_shape_dtype_string(shape, in_dtype), onp.dtype(fill_value_dtype).name, onp.dtype(out_dtype).name), 'shape': shape, 'in_dtype': in_dtype, 'fill_value_dtype': fill_value_dtype, 'out_dtype': out_dtype, 'rng_factory': jtu.rand_default} for shape in array_shapes for in_dtype in default_dtypes for fill_value_dtype in default_dtypes for out_dtype in default_dtypes)))
def testFullLike(self, shape, in_dtype, fill_value_dtype, out_dtype, rng_factory):
    rng = rng_factory()
    onp_fun = (lambda x, fill_value: onp.full_like(x, fill_value, dtype=out_dtype))
    jnp_fun = (lambda x, fill_value: jnp.full_like(x, fill_value, dtype=out_dtype))
    args_maker = (lambda : [rng(shape, in_dtype), rng((), fill_value_dtype)])
    self._CheckAgainstNumpy(onp_fun, jnp_fun, args_maker, check_dtypes=True)
    self._CompileAndCheck(jnp_fun, args_maker, check_dtypes=True)
@parameterized.named_parameters(jtu.cases_from_list(({'testcase_name': '_inshape={}_filldtype={}_outdtype={}'.format(jtu.format_shape_dtype_string(shape, in_dtype), onp.dtype(fill_value_dtype).name, onp.dtype(out_dtype).name), 'shape': shape, 'in_dtype': in_dtype, 'fill_value_dtype': fill_value_dtype, 'out_dtype': out_dtype, 'rng_factory': jtu.rand_default} for shape in array_shapes for in_dtype in default_dtypes for fill_value_dtype in default_dtypes for out_dtype in default_dtypes)))
def testFullLike(self, shape, in_dtype, fill_value_dtype, out_dtype, rng_factory):
    rng = rng_factory()
    onp_fun = (lambda x, fill_value: onp.full_like(x, fill_value, dtype=out_dtype))
    jnp_fun = (lambda x, fill_value: jnp.full_like(x, fill_value, dtype=out_dtype))
    args_maker = (lambda : [rng(shape, in_dtype), rng((), fill_value_dtype)])
    self._CheckAgainstNumpy(onp_fun, jnp_fun, args_maker, check_dtypes=True)
    self._CompileAndCheck(jnp_fun, args_maker, check_dtypes=True)