How to get the input shape of TensorFlow layers?:

Continuing the discussion from How to get the input shape of TensorFlow layers?:

Hi @Ammar_Abdullah, You can iterate through the layers in the model and can get the input shapes of the layers. For example,

input1 = keras.Input(shape=(128,))
input2 = keras.Input(shape=(64,))
dense1 = keras.layers.Dense(64)(input1)
dense2 = keras.layers.Dense(32)(input2)
concat = keras.layers.Concatenate()([dense1, dense2])
output = keras.layers.Dense(10)(concat)

model = keras.Model(inputs=[input1, input2], outputs=output)

for layer in model.layers:
    print(layer.input)

Thank You.