def METHOD_NAME(size, keepdims):
    arr_np = np.random.randint(-5, 5, size=size)
    arr_num = num.array(arr_np)
    ndim = arr_np.ndim
    for axis in range(-ndim + 1, ndim, 1):
        out_np = np.count_nonzero(arr_np, axis=axis, keepdims=keepdims)
        out_num = num.count_nonzero(arr_num, axis=axis, keepdims=keepdims)
        # Numpy has the parameter 'keepdims',
        # cuNumeric do not have this parameter.
        # cuNumeric raises "TypeError: count_nonzero() got an unexpected
        # keyword argument 'keepdims'"
        assert np.array_equal(out_np, out_num)