TPU Tensorflow mapping string label to int with 
@SuryanarayanaY 
I was able to reproduce the issue on colab using tf2.12 and TPU but it is working as expected on the GPU. Please find the gist of [TPU](https://colab.research.google.com/gist/tiruk007/9ef6fcbbf829dfad381dee7615a7b771/tpu.ipynb) & [GPU](https://colab.research.google.com/gist/tiruk007/341fc13fcaafbf96af8357e971d128ec/gpu.ipynb) for reference.

Thank you ! Hi @Shiro-LK ,

At present not all Ops are executable with TPUs. The iter operation might be one of them. Also, from the error log: 

`Executing non-communication op <MakeIterator> originally returned UnavailableError, and was replaced by InternalError to avoid invoking TF network error handling logic` 

 It seems `iter` operation not supported on TPUs.

You can find the TPU supported Ops list [here](https://cloud.google.com/tpu/docs/tensorflow-ops) for reference. Please cross check the source and confirm. If you find anything missing here please revert back to us.

Thanks! Thank, I suppose this ops is not compatible for the moment, but it is not mentionned in this documentation. I succeed to make it works without changing anything though, but it may work one time every 20 attempt. Not sure how it is possible. @SuryanarayanaY 
<details><summary>Click to expand!</summary> 
 
 ### Issue Type

Bug

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

No

### Source

source

### Tensorflow Version

2.12

### Custom Code

Yes

### OS Platform and Distribution

Colab

### Mobile device

_No response_

### Python version

_No response_

### Bazel version

_No response_

### GCC/Compiler version

_No response_

### CUDA/cuDNN version

None

### GPU model and memory

None

### Current Behaviour?

I currently get an error when trying to get my batch from a tf.dataset. I am mapping the string label in the tfrecord into int with tf.lookup.StaticHashTable. 
```
InternalError: failed to connect to all addresses; last error: UNKNOWN: ipv4:127.0.0.1:37044: Failed to connect to remote host: Connection refused
Additional GRPC error information from remote target /job:localhost/replica:0/task:0/device:CPU:0:
```

Because of that I can't get the batch of my dataset, and train a model with TPU. It works fine with GPU.

### Standalone code to reproduce the issue

```shell
https://colab.research.google.com/drive/1vAADMl5fBulmSnbmbOTrMjyzAYAgHhFl?authuser=1#scrollTo=_zv9OlXbIqDf
```


### Relevant log output

```shell
AttributeError                            Traceback (most recent call last)

/usr/local/lib/python3.9/dist-packages/tensorflow/python/data/ops/iterator_ops.py in _next_internal(self)
    786         # Fast path for the case `self._structure` is not a nested structure.
--> 787         return self._element_spec._from_compatible_tensor_list(ret)  # pylint: disable=protected-access
    788       except AttributeError:

AttributeError: 'tuple' object has no attribute '_from_compatible_tensor_list'


During handling of the above exception, another exception occurred:

InternalError                             Traceback (most recent call last)

13 frames

InternalError: failed to connect to all addresses; last error: UNKNOWN: ipv4:127.0.0.1:37044: Failed to connect to remote host: Connection refused
Additional GRPC error information from remote target /job:localhost/replica:0/task:0/device:CPU:0:
:UNKNOWN:failed to connect to all addresses; last error: UNKNOWN: ipv4:127.0.0.1:37044: Failed to connect to remote host: Connection refused {grpc_status:14, created_time:"2023-04-16T09:15:30.550805248+00:00"}
Executing non-communication op <MakeIterator> originally returned UnavailableError, and was replaced by InternalError to avoid invoking TF network error handling logic.


During handling of the above exception, another exception occurred:

InternalError                             Traceback (most recent call last)

/usr/local/lib/python3.9/dist-packages/tensorflow/python/eager/executor.py in wait(self)
     63   def wait(self):
     64     """Waits for ops dispatched in this executor to finish."""
---> 65     pywrap_tfe.TFE_ExecutorWaitForAllPendingNodes(self._handle)
     66 
     67   def clear_error(self):

InternalError: failed to connect to all addresses; last error: UNKNOWN: ipv4:127.0.0.1:37044: Failed to connect to remote host: Connection refused
Additional GRPC error information from remote target /job:localhost/replica:0/task:0/device:CPU:0:
:UNKNOWN:failed to connect to all addresses; last error: UNKNOWN: ipv4:127.0.0.1:37044: Failed to connect to remote host: Connection refused {grpc_status:14, created_time:"2023-04-16T09:15:30.550805248+00:00"}
Executing non-communication op <MakeIterator> originally returned UnavailableError, and was replaced by InternalError to avoid invoking TF network error handling logic.
```
</details>