TensorFlow 2.0 RC is available Learn more

tf.keras.layers.InputLayer

TensorFlow 2.0 version View source on GitHub

Class InputLayer

Layer to be used as an entry point into a Network (a graph of layers).

Inherits From: Layer

Aliases:

  • Class tf.compat.v1.keras.layers.InputLayer
  • Class tf.compat.v2.keras.layers.InputLayer

It can either wrap an existing tensor (pass an input_tensor argument) or create its a placeholder tensor (pass arguments input_shape, and optionally, dtype).

It is generally recommend to use the functional layer API via Input, (which creates an InputLayer) without directly using InputLayer.

Arguments:

  • input_shape: Shape tuple (not including the batch axis), or TensorShape instance (not including the batch axis).
  • batch_size: Optional input batch size (integer or None).
  • dtype: Datatype of the input.
  • input_tensor: Optional tensor to use as layer input instead of creating a placeholder.
  • sparse: Boolean, whether the placeholder created is meant to be sparse.
  • name: Name of the layer (string).

__init__

View source

__init__(
    input_shape=None,
    batch_size=None,
    dtype=None,
    input_tensor=None,
    sparse=False,
    name=None,
    **kwargs
)