tf.math.real can accept string tensor, inconsistent with the documentation.
Hi, I also notice that tf.math.imag has the same issue. To reproduce:
```
import tensorflow as tf
x = tf.constant(["Hello"])
res = tf.math.imag(x)
print(res)
```
Expected output: a proper exception
Actual output: pass without exception
 This issue has been resolved as of https://github.com/tensorflow/tensorflow/pull/60540. @drewshark,
I tried to execute the code on tf-nightly(2.14.0-dev20230615) and it was providing the error for **tf.math.real** . Kindly find the gist of it [here](https://colab.research.google.com/gist/tilakrayal/6b8ef392fe64fddcd374c69d28f3a89a/untitled1205.ipynb) and also the related PR #60540  was also merged.

```
      .def_property_readonly(
          "is_numeric",
          [](tensorflow::DataType self) {
            return tensorflow::DataTypeIsNumeric(tensorflow::BaseType(self));
          },
          "Returns whether this is a numeric data type.")

```
https://github.com/tensorflow/tensorflow/pull/60540/files

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

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

Bug

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

Yes

### Source

source

### Tensorflow Version

tf-nightly

### Custom Code

Yes

### OS Platform and Distribution

_No response_

### Mobile device

_No response_

### Python version

3.9

### Bazel version

_No response_

### GCC/Compiler version

_No response_

### CUDA/cuDNN version

_No response_

### GPU model and memory

_No response_

### Current Behaviour?

Following the documentation: https://www.tensorflow.org/api_docs/python/tf/math/real, the input of tf.math.real should be a numeric tensor. However, this API can still pass when processing the string tensor. In contrast, other math operators such as tf.math.reduce_all, tf.math.log will raises an InvalidArgumentError.


### Standalone code to reproduce the issue

```shell
import tensorflow as tf
x = tf.constant(["Hello"])
res = tf.math.real(x)
print(res)
```


### Relevant log output

```shell
tf.Tensor([b'Hello'], shape=(1,), dtype=string)
```
</details>