Crash on converting circular padding  to onnx
Labels: module: onnx, triaged

### 🐛 Describe the bug

converting a network with circular padding to onnx model suffers a crash. here is the code


```
def circular_padding(x,sz=1):
    x = F.pad(x,(sz,sz,0,0), mode='circular')  # unable to convert
    x = F.pad(x,(0,0,sz,sz))
    # x = torch.cat([x[:,:,:,-sz:].clone(),x,x[:,:,:,:sz].clone()],dim = -1).clone() # a workaround
    return x

class Decoder(nn.Module):
    def __init__(self,args):
        super(Decoder, self).__init__()
        self.conv = nn.Conv2d(planes, planes, kernel_size=3, stride=1,
                               padding=0, bias=False)
    def forward(x):
        x = circular_padding(x)
        x = self.conv(x) 
       return x

if __name__ == '__main__':
    model = Decoder() # remove all paddings for all conv, and add a circularpadding before the conv
    device = torch.device('cpu')
    input = input_val.to(device)
    input_names = ["input1"]
    output_names = ["output"]
    torch.onnx.export(model, input, 'model.onnx', verbose=True, input_names=input_names, output_names=output_names,opset_version=11)

```



and here is the output:

```
  Traceback (most recent call last):

    File "convert.py", line 40, in <module>
      main()
    File "convert.py", line 37, in main
      convert_torch_to_onnx(model, onnx_filename, input)
    File "convert.py", line 10, in convert_torch_to_onnx
      torch.onnx.export(model, input, onnx_filename, verbose=True, input_names=input_names, output_names=output_names,opset_version=11)
    File "/usr/local/lib/miniconda3/envs/SDC/lib/python3.8/site-packages/torch/onnx/utils.py", line 506, in export
      _export(
    File "/usr/local/lib/miniconda3/envs/SDC/lib/python3.8/site-packages/torch/onnx/utils.py", line 1548, in _export
      graph, params_dict, torch_out = _model_to_graph(
    File "/usr/local/lib/miniconda3/envs/SDC/lib/python3.8/site-packages/torch/onnx/utils.py", line 1117, in _model_to_graph
      graph = _optimize_graph(
    File "/usr/local/lib/miniconda3/envs/SDC/lib/python3.8/site-packages/torch/onnx/utils.py", line 665, in _optimize_graph
      graph = _C._jit_pass_onnx(graph, operator_export_type)
    File "/usr/local/lib/miniconda3/envs/SDC/lib/python3.8/site-packages/torch/onnx/utils.py", line 1891, in _run_symbolic_function
      return symbolic_fn(graph_context, *inputs, **attrs)
    File "/usr/local/lib/miniconda3/envs/SDC/lib/python3.8/site-packages/torch/onnx/symbolic_opset11.py", line 864, in pad
      return opset9._pad_circular(g, input, pad)
    File "/usr/local/lib/miniconda3/envs/SDC/lib/python3.8/site-packages/torch/onnx/symbolic_opset9.py", line 1919, in _pad_circular
      left = symbolic_helper._slice_helper(
    File "/usr/local/lib/miniconda3/envs/SDC/lib/python3.8/site-packages/torch/onnx/symbolic_helper.py", line 729, in _slice_helper
      return _slice10(g, input, axes, starts, ends, steps, dynamic_slice)
    File "/usr/local/lib/miniconda3/envs/SDC/lib/python3.8/site-packages/torch/onnx/symbolic_opset10.py", line 352, in _slice
      if ends[0] > _constants.INT64_MAX:
  TypeError: '>' not supported between instances of 'NoneType' and 'int' 

```


