code: def test_serialization(self):
      # Unbuilt deferred
      model = Sequential(name="seq")
      model.add(layers.Dense(4))
      model.add(layers.Dense(5))
      revived = self.run_class_serialization_test(model)
      self.assertLen(revived.layers, 2)
  
      # Built deferred
      model.build((2, 3))
      revived = self.run_class_serialization_test(model)
      self.assertLen(revived.layers, 2)
  
      # Regular
      model = Sequential(name="seq")
      model.add(Input(shape=(2,), batch_size=3))
      model.add(layers.Dense(4))
      model.add(layers.Dense(5))
      model.add(layers.Dense(6))
      revived = self.run_class_serialization_test(model)
      self.assertLen(revived.layers, 3)
  
      # Weird
      class DictLayer(layers.Layer):
          def call(self, inputs):
              assert isinstance(inputs, dict)
              return inputs
  
      model = Sequential([DictLayer()])
      revived = self.run_class_serialization_test(
          model, custom_objects={"DictLayer": DictLayer}
      )
      self.assertLen(revived.layers, 1)
  
imports: import numpy
  import pytest
  from keras import backend
  from keras import layers
  from keras import testing
  from keras.layers.core.input_layer import Input
  from keras.models.functional import Functional
  from keras.models.sequential import Sequential
label_desc: Use image node_id 8 for calling the SequentialTest obj's underlying member method code with example usage: obj.test_serialization() and returns: inputs