tf.raw_ops.QuantizeAndDequantizeV4 (and v3) crash (abort)
Related: [#57714](https://github.com/tensorflow/tensorflow/issues/57714) @SuryanarayanaY 
I was able to reproduce the issue on colab using TF2.12 and tf-nightly-2.13.0-dev20230328. Please find the gist of [2.12](https://colab.research.google.com/gist/tiruk007/0f943cabe45e4fefea259388f975107b/untitled172.ipynb) and [tf-nightly](https://colab.research.google.com/gist/tiruk007/79ba9fcb07487e91c1947bf526a56946/untitled173.ipynb) for reference.

Thank you! The check fail is happening due to different ` input_min=-1`, `input_max=[-1,1]`. As per [API](https://www.tensorflow.org/api_docs/python/tf/raw_ops/QuantizeAndDequantizeV4) both `input_min` and `input_max` should be of same type and size if `range_given=True`.

Please refer to attached [gist](https://colab.research.google.com/gist/SuryanarayanaY/f1ccb35630bfa6b9109bff3071da2815/untitled173.ipynb). Checked in tf-nightly(2.15.0-dev20231004). Crash due to check fail.

<img width="1505" alt="Screenshot 2023-10-04 at 2 56 17 PM" src="https://github.com/tensorflow/tensorflow/assets/116063290/876ed1f1-f2d6-41aa-9bc0-2fffce48915d">
 @trickiwoo,
I tried to execute the mentioned code on tf-nightly and the code was executed with the error and also observed that the crash did not happen. And the same has been updated in the respective files. Kindly find the [gist](https://colab.research.google.com/gist/tilakrayal/942373beca9c416d031768af09f6f45f/untitled1698.ipynb) for the [reference](https://colab.research.google.com/gist/tilakrayal/4f96cf1a630f777a6075a0737b2567ce/untitled1699.ipynb).

https://github.com/tensorflow/tensorflow/blob/master/tensorflow/core/kernels/quantize_and_dequantize_op.cc#L22

https://github.com/tensorflow/tensorflow/blob/master/tensorflow/core/kernels/resource_variable_ops.cc#L1120
```python
// Check data type of update and resource to scatter.
const DataType update_dtype = c->input(2).dtype();
OP_REQUIRES(c, v->tensor()->dtype() == update_dtype,
errors::InvalidArgument(
"DType of scatter resource and updates does not match."));
```
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/60124">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/60124">No</a>

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

Bug

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

Yes

### Source

source

### Tensorflow Version

2.13.0-dev20230208

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

```shell
tf.raw_ops.QuantizeAndDequantizeV4 (and v3) crash (abort)
```


### Standalone code to reproduce the issue

```shell
import numpy as np
import tensorflow as tf
tf.raw_ops.QuantizeAndDequantizeV4(input=[np.ones((10))], input_min=-1, input_max=[-1, 1], range_given=True)
```


### Relevant log output

```shell
2023-03-26 22:24:03.910007: F tensorflow/core/framework/tensor.cc:778] Check failed: 1 == NumElements() (1 vs. 2)Must have a one element tensor
Aborted (core dumped)
```
</details>