@parameterized.named_parameters(jtu.cases_from_list(({'testcase_name': '_shape={}_axis={}'.format(jtu.format_shape_dtype_string(shape, dtype), axis), 'shape': shape, 'dtype': dtype, 'axis': axis} for shape in all_shapes for dtype in all_dtypes for axis in (list(range((- len(shape)), len(shape))) + [None]))))
def testCountNonzero(self, shape, dtype, axis):
    rng = jtu.rand_some_zero()
    onp_fun = (lambda x: onp.count_nonzero(x, axis))
    jnp_fun = (lambda x: jnp.count_nonzero(x, axis))
    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': '_shape={}_axis={}'.format(jtu.format_shape_dtype_string(shape, dtype), axis), 'shape': shape, 'dtype': dtype, 'axis': axis} for shape in all_shapes for dtype in all_dtypes for axis in (list(range((- len(shape)), len(shape))) + [None]))))
def testCountNonzero(self, shape, dtype, axis):
    rng = jtu.rand_some_zero()
    onp_fun = (lambda x: onp.count_nonzero(x, axis))
    jnp_fun = (lambda x: jnp.count_nonzero(x, axis))
    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)