I'm a PyTorch user but recently reading some code implemented using tensorflow. My question is, if we just have a simple neural network like this, where is the input size specified? Or is this model allowed to work with a variable size input?
class SimpleNet(tf.keras.Model):
def __init__(self):
super(SimpleNet, self).__init__()
activation = tf.keras.activations.tanh
self.features = [
#Where is the input size specified?
tf.keras.layers.Dense(89, activation),
tf.keras.layers.Dense(6 * 32, activation),
tf.keras.layers.Dense(32, activation),
tf.keras.layers.Dense(1),
]
def process(self, x):
x = apply_layers(x, self.features)
return x
...