code: def test_serialization():
      model = tf.keras.Sequential(
          [
              tf.keras.Input(shape=[1]),
              tf.keras.layers.Dense(1),
              tf.keras.layers.Dense(1),
          ]
      )
  
      opt1 = tf.keras.optimizers.Adam(learning_rate=1e-3)
      opt2 = tf.keras.optimizers.SGD(learning_rate=0)
  
      opt_layer_pairs = [
          (opt1, model.layers[0]),
          (opt2, model.layers[1]),
      ]
  
      optimizer = MultiOptimizer(opt_layer_pairs)
      config = tf.keras.optimizers.serialize(optimizer)
  
      new_optimizer = tf.keras.optimizers.deserialize(config)
  
      old_config = optimizer.get_config()
      new_config = new_optimizer.get_config()
  
      # TODO: Remove if statement after 2.13 is oldest version supported due to new serialization
      if Version(tf.__version__) >= Version("2.13"):
          # New Serialization method stores the memory addresses of each optimizer which won't match
          old_config["optimizer_specs"][0]["optimizer"] = old_config[
              "optimizer_specs"
          ][0]["optimizer"].__class__
          old_config["optimizer_specs"][1]["optimizer"] = old_config[
              "optimizer_specs"
          ][1]["optimizer"].__class__
  
          new_config["optimizer_specs"][0]["optimizer"] = new_config[
              "optimizer_specs"
          ][0]["optimizer"].__class__
          new_config["optimizer_specs"][1]["optimizer"] = new_config[
              "optimizer_specs"
          ][1]["optimizer"].__class__
  
      assert new_config == old_config
  
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 10 for calling a global function with example usage: test_serialization() without return types