`tf.raw_ops.AvgPool`: negative kernel size is not checked at shape inference step
Hi **@Sehun0819** ,

Sorry for the delay, I tried to run your code on Colab using TF v2.15 and nightly. Please find the [gist](https://colab.sandbox.google.com/gist/Venkat6871/9f60934e6a7e51d8012e1f9214670383/63034_2-15-nightly.ipynb) here for reference.
Thank you!
### Issue type

Bug

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

Yes

### Source

source

### TensorFlow version

tf 2.17

### Custom code

Yes

### OS platform and distribution

Linux Ubuntu 22.04 LTS

### Mobile device

_No response_

### Python version

3.11.7

### Bazel version

6.5.0

### GCC/compiler version

clang 16

### CUDA/cuDNN version

_No response_

### GPU model and memory

_No response_

### Current behavior?

Currently shape inference step of `tf.raw_ops.AvgPool` allows negative kernel size.
Note that debug build rejects it [here](https://github.com/tensorflow/tensorflow/blob/7ba14e559de0112cbf59dc6db6f8c6a18283642a/tensorflow/core/framework/common_shape_fns.cc#L1393-L1394):
```C++
  TF_RETURN_IF_ERROR(GetWindowedOutputSizeFromDims(
      c, in_rows_dim, kernel_rows, stride_rows, padding, &output_rows));
```
, where `kernel_rows` is converted to `DimensionOrConstant` and ends up with assertion failure [here](https://github.com/tensorflow/tensorflow/blob/7ba14e559de0112cbf59dc6db6f8c6a18283642a/tensorflow/core/framework/shape_inference.h#L890-L895):
```C++
inline DimensionOrConstant::DimensionOrConstant(int64_t val) : val(val) {
  DCHECK(val >= 0 || val == InferenceContext::kUnknownDim)
      << "Dimension must be non-negative or equal to "
         "InferenceContext::kUnknownDim but got "
      << val;
}
```


### Standalone code to reproduce the issue

```Python
import tensorflow as tf

tf.compat.v1.disable_eager_execution()

x = tf.raw_ops.AvgPool(
    value=tf.random.normal([1,1,1,1]),
    ksize=[1,-2,1,1],
    strides=[1,1,1,1],
    padding="SAME",
    data_format='NHWC',
    name=None
)

print(x)
```


### Relevant log output

Release Build:
```shell
Tensor("AvgPool:0", shape=(1, 1, 1, 1), dtype=float32)
```

Debug Build:
```shell
2024-02-23 22:18:43.783609: F ./tensorflow/core/framework/shape_inference.h:891] Check failed: val >= 0 || val == InferenceContext::kUnknownDim Dimension must be non-negative or equal to InferenceContext::kUnknownDim but got -2
Aborted (core dumped)
```
