TimeDistributed layer with nested model no longer working in TensorFlow 2.16.1
Hi **@Dobiasd** ,

Sorry for the delay, I tried to run your code on colab using TF v2.15, 2.16 and nightly faced the same issue. Please find the [gist](https://colab.sandbox.google.com/gist/Venkat6871/c789131d6e3f056091fc9ac82107d613/65393_2-15-2-16-1-nightly.ipynb) here for reference.

Thank you! Any news on this? Is this going to be resolved, or should we avoid using tf.keras.Model inside TimeDistributed layers from now on? Hi **@Dobiasd** ,
- Please post this issue on [keras-team/keras repo.](https://github.com/keras-team/keras/issues)
To know more see;
[https://discuss.tensorflow.org/t/keras-project-moved-to-new-repository-in-https-github-com-keras-team-keras/1999](https://discuss.tensorflow.org/t/keras-project-moved-to-new-repository-in-https-github-com-keras-team-keras/1999).

Thank you! Ok, done: https://github.com/keras-team/keras/issues/19792 @Dobiasd This is fixed in [upstream](https://github.com/keras-team/keras/commit/bf607fffbac61ab3bf509094c9b7a6a17853458c), so you can close this now. Are you satisfied with the resolution of your issue?
<a href="https://docs.google.com/forms/d/e/1FAIpQLSfaP12TRhd9xSxjXZjcZFNXPGk4kc1-qMdv3gc6bEP90vY1ew/viewform?entry.85265664=Yes&entry.2137816233=https://github.com/tensorflow/tensorflow/issues/65393">Yes</a>
<a href="https://docs.google.com/forms/d/e/1FAIpQLSfaP12TRhd9xSxjXZjcZFNXPGk4kc1-qMdv3gc6bEP90vY1ew/viewform?entry.85265664=No&entry.2137816233=https://github.com/tensorflow/tensorflow/issues/65393">No</a>

With TensorFlow `2.15.1`, the following code works fine:

```python3
import numpy as np
from tensorflow.keras.layers import Input, TimeDistributed, Flatten
from tensorflow.keras.models import Model, Sequential

inputs = [Input((17, 4))]

nested_model = Sequential()
nested_model.add(Flatten(input_shape=(4,)))
nested_model.compile(optimizer='rmsprop', loss='categorical_crossentropy')
outputs = [TimeDistributed(nested_model)(inputs[0])]

model = Model(inputs=inputs, outputs=outputs)
model.compile(loss='mse', optimizer='adam')

x = np.random.random((1, 17, 4))
model.predict(x)
```

But with `2.16.1`, it no longer does:

```
NotImplementedError: Exception encountered when calling TimeDistributed.call().

Layer Sequential should implement `def compute_output_shape(self, input_shape)`.
```