code: def test_list_of_layers():
      model = tf.keras.Sequential(
          [
              tf.keras.Input(shape=(4,)),
              tf.keras.layers.Dense(16),
              tf.keras.layers.Dense(16),
              tf.keras.layers.Dense(32),
              tf.keras.layers.Dense(32),
          ]
      )
  
      optimizers_and_layers = [
          (tf.keras.optimizers.SGD(learning_rate=0.0), model.layers[0]),
          (tf.keras.optimizers.Adam(), model.layers[1]),
          (tf.keras.optimizers.Adam(), model.layers[2:]),
      ]
  
      weights_before_train = [
          [weight.numpy() for weight in layer.weights]
          for layer in model.layers
      ]
  
      multi_optimizer = MultiOptimizer(optimizers_and_layers)
      model.compile(multi_optimizer, loss="mse")
  
      x = np.ones((128, 4)).astype(np.float32)
      y = np.ones((128, 32)).astype(np.float32)
      model.fit(x, y, batch_size=32, epochs=10)
  
      weights_after_train = [
          [weight.numpy() for weight in layer.weights]
          for layer in model.layers
      ]
  
      assert_list_allclose(
          weights_before_train[0], weights_after_train[0]
      )
  
      for layer_before, layer_after in zip(
          weights_before_train[1:], weights_after_train[1:]
      ):
          assert_list_not_allclose(layer_before, layer_after)
  
      assert_sync_iterations(
          model.optimizer, desired=ceil(128 / 32) * 10
      )
  
file_path: addons/tensorflow_addons/optimizers/tests/discriminative_layer_training_test.py
imports: from math import ceil
  from packaging.version import Version
  import pytest
  import numpy
  import tensorflow
  from tensorflow_addons.optimizers.discriminative_layer_training import MultiOptimizer
  from tensorflow_addons.utils import test_utils
label_desc: Use image node_id 5 for calling a global function with example usage: test_list_of_layers() without return types