Repository: pytorch
Issue: orch.onnx.errors.UnsupportedOperatorError: Exporting the operator 'aten::unflatten' to ONNX opset version 12 is not supported. 
Labels: module: onnx,triaged

### 🐛 Describe the bug

Get  orch.onnx.errors.UnsupportedOperatorError: Exporting the operator 'aten::unflatten' to ONNX opset version 12 is not supported. 

 When I execute 

`torch.onnx.export(trian_modle.eval(),example,"model.onnx", input_names=["input"], output_names=["output"], opset_version=12)`

This is my model code
```
class TransformerModel(nn.Module):
    def __init__(self, input_dim, output_dim, d_model, nhead, num_layers, dim_feedforward, dropout):
        super(TransformerModel, self).__init__()
        self.cnn = nn.Conv1d(in_channels=4, out_channels=d_model, kernel_size=1, stride=1)
        encoder_layers = nn.TransformerEncoderLayer(d_model=d_model, nhead=nhead, dim_feedforward=dim_feedforward, dropout=dropout)
        self.transformer_encoder = nn.TransformerEncoder(encoder_layers, num_layers=num_layers)
        self.fc = nn.Linear(d_model, output_dim)
        self.d_model = d_model
        self.feature = torch.nn.Sequential(
        torch.nn.Conv1d(300, 64, kernel_size=3, padding=1),
        torch.nn.BatchNorm1d(64),
        torch.nn.ReLU(),
        torch.nn.Conv1d(64, 64, kernel_size=3, padding=1),
        torch.nn.BatchNorm1d(64),
        torch.nn.ReLU(),
        torch.nn.MaxPool1d(2),

        torch.nn.Conv1d(64, 128, kernel_size=3, padding=1),
        torch.nn.BatchNorm1d(128),
        torch.nn.ReLU(),
        torch.nn.Conv1d(128, 128, kernel_size=3, padding=1),
        torch.nn.BatchNorm1d(128),
        torch.nn.ReLU(),
        torch.nn.MaxPool1d(2),

        torch.nn.Conv1d(128, 256, kernel_size=3, padding=1),
        torch.nn.BatchNorm1d(256),
        torch.nn.ReLU(),
        torch.nn.Conv1d(256, 256, kernel_size=3, padding=1),
        torch.nn.BatchNorm1d(256),
        torch.nn.ReLU(),
        torch.nn.Conv1d(256, 256, kernel_size=3, padding=1),
        torch.nn.BatchNorm1d(256),
        torch.nn.ReLU(),
        torch.nn.Conv1d(256, 256, kernel_size=3, padding=1),
        torch.nn.BatchNorm1d(256),
        torch.nn.ReLU(),
        torch.nn.MaxPool1d(2),

        torch.nn.Conv1d(256, 512, kernel_size=3, padding=1),
        torch.nn.BatchNorm1d(512),
        torch.nn.ReLU(),
        torch.nn.Conv1d(512, 512, kernel_size=3, padding=1),
        torch.nn.BatchNorm1d(512),
        torch.nn.ReLU(),
        torch.nn.Conv1d(512, 512, kernel_size=3, padding=1),
        torch.nn.BatchNorm1d(512),
        torch.nn.ReLU(),
        torch.nn.Conv1d(512, 512, kernel_size=3, padding=1),
        torch.nn.BatchNorm1d(512),
        torch.nn.ReLU(),
        torch.nn.MaxPool1d(2),

        torch.nn.Conv1d(512, 512, kernel_size=3, padding=1),
        torch.nn.BatchNorm1d(512),
        torch.nn.ReLU(),
        torch.nn.Conv1d(512, 512, kernel_size=3, padding=1),
        torch.nn.BatchNorm1d(512),
        torch.nn.ReLU(),
        torch.nn.Conv1d(512, 512, kernel_size=3, padding=1),
        torch.nn.BatchNorm1d(512),
        torch.nn.ReLU(),
        torch.nn.Conv1d(512, 512, kernel_size=3, padding=1),
        torch.nn.BatchNorm1d(512),
        torch.nn.ReLU(),
        torch.nn.MaxPool1d(2),
        torch.nn.AvgPool1d(kernel_size=2, stride=1, padding=0)
        )
        self.classifer = torch.nn.Sequential(
            torch.nn.Linear(1024,1024),
            torch.nn.ReLU(),
            torch.nn.Dropout(0.5),
            torch.nn.Linear(1024,1024),
            torch.nn.ReLU(),
            torch.nn.Dropout(0.5),
            torch.nn.Linear(1024, 512),
            torch.nn.ReLU(),
            torch.nn.Linear(512, 1),
        )

    def forward(self, src):
        output = self.transformer_encoder(src)
        output = self.feature(output)
        output = output.view(-1, 1024)
        output = self.classifer(output)
        output = torch.sigmoid(output)
        output = output.squeeze(dim=1)
        return output
```
        
   I have tried all onnx versions and found that none of them work

### Versions

torch    == 1.13.1