Error message of tf.clip_by_norm is wrong
Hi @cheyennee 

Although the error messages in these two cases are different, they are both consistent with the documentation. The first error message indicates that the tensor type (boolean) is not allowed, while the second error message indicates that the data type (int32) is not compatible with a floating point type.
Thank you! Hi, @synandi  What confuses me is that the error message should be consistent in both two cases, no matter what type of param `t` is input. @cheyennee 
The two errors have different ops because they are caused by different TensorFlow operations.

In the first code snippet, the error is caused by `tf.clip_by_norm`, which internally uses the `tf.multiply` operation (also known as Mul) to perform element-wise multiplication between the input tensor `t` and its scaled norm.

In the second code snippet, the error is caused by the `tf.sqrt` operation, which expects its input tensor to have a floating-point type (bfloat16, half, float, double, complex64, or complex128). However, in this case, the input tensor `t` has an integer type (int32), which is not allowed.

Thank you! @synandi Got that. Thanks for detailed explanation. 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/60444">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/60444">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/versions/r2.4/api_docs/python/tf/clip_by_norm), the param `t` should be a Tensor or IndexedSlices, which must be a floating point type. But when `t` is [True, True], the error message indicates that `t` can be int type. More importantly, the error message when `t` is bool type is different from the error message when `t` is int type.

### Standalone code to reproduce the issue

```shell
snippet code 1:

import tensorflow as tf
results={}
try:
  t = [True,True]
  clip_norm = 1.0
  results["res"] = tf.clip_by_norm(t=t,clip_norm=clip_norm,)
except Exception as e:
  results["err"] = "Error:"+str(e)
print(results)
#results={'err': "Error:Value for attr 'T' of bool is not in the list of allowed values: bfloat16, half, float, double, uint8, int8, uint16, int16, int32, uint32, uint64, int64, complex64, complex128\n\t; NodeDef: {{node Mul}}; Op<name=Mul; signature=x:T, y:T -> z:T; attr=T:type,allowed=[DT_BFLOAT16, DT_HALF, DT_FLOAT, DT_DOUBLE, DT_UINT8, DT_INT8, DT_UINT16, DT_INT16, DT_INT32, DT_UINT32, DT_UINT64, DT_INT64, DT_COMPLEX64, DT_COMPLEX128]; is_commutative=true> [Op:Mul]"}
```

snippet code 2:
```
import tensorflow as tf
results={}
try:
  t = [1,1,]
  clip_norm = 1.0
  results["res"] = tf.clip_by_norm(t=t,clip_norm=clip_norm,)
except Exception as e:
  results["err"] = "Error:"+str(e)
print(results)
# results={'err': "Error:Value for attr 'T' of int32 is not in the list of allowed values: bfloat16, half, float, double, complex64, complex128\n\t; NodeDef: {{node Sqrt}}; Op<name=Sqrt; signature=x:T -> y:T; attr=T:type,allowed=[DT_BFLOAT16, DT_HALF, DT_FLOAT, DT_DOUBLE, DT_COMPLEX64, DT_COMPLEX128]> [Op:Sqrt]"}
```
```


### Relevant log output

_No response_</details>