Given some TensorSpec or some tuple of TensorSpec's, is there a (simple) way to make a tf.keras.Inputs for some tf.keras.Model where the input has its shape specified in the TensorSpec ?
For example:
import tensorflow as tf
spec = tf.TensorSpec([2], dtype=tf.float32)
inputs = tf.keras.Input((2,)) # how to define these inputs from spec ?
outputs = tf.keras.layers.Dense(units=10, activation='sigmoid')(inputs)
model = tf.keras.Model(inputs=inputs, outputs=outputs)
with model.input_shape = (None, 2)
, but also to work with a tuple of TensorSpec's:
import tensorflow as tf
spec = (tf.TensorSpec([2], dtype=tf.float32), tf.TensorSpec([5], dtype=tf.float32))
inputs = (tf.keras.Input((2,)), tf.keras.Input((5,))) # how to define these inputs from spec ?
x = tf.concat(inputs, axis=1)
outputs = tf.keras.layers.Dense(units=10, activation='sigmoid')(x)
model = tf.keras.Model(inputs=inputs, outputs=outputs)
with model.input_shape = ((None, 2), (None, 5))
.