fix type check of overflow (#107579)
Fixes #95451 and remove duplicate check
**Code:**
```python
import torch
import sys
i = sys.maxsize + 1
input = torch.full((1, 32, 32,), 0.5)
torch.max_pool1d(input, kernel_size=[i] , stride=[i], padding=0, dilation=[i], ceil_mode=True)
```
**Result:**
```shell
Traceback (most recent call last):
File "/root/Git.d/pytorch/samples/src/simple.py", line 13, in <module>
torch.max_pool1d(input, kernel_size=[i] , stride=[i], padding=0, dilation=[i], ceil_mode=True)
TypeError: max_pool1d(): argument 'dilation' failed to unpack the object at pos 1 with error "Overflow when unpacking long"
```
Pull Request resolved: https://github.com/pytorch/pytorch/pull/107579
Approved by: https://github.com/albanD