docstr: Tests qdwh with random input.
docstr_tok: ["Tests","qdwh","with","random","input","."]
code: def testQdwhWithRandomMatrix(self, m, n, log_cond, padding):
      """Tests qdwh with random input."""
      rng = jtu.rand_uniform(self.rng(), low=0.3, high=0.9)
      a = rng((m, n), _QDWH_TEST_DTYPE)
      u, s, v = jnp.linalg.svd(a, full_matrices=False)
      cond = 10**log_cond
      s = jnp.expand_dims(
          jnp.linspace(cond, 1, min(m, n)), range(u.ndim - 1)
      )
      a = (u * s) @ v
      is_hermitian = _check_symmetry(a)
      max_iterations = 10
  
      def lsp_linalg_fn(a):
          if padding is not None:
              pm, pn = padding
              a = jnp.pad(
                  a, [(0, pm), (0, pn)], constant_values=jnp.nan
              )
          u, h, _, _ = qdwh.qdwh(
              a,
              is_hermitian=is_hermitian,
              max_iterations=max_iterations,
              dynamic_shape=(m, n) if padding else None,
          )
          if padding is not None:
              u = u[:m, :n]
              h = h[:n, :n]
          return u, h
  
      args_maker = lambda: [a]
  
      # Sets the test tolerance.
      rtol = 1e6 * _QDWH_TEST_EPS
  
      with self.subTest("Test JIT compatibility"):
          self._CompileAndCheck(lsp_linalg_fn, args_maker)
  
      with self.subTest("Test against numpy."):
          self._CheckAgainstNumpy(
              osp_linalg.polar,
              lsp_linalg_fn,
              args_maker,
              rtol=rtol,
              atol=1e-3,
          )
  
file_path: jax/tests/qdwh_test.py
imports: import functools
  import jax
  import jax.numpy
  import numpy
  import scipy.linalg
  from jax._src import config
  from jax._src import test_util
  from jax._src.lax import qdwh
  from absl.testing import absltest
label_desc: Use image node_id 3 for calling the QdwhTest obj's underlying member method code with example usage: obj.testQdwhWithRandomMatrix(m, n, log_cond, padding) and returns: u,  h