Repository: pytorch
Issue: torch.nn.Conv2d/Conv1d's padding mode circular cannot accept 3-dim input
Labels: module: nn,triaged,actionable

### 🐛 Describe the bug

torch.nn.Conv2d can accept 3-dim tensor without batch, 
but when I set padding_mode="circular", Conv2d seemed to get some 
error at the underlying level.

When it's set to other modes, Conv2d will run normally and successfully 
calculate 3-dim input, like this:

```
conv2d_circular = torch.nn.Conv2d(in_channels=256, out_channels=256, kernel_size=3, padding=0, padding_mode="circular")
conv2d_zeros = torch.nn.Conv2d(in_channels=256, out_channels=256, kernel_size=3, padding=0, padding_mode="zeros")
conv2d_reflect = torch.nn.Conv2d(in_channels=256, out_channels=256, kernel_size=3, padding=0, padding_mode="reflect")
conv2d_replicate = torch.nn.Conv2d(in_channels=256, out_channels=256, kernel_size=3, padding=0, padding_mode="replicate")

x_3dim = torch.randn(256, 32, 32)
```
these ran without any error:
```
print(conv2d_zeros(x_3dim).shape)
print(conv2d_reflect(x_3dim).shape)
print(conv2d_replicate(x_3dim).shape)
```
output:
```
torch.Size([256, 30, 30])
torch.Size([256, 30, 30])
torch.Size([256, 30, 30])
```

But run ```conv2d_circular(x_3dim)``` will show this error message:
```
---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
Cell In[10], line 1
----> 1 conv2d_circular(x_3dim).shape

File ~\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\nn\modules\module.py:1501, in Module._call_impl(self, *args, **kwargs)
   1496 # If we don't have any hooks, we want to skip the rest of the logic in
   1497 # this function, and just call forward.
   1498 if not (self._backward_hooks or self._backward_pre_hooks or self._forward_hooks or self._forward_pre_hooks
   1499         or _global_backward_pre_hooks or _global_backward_hooks
   1500         or _global_forward_hooks or _global_forward_pre_hooks):
-> 1501     return forward_call(*args, **kwargs)
   1502 # Do not call functions when jit is used
   1503 full_backward_hooks, non_full_backward_hooks = [], []

File ~\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\nn\modules\conv.py:463, in Conv2d.forward(self, input)
    462 def forward(self, input: Tensor) -> Tensor:
--> 463     return self._conv_forward(input, self.weight, self.bias)

File ~\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\nn\modules\conv.py:456, in Conv2d._conv_forward(self, input, weight, bias)
    454 def _conv_forward(self, input: Tensor, weight: Tensor, bias: Optional[Tensor]):
    455     if self.padding_mode != 'zeros':
--> 456         return F.conv2d(F.pad(input, self._reversed_padding_repeated_twice, mode=self.padding_mode),
    457                         weight, bias, self.stride,
    458                         _pair(0), self.dilation, self.groups)
    459     return F.conv2d(input, weight, bias, self.stride,
    460                     self.padding, self.dilation, self.groups)

RuntimeError: Invalid padding size, expected 2 but got 4
```

what's more, I tried to set "padding" to 0~100, and this problem is still not solved.

### Versions

```
PS D:\PythonProjects\venv\Lib\site-packages\torch\utils> python collect_env.py
Collecting environment information...
PyTorch version: 2.0.1+cu117
Is debug build: False
CUDA used to build PyTorch: 11.7
ROCM used to build PyTorch: N/A

OS: Microsoft Windows 11 家庭中文版
GCC version: Could not collect
Clang version: Could not collect
CMake version: Could not collect
Libc version: N/A

Python version: 3.10.11 (tags/v3.10.11:7d4cc5a, Apr  5 2023, 00:38:17) [MSC v.1929 64 bit (AMD64)] (64-bit runtime)
Python platform: Windows-10-10.0.22621-SP0
Is CUDA available: True
CUDA runtime version: Could not collect
CUDA_MODULE_LOADING set to: LAZY
GPU models and configuration: GPU 0: NVIDIA GeForce RTX 4070 Laptop GPU
Nvidia driver version: 532.03
cuDNN version: Could not collect
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: True

CPU:
Architecture=9
CurrentClockSpeed=2200
DeviceID=CPU0
Family=207
L2CacheSize=16384
L2CacheSpeed=
Manufacturer=GenuineIntel
MaxClockSpeed=2200
Name=13th Gen Intel(R) Core(TM) i9-13900HX
ProcessorType=3
Revision=

Versions of relevant libraries:
[pip3] numpy==1.24.3
[pip3] torch==2.0.1+cu117
[pip3] torchaudio==2.0.2+cu117
[pip3] torchvision==0.15.2+cu117
[conda] Could not collect
```

cc @albanD @mruberry @jbschlosser @walterddr @mikaylagawarecki