@parameterized.named_parameters(jtu.cases_from_list(({'testcase_name': '_inshape={}_outshape={}_order={}'.format(jtu.format_shape_dtype_string(arg_shape, dtype), jtu.format_shape_dtype_string(out_shape, dtype), order), 'arg_shape': arg_shape, 'out_shape': out_shape, 'dtype': dtype, 'order': order, 'rng_factory': jtu.rand_default} for dtype in default_dtypes for order in ['C', 'F'] for (arg_shape, out_shape) in [(jtu.NUMPY_SCALAR_SHAPE, (1, 1, 1)), ((), (1, 1, 1)), ((7, 0), (0, 42, 101)), ((3, 4), 12), ((3, 4), (12,)), ((3, 4), (- 1)), ((2, 1, 4), ((- 1),)), ((2, 2, 4), (2, 8))])))
def testReshape(self, arg_shape, out_shape, dtype, order, rng_factory):
    rng = rng_factory()
    onp_fun = (lambda x: onp.reshape(x, out_shape, order=order))
    jnp_fun = (lambda x: jnp.reshape(x, out_shape, order=order))
    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={}_outshape={}_order={}'.format(jtu.format_shape_dtype_string(arg_shape, dtype), jtu.format_shape_dtype_string(out_shape, dtype), order), 'arg_shape': arg_shape, 'out_shape': out_shape, 'dtype': dtype, 'order': order, 'rng_factory': jtu.rand_default} for dtype in default_dtypes for order in ['C', 'F'] for (arg_shape, out_shape) in [(jtu.NUMPY_SCALAR_SHAPE, (1, 1, 1)), ((), (1, 1, 1)), ((7, 0), (0, 42, 101)), ((3, 4), 12), ((3, 4), (12,)), ((3, 4), (- 1)), ((2, 1, 4), ((- 1),)), ((2, 2, 4), (2, 8))])))
def testReshape(self, arg_shape, out_shape, dtype, order, rng_factory):
    rng = rng_factory()
    onp_fun = (lambda x: onp.reshape(x, out_shape, order=order))
    jnp_fun = (lambda x: jnp.reshape(x, out_shape, order=order))
    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)