code: def test_spectral_dac_eigh(
      self, linear_size, dtype, termination_size
  ):
      if not jtu.test_device_matches(["tpu"]) and termination_size != 1:
          raise unittest.SkipTest(
              "Termination sizes greater than 1 only work on TPU"
          )
  
      rng = self.rng()
      H = rng.randn(linear_size, linear_size)
      H = jnp.array(0.5 * (H + H.conj().T)).astype(dtype)
      if jnp.dtype(dtype).name in ("bfloat16", "float16"):
          self.assertRaises(NotImplementedError, lax_eigh.eigh, H)
          return
      evs, V = lax_eigh.eigh(H, termination_size=termination_size)
      ev_exp, _ = jnp.linalg.eigh(H)
      HV = jnp.dot(H, V, precision=lax.Precision.HIGHEST)
      vV = evs.astype(V.dtype)[None, :] * V
      eps = jnp.finfo(H.dtype).eps
      atol = jnp.linalg.norm(H) * eps
      self.assertAllClose(ev_exp, jnp.sort(evs), atol=20 * atol)
      self.assertAllClose(
          HV,
          vV,
          atol=atol
          * (140 if jnp.issubdtype(dtype, jnp.complexfloating) else 40),
      )
  
file_path: jax/tests/lax_scipy_spectral_dac_test.py
imports: import unittest
  from jax import lax
  from jax import numpy
  from jax._src import test_util
  from jax._src.lax import eigh
  from absl.testing import absltest
  from jax import config
label_desc: Use image node_id 1 for calling the LaxScipySpectralDacTest obj's underlying member method code with example usage: obj.test_spectral_dac_eigh(linear_size, dtype, termination_size) without return types