pytorch dynamic quantized model failed to convert to onnx 
Labels: module: onnx, triaged

### 🐛 Describe the bug

I try to convert the dynamic quantized pytorch model to ONNX, but failed. The original float32 model can be successfully converted to onnx.  I tried torch1.9 (CUDA) and torch2.0 (CPU), both have same issues.

Sample code:

```python
model_int8 = torch.quantization.quantize_dynamic(model, None, dtype=torch.qint8)
mic_audio = torch.randn((4, frame_number))* 32367
echo_ref_audio = torch.rand((1, frame_number))* 32367
cache_new = torch.zeros_like(cache) + 1.0e-8
export_inputs = (mic_audio, echo_ref_audio, cache_new)
torch.onnx.export(model_int8, export_inputs, output_filename, verbose=True, opset_version=16)
```

Error info:

```
export_onnx.py", line 125, in export_onnx_model
    torch.onnx.export(model_int8, export_inputs, output_filename, verbose=True, opset_version=16)
  File "/data1/*/myve_torch2_cpu/lib/python3.9/site-packages/torch/onnx/utils.py", line 506, in export
    _export(
  File "/data1/*/myve_torch2_cpu/lib/python3.9/site-packages/torch/onnx/utils.py", line 1550, in _export
    graph, params_dict, torch_out = _model_to_graph(
  File "/data1/*/myve_torch2_cpu/lib/python3.9/site-packages/torch/onnx/utils.py", line 1115, in _model_to_graph
    graph, params, torch_out, module = _create_jit_graph(model, args)
  File "/data1/*/myve_torch2_cpu/lib/python3.9/site-packages/torch/onnx/utils.py", line 975, in _create_jit_graph
    in_vars, _ = torch.jit._flatten(args_params)
RuntimeError: Only tuples, lists and Variables are supported as JIT inputs/outputs. Dictionaries and strings are also accepted, but their usage is not recommended. Here, received an input of unsupported type: torch._C.ScriptObject
```

### Versions

PyTorch version: 2.0.0+cpu
Is debug build: False
CUDA used to build PyTorch: Could not collect
ROCM used to build PyTorch: N/A

OS: tlinux 2.6 (x86_64)
GCC version: (GCC) 4.8.5 20150623 (Red Hat 4.8.5-44)
Clang version: Could not collect
CMake version: version 3.24.3
Libc version: glibc-2.17

Python version: 3.9.0 (default, Nov 17 2022, 07:27:34)  [GCC 4.8.5 20150623 (Red Hat 4.8.5-44)] (64-bit runtime)
Python platform: Linux-4.14.105-1-tlinux3-0019-x86_64-with-glibc2.17
Is CUDA available: False
CUDA runtime version: 11.2.142
CUDA_MODULE_LOADING set to: N/A
GPU models and configuration: 
GPU 0: Tesla P40
GPU 1: Tesla P40
GPU 2: Tesla P40
GPU 3: Tesla P40
GPU 4: Tesla P40
GPU 5: Tesla P40
GPU 6: Tesla P40
GPU 7: Tesla P40

Nvidia driver version: 460.32.03
cuDNN version: Could not collect
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
CPU(s):                88
On-line CPU(s) list:   0-87
Thread(s) per core:    2
Core(s) per socket:    22
Socket(s):             2
NUMA node(s):          2
Vendor ID:             GenuineIntel
CPU family:            6
Model:                 79
Model name:            Intel(R) Xeon(R) CPU E5-2699 v4 @ 2.20GHz
Stepping:              1
CPU MHz:               2799.841
CPU max MHz:           2201.0000
CPU min MHz:           1200.0000
BogoMIPS:              4399.69
Virtualization:        VT-x
L1d cache:             32K
L1i cache:             32K
L2 cache:              256K
L3 cache:              56320K
NUMA node0 CPU(s):     0-21,44-65
NUMA node1 CPU(s):     22-43,66-87
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 arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic movbe popcnt aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb cat_l3 cdp_l3 invpcid_single pti intel_ppin tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm cqm rdt_a rdseed adx smap intel_pt xsaveopt cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local dtherm ida arat pln pts

Versions of relevant libraries:
[pip3] numpy==1.24.1
[pip3] torch==2.0.0+cpu
[pip3] torchaudio==2.0.1+cpu
[pip3] torchvision==0.15.1+cpu
[conda] Could not collect

cc @jerryzh168 @jianyuh @raghuramank100 @jamesr66a @vkuzo @jgong5 @Xia-Weiwen @leslie-fang-intel