The `mask` dtype should be asserted to be boolean in `tf.compat.v1.boolean_mask` (and `tf.boolean_mask`)
@SuryanarayanaY  I was able to replicate this issue on colab, please find the [gist](https://colab.research.google.com/gist/sushreebarsa/f2a39e8023cb25652a046bda86f7ebc6/61820.ipynb) here. Thank you! The best we could do is update the documentation, since there are several users who already rely on this behavior.
### Issue type

Bug

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

Yes

### Source

binary

### TensorFlow version

2.14.0-rc1

### Custom code

Yes

### OS platform and distribution

_No response_

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

The `mask` dtype should be asserted to be boolean in `tf.compat.v1.boolean_mask` (and `tf.boolean_mask`).
The documentation [`tf.boolean_mask`](https://www.tensorflow.org/api_docs/python/tf/boolean_mask) states that the `mask` is a K-D boolean Tensor, K <= N and K must be known statically.
However, currently, the `mask` dtype is not asserted to be boolean in `tf.compat.v1.boolean_mask` (and `tf.boolean_mask`) and cast to boolean if it is not a boolean Tensor, which may lead to unexpected results.
Generally, only the `0` and `1` values in the `mask` can be directly treated as `False` and `True` respectively, while other values should be determined by certain rules in different scenarios (_e.g._ negative values can be treated as `False` in some scenarios, or close to `0` values can be treated as `False` in some other scenarios).

I think it's worth updating the documentation to state that the `mask` will be cast to boolean if it is not a boolean Tensor, or warning users that the `mask` dtype should be boolean.
As mentioned in #54412, it is better to raise an InvalidArgumentError Exception when the `mask` dtype is not boolean, which forces users to cast the `mask` to boolean explicitly.


### Standalone code to reproduce the issue

```python
import tensorflow as tf
print(tf.version.GIT_VERSION, tf.version.VERSION, flush=True)
print(tf.config.list_physical_devices(), flush=True)


try:
    tensor = [0,1,2,3]
    mask = tf.random.uniform([4], dtype=tf.float64)
    x1 = tf.compat.v1.boolean_mask(tensor, mask) 
    print(x1, flush=True)
except Exception as e:
    print("Success! Error:", str(e), flush=True)
else:
    print("Failed!", flush=True)
```


### Relevant log output

```text
v2.14.0-rc0-34-gdd01672d9a9 2.14.0-rc1
[PhysicalDevice(name='/physical_device:CPU:0', device_type='CPU'), PhysicalDevice(name='/physical_device:GPU:0', device_type='GPU')]
tf.Tensor([0 1 2 3], shape=(4,), dtype=int32)
Failed!
```
