This is my test code:
from keras import layers input1 = layers.Input((2,3)) output = layers.Dense(4)(input1) print(output)
The output is:
<tf.Tensor 'dense_2/add:0' shape=(?, 2, 4) dtype=float32>
But What Happend?
The documentation says:
Note: if the input to the layer has a rank greater than 2, then it is flattened prior to the initial dot product with kernel.
While the output is reshaped?