class_docstr: Tests for LAX-backed scipy.stats implementations
code: def testWelchWithDefaultStepArgsAgainstNumpy(
      self,
      *,
      shape,
      dtype,
      nperseg,
      noverlap,
      use_nperseg,
      use_noverlap,
      use_window,
      timeaxis,
  ):
      if (
          tuple(shape) == (2, 3, 389, 5)
          and nperseg == 17
          and noverlap == 13
      ):
          raise unittest.SkipTest("Test fails for these inputs")
      kwargs = {"axis": timeaxis}
  
      if use_nperseg:
          kwargs["nperseg"] = nperseg
      if use_window:
          kwargs["window"] = jnp.array(
              osp_signal.get_window("hann", nperseg),
              dtype=dtypes.to_complex_dtype(dtype),
          )
      if use_noverlap:
          kwargs["noverlap"] = noverlap
  
      @jtu.ignore_warning(message="nperseg = 256 is greater than")
      def osp_fun(x):
          freqs, Pxx = osp_signal.welch(x, **kwargs)
          return freqs.astype(_real_dtype(dtype)), Pxx.astype(
              _real_dtype(dtype)
          )
  
      jsp_fun = partial(jsp_signal.welch, **kwargs)
      tol = {
          np.float32: 1e-5,
          np.float64: 1e-12,
          np.complex64: 1e-5,
          np.complex128: 1e-12,
      }
      if jtu.test_device_matches(["tpu"]):
          tol = _TPU_FFT_TOL
  
      rng = jtu.rand_default(self.rng())
      args_maker = lambda: [rng(shape, dtype)]
  
      self._CheckAgainstNumpy(
          osp_fun, jsp_fun, args_maker, rtol=tol, atol=tol
      )
      self._CompileAndCheck(jsp_fun, args_maker, rtol=tol, atol=tol)
  
imports: from functools import partial
  import unittest
  from absl.testing import absltest
  import numpy
  import scipy.signal
  from jax import lax
  import jax.numpy
  from jax._src import dtypes
  from jax._src import test_util
  import jax.scipy.signal
  from jax import config
label_desc: Use image node_id 9 for calling the LaxBackedScipySignalTests obj's underlying member method code with example usage: obj.testWelchWithDefaultStepArgsAgainstNumpy() and returns: freqs,  Pxx