Tensorflow weird GPU memory usage universal-sentence-encoder
@nitishvu,
I was facing a different issue while executing the above mentioned code. Kindly find the gist of it [here](https://colab.research.google.com/gist/tilakrayal/1e0f62846cab4956ca733d98b81bb4a3/untitled1512.ipynb). Also clear_session() is not enough to reset states and ensure reproducibility. Also needed the Set (& reset) random seeds, Reset TensorFlow default graph and delete the previous model.

https://github.com/keras-team/keras/issues/9379
https://stackoverflow.com/questions/58453793/the-clear-session-method-of-keras-backend-does-not-clean-up-the-fitting-data

Thank you!

 This issue is stale because it has been open for 7 days with no activity. It will be closed if no further activity occurs. Thank you. This issue was closed because it has been inactive for 7 days since being marked as stale. Please reopen if you'd like to work on this further. 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/62366">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/62366">No</a>

### Issue type

Performance

### Have you reproduced the bug with TensorFlow Nightly?

No

### Source

binary

### TensorFlow version

v2.14.0-rc1-21-g4dacf3f368e 2.14.0

### Custom code

Yes

### OS platform and distribution

ubuntu 20.04

### Mobile device

_No response_

### Python version

3.9.17

### Bazel version

_No response_

### GCC/compiler version

_No response_

### CUDA/cuDNN version

12.0

### GPU model and memory

_No response_

### Current behavior?

Hi I am new to TensorFlow, GPU,Models everything :)

I am using the below code to generate text embeddings

```
texts = [ "This is the first sentence.","Another sentence for embedding.","Embeddings are useful for NLP."]
import tensorflow as tf
import numpy as np

# Path to the saved USE model directory
use_model_path = "universal-sentence-encoder"
# Configure GPU memory growth
gpus = tf.config.experimental.list_physical_devices('GPU')
if gpus:
    for gpu in gpus:
        tf.config.experimental.set_memory_growth(gpu, True)
        
use_model = tf.saved_model.load(use_model_path)

embeddings_list = []
embeddings = use_model(texts)
embeddings_list = embeddings.numpy().tolist()
#clear session
tf.keras.backend.clear_session()


print(embeddings_list)
```
If I execute this in a for loop with a list of 512kb texts, GPU memory increases exponentially. Even after adding tf.keras.backend.clear_session() in every iteration, I see the same behavior.

I am expecting it to release memory on each iteration.
 I know we can do this in batches but I am planning to us this as a REST API.
how can I optimize this?

### Standalone code to reproduce the issue

```shell
texts = [ "This is the first sentence.","Another sentence for embedding.","Embeddings are useful for NLP."]
import tensorflow as tf
import numpy as np

# Path to the saved USE model directory
use_model_path = "universal-sentence-encoder"
# Configure GPU memory growth
gpus = tf.config.experimental.list_physical_devices('GPU')
if gpus:
    for gpu in gpus:
        tf.config.experimental.set_memory_growth(gpu, True)
        
use_model = tf.saved_model.load(use_model_path)

embeddings_list = []
embeddings = use_model(texts)
embeddings_list = embeddings.numpy().tolist()
#clear session
tf.keras.backend.clear_session()


print(embeddings_list)
```


### Relevant log output

_No response_