@parameterized.named_parameters(jtu.cases_from_list(({'testcase_name': '_start_shape={}_stop_shape={}_num={}_endpoint={}_base={}_dtype={}'.format(start_shape, stop_shape, num, endpoint, base, (dtype.__name__ if dtype else 'None')), 'start_shape': start_shape, 'stop_shape': stop_shape, 'num': num, 'endpoint': endpoint, 'base': base, 'dtype': dtype, 'rng_factory': rng_factory} for start_shape in [(), (2,), (2, 2)] for stop_shape in [(), (2,), (2, 2)] for num in [0, 1, 2, 5, 20] for endpoint in [True, False] for base in [10.0, 2, onp.e] for dtype in (inexact_dtypes + [None]) for rng_factory in [jtu.rand_default])))
def testLogspace(self, start_shape, stop_shape, num, endpoint, base, dtype, rng_factory):
    if ((dtype in int_dtypes) and (jtu.device_under_test() in ('gpu', 'tpu')) and (not FLAGS.jax_enable_x64)):
        raise unittest.SkipTest("GPUx32 truncated exponentiation doesn't exactly match other platforms.")
    rng = rng_factory()
    tol = {onp.float16: 0.02, onp.float32: 0.01, onp.float64: 1e-06, onp.complex64: 0.001, onp.complex128: 1e-06}
    args_maker = self._GetArgsMaker(rng, [start_shape, stop_shape], [dtype, dtype])
    (start, stop) = args_maker()
    ndim = len(onp.shape((start + stop)))
    for axis in range((- ndim), ndim):
        jnp_op = (lambda start, stop: jnp.logspace(start, stop, num, endpoint=endpoint, base=base, dtype=dtype, axis=axis))
        onp_op = (lambda start, stop: onp.logspace(start, stop, num, endpoint=endpoint, base=base, dtype=dtype, axis=axis))
        self._CheckAgainstNumpy(onp_op, jnp_op, args_maker, check_dtypes=False, tol=tol)
        if (dtype in (inexact_dtypes + [None])):
            atol = {onp.float16: 0.01}
            self._CompileAndCheck(jnp_op, args_maker, check_dtypes=False, atol=atol, rtol=tol)
@parameterized.named_parameters(jtu.cases_from_list(({'testcase_name': '_start_shape={}_stop_shape={}_num={}_endpoint={}_base={}_dtype={}'.format(start_shape, stop_shape, num, endpoint, base, (dtype.__name__ if dtype else 'None')), 'start_shape': start_shape, 'stop_shape': stop_shape, 'num': num, 'endpoint': endpoint, 'base': base, 'dtype': dtype, 'rng_factory': rng_factory} for start_shape in [(), (2,), (2, 2)] for stop_shape in [(), (2,), (2, 2)] for num in [0, 1, 2, 5, 20] for endpoint in [True, False] for base in [10.0, 2, onp.e] for dtype in (inexact_dtypes + [None]) for rng_factory in [jtu.rand_default])))
def testLogspace(self, start_shape, stop_shape, num, endpoint, base, dtype, rng_factory):
    if ((dtype in int_dtypes) and (jtu.device_under_test() in ('gpu', 'tpu')) and (not FLAGS.jax_enable_x64)):
        raise unittest.SkipTest("GPUx32 truncated exponentiation doesn't exactly match other platforms.")
    rng = rng_factory()
    tol = {onp.float16: 0.02, onp.float32: 0.01, onp.float64: 1e-06, onp.complex64: 0.001, onp.complex128: 1e-06}
    args_maker = self._GetArgsMaker(rng, [start_shape, stop_shape], [dtype, dtype])
    (start, stop) = args_maker()
    ndim = len(onp.shape((start + stop)))
    for axis in range((- ndim), ndim):
        jnp_op = (lambda start, stop: jnp.logspace(start, stop, num, endpoint=endpoint, base=base, dtype=dtype, axis=axis))
        onp_op = (lambda start, stop: onp.logspace(start, stop, num, endpoint=endpoint, base=base, dtype=dtype, axis=axis))
        self._CheckAgainstNumpy(onp_op, jnp_op, args_maker, check_dtypes=False, tol=tol)
        if (dtype in (inexact_dtypes + [None])):
            atol = {onp.float16: 0.01}
            self._CompileAndCheck(jnp_op, args_maker, check_dtypes=False, atol=atol, rtol=tol)