code: def test_pretrained_model():
      resnet = tf.keras.applications.ResNet50(
          include_top=False, weights=None
      )
      dense = tf.keras.layers.Dense(32)
      model = tf.keras.Sequential([resnet, dense])
  
      resnet_weights_before_train = [
          weight.numpy() for weight in resnet.trainable_weights
      ]
      dense_weights_before_train = [
          weight.numpy() for weight in dense.weights
      ]
  
      optimizers_and_layers = [(tf.keras.optimizers.SGD(), dense)]
  
      multi_optimizer = MultiOptimizer(optimizers_and_layers)
      model.compile(multi_optimizer, loss="mse")
  
      x = np.ones((128, 32, 32, 3)).astype(np.float32)
      y = np.ones((128, 32)).astype(np.float32)
      model.fit(x, y, batch_size=32)
  
      resnet_weights_after_train = [
          weight.numpy() for weight in resnet.trainable_weights
      ]
      dense_weights_after_train = [
          weight.numpy() for weight in dense.weights
      ]
  
      assert_list_allclose(
          resnet_weights_before_train, resnet_weights_after_train
      )
      assert_list_not_allclose(
          dense_weights_before_train, dense_weights_after_train
      )
      assert_sync_iterations(model.optimizer, desired=ceil(128 / 32))
  
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 8 for calling a global function with example usage: test_pretrained_model() without return types