code: def test_matrix(self):
      sn = spectral_norm.SpectralNorm()
      # We can easily calculate the first singular value for this matrix.
      input_ = 4.0 * jnp.eye(8, 8)
      sn(input_)
      np.testing.assert_allclose(sn.sigma, 4.0, atol=1e-3)
  
file_path: dm-haiku/haiku/_src/spectral_norm_test.py
imports: from absl.testing import absltest
  from haiku._src import basic
  from haiku._src import spectral_norm
  from haiku._src import test_utils
  from haiku._src import transform
  import jax.numpy
  import jax.random
  import numpy
label_desc: Use image node_id 4 for calling the SpectralNormTest obj's underlying member method code with example usage: obj.test_matrix() without return types