code: def test_apply_layer():
      images = tf.ones((1, 2, 2, 1))
      sn_wrapper = spectral_normalization.SpectralNormalization(
          tf.keras.layers.Conv2D(
              1,
              [2, 2],
              kernel_initializer=tf.constant_initializer(value=1),
          ),
          input_shape=(2, 2, 1),
      )
  
      result = sn_wrapper(images, training=False)
      result_train = sn_wrapper(images, training=True)
      expected_output = np.array([[[[4.0]]]], dtype=np.float32)
  
      np.testing.assert_allclose(result, expected_output)
      # max eigen value of 2x2 matrix of ones is 2
      np.testing.assert_allclose(result_train, expected_output / 2)
      assert hasattr(sn_wrapper, "u")
  
file_path: addons/tensorflow_addons/layers/tests/spectral_normalization_test.py
imports: import numpy
  import pytest
  import tensorflow
  from tensorflow_addons.layers import spectral_normalization
  from tensorflow_addons.utils import test_utils
label_desc: Use image node_id 7 for calling a global function with example usage: test_apply_layer() without return types