bug feedback
@seems666,
When I was trying to execute the mentioned code on tensorflow v2.11, the code was executed only one time and also the output was generated.
![Screenshot 2023-03-18 9 32 23 AM](https://user-images.githubusercontent.com/81610181/226083925-49a6357d-214a-461c-82ea-004d22defe42.png)

Also **tf.keras.layers.MaxPool2D** performs the Max pooling operation for 2D spatial data. Kindly find the gist of it [here](https://colab.research.google.com/gist/tilakrayal/061afd80e107214219f8000ca3093c85/untitled1041.ipynb) and you are using tensoflow v2.5 which was a bit old. So please try to install tensorflow v2.11 which is the latest stable version. 

Thank you! > 

Got it, thank you very much! @seems666,
Good to hear that your issue got resolved and thank you for the confirmation. So Could you please feel free to close this issue and If you need any further assistance please feel free to create a new issue. Thank you! 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/60028">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/60028">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.5

### Custom Code

Yes

### OS Platform and Distribution

Windows 10 21H2 9044.2604

### Mobile device

_No response_

### Python version

3.7

### Bazel version

_No response_

### GCC/Compiler version

_No response_

### CUDA/cuDNN version

11.6

### GPU model and memory

_No response_

### Current Behaviour?

```shell
A bug happened!
Operator MaxPool2D has no output for a long time and doesn't throw any Exception when kernel_size is greater than the height of input_data
```


### Standalone code to reproduce the issue

```shell
import tensorflow as tf
import numpy as np

nums = 1
in_channels = 1
out_channels = 3
height = 1
width = 1
kernel_size = 3
stride = 2
pad_mode = 'valid'
tf_data = np.ones([nums, in_channels, height, width], float)
try:
    print(tf.keras.layers.MaxPool2D(pool_size=(kernel_size, kernel_size), strides=stride, 
          padding=pad_mode,data_format='channels_first')(tf_data))
except BaseException as e:
    print(e)
```


### Relevant log output

```shell
the code is always running without any output or exception
```
</details>