class_docstr: `Sequential` groups a linear stack of layers into a `Model`.
  
  Examples:
  
  ```python
  model = keras.Sequential()
  model.add(keras.Input(shape=(16,)))
  model.add(keras.layers.Dense(8))
  
  # Note that you can also omit the initial `Input`.
  # In that case the model doesn't have any weights until the first call
  # to a training/evaluation method (since it isn't yet built):
  model = keras.Sequential()
  model.add(keras.layers.Dense(8))
  model.add(keras.layers.Dense(4))
  # model.weights not created yet
  
  # Whereas if you specify an `Input`, the model gets built
  # continuously as you are adding layers:
  model = keras.Sequential()
  model.add(keras.Input(shape=(16,)))
  model.add(keras.layers.Dense(8))
  len(model.weights)  # Returns "2"
  
  # When using the delayed-build pattern (no input shape specified), you can
  # choose to manually build your model by calling
  # `build(batch_input_shape)`:
  model = keras.Sequential()
  model.add(keras.layers.Dense(8))
  model.add(keras.layers.Dense(4))
  model.build((None, 16))
  len(model.weights)  # Returns "4"
  
  # Note that when using the delayed-build pattern (no input shape specified),
  # the model gets built the first time you call `fit`, `eval`, or `predict`,
  # or the first time you call the model on some input data.
  model = keras.Sequential()
  model.add(keras.layers.Dense(8))
  model.add(keras.layers.Dense(1))
  model.compile(optimizer='sgd', loss='mse')
  # This builds the model for the first time:
  model.fit(x, y, batch_size=32, epochs=10)
  ```
class_docstr_tok: ["`","Sequential","`","groups","a","linear","stack","of","layers","into","a","`","Model","`",".","Examples",":","``","`","python","model","=","keras.Sequential","(",")","model.add","(","keras.Input","(","shape=","(","16",",",")",")",")","model.add","(","keras.layers.Dense","(","8",")",")","#","Note","that","you","can","also","omit","the","initial","`","Input","`",".","#","In","that","case","the","model","does","n't","have","any","weights","until","the","first","call","#","to","a","training\/evaluation","method","(","since","it","is","n't","yet","built",")",":","model","=","keras.Sequential","(",")","model.add","(","keras.layers.Dense","(","8",")",")","model.add","(","keras.layers.Dense","(","4",")",")","#","model.weights","not","created","yet","#","Whereas","if","you","specify","an","`","Input","`",",","the","model","gets","built","#","continuously","as","you","are","adding","layers",":","model","=","keras.Sequential","(",")","model.add","(","keras.Input","(","shape=","(","16",",",")",")",")","model.add","(","keras.layers.Dense","(","8",")",")","len","(","model.weights",")","#","Returns","``","2","''","#","When","using","the","delayed-build","pattern","(","no","input","shape","specified",")",",","you","can","#","choose","to","manually","build","your","model","by","calling","#","`","build","(","batch_input_shape",")","`",":","model","=","keras.Sequential","(",")","model.add","(","keras.layers.Dense","(","8",")",")","model.add","(","keras.layers.Dense","(","4",")",")","model.build","(","(","None",",","16",")",")","len","(","model.weights",")","#","Returns","``","4","''","#","Note","that","when","using","the","delayed-build","pattern","(","no","input","shape","specified",")",",","#","the","model","gets","built","the","first","time","you","call","`","fit","`",",","`","eval","`",",","or","`","predict","`",",","#","or","the","first","time","you","call","the","model","on","some","input","data",".","model","=","keras.Sequential","(",")","model.add","(","keras.layers.Dense","(","8",")",")","model.add","(","keras.layers.Dense","(","1",")",")","model.compile","(","optimizer='sgd","'",",","loss='mse","'",")","#","This","builds","the","model","for","the","first","time",":","model.fit","(","x",",","y",",","batch_size=32",",","epochs=10",")","``","`"]
code: def __init__(self, layers=None, trainable=True, name=None):
      super().__init__(trainable=trainable, name=name)
      self._functional = None
      self._layers = []
      if layers:
          for layer in layers:
              self.add(layer, rebuild=False)
          self._maybe_rebuild()
  
imports: import copy
  import inspect
  import tree
  from keras.api_export import keras_export
  from keras.backend.common import global_state
  from keras.layers.core.input_layer import InputLayer
  from keras.layers.layer import Layer
  from keras.legacy.saving import saving_utils
  from keras.legacy.saving import serialization
  from keras.models.functional import Functional
  from keras.models.model import Model
  from keras.saving import serialization_lib
label_desc: Use image node_id 1 to create a new Sequential object from inherited base classes: Model with example: obj = Sequential(layers, trainable, name)