experimental_convert_saved_model_to_mlir strips public functions with expected names from exported MLIR
@matthiaskramm for visibility (can't seem to assign you) Thanks for the detailed bug report! I'll take a look. (Give me a few days, I'm in the middle of another thing.) I can't find a pass that would already do this (take the exported_names and create a wrapper function for each). The one that comes closest is `tensorflow/compiler/mlir/tfrt/transforms/lower_saved_model.cc`, but it duplicates the function(s) in question which I don't think we should.

Will write a new pass and hook up to `tf-lower-to-mlprogram-and-hlo`. This should be fixed now. (In tf-nightly) Hi, @dellis23 

Apologize for the delayed response and I was able to replicate the same issue with `tf-nightly` and I have added [gist-file](https://colab.research.google.com/gist/gaikwadrahul8/d4697e78fc93c5b2440e6898cfb00a03/-59685.ipynb) for your reference and May I know have we taken care of your issue in `tf-nightly` please ? Thank you!

I have added details about `simple-model.mlir` below:

```
module {
  func.func @train(%arg0: tensor<f32>) -> tensor<f32> {
    %0 = call @__inference_train_3160_internal(%arg0) : (tensor<f32>) -> tensor<f32>
    return %0 : tensor<f32>
  }
  ml_program.global public mutable @vars.__sm_node1__w(dense<1.200000e+01> : tensor<f32>) : tensor<f32>
  ml_program.global public mutable @vars.__sm_node2__b(dense<7.000000e+00> : tensor<f32>) : tensor<f32>
  func.func private @__inference_train_3160_internal(%arg0: tensor<f32>) -> tensor<f32> {
    %0 = ml_program.global_load @vars.__sm_node1__w : tensor<f32>
    %1 = stablehlo.add %0, %arg0 : tensor<f32>
    ml_program.global_store @vars.__sm_node1__w = %1 : tensor<f32>
    %2 = ml_program.global_load @vars.__sm_node1__w : tensor<f32>
    %3 = ml_program.global_load @vars.__sm_node2__b : tensor<f32>
    %4 = stablehlo.add %3, %arg0 : tensor<f32>
    ml_program.global_store @vars.__sm_node2__b = %4 : tensor<f32>
    return %2 : tensor<f32>
  }
}
``` @gaikwadrahul8 No worries! Yes, this seems to be fixed in the latest nightly. Thanks. Hi, @dellis23 

Thank you for the confirmation and Could you please confirm if this issue is resolved for you ? Please feel free to close the issue if it is resolved ? Thank you! 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/59685">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/59685">No</a>

<details><summary>Click to expand!</summary> 
 
 ### Issue Type

Bug

### Have you reproduced the bug with TF nightly?

Yes

### Source

source

### Tensorflow Version

v1.12.1-89390-gf1ef1162316 2.13.0-dev20230214

### Custom Code

Yes

### OS Platform and Distribution

_No response_

### Mobile device

_No response_

### Python version

_No response_

### Bazel version

_No response_

### GCC/Compiler version

_No response_

### CUDA/cuDNN version

_No response_

### GPU model and memory

_No response_

### Current Behaviour?

Using `experimental_convert_saved_model_to_mlir` to generate MLIR for a model strips nice names (e.g. "train") and leaves behind funky ones (e.g. "__inference_train_250").

See https://github.com/iree-org/iree/issues/10849#issuecomment-1430031039 for more background.

### Standalone code to reproduce the issue

```python
import tensorflow as tf
from tensorflow.python import pywrap_mlir
from pathlib import Path


class MyModel(tf.Module):
  def __init__(self, **kwargs):
    super().__init__(**kwargs)
    self.w = tf.Variable(5.0, name='weight')
    self.b = tf.Variable(0.0, name='bias')

  @tf.function
  def train(self, x):
    self.w.assign_add(x)
    self.b.assign_add(x)
    return self.w


m = MyModel()
m.train(tf.constant(3.0))
m.train(tf.constant(4.0))
tf.saved_model.save(m, '/tmp/simple-model')


def convert_to_hlo(model_path: str):
  result = pywrap_mlir.experimental_convert_saved_model_to_mlir(
      model_path, "", show_debug_info=False)
  pipeline = ["tf-lower-to-mlprogram-and-hlo"]
  result = pywrap_mlir.experimental_run_pass_pipeline(
      result, ",".join(pipeline), show_debug_info=False)
  return result

Path("/tmp/simple-model.mlir").write_text(
  convert_to_hlo("/tmp/simple-model"))
```

This generates the following MLIR:

```mlir
module {
  ml_program.global public mutable @vars.__sm_node1__w(dense<1.200000e+01> : tensor<f32>) : tensor<f32>
  ml_program.global public mutable @vars.__sm_node2__b(dense<7.000000e+00> : tensor<f32>) : tensor<f32>
  func.func @__inference_train_250(%arg0: tensor<f32>) -> tensor<f32> {
    %0 = ml_program.global_load @vars.__sm_node1__w : tensor<f32>
    %1 = stablehlo.add %0, %arg0 : tensor<f32>
    ml_program.global_store @vars.__sm_node1__w = %1 : tensor<f32>
    %2 = ml_program.global_load @vars.__sm_node1__w : tensor<f32>
    %3 = ml_program.global_load @vars.__sm_node2__b : tensor<f32>
    %4 = stablehlo.add %3, %arg0 : tensor<f32>
    ml_program.global_store @vars.__sm_node2__b = %4 : tensor<f32>
    return %2 : tensor<f32>
  }
}
```

Note the name `__inference_train_250` rather than the expected `train`.


### Relevant log output

_No response_</details>