Repository: pytorch
Issue: max_pool1d(): argument 'dilation' must be tuple of ints, but found element of type int at pos 1
Labels: triaged,module: pooling,module: edge cases

### 🐛 Describe the bug

`max_pool1d(): argument 'dilation' must be tuple of ints, but found element of type int at pos 1` when arguments are large.

### Example to reproduce
Using the code below, I vary three arguments `kernel_size`, `stride` and `dilation variables` (using a variable `i`).

Set `i` (i.e. the value of the variables) to be beyond the range of `int64_t` e.g. `sys.maxsize + 1` (i.e. 2^63) or `- (sys.maxsize + 2)` (i.e. -2^63 - 1). I tried this because I notice that `kernel_size`, `stride` and `dilation variables` are [stored as arrays of int64_t const variables](https://github.com/pytorch/pytorch/blob/74fe57079f00d7a74f1fccffd35a1970da3982a6/aten/src/ATen/native/MaxPooling.cpp#L17). 

Example 1: 

```python
import torch
import sys

# Set value of variables
i = sys.maxsize + 1

self = torch.full((2, 10, 4,), 0.5, dtype=torch.float64, requires_grad=False)
kernel_size = [i]  # Set above
stride = [i]  # Set above
padding = [0]
dilation = [i]  # Set above
ceil_mode = True
torch.max_pool1d(self, kernel_size, stride, padding, dilation, ceil_mode)
```

Example 2:

```python
import torch
import sys

self = torch.full((2, 10, 4,), 0.5, dtype=torch.float64, requires_grad=False)
kernel_size = [sys.maxsize + 1]  # Set to larger than `int64_t`
stride = [1]  # Set to 1
padding = [0]
dilation = [1]  # Set to 1
ceil_mode = True
torch.max_pool1d(self, kernel_size, stride, padding, dilation, ceil_mode)
```


### Result

Example 1:

```stacktrace
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: max_pool1d(): argument 'dilation' must be tuple of ints, but found element of type int at pos 1
```

Example 2:

Note that if I go beyond the range for `int64_t` for `stride` or `padding` instead while setting the other two to `1`, the name of the argument is reflected in the error message instead of `'kernel_size'`

```stacktrace
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: max_pool1d(): argument 'kernel_size' must be tuple of ints, but found element of type int at pos 1
```

### Expected behavior
An error indicating there's an integer overflow

### Versions

PyTorch version: 1.10.1+cu102
Is debug build: False
CUDA used to build PyTorch: 10.2
ROCM used to build PyTorch: N/A

OS: Ubuntu 20.04.4 LTS (x86_64)
GCC version: (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0
Clang version: Could not collect
CMake version: version 3.16.3
Libc version: glibc-2.31

Python version: 3.9.7 (default, Sep 16 2021, 13:09:58)  [GCC 7.5.0] (64-bit runtime)
Python platform: Linux-5.11.0-27-generic-x86_64-with-glibc2.31
Is CUDA available: True
CUDA runtime version: Could not collect
GPU models and configuration:
GPU 0: NVIDIA GeForce GTX 1080 Ti
GPU 1: NVIDIA GeForce GTX 1080 Ti
GPU 2: NVIDIA GeForce GTX 1080 Ti
GPU 3: NVIDIA GeForce GTX 1080 Ti

Nvidia driver version: 470.103.01
cuDNN version: Could not collect
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: True

Versions of relevant libraries:
[pip3] mypy-extensions==0.4.3
[pip3] numpy==1.21.4
[pip3] torch==1.10.1
[conda] mypy-extensions           0.4.3                    pypi_0    pypi
[conda] numpy                     1.21.4                   pypi_0    pypi
[conda] torch                     1.10.1                   pypi_0    pypi