@parameterized.named_parameters(jtu.cases_from_list(({'testcase_name': '_inshape={}_expanddim={}'.format(jtu.format_shape_dtype_string(arg_shape, dtype), dim), 'arg_shape': arg_shape, 'dtype': dtype, 'dim': dim, 'rng_factory': jtu.rand_default} for arg_shape in [(), (3,), (3, 4)] for dtype in default_dtypes for dim in range(((- len(arg_shape)) + 1), len(arg_shape)))))
def testExpandDimsStaticDim(self, arg_shape, dtype, dim, rng_factory):
    rng = rng_factory()
    onp_fun = (lambda x: onp.expand_dims(x, dim))
    jnp_fun = (lambda x: jnp.expand_dims(x, dim))
    args_maker = (lambda : [rng(arg_shape, 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={}_expanddim={}'.format(jtu.format_shape_dtype_string(arg_shape, dtype), dim), 'arg_shape': arg_shape, 'dtype': dtype, 'dim': dim, 'rng_factory': jtu.rand_default} for arg_shape in [(), (3,), (3, 4)] for dtype in default_dtypes for dim in range(((- len(arg_shape)) + 1), len(arg_shape)))))
def testExpandDimsStaticDim(self, arg_shape, dtype, dim, rng_factory):
    rng = rng_factory()
    onp_fun = (lambda x: onp.expand_dims(x, dim))
    jnp_fun = (lambda x: jnp.expand_dims(x, dim))
    args_maker = (lambda : [rng(arg_shape, dtype)])
    self._CheckAgainstNumpy(onp_fun, jnp_fun, args_maker, check_dtypes=True)
    self._CompileAndCheck(jnp_fun, args_maker, check_dtypes=True)