In the definition of keras.Sequential.add, we have (in accordance with the docs)
if isinstance(layer, tf.Module):
if not isinstance(layer, base_layer.Layer):
layer = functional.ModuleWrapper(layer)
else:
raise TypeError('The added layer must be an instance of class Layer. '
f'Received: layer={layer} of type {type(layer)}.')
and yet, when I execute
model = keras.Sequential()
model.add(keras.Input(100))
a TypeError is not raised. keras.Input returns a tensor, and the definition of a KerasTensor shows that it inherits from an Object, and not a Layer.
Why can I add an Input to a Sequential, rather than being required to add an InputLayer as I would expect?