ML Community Day is November 9! Join us for updates from TensorFlow, JAX, and more Learn more

tf.keras.Input

Input() is used to instantiate a Keras tensor.

Used in the notebooks

Used in the guide Used in the tutorials

A Keras tensor is a symbolic tensor-like object, which we augment with certain attributes that allow us to build a Keras model just by knowing the inputs and outputs of the model.

For instance, if a, b and c are Keras tensors, it becomes possible to do: model = Model(input=[a, b], output=c)

shape A shape tuple (integers), not including the batch size. For instance, shape=(32,) indicates that the expected input will be batches of 32-dimensional vectors. Elements of this tuple can be None; 'None' elements represent dimensions where the shape is not known.
batch_size optional static batch size (integer).
name An optional name string for the layer. Should be unique in a model (do not reuse the same name twice). It will be autogenerated if it isn't provided.
dtype The data type expected by the input, as a string (float32, float64, int32...)
sparse A boolean specifying whether the placeholde