### Versions

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: Ubuntu 20.04.6 LTS (x86_64)
GCC version: (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0
Clang version: Could not collect
CMake version: version 3.26.4
Libc version: glibc-2.31

Python version: 3.8.15 (default, Nov  4 2022, 20:59:55)  [GCC 11.2.0] (64-bit runtime)
Python platform: Linux-4.18.0-425.3.1.el8.x86_64-x86_64-with-glibc2.17
Is CUDA available: True
CUDA runtime version: 11.7.64
CUDA_MODULE_LOADING set to: LAZY
GPU models and configuration: 
GPU 0: NVIDIA A100-SXM4-80GB
GPU 1: NVIDIA A100-SXM4-80GB

Nvidia driver version: 515.65.01
cuDNN version: Probably one of the following:
/usr/lib/x86_64-linux-gnu/libcudnn.so.8.2.0
/usr/lib/x86_64-linux-gnu/libcudnn_adv_infer.so.8.2.0
/usr/lib/x86_64-linux-gnu/libcudnn_adv_train.so.8.2.0
/usr/lib/x86_64-linux-gnu/libcudnn_cnn_infer.so.8.2.0
/usr/lib/x86_64-linux-gnu/libcudnn_cnn_train.so.8.2.0
/usr/lib/x86_64-linux-gnu/libcudnn_ops_infer.so.8.2.0
/usr/lib/x86_64-linux-gnu/libcudnn_ops_train.so.8.2.0
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: True

CPU:
Architecture:                    x86_64
CPU op-mode(s):                  32-bit, 64-bit
Byte Order:                      Little Endian
Address sizes:                   46 bits physical, 57 bits virtual
CPU(s):                          128
On-line CPU(s) list:             0-127
Thread(s) per core:              2
Core(s) per socket:              32
Socket(s):                       2
NUMA node(s):                    2
Vendor ID:                       GenuineIntel
CPU family:                      6
Model:                           106
Model name:                      Intel(R) Xeon(R) Platinum 8358P CPU @ 2.60GHz
Stepping:                        6
CPU MHz:                         3400.000
CPU max MHz:                     3400.0000
CPU min MHz:                     800.0000
BogoMIPS:                        5200.00
Virtualization:                  VT-x
L1d cache:                       3 MiB
L1i cache:                       2 MiB
L2 cache:                        80 MiB
L3 cache:                        96 MiB
NUMA node0 CPU(s):               0-31,64-95
NUMA node1 CPU(s):               32-63,96-127
Vulnerability Itlb multihit:     Not affected
Vulnerability L1tf:              Not affected
Vulnerability Mds:               Not affected
Vulnerability Meltdown:          Not affected
Vulnerability Mmio stale data:   Mitigation; Clear CPU buffers; SMT vulnerable
Vulnerability Retbleed:          Not affected
Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl
Vulnerability Spectre v1:        Mitigation; usercopy/swapgs barriers and __user pointer sanitization
Vulnerability Spectre v2:        Mitigation; Enhanced IBRS, IBPB conditional, RSB filling, PBRSB-eIBRS SW sequence
Vulnerability Srbds:             Not affected
Vulnerability Tsx async abort:   Not affected
Flags:                           fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb cat_l3 invpcid_single intel_ppin ssbd mba ibrs ibpb stibp ibrs_enhanced tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid cqm rdt_a avx512f avx512dq rdseed adx smap avx512ifma clflushopt clwb intel_pt avx512cd sha_ni avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local split_lock_detect wbnoinvd dtherm ida arat pln pts avx512vbmi umip pku ospke avx512_vbmi2 gfni vaes vpclmulqdq avx512_vnni avx512_bitalg tme avx512_vpopcntdq la57 rdpid fsrm md_clear pconfig flush_l1d arch_capabilities

Versions of relevant libraries:
[pip3] numpy==1.23.4
[pip3] torch==2.0.1
[pip3] torch-tb-profiler==0.4.1
[pip3] torchaudio==2.0.1
[pip3] torchvision==0.15.1
[pip3] triton==2.0.0
[conda] numpy                     1.23.4                   pypi_0    pypi
[conda] torch                     2.0.1                    pypi_0    pypi
[conda] torch-tb-profiler         0.4.1                    pypi_0    pypi
[conda] torchaudio                2.0.1                    pypi_0    pypi
[conda] torchvision               0.15.1                   pypi_0    pypi
[conda] triton                    2.0.0                    pypi_0    pypi