class_docstr: Tests for LAX-backed Numpy reduction operations.
class_docstr_tok: ["Tests","for","LAX-backed","Numpy","reduction","operations","."]
code: def testQuantile(
      self,
      op,
      q_rng,
      a_shape,
      a_dtype,
      q_shape,
      q_dtype,
      axis,
      keepdims,
      method,
  ):
      a_rng = jtu.rand_some_nan(self.rng())
      q_rng = q_rng(self.rng())
      if "median" in op:
          args_maker = lambda: [a_rng(a_shape, a_dtype)]
      else:
          args_maker = lambda: [
              a_rng(a_shape, a_dtype),
              q_rng(q_shape, q_dtype),
          ]
  
      @jtu.ignore_warning(
          category=RuntimeWarning, message="All-NaN slice encountered"
      )
      def np_fun(*args):
          args = [
              x
              if jnp.result_type(x) != jnp.bfloat16
              else np.asarray(x, np.float32)
              for x in args
          ]
          return getattr(np, op)(
              *args, axis=axis, keepdims=keepdims, method=method
          )
  
      jnp_fun = partial(
          getattr(jnp, op), axis=axis, keepdims=keepdims, method=method
      )
  
      # TODO(phawkins): we currently set dtype=False because we aren't as
      # aggressive about promoting to float64. It's not clear we want to mimic
      # Numpy here.
      tol_spec = {np.float16: 1e-2, np.float32: 2e-4, np.float64: 5e-6}
      tol = max(
          jtu.tolerance(a_dtype, tol_spec),
          jtu.tolerance(q_dtype, tol_spec),
      )
      self._CheckAgainstNumpy(
          np_fun, jnp_fun, args_maker, check_dtypes=False, tol=tol
      )
      self._CompileAndCheck(jnp_fun, args_maker, rtol=tol)
  
imports: import collections
  from functools import partial
  import itertools
  import unittest
  from absl.testing import absltest
  from absl.testing import parameterized
  import numpy
  import jax
  from jax import numpy
  from jax._src import config
  from jax._src import dtypes
  from jax._src import test_util
  from jax._src.util import NumpyComplexWarning
label_desc: Use image node_id 17 for calling the JaxNumpyReducerTests obj's underlying member method code with example usage: obj.testQuantile(op, q_rng, a_shape, a_dtype, q_shape, q_dtype, axis, keepdims, method) and returns: getattr