code: def test_model_fit(base_layer_fn, input_shape, output_shape):
      inputs = tf.keras.layers.Input(shape=input_shape)
      base_layer = base_layer_fn()
  
      sn_layer = spectral_normalization.SpectralNormalization(
          base_layer
      )
      model = tf.keras.models.Sequential(layers=[inputs, sn_layer])
      model.add(tf.keras.layers.Activation("relu"))
  
      model.compile(
          optimizer=tf.keras.optimizers.RMSprop(learning_rate=0.001),
          loss="mse",
      )
      model.fit(
          np.random.random((2, *input_shape)),
          np.random.random((2, *output_shape)),
          epochs=3,
          batch_size=10,
          verbose=0,
      )
      assert hasattr(model.layers[0], "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 4 for calling a global function with example usage: test_model_fit(base_layer_fn, input_shape, output_shape) without return types