Warning when using jnp.any, jnp.all on complex arrays
The `numpy` equivalents operate quietly on complex arrays, while the `jax.numpy` variants raise a ComplexWarning

```python 
In [1]: x = np.random.randn(2) + 1j * np.random.randn(2)

In [2]: np.any(x)
Out[2]: True

In [3]: jax.numpy.any(jax.device_put(x))
/home/pfister/miniconda3/envs/scico/lib/python3.8/site-packages/jax/_src/numpy/lax_numpy.py:1945: ComplexWarning: Casting complex values to real discards the imaginary part
  a = preproc(a) if preproc else a
Out[3]: DeviceArray(True, dtype=bool)
```
- jax 0.2.11
- jaxlib 0.1.64
diff --git a/jax/_src/numpy/lax_numpy.py b/jax/_src/numpy/lax_numpy.py
index 95148f016..7e3306743 100644
--- a/jax/_src/numpy/lax_numpy.py
+++ b/jax/_src/numpy/lax_numpy.py
@@ -1993,7 +1993,10 @@ def _reduction_init_val(a, init_val):
     sign, info = np.sign(init_val), iinfo(a_dtype)
     return np.array(info.min if sign < 0 else info.max, dtype=a_dtype)
 
-_cast_to_bool = partial(lax.convert_element_type, new_dtype=bool_)
+def _cast_to_bool(operand):
+  with warnings.catch_warnings():
+    warnings.filterwarnings("ignore", category=np.ComplexWarning)
+    return lax.convert_element_type(operand, bool_)
 
 @_wraps(np.sum, skip_params=['out'])
 def sum(a, axis: Optional[Union[int, Tuple[int, ...]]] = None, dtype=None,
diff --git a/tests/lax_numpy_test.py b/tests/lax_numpy_test.py
index 501ab9e1c..36d6725dc 100644
--- a/tests/lax_numpy_test.py
+++ b/tests/lax_numpy_test.py
@@ -785,9 +785,7 @@ class LaxBackedNumpyTests(jtu.JaxTestCase):
       res = res if not is_bf16_nan_test else res.astype(jnp.bfloat16)
       return res
     np_fun = _promote_like_jnp(np_fun, inexact)
-    np_fun = jtu.ignore_warning(category=np.ComplexWarning)(np_fun)
     jnp_fun = lambda x: jnp_op(x, axis, keepdims=keepdims)
-    jnp_fun = jtu.ignore_warning(category=jnp.ComplexWarning)(jnp_fun)
     args_maker = lambda: [rng(shape, dtype)]
     tol = {np.float16: 0.002}
     self._CheckAgainstNumpy(np_fun, jnp_fun, args_maker, tol=tol)
['jax/_src/numpy/lax_numpy.py', 'tests/lax_numpy_test.py']