Repository: pytorch
Issue: torch.onnx.dynamo_export fails to convert torchaudio.transforms.MFCC to onnx
Labels: needs reproduction,module: onnx,triaged

### 🐛 Describe the bug

We use the following script to convert MFCC to onnx (motivation: we've found that torchaudio MFCC implementation, librosa and especially cpp librosa implementations differ while we need to have 100% result equality, thus, we would like to convert MFCC we use to onnx model to use in C++ onnxruntime):

```
import torch
import torchaudio
import numpy

sample_rate=16000
n_mfcc=13
melkwargs={
  'n_mels': 64,
  'n_fft': 512,
  'win_length': 400,
  'hop_length': 320,
  'center': False,
  'power': 2,
  'f_min': 300,
  'f_max': 3500
}

class AudioCommandMFCC(torch.nn.Module):
  def __init__(self, sample_rate: int, n_mfcc: int, melkwargs: dict):
    super().__init__()
    self.transform = torchaudio.transforms.MFCC(
      sample_rate=sample_rate,
      n_mfcc=n_mfcc,
      melkwargs=melkwargs
    )

  def forward(self, wave_batch: torch.Tensor) -> torch.Tensor:
    mfcc = self.transform(wave_batch)
    return mfcc

audioCommandMFCC = AudioCommandMFCC(
  sample_rate=sample_rate,
  n_mfcc=n_mfcc,
  melkwargs=melkwargs
)

torch.save(audioCommandMFCC.eval(), "audio-command-mfcc.pt")

audioCommandMFCC = torch.load("audio-command-mfcc.pt")

input = torch.ones(1, 512)

# # this also fails
# torch.onnx.export(audioCommandMFCC,
#                   f="audio-command-mfcc.onnx",
#                   input_names=["wave_batch"],
#                   output_names=["mfcc"],
#                   args=({ "wave_batch": input }),
#                   dynamic_axes={
#                     "wave_batch": { 1: "wave_batch_length" }
#                   }
#                 )

onnx_program = torch.onnx.dynamo_export(audioCommandMFCC, input)
onnx_program.save("audio-command-mfcc.onnx")
```

Running of the script provides the following output:

> /home/arseniy/miniconda3/envs/torch/lib/python3.11/site-packages/torch/onnx/_internal/exporter.py:137: 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 "/home/arseniy/miniconda3/envs/torch/lib/python3.11/site-packages/torch/onnx/_internal/exporter.py", line 1433, in dynamo_export
>     ).export()
>       ^^^^^^^^
>   File "/home/arseniy/miniconda3/envs/torch/lib/python3.11/site-packages/torch/onnx/_internal/exporter.py", line 1175, in export
>     graph_module = self.options.fx_tracer.generate_fx(
>                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>   File "/home/arseniy/miniconda3/envs/torch/lib/python3.11/site-packages/torch/onnx/_internal/fx/dynamo_graph_extractor.py", line 213, in generate_fx
>     graph_module, graph_guard = torch._dynamo.export(
>                                 ^^^^^^^^^^^^^^^^^^^^^
>   File "/home/arseniy/miniconda3/envs/torch/lib/python3.11/site-packages/torch/_dynamo/eval_frame.py", line 1355, in inner
>     result_traced = opt_f(*args, **kwargs)
>                     ^^^^^^^^^^^^^^^^^^^^^^
>   File "/home/arseniy/miniconda3/envs/torch/lib/python3.11/site-packages/torch/_dynamo/eval_frame.py", line 489, in _fn
>     return fn(*args, **kwargs)
>            ^^^^^^^^^^^^^^^^^^^
>   File "/home/arseniy/miniconda3/envs/torch/lib/python3.11/site-packages/torch/onnx/_internal/fx/dynamo_graph_extractor.py", line 168, in wrapped
>     return output_adapter.apply(model_func(*args, **kwargs), model=model)
>                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^
>   File "/home/arseniy/miniconda3/envs/torch/lib/python3.11/site-packages/torch/_dynamo/eval_frame.py", line 655, in catch_errors
>     return callback(frame, cache_entry, hooks, frame_state)
>            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>   File "/home/arseniy/miniconda3/envs/torch/lib/python3.11/site-packages/torch/_dynamo/convert_frame.py", line 383, in _convert_frame_assert
>     compiled_product = _compile(
>                        ^^^^^^^^^
>   File "/home/arseniy/miniconda3/envs/torch/lib/python3.11/site-packages/torch/_dynamo/convert_frame.py", line 646, in _compile
>     guarded_code = compile_inner(code, one_graph, hooks, transform)
>                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>   File "/home/arseniy/miniconda3/envs/torch/lib/python3.11/site-packages/torch/_dynamo/utils.py", line 244, in time_wrapper
>     r = func(*args, **kwargs)
>         ^^^^^^^^^^^^^^^^^^^^^
>   File "/home/arseniy/miniconda3/envs/torch/lib/python3.11/site-packages/torch/_dynamo/convert_frame.py", line 562, in compile_inner
>     out_code = transform_code_object(code, transform)
>                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>   File "/home/arseniy/miniconda3/envs/torch/lib/python3.11/site-packages/torch/_dynamo/bytecode_transformation.py", line 1033, in transform_code_object
>     transformations(instructions, code_options)
>   File "/home/arseniy/miniconda3/envs/torch/lib/python3.11/site-packages/torch/_dynamo/convert_frame.py", line 151, in _fn
>     return fn(*args, **kwargs)
>            ^^^^^^^^^^^^^^^^^^^
>   File "/home/arseniy/miniconda3/envs/torch/lib/python3.11/site-packages/torch/_dynamo/convert_frame.py", line 527, in transform
>     tracer.run()
>   File "/home/arseniy/miniconda3/envs/torch/lib/python3.11/site-packages/torch/_dynamo/symbolic_convert.py", line 2128, in run
>     super().run()
>   File "/home/arseniy/miniconda3/envs/torch/lib/python3.11/site-packages/torch/_dynamo/symbolic_convert.py", line 818, in run
>     and self.step()
>         ^^^^^^^^^^^
>   File "/home/arseniy/miniconda3/envs/torch/lib/python3.11/site-packages/torch/_dynamo/symbolic_convert.py", line 781, in step
>     getattr(self, inst.opname)(inst)
>   File "/home/arseniy/miniconda3/envs/torch/lib/python3.11/site-packages/torch/_dynamo/symbolic_convert.py", line 470, in wrapper
>     return inner_fn(self, inst)
>            ^^^^^^^^^^^^^^^^^^^^
>   File "/home/arseniy/miniconda3/envs/torch/lib/python3.11/site-packages/torch/_dynamo/symbolic_convert.py", line 1802, in CALL
>     self.call_function(fn, args, kwargs)
>   File "/home/arseniy/miniconda3/envs/torch/lib/python3.11/site-packages/torch/_dynamo/symbolic_convert.py", line 652, in call_function
>     self.push(fn.call_function(self, args, kwargs))
>               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>   File "/home/arseniy/miniconda3/envs/torch/lib/python3.11/site-packages/torch/_dynamo/variables/nn_module.py", line 328, in call_function
>     return tx.inline_user_function_return(
>            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>   File "/home/arseniy/miniconda3/envs/torch/lib/python3.11/site-packages/torch/_dynamo/symbolic_convert.py", line 688, in inline_user_function_return
>     return InliningInstructionTranslator.inline_call(self, fn, args, kwargs)
>            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>   File "/home/arseniy/miniconda3/envs/torch/lib/python3.11/site-packages/torch/_dynamo/symbolic_convert.py", line 2261, in inline_call
>     return cls.inline_call_(parent, func, args, kwargs)
>            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>   File "/home/arseniy/miniconda3/envs/torch/lib/python3.11/site-packages/torch/_dynamo/symbolic_convert.py", line 2376, in inline_call_
>     tracer.run()
>   File "/home/arseniy/miniconda3/envs/torch/lib/python3.11/site-packages/torch/_dynamo/symbolic_convert.py", line 818, in run
>     and self.step()
>         ^^^^^^^^^^^
>   File "/home/arseniy/miniconda3/envs/torch/lib/python3.11/site-packages/torch/_dynamo/symbolic_convert.py", line 781, in step
>     getattr(self, inst.opname)(inst)
>   File "/home/arseniy/miniconda3/envs/torch/lib/python3.11/site-packages/torch/_dynamo/symbolic_convert.py", line 470, in wrapper
>     return inner_fn(self, inst)
>            ^^^^^^^^^^^^^^^^^^^^
>   File "/home/arseniy/miniconda3/envs/torch/lib/python3.11/site-packages/torch/_dynamo/symbolic_convert.py", line 1252, in CALL_FUNCTION_EX
>     self.call_function(fn, argsvars.items, kwargsvars.items)
>   File "/home/arseniy/miniconda3/envs/torch/lib/python3.11/site-packages/torch/_dynamo/symbolic_convert.py", line 652, in call_function
>     self.push(fn.call_function(self, args, kwargs))
>               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>   File "/home/arseniy/miniconda3/envs/torch/lib/python3.11/site-packages/torch/_dynamo/variables/functions.py", line 294, in call_function
>     return super().call_function(tx, args, kwargs)
>            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>   File "/home/arseniy/miniconda3/envs/torch/lib/python3.11/site-packages/torch/_dynamo/variables/functions.py", line 248, in call_function
>     return super().call_function(tx, args, kwargs)
>            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>   File "/home/arseniy/miniconda3/envs/torch/lib/python3.11/site-packages/torch/_dynamo/variables/functions.py", line 81, in call_function
>     return tx.inline_user_function_return(
>            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>   File "/home/arseniy/miniconda3/envs/torch/lib/python3.11/site-packages/torch/_dynamo/symbolic_convert.py", line 688, in inline_user_function_return
>     return InliningInstructionTranslator.inline_call(self, fn, args, kwargs)
>            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>   File "/home/arseniy/miniconda3/envs/torch/lib/python3.11/site-packages/torch/_dynamo/symbolic_convert.py", line 2261, in inline_call
>     return cls.inline_call_(parent, func, args, kwargs)
>            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>   File "/home/arseniy/miniconda3/envs/torch/lib/python3.11/site-packages/torch/_dynamo/symbolic_convert.py", line 2376, in inline_call_
>     tracer.run()
>   File "/home/arseniy/miniconda3/envs/torch/lib/python3.11/site-packages/torch/_dynamo/symbolic_convert.py", line 818, in run
>     and self.step()
>         ^^^^^^^^^^^
>   File "/home/arseniy/miniconda3/envs/torch/lib/python3.11/site-packages/torch/_dynamo/symbolic_convert.py", line 781, in step
>     getattr(self, inst.opname)(inst)
>   File "/home/arseniy/miniconda3/envs/torch/lib/python3.11/site-packages/torch/_dynamo/symbolic_convert.py", line 470, in wrapper
>     return inner_fn(self, inst)
>            ^^^^^^^^^^^^^^^^^^^^
>   File "/home/arseniy/miniconda3/envs/torch/lib/python3.11/site-packages/torch/_dynamo/symbolic_convert.py", line 1802, in CALL
>     self.call_function(fn, args, kwargs)
>   File "/home/arseniy/miniconda3/envs/torch/lib/python3.11/site-packages/torch/_dynamo/symbolic_convert.py", line 652, in call_function
>     self.push(fn.call_function(self, args, kwargs))
>               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>   File "/home/arseniy/miniconda3/envs/torch/lib/python3.11/site-packages/torch/_dynamo/variables/nn_module.py", line 328, in call_function
>     return tx.inline_user_function_return(
>            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>   File "/home/arseniy/miniconda3/envs/torch/lib/python3.11/site-packages/torch/_dynamo/symbolic_convert.py", line 688, in inline_user_function_return
>     return InliningInstructionTranslator.inline_call(self, fn, args, kwargs)
>            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>   File "/home/arseniy/miniconda3/envs/torch/lib/python3.11/site-packages/torch/_dynamo/symbolic_convert.py", line 2261, in inline_call
>     return cls.inline_call_(parent, func, args, kwargs)
>            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>   File "/home/arseniy/miniconda3/envs/torch/lib/python3.11/site-packages/torch/_dynamo/symbolic_convert.py", line 2376, in inline_call_
>     tracer.run()
>   File "/home/arseniy/miniconda3/envs/torch/lib/python3.11/site-packages/torch/_dynamo/symbolic_convert.py", line 818, in run
>     and self.step()
>         ^^^^^^^^^^^
>   File "/home/arseniy/miniconda3/envs/torch/lib/python3.11/site-packages/torch/_dynamo/symbolic_convert.py", line 781, in step
>     getattr(self, inst.opname)(inst)
>   File "/home/arseniy/miniconda3/envs/torch/lib/python3.11/site-packages/torch/_dynamo/symbolic_convert.py", line 470, in wrapper
>     return inner_fn(self, inst)
>            ^^^^^^^^^^^^^^^^^^^^
>   File "/home/arseniy/miniconda3/envs/torch/lib/python3.11/site-packages/torch/_dynamo/symbolic_convert.py", line 1252, in CALL_FUNCTION_EX
>     self.call_function(fn, argsvars.items, kwargsvars.items)
>   File "/home/arseniy/miniconda3/envs/torch/lib/python3.11/site-packages/torch/_dynamo/symbolic_convert.py", line 652, in call_function
>     self.push(fn.call_function(self, args, kwargs))
>               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>   File "/home/arseniy/miniconda3/envs/torch/lib/python3.11/site-packages/torch/_dynamo/variables/functions.py", line 294, in call_function
>     return super().call_function(tx, args, kwargs)
>            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>   File "/home/arseniy/miniconda3/envs/torch/lib/python3.11/site-packages/torch/_dynamo/variables/functions.py", line 248, in call_function
>     return super().call_function(tx, args, kwargs)
>            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>   File "/home/arseniy/miniconda3/envs/torch/lib/python3.11/site-packages/torch/_dynamo/variables/functions.py", line 81, in call_function
>     return tx.inline_user_function_return(
>            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>   File "/home/arseniy/miniconda3/envs/torch/lib/python3.11/site-packages/torch/_dynamo/symbolic_convert.py", line 688, in inline_user_function_return
>     return InliningInstructionTranslator.inline_call(self, fn, args, kwargs)
>            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>   File "/home/arseniy/miniconda3/envs/torch/lib/python3.11/site-packages/torch/_dynamo/symbolic_convert.py", line 2261, in inline_call
>     return cls.inline_call_(parent, func, args, kwargs)
>            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>   File "/home/arseniy/miniconda3/envs/torch/lib/python3.11/site-packages/torch/_dynamo/symbolic_convert.py", line 2376, in inline_call_
>     tracer.run()
>   File "/home/arseniy/miniconda3/envs/torch/lib/python3.11/site-packages/torch/_dynamo/symbolic_convert.py", line 818, in run
>     and self.step()
>         ^^^^^^^^^^^
>   File "/home/arseniy/miniconda3/envs/torch/lib/python3.11/site-packages/torch/_dynamo/symbolic_convert.py", line 781, in step
>     getattr(self, inst.opname)(inst)
>   File "/home/arseniy/miniconda3/envs/torch/lib/python3.11/site-packages/torch/_dynamo/symbolic_convert.py", line 470, in wrapper
>     return inner_fn(self, inst)
>            ^^^^^^^^^^^^^^^^^^^^
>   File "/home/arseniy/miniconda3/envs/torch/lib/python3.11/site-packages/torch/_dynamo/symbolic_convert.py", line 1802, in CALL
>     self.call_function(fn, args, kwargs)
>   File "/home/arseniy/miniconda3/envs/torch/lib/python3.11/site-packages/torch/_dynamo/symbolic_convert.py", line 652, in call_function
>     self.push(fn.call_function(self, args, kwargs))
>               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>   File "/home/arseniy/miniconda3/envs/torch/lib/python3.11/site-packages/torch/_dynamo/variables/nn_module.py", line 328, in call_function
>     return tx.inline_user_function_return(
>            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>   File "/home/arseniy/miniconda3/envs/torch/lib/python3.11/site-packages/torch/_dynamo/symbolic_convert.py", line 688, in inline_user_function_return
>     return InliningInstructionTranslator.inline_call(self, fn, args, kwargs)
>            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>   File "/home/arseniy/miniconda3/envs/torch/lib/python3.11/site-packages/torch/_dynamo/symbolic_convert.py", line 2261, in inline_call
>     return cls.inline_call_(parent, func, args, kwargs)
>            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>   File "/home/arseniy/miniconda3/envs/torch/lib/python3.11/site-packages/torch/_dynamo/symbolic_convert.py", line 2376, in inline_call_
>     tracer.run()
>   File "/home/arseniy/miniconda3/envs/torch/lib/python3.11/site-packages/torch/_dynamo/symbolic_convert.py", line 818, in run
>     and self.step()
>         ^^^^^^^^^^^
>   File "/home/arseniy/miniconda3/envs/torch/lib/python3.11/site-packages/torch/_dynamo/symbolic_convert.py", line 781, in step
>     getattr(self, inst.opname)(inst)
>   File "/home/arseniy/miniconda3/envs/torch/lib/python3.11/site-packages/torch/_dynamo/symbolic_convert.py", line 470, in wrapper
>     return inner_fn(self, inst)
>            ^^^^^^^^^^^^^^^^^^^^
>   File "/home/arseniy/miniconda3/envs/torch/lib/python3.11/site-packages/torch/_dynamo/symbolic_convert.py", line 1252, in CALL_FUNCTION_EX
>     self.call_function(fn, argsvars.items, kwargsvars.items)
>   File "/home/arseniy/miniconda3/envs/torch/lib/python3.11/site-packages/torch/_dynamo/symbolic_convert.py", line 652, in call_function
>     self.push(fn.call_function(self, args, kwargs))
>               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>   File "/home/arseniy/miniconda3/envs/torch/lib/python3.11/site-packages/torch/_dynamo/variables/functions.py", line 294, in call_function
>     return super().call_function(tx, args, kwargs)
>            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>   File "/home/arseniy/miniconda3/envs/torch/lib/python3.11/site-packages/torch/_dynamo/variables/functions.py", line 248, in call_function
>     return super().call_function(tx, args, kwargs)
>            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>   File "/home/arseniy/miniconda3/envs/torch/lib/python3.11/site-packages/torch/_dynamo/variables/functions.py", line 81, in call_function
>     return tx.inline_user_function_return(
>            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>   File "/home/arseniy/miniconda3/envs/torch/lib/python3.11/site-packages/torch/_dynamo/symbolic_convert.py", line 688, in inline_user_function_return
>     return InliningInstructionTranslator.inline_call(self, fn, args, kwargs)
>            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>   File "/home/arseniy/miniconda3/envs/torch/lib/python3.11/site-packages/torch/_dynamo/symbolic_convert.py", line 2261, in inline_call
>     return cls.inline_call_(parent, func, args, kwargs)
>            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>   File "/home/arseniy/miniconda3/envs/torch/lib/python3.11/site-packages/torch/_dynamo/symbolic_convert.py", line 2376, in inline_call_
>     tracer.run()
>   File "/home/arseniy/miniconda3/envs/torch/lib/python3.11/site-packages/torch/_dynamo/symbolic_convert.py", line 818, in run
>     and self.step()
>         ^^^^^^^^^^^
>   File "/home/arseniy/miniconda3/envs/torch/lib/python3.11/site-packages/torch/_dynamo/symbolic_convert.py", line 781, in step
>     getattr(self, inst.opname)(inst)
>   File "/home/arseniy/miniconda3/envs/torch/lib/python3.11/site-packages/torch/_dynamo/symbolic_convert.py", line 470, in wrapper
>     return inner_fn(self, inst)
>            ^^^^^^^^^^^^^^^^^^^^
>   File "/home/arseniy/miniconda3/envs/torch/lib/python3.11/site-packages/torch/_dynamo/symbolic_convert.py", line 1802, in CALL
>     self.call_function(fn, args, kwargs)
>   File "/home/arseniy/miniconda3/envs/torch/lib/python3.11/site-packages/torch/_dynamo/symbolic_convert.py", line 652, in call_function
>     self.push(fn.call_function(self, args, kwargs))
>               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>   File "/home/arseniy/miniconda3/envs/torch/lib/python3.11/site-packages/torch/_dynamo/variables/functions.py", line 248, in call_function
>     return super().call_function(tx, args, kwargs)
>            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>   File "/home/arseniy/miniconda3/envs/torch/lib/python3.11/site-packages/torch/_dynamo/variables/functions.py", line 81, in call_function
>     return tx.inline_user_function_return(
>            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>   File "/home/arseniy/miniconda3/envs/torch/lib/python3.11/site-packages/torch/_dynamo/symbolic_convert.py", line 688, in inline_user_function_return
>     return InliningInstructionTranslator.inline_call(self, fn, args, kwargs)
>            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>   File "/home/arseniy/miniconda3/envs/torch/lib/python3.11/site-packages/torch/_dynamo/symbolic_convert.py", line 2261, in inline_call
>     return cls.inline_call_(parent, func, args, kwargs)
>            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>   File "/home/arseniy/miniconda3/envs/torch/lib/python3.11/site-packages/torch/_dynamo/symbolic_convert.py", line 2376, in inline_call_
>     tracer.run()
>   File "/home/arseniy/miniconda3/envs/torch/lib/python3.11/site-packages/torch/_dynamo/symbolic_convert.py", line 818, in run
>     and self.step()
>         ^^^^^^^^^^^
>   File "/home/arseniy/miniconda3/envs/torch/lib/python3.11/site-packages/torch/_dynamo/symbolic_convert.py", line 781, in step
>     getattr(self, inst.opname)(inst)
>   File "/home/arseniy/miniconda3/envs/torch/lib/python3.11/site-packages/torch/_dynamo/symbolic_convert.py", line 470, in wrapper
>     return inner_fn(self, inst)
>            ^^^^^^^^^^^^^^^^^^^^
>   File "/home/arseniy/miniconda3/envs/torch/lib/python3.11/site-packages/torch/_dynamo/symbolic_convert.py", line 1802, in CALL
>     self.call_function(fn, args, kwargs)
>   File "/home/arseniy/miniconda3/envs/torch/lib/python3.11/site-packages/torch/_dynamo/symbolic_convert.py", line 652, in call_function
>     self.push(fn.call_function(self, args, kwargs))
>               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>   File "/home/arseniy/miniconda3/envs/torch/lib/python3.11/site-packages/torch/_dynamo/variables/functions.py", line 248, in call_function
>     return super().call_function(tx, args, kwargs)
>            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>   File "/home/arseniy/miniconda3/envs/torch/lib/python3.11/site-packages/torch/_dynamo/variables/functions.py", line 81, in call_function
>     return tx.inline_user_function_return(
>            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>   File "/home/arseniy/miniconda3/envs/torch/lib/python3.11/site-packages/torch/_dynamo/symbolic_convert.py", line 688, in inline_user_function_return
>     return InliningInstructionTranslator.inline_call(self, fn, args, kwargs)
>            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>   File "/home/arseniy/miniconda3/envs/torch/lib/python3.11/site-packages/torch/_dynamo/symbolic_convert.py", line 2261, in inline_call
>     return cls.inline_call_(parent, func, args, kwargs)
>            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>   File "/home/arseniy/miniconda3/envs/torch/lib/python3.11/site-packages/torch/_dynamo/symbolic_convert.py", line 2376, in inline_call_
>     tracer.run()
>   File "/home/arseniy/miniconda3/envs/torch/lib/python3.11/site-packages/torch/_dynamo/symbolic_convert.py", line 818, in run
>     and self.step()
>         ^^^^^^^^^^^
>   File "/home/arseniy/miniconda3/envs/torch/lib/python3.11/site-packages/torch/_dynamo/symbolic_convert.py", line 781, in step
>     getattr(self, inst.opname)(inst)
>   File "/home/arseniy/miniconda3/envs/torch/lib/python3.11/site-packages/torch/_dynamo/symbolic_convert.py", line 470, in wrapper
>     return inner_fn(self, inst)
>            ^^^^^^^^^^^^^^^^^^^^
>   File "/home/arseniy/miniconda3/envs/torch/lib/python3.11/site-packages/torch/_dynamo/symbolic_convert.py", line 1802, in CALL
>     self.call_function(fn, args, kwargs)
>   File "/home/arseniy/miniconda3/envs/torch/lib/python3.11/site-packages/torch/_dynamo/symbolic_convert.py", line 652, in call_function
>     self.push(fn.call_function(self, args, kwargs))
>               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>   File "/home/arseniy/miniconda3/envs/torch/lib/python3.11/site-packages/torch/_dynamo/variables/misc.py", line 973, in call_function
>     unimplemented(msg)
>   File "/home/arseniy/miniconda3/envs/torch/lib/python3.11/site-packages/torch/_dynamo/exc.py", line 193, in unimplemented
>     raise Unsupported(msg)
> torch._dynamo.exc.Unsupported: 'skip function isinstance in file /home/arseniy/miniconda3/envs/torch/lib/python3.11/site-packages/torch/jit/__init__.py'', skipped according skipfiles.SKIP_DIRS'
> 
> from user code:
>    File "/home/arseniy/arseniy/run-dynamo-export.py", line 28, in forward
>     mfcc = self.transform(wave_batch)
>   File "/home/arseniy/miniconda3/envs/torch/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1520, in _call_impl
>     return forward_call(*args, **kwargs)
>   File "/home/arseniy/miniconda3/envs/torch/lib/python3.11/site-packages/torchaudio/transforms/_transforms.py", line 699, in forward
>     mel_specgram = self.MelSpectrogram(waveform)
>   File "/home/arseniy/miniconda3/envs/torch/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1520, in _call_impl
>     return forward_call(*args, **kwargs)
>   File "/home/arseniy/miniconda3/envs/torch/lib/python3.11/site-packages/torchaudio/transforms/_transforms.py", line 619, in forward
>     specgram = self.spectrogram(waveform)
>   File "/home/arseniy/miniconda3/envs/torch/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1520, in _call_impl
>     return forward_call(*args, **kwargs)
>   File "/home/arseniy/miniconda3/envs/torch/lib/python3.11/site-packages/torchaudio/transforms/_transforms.py", line 110, in forward
>     return F.spectrogram(
>   File "/home/arseniy/miniconda3/envs/torch/lib/python3.11/site-packages/torchaudio/functional/functional.py", line 119, in spectrogram
>     frame_length_norm, window_norm = _get_spec_norms(normalized)
>   File "/home/arseniy/miniconda3/envs/torch/lib/python3.11/site-packages/torchaudio/functional/functional.py", line 233, in _get_spec_norms
>     if torch.jit.isinstance(normalized, str):
> 
> Set TORCH_LOGS="+dynamo" and TORCHDYNAMO_VERBOSE=1 for more information
> 
> 
> The above exception was the direct cause of the following exception:
> 
> Traceback (most recent call last):
>   File "/home/arseniy/arseniy/run-dynamo-export.py", line 53, in <module>
>     onnx_program = torch.onnx.dynamo_export(audioCommandMFCC, input)
>                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>   File "/home/arseniy/miniconda3/envs/torch/lib/python3.11/site-packages/torch/onnx/_internal/exporter.py", line 1444, in dynamo_export
>     raise OnnxExporterError(
> torch.onnx.OnnxExporterError: Failed to export the model to ONNX. Generating SARIF report at 'report_dynamo_export.sarif'. SARIF is a standard format for the output of static analysis tools. SARIF logs can be loaded in VS Code SARIF viewer extension, or SARIF web viewer (https://microsoft.github.io/sarif-web-component/). Please report a bug on PyTorch Github: https://github.com/pytorch/pytorch/issues

SARIF file content:

> {
>  "runs":[
>   {
>    "tool":{
>     "driver":{
>      "name":"torch.onnx.dynamo_export",
>      "contents":[
>       "localizedData",
>       "nonLocalizedData"
>      ],
>      "language":"en-US",
>      "rules":[],
>      "version":"2.2.2"
>     }
>    },
>    "language":"en-US",
>    "newlineSequences":[
>     "\r\n",
>     "\n"
>    ],
>    "results":[]
>   }
>  ],
>  "version":"2.1.0",
>  "schemaUri":"https://docs.oasis-open.org/sarif/sarif/v2.1.0/cs01/schemas/sarif-schema-2.1.0.json"
> }



### Versions

[pip3] numpy==1.26.4
[pip3] onnx==1.16.0
[pip3] onnxruntime-gpu==1.17.1
[pip3] onnxscript==0.1.0.dev20240412
[pip3] torch==2.2.2
[pip3] torchaudio==2.2.2
[conda] blas                      1.0                         mkl
[conda] cudatoolkit               11.8.0               h6a678d5_0
[conda] mkl                       2023.1.0         h213fc3f_46344
[conda] mkl-service               2.4.0           py311h5eee18b_1
[conda] mkl_fft                   1.3.8           py311h5eee18b_0
[conda] mkl_random                1.2.4           py311hdb19cb5_0
[conda] numpy                     1.26.4          py311h08b1b3b_0
[conda] numpy-base                1.26.4          py311hf175353_0
[conda] pytorch                   2.2.2              py3.11_cpu_0    pytorch
[conda] pytorch-mutex             1.0                         cpu    pytorch
[conda] torchaudio                2.2.2                 py311_cpu    pytorch