cov to onnx error
Labels: module: onnx, module: windows, triaged

### 🐛 Describe the bug

code:
```python
import torch
import torchaudio
from torch import nn
from torch import onnx


class DataCov(nn.Module):
    def __init__(self):
        super(DataCov, self).__init__()

        self.transform = nn.Sequential(
            torchaudio.transforms.MelSpectrogram(sample_rate=48000, n_fft=1536, hop_length=768, f_min=20, f_max=20000)
        )

    def forward(self, x1):
        return self.transform(x1)

def export_datacov_onnx(path):
    model = DataCov()
    model.eval()
    model = torch.jit.script(model)
    x = torch.randn((1, 48000 * 12), requires_grad=True)
    args = (x,)
    torch.onnx.dynamo_export(model, args, path, export_params=True, opset_version=17)

if __name__ == '__main__':
    export_datacov_onnx('DataCov.onnx')
```

error:
```
C:\Users\dell\miniconda3\envs\mos_cov_to_android\Lib\site-packages\torch\onnx\_internal\exporter.py:112: UserWarning: torch.onnx.dynamo_export only implements opset version 18 for now. If you need to use a different opset version, please register them with register_custom_op.
  warnings.warn(
Traceback (most recent call last):
  File "C:\Users\dell\miniconda3\envs\mos_cov_to_android\Lib\site-packages\torch\onnx\_internal\exporter.py", line 1006, in dynamo_export
    ).export()
      ^^^^^^^^
  File "C:\Users\dell\miniconda3\envs\mos_cov_to_android\Lib\site-packages\torch\onnx\_internal\exporter.py", line 810, in export
    graph_module = self.options.fx_tracer.generate_fx(
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\dell\miniconda3\envs\mos_cov_to_android\Lib\site-packages\torch\onnx\_internal\fx\dynamo_graph_extractor.py", line 198, in generate_fx
    graph_module, graph_guard = torch._dynamo.export(
                                ^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\dell\miniconda3\envs\mos_cov_to_android\Lib\site-packages\torch\_dynamo\eval_frame.py", line 1116, in inner
    check_if_dynamo_supported()
  File "C:\Users\dell\miniconda3\envs\mos_cov_to_android\Lib\site-packages\torch\_dynamo\eval_frame.py", line 538, in check_if_dynamo_supported
    raise RuntimeError("Windows not yet supported for torch.compile")
RuntimeError: Windows not yet supported for torch.compile

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "C:\Users\dell\miniconda3\envs\mos_cov_to_android\Lib\site-packages\torch\onnx\_internal\exporter.py", line 1016, in dynamo_export
    raise OnnxExporterError(
torch.onnx.OnnxExporterError: Failed to export the model to ONNX. Generating SARIF report at report_dynamo_export.sarif. Please report a bug on PyTorch Github: https://github.com/pytorch/pytorch/issues
python-BaseException

[report_dynamo_export.zip](https://github.com/pytorch/pytorch/files/12318966/report_dynamo_export.zip)
```


### Versions

Collecting environment information...
PyTorch version: 2.1.0.dev20230810+cpu
Is debug build: False
CUDA used to build PyTorch: None
ROCM used to build PyTorch: N/A

OS: Microsoft Windows 10 专业版
GCC version: (Rev5, Built by MSYS2 project) 13.1.0
Clang version: Could not collect
CMake version: version 3.26.4
Libc version: N/A

Python version: 3.11.4 | packaged by Anaconda, Inc. | (main, Jul  5 2023, 13:47:18) [MSC v.1916 64 bit (AMD64)] (64-bit runtime)
Python platform: Windows-10-10.0.19045-SP0
Is CUDA available: False
CUDA runtime version: No CUDA
CUDA_MODULE_LOADING set to: N/A
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

CPU:










Revision=

Versions of relevant libraries:
[pip3] numpy==1.24.4
[pip3] torch==2.1.0.dev20230810+cpu
[pip3] torchaudio==2.1.0.dev20230810+cpu
[pip3] torchvision==0.16.0.dev20230810+cpu
[conda] blas                      1.0                         mkl    defaults
[conda] mkl                       2023.1.0         h6b88ed4_46357    defaults
[conda] mkl-service               2.4.0           py311h2bbff1b_1    defaults
[conda] mkl_fft                   1.3.6           py311hf62ec03_1    defaults
[conda] mkl_random                1.2.2           py311hf62ec03_1    defaults
[conda] numpy                     1.24.4                   pypi_0    pypi
[conda] numpy-base                1.25.0          py311hd01c5d8_0    defaults
[conda] pytorch-mutex             1.0                         cpu    pytorch
[conda] torch                     2.1.0.dev20230810+cpu          pypi_0    pypi
[conda] torchaudio                2.1.0.dev20230810+cpu          pypi_0    pypi
[conda] torchvision               0.16.0.dev20230810+cpu          pypi_0    pypi

cc @peterjc123 @mszhanyi @skyline75489 @nbcsm @vladimir-aubrecht @iremyux @Blackhex @cristianPanaite @ezyang @msaroufim @wconstab @bdhirsh @anijain2305