Tensorflow SavedModel graph is lexicographically instead of numerically ordered
@p3achyjr,
Could you please provide the complete code to reproduce the issue and it helps us to analyse the issue in an effective way. Thank you! ```
class Model(tf.keras.Model):
  def call(self, x):
    return (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11)
    
model = Model()
model(tf.convert_to_tensor(5))
model.save(dir)
```

```
saved_model_cli show --dir dir --all
``` @p3achyjr,
While executing the above mentioned code, I was facing a different error. Kindly find the gist of it [here](https://colab.research.google.com/gist/tilakrayal/92fd4e742af25fe8a1540e56df4514b6/untitled1242.ipynb) and provide the complete code and the dependencies to reproduce the issue. Thank you! sorry about that, try this?

https://colab.research.google.com/gist/p3achyjr/b4930a63f215ff23615bdcd12a08fc4f/untitled1242.ipynb @p3achyjr,
Where do you call the loaded saved model?

If you call from python, you could directly do this:

```
rt = tf.ragged.constant([[["hey"]]])
t = tf.constant([1])
loaded({"ragged_tensor_input": rt, "nested_tensor_input": {"nested_tensor1": t}})
```

Also please take a look at this comment from the developer for the similar issue.
https://github.com/tensorflow/tensorflow/issues/56819#issuecomment-1241215918

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/61251">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/61251">No</a>

### Issue type

Bug

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

No

### Source

source

### TensorFlow version

2.11

### Custom code

Yes

### OS platform and distribution

Ubuntu (not sure version)

### Mobile device

_No response_

### Python version

3.8.10

### Bazel version

_No response_

### GCC/compiler version

9

### CUDA/cuDNN version

_No response_

### GPU model and memory

_No response_

### Current behavior?

I have a SavedModel, and when I used saved_model_cli show, I see this:

```
signature_def['serving_default']:
  The given SavedModel SignatureDef contains the following input(s):
    inputs['args_0'] tensor_info:
        dtype: DT_FLOAT
        shape: (-1, 19, 19, 13)
        name: serving_default_args_0:0
    inputs['args_1'] tensor_info:
        dtype: DT_FLOAT
        shape: (-1, 7)
        name: serving_default_args_1:0
  The given SavedModel SignatureDef contains the following output(s):
    outputs['output_1'] tensor_info:
        dtype: DT_FLOAT
        shape: (-1, 362)
        name: StatefulPartitionedCall:0
    outputs['output_10'] tensor_info:
        dtype: DT_FLOAT
        shape: (-1)
        name: StatefulPartitionedCall:1
    outputs['output_11'] tensor_info:
        dtype: DT_FLOAT
        shape: (-1)
        name: StatefulPartitionedCall:2
    outputs['output_12'] tensor_info:
        dtype: DT_FLOAT
        shape: (-1)
        name: StatefulPartitionedCall:3
    outputs['output_2'] tensor_info:
        dtype: DT_FLOAT
        shape: (-1, 362)
        name: StatefulPartitionedCall:4
    outputs['output_3'] tensor_info:
        dtype: DT_FLOAT
        shape: (-1, 2)
        name: StatefulPartitionedCall:5
    outputs['output_4'] tensor_info:
        dtype: DT_FLOAT
        shape: (-1, 2)
        name: StatefulPartitionedCall:6
    outputs['output_5'] tensor_info:
        dtype: DT_FLOAT
        shape: (-1, 19, 19, 1)
        name: StatefulPartitionedCall:7
    outputs['output_6'] tensor_info:
        dtype: DT_FLOAT
        shape: (-1, 800)
        name: StatefulPartitionedCall:8
    outputs['output_7'] tensor_info:
        dtype: DT_FLOAT
        shape: (-1, 800)
        name: StatefulPartitionedCall:9
    outputs['output_8'] tensor_info:
        dtype: DT_FLOAT
        shape: (-1, 1)
        name: StatefulPartitionedCall:10
    outputs['output_9'] tensor_info:
        dtype: DT_FLOAT
        shape: (-1, 362)
        name: StatefulPartitionedCall:11
```

In this case, 'output_10' appears before 'output_9', and the order of the 'StatefulPartitionedCall' nodes get messed up.

I think that the outputs should be numerically ordered, either by sorting internally, or by padding the output index to a fixed with (i.e. {%03d}.format(IDX)

### Standalone code to reproduce the issue

```shell
save a model with more than 10 outputs
```


### Relevant log output

_No response_