class_docstr: `Sequential` groups a linear stack of layers into a `tf.keras.Model`.
  
  `Sequential` provides training and inference features on this model.
  
  Examples:
  
  >>> # Optionally, the first layer can receive an `input_shape` argument:
  >>> model = tf.keras.Sequential()
  >>> model.add(tf.keras.layers.Dense(8, input_shape=(16,)))
  >>> # Afterwards, we do automatic shape inference:
  >>> model.add(tf.keras.layers.Dense(4))
  
  >>> # This is identical to the following:
  >>> model = tf.keras.Sequential()
  >>> model.add(tf.keras.Input(shape=(16,)))
  >>> model.add(tf.keras.layers.Dense(8))
  
  >>> # Note that you can also omit the `input_shape` argument.
  >>> # 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 = tf.keras.Sequential()
  >>> model.add(tf.keras.layers.Dense(8))
  >>> model.add(tf.keras.layers.Dense(4))
  >>> # model.weights not created yet
  
  >>> # Whereas if you specify the input shape, the model gets built
  >>> # continuously as you are adding layers:
  >>> model = tf.keras.Sequential()
  >>> model.add(tf.keras.layers.Dense(8, input_shape=(16,)))
  >>> model.add(tf.keras.layers.Dense(4))
  >>> len(model.weights)
  4
  
  >>> # 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 = tf.keras.Sequential()
  >>> model.add(tf.keras.layers.Dense(8))
  >>> model.add(tf.keras.layers.Dense(4))
  >>> model.build((None, 16))
  >>> len(model.weights)
  4
  
  ```python
  # 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 = tf.keras.Sequential()
  model.add(tf.keras.layers.Dense(8))
  model.add(tf.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","`","tf.keras.Model","`",".","`","Sequential","`","provides","training","and","inference","features","on","this","model",".","Examples",":",">",">",">","#","Optionally",",","the","first","layer","can","receive","an","`","input_shape","`","argument",":",">",">",">","model","=","tf.keras.Sequential","(",")",">",">",">","model.add","(","tf.keras.layers.Dense","(","8",",","input_shape=","(","16",",",")",")",")",">",">",">","#","Afterwards",",","we","do","automatic","shape","inference",":",">",">",">","model.add","(","tf.keras.layers.Dense","(","4",")",")",">",">",">","#","This","is","identical","to","the","following",":",">",">",">","model","=","tf.keras.Sequential","(",")",">",">",">","model.add","(","tf.keras.Input","(","shape=","(","16",",",")",")",")",">",">",">","model.add","(","tf.keras.layers.Dense","(","8",")",")",">",">",">","#","Note","that","you","can","also","omit","the","`","input_shape","`","argument",".",">",">",">","#","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","=","tf.keras.Sequential","(",")",">",">",">","model.add","(","tf.keras.layers.Dense","(","8",")",")",">",">",">","model.add","(","tf.keras.layers.Dense","(","4",")",")",">",">",">","#","model.weights","not","created","yet",">",">",">","#","Whereas","if","you","specify","the","input","shape",",","the","model","gets","built",">",">",">","#","continuously","as","you","are","adding","layers",":",">",">",">","model","=","tf.keras.Sequential","(",")",">",">",">","model.add","(","tf.keras.layers.Dense","(","8",",","input_shape=","(","16",",",")",")",")",">",">",">","model.add","(","tf.keras.layers.Dense","(","4",")",")",">",">",">","len","(","model.weights",")","4",">",">",">","#","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","=","tf.keras.Sequential","(",")",">",">",">","model.add","(","tf.keras.layers.Dense","(","8",")",")",">",">",">","model.add","(","tf.keras.layers.Dense","(","4",")",")",">",">",">","model.build","(","(","None",",","16",")",")",">",">",">","len","(","model.weights",")","4","``","`","python","#","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","=","tf.keras.Sequential","(",")","model.add","(","tf.keras.layers.Dense","(","8",")",")","model.add","(","tf.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 input_spec(self):
      if hasattr(self, "_manual_input_spec"):
          return self._manual_input_spec
      if self.layers and hasattr(self.layers[0], "input_spec"):
          return self.layers[0].input_spec
      return None
  
imports: import copy
  import warnings
  from tensorflow.python import tf2
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import tensor_util
  from tensorflow.python.keras import layers
  from tensorflow.python.keras.engine import base_layer
  from tensorflow.python.keras.engine import functional
  from tensorflow.python.keras.engine import input_layer
  from tensorflow.python.keras.engine import training_utils
  from tensorflow.python.keras.saving.saved_model import model_serialization
  from tensorflow.python.keras.utils import generic_utils
  from tensorflow.python.keras.utils import layer_utils
  from tensorflow.python.keras.utils import tf_inspect
  from tensorflow.python.keras.utils import tf_utils
  from tensorflow.python.module import module
  from tensorflow.python.ops.numpy_ops import np_arrays
  from tensorflow.python.platform import tf_logging
  from tensorflow.python.trackable import base
  from tensorflow.python.util import nest
label_desc: Use image node_id 14 for calling the Sequential obj's underlying member method code with example usage: obj.input_spec() and returns: None, self, self