A symbolic tensor is a placeholder that carries shape and dtype information without containing actual data. It represents the future tensors a model will process. section 7.2.2
Following shape information through layers
In a Keras Functional model, keras.Input(shape=(3,)) creates a symbolic tensor with shape (None, 3) and dtype float32. Calling a Dense(64) layer on it returns another symbolic tensor with shape (None, 64). A final Dense(10) layer produces the model output, which can be passed with the input to keras.Model. section 7.2.2
Use symbolic tensors to:
- Describe model inputs before supplying real arrays. section 7.2.2
- Connect layers while tracking updated shape and dtype information. section 7.2.2
- Build graph-shaped models with multiple inputs or outputs. section 7.2.2
Listing 7.8 A simple Functional model with two Dense layers
inputs = keras.Input(shape=(3,), name="my_input") features = layers.Dense(64, activation="relu")(inputs) outputs = layers.Dense(10, activation="softmax")(features) model = keras.Model(inputs=inputs, outputs=outputs, name="my_functional_model")
A compact Functional API example shows symbolic input creation, layer composition, and model construction. section 7.2.2

