arguments in tf.math.greater should be the same type
Same issue can be found in `tf.math.greater_equal`. Same issue can be found in `tf.math.less` 、 `tf.math.less_equal` 、`tf.math.maximum`、`tf.math.minimum`. As following code shows, when argument `x` and `y` have different types, it wont throw an exception.
```
import tensorflow as tf
results={}
try:
  x = [-1.7,-1.5]
  y = 8
  results["res"] = tf.math.less(x=x,y=y,)
except Exception as e:
  results["err"] = "Error:"+str(e)
print(results)
# results={'res': <tf.Tensor: shape=(2,), dtype=bool, numpy=array([ True,  True])>}
```
```
import tensorflow as tf
results={}
try:
  x_tensor = tf.random.uniform([16], dtype=tf.bfloat16)
  x = tf.identity(x_tensor)
  y = 2
  results["res"] = tf.math.maximum(x=x,y=y,)
except Exception as e:
  results["err"] = "Error:"+str(e)
print(results)
# results={'res': <tf.Tensor: shape=(16,), dtype=bfloat16, numpy=array([2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2], dtype=bfloat16)>}
``` @cheyennee,
I tried to replicate the code on tf-nightly and also tried the code with alternative input values as well. Kindly find the gist of it [here](https://colab.research.google.com/gist/tilakrayal/0abeabafcbb96c557f335fce9b2d88b3/untitled1108.ipynb).


```
  #x = 16
  #print(type(x))
  #y_tensor = tf.random.uniform([4, 1, 1], dtype=tf.float32)
  #y = tf.identity(tf.random.uniform([4, 1, 1], dtype=tf.float32))
  #print(y)
  results["res"] = tf.math.greater(x=tf.identity(tf.random.uniform([4, 1, 1], dtype=tf.float32)),y=tf.identity(tf.random.uniform([4, 1, 1], dtype=tf.float32)))     
  print(results)

array([[[False]],

       [[False]],

       [[ True]],

       [[ True]]])>}

  #x = 16
  #print(type(x))
  #y_tensor = tf.random.uniform([4, 1, 1], dtype=tf.float32)
  #y = tf.identity(tf.random.uniform([4, 1, 1], dtype=tf.float32))
  #print(y)
  results["res"] = tf.math.greater(x=tf.identity(tf.random.uniform([4, 1, 1], dtype=tf.float16)),y=tf.identity(tf.random.uniform([4, 1, 1], dtype=tf.float16)))     
  print(results)

array([[[ True]],

       [[ True]],

       [[False]],

       [[ True]]])>}
``` @tilakrayal  Hiii, I appreciate you taking the time to provide me with the gist of the issue. I have reviewed the information you shared and the repro results are the same as mine. Please let me know if these APIs do have issues. @cheyennee,
I tried to execute the mentioned code by providing `x=16 (int)` and `y=1.2 (float)`, and it was failing as intended. Whereas with the code you mentioned the input 'y' was converting to the **tf.Tensor** which might be the reason the code was not failing. Kindly find the gist of it [here](https://colab.research.google.com/gist/tilakrayal/484b364414e77b07627f0c13834be3ee/untitled1244.ipynb).

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/60511">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/60511">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 2.12.0

### Custom Code

Yes

### OS Platform and Distribution

win11

### 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?

According to [doc](https://tensorflow.google.cn/api_docs/python/tf/math/greater), the argument `x` and `y` in `tf.math.greater` should be the same type. However, in following snippet code, the type of argument `x` is int and the type of argument `y` is float32, it doesnt throw an exception, which is inconsitent with the doc.

### Standalone code to reproduce the issue

```shell
import tensorflow as tf
results={}
try:
  x = 16
  y_tensor = tf.random.uniform([4, 1, 1], dtype=tf.float32)
  y = tf.identity(y_tensor)
  results["res"] = tf.math.greater(x=x,y=y,)
except Exception as e:
  results["err"] = "Error:"+str(e)
print(results)

results = 'res': <tf.Tensor: shape=(4, 1, 1), dtype=bool, numpy=
array([[[ True]],
      [[ True]],
      [[ True]],
      [[ True]]])>
```
```


### Relevant log output

_No response_</details>