Repository: pytorch
Issue: Export quantized shufflenet_v2_x0_5 to ONNX
Labels: module: onnx,triaged,onnx-triaged

### 🐛 Describe the bug

Fail to export quantized shufflenet_v2_x0_5 to ONNX using the following code:

```python
import io
import numpy as np

import torch
import torch.utils.model_zoo as model_zoo
import torch.onnx

import torchvision.models.quantization as models

torch_model = models.shufflenet_v2_x0_5(pretrained=True, quantize=True)
torch_model.eval()

batch_size = 1
input_float = torch.zeros(1, 3, 224, 224)
input_tensor = input_float

torch_out = torch.jit.trace(torch_model, input_tensor)

# Export the model
torch.onnx.export(torch_model,               # model being run
                  input_tensor,              # model input (or a tuple for multiple inputs)
                  "shufflenet_v2_x0_5_qdq.onnx",   # where to save the model (can be a file or file-like object)
                  export_params=True,        # store the trained parameter weights inside the model file
                  opset_version=16,          # the ONNX version to export the model to
                  do_constant_folding=True,  # whether to execute constant folding for optimization
                  input_names = ['input'],   # the model's input names
                  output_names = ['output'], # the model's output names
                  dynamic_axes={'input' : {0 : 'batch_size'},    # variable length axes
                                'output' : {0 : 'batch_size'}})
```


Stacktrace:

```text
/home/skyline/miniconda3/envs/torch-nightly-py39/lib/python3.9/site-packages/torchvision/models/_utils.py:208: UserWarning: The parameter 'pretrained' is deprecated since 0.13 and will be removed in 0.15, please use 'weights' instead.
  warnings.warn(
/home/skyline/miniconda3/envs/torch-nightly-py39/lib/python3.9/site-packages/torchvision/models/_utils.py:223: UserWarning: Arguments other than a weight enum or `None` for 'weights' are deprecated since 0.13 and will be removed in 0.15. The current behavior is equivalent to passing `weights=ShuffleNet_V2_X0_5_QuantizedWeights.IMAGENET1K_FBGEMM_V1`. You can also use `weights=ShuffleNet_V2_X0_5_QuantizedWeights.DEFAULT` to get the most up-to-date weights.
  warnings.warn(msg)
/home/skyline/miniconda3/envs/torch-nightly-py39/lib/python3.9/site-packages/torch/onnx/_patch_torch.py:67: UserWarning: The shape inference of prim::TupleConstruct type is missing, so it may result in wrong shape inference for the exported graph. Please consider adding it in symbolic function. (Triggered internally at /opt/conda/conda-bld/pytorch_1658041842671/work/torch/csrc/jit/passes/onnx/shape_type_inference.cpp:1874.)
  torch._C._jit_pass_onnx_node_shape_type_inference(
Traceback (most recent call last):
  File "/home/skyline/Projects/python-playground/ml/ModelConversion/torch_quantizied_model_to_onnx.py", line 20, in <module>
    torch.onnx.export(torch_model,               # model being run
  File "/home/skyline/miniconda3/envs/torch-nightly-py39/lib/python3.9/site-packages/torch/onnx/utils.py", line 479, in export
    _export(
  File "/home/skyline/miniconda3/envs/torch-nightly-py39/lib/python3.9/site-packages/torch/onnx/utils.py", line 1411, in _export
    graph, params_dict, torch_out = _model_to_graph(
  File "/home/skyline/miniconda3/envs/torch-nightly-py39/lib/python3.9/site-packages/torch/onnx/utils.py", line 1054, in _model_to_graph
    graph = _optimize_graph(
  File "/home/skyline/miniconda3/envs/torch-nightly-py39/lib/python3.9/site-packages/torch/onnx/utils.py", line 624, in _optimize_graph
    graph = _C._jit_pass_onnx(graph, operator_export_type)
  File "/home/skyline/miniconda3/envs/torch-nightly-py39/lib/python3.9/site-packages/torch/onnx/utils.py", line 1744, in _run_symbolic_function
    return symbolic_fn(g, *inputs, **attrs)
  File "/home/skyline/miniconda3/envs/torch-nightly-py39/lib/python3.9/site-packages/torch/onnx/symbolic_opset13.py", line 716, in conv2d_relu
    input, input_scale, _, _ = symbolic_helper.dequantize_helper(g, q_input)
  File "/home/skyline/miniconda3/envs/torch-nightly-py39/lib/python3.9/site-packages/torch/onnx/symbolic_helper.py", line 1235, in dequantize_helper
    unpacked_qtensors = _unpack_tuple(qtensor)
  File "/home/skyline/miniconda3/envs/torch-nightly-py39/lib/python3.9/site-packages/torch/onnx/symbolic_helper.py", line 167, in _unpack_tuple
    raise RuntimeError(
RuntimeError: ONNX symbolic expected node type `prim::TupleConstruct`, got `%423 : Tensor(*, *, *, *) = onnx::Slice(%x.8, %419, %422, %411), scope: __module.stage2/__module.stage2.1 # /home/skyline/miniconda3/envs/torch-nightly-py39/lib/python3.9/site-packages/torchvision/models/quantization/shufflenetv2.py:42:0
`
```


### Versions

PyTorch version: 1.13.0.dev20220717
Is debug build: False
CUDA used to build PyTorch: None
ROCM used to build PyTorch: N/A

OS: Ubuntu 22.04 LTS (x86_64)
GCC version: (Ubuntu 11.2.0-19ubuntu1) 11.2.0
Clang version: 14.0.6
CMake version: version 3.22.1
Libc version: glibc-2.35

Python version: 3.9.12 (main, Jun  1 2022, 11:38:51)  [GCC 7.5.0] (64-bit runtime)
Python platform: Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.35
Is CUDA available: False
CUDA runtime version: No CUDA
GPU models and configuration: No CUDA
Nvidia driver version: No CUDA
cuDNN version: No CUDA
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: True

Versions of relevant libraries:
[pip3] numpy==1.23.1
[pip3] torch==1.13.0.dev20220717
[pip3] torchaudio==0.13.0.dev20220717
[pip3] torchvision==0.14.0.dev20220717
[conda] blas                      1.0                         mkl
[conda] cpuonly                   2.0                           0    pytorch-nightly
[conda] cudatoolkit               10.2.89              hfd86e86_1
[conda] mkl                       2021.4.0           h06a4308_640
[conda] mkl-service               2.4.0            py39h7f8727e_0
[conda] mkl_fft                   1.3.1            py39hd3c417c_0
[conda] mkl_random                1.2.2            py39h51133e4_0
[conda] numpy                     1.23.1                   pypi_0    pypi
[conda] numpy-base                1.22.3           py39hf524024_0
[conda] pytorch                   1.13.0.dev20220717     py3.9_cpu_0    pytorch-nightly
[conda] pytorch-mutex             1.0                         cpu    pytorch-nightly
[conda] torchaudio                0.13.0.dev20220717        py39_cpu    pytorch-nightly
[conda] torchvision               0.14.0.dev20220717        py39_cpu    pytorch-nightly