Repository: pytorch
Issue: Cannot export Pytorch model (ReDimNet) to ONNX
Labels: module: onnx,triaged

### 🐛 Describe the bug

I try to export ReDimNet model from pytorch to ONNX. Please help me this out. The code I use is :

``` 
import torch
model = torch.hub.load('IDRnD/ReDimNet', 'b3', pretrained=True, finetuned=False)
input_sample = torch.randn(1, 32000)
model.eval()
with torch.no_grad():
    onnx_program_redim = torch.onnx.dynamo_export(model, input_sample)
```  

Error is 


---------------------------------------------------------------------------
Unsupported                               Traceback (most recent call last)
File ~/miniconda3/envs/speaker_recog/lib/python3.10/site-packages/torch/onnx/_internal/exporter.py:1509, in dynamo_export(model, export_options, *model_args, **model_kwargs)
   1503 try:
   1504     return Exporter(
   1505         options=resolved_export_options,
   1506         model=model,
   1507         model_args=model_args,
   1508         model_kwargs=model_kwargs,
-> 1509     ).export()
   1510 except Exception as e:

File ~/miniconda3/envs/speaker_recog/lib/python3.10/site-packages/torch/onnx/_internal/exporter.py:1236, in Exporter.export(self)
   1231 with self.options.diagnostic_context, decomposition_skip.enable_decomposition_skips(
   1232     self.options
   1233 ), torch._dynamo.config.patch(
   1234     dataclasses.asdict(DEFAULT_EXPORT_DYNAMO_CONFIG)
   1235 ):
-> 1236     graph_module = self.options.fx_tracer.generate_fx(
   1237         self.options, self.model, self.model_args, self.model_kwargs
   1238     )
   1239     # TODO: Defer `import onnxscript` out of `import torch` path
   1240     # https://github.com/pytorch/pytorch/issues/103764

File ~/miniconda3/envs/speaker_recog/lib/python3.10/site-packages/torch/onnx/_internal/fx/dynamo_graph_extractor.py:214, in DynamoExport.generate_fx(self, options, model, model_args, model_kwargs)
    213 with fake_mode:  # type: ignore[attr-defined]
--> 214     graph_module, graph_guard = torch._dynamo.export(
    215         wrapped_model,
    216         tracing_mode=fx_mode,
    217     )(
    218         *model_args,
    219         **model_kwargs,
    220     )
    221 del graph_guard  # Unused

File ~/miniconda3/envs/speaker_recog/lib/python3.10/site-packages/torch/_dynamo/eval_frame.py:1379, in export.<locals>.inner(*args, **kwargs)
   1378 try:
-> 1379     result_traced = opt_f(*args, **kwargs)
   1380 except ConstraintViolationError as e:

File ~/miniconda3/envs/speaker_recog/lib/python3.10/site-packages/torch/_dynamo/eval_frame.py:433, in _TorchDynamoContext.__call__.<locals>._fn(*args, **kwargs)
    432 try:
--> 433     return fn(*args, **kwargs)
    434 finally:
    435     # Restore the dynamic layer stack depth if necessary.

File ~/miniconda3/envs/speaker_recog/lib/python3.10/site-packages/torch/onnx/_internal/fx/dynamo_graph_extractor.py:169, in _wrap_model_with_output_adapter.<locals>.wrapped(*args, **kwargs)
    167 @functools.wraps(model_func)
    168 def wrapped(*args, **kwargs):
--> 169     return output_adapter.apply(model_func(*args, **kwargs), model=model)

File ~/miniconda3/envs/speaker_recog/lib/python3.10/site-packages/torch/_dynamo/convert_frame.py:1116, in CatchErrorsWrapper.__call__(self, frame, cache_entry, frame_state)
   1114 with compile_lock, _disable_current_modes():
   1115     # skip=1: skip this frame
-> 1116     return self._torchdynamo_orig_callable(
   1117         frame, cache_entry, self.hooks, frame_state, skip=1
   1118     )

File ~/miniconda3/envs/speaker_recog/lib/python3.10/site-packages/torch/_dynamo/convert_frame.py:472, in ConvertFrameAssert.__call__(self, frame, cache_entry, hooks, frame_state, skip)
    460 signpost_event(
    461     "dynamo",
    462     "_convert_frame_assert._compile",
   (...)
    469     },
    470 )
--> 472 return _compile(
    473     frame.f_code,
    474     frame.f_globals,
    475     frame.f_locals,
    476     frame.f_builtins,
    477     self._torchdynamo_orig_callable,
    478     self._one_graph,
    479     self._export,
    480     self._export_constraints,
    481     hooks,
    482     cache_entry,
    483     cache_size,
    484     frame,
    485     frame_state=frame_state,
    486     compile_id=compile_id,
    487     skip=skip + 1,
    488 )

File ~/miniconda3/envs/speaker_recog/lib/python3.10/site-packages/torch/_utils_internal.py:84, in compile_time_strobelight_meta.<locals>.compile_time_strobelight_meta_inner.<locals>.wrapper_function(*args, **kwargs)
     83     kwargs["skip"] = kwargs["skip"] + 1
---> 84 return StrobelightCompileTimeProfiler.profile_compile_time(
     85     function, phase_name, *args, **kwargs
     86 )

File ~/miniconda3/envs/speaker_recog/lib/python3.10/site-packages/torch/_strobelight/compile_time_profiler.py:129, in StrobelightCompileTimeProfiler.profile_compile_time(cls, func, phase_name, *args, **kwargs)
    128 if not cls.enabled:
--> 129     return func(*args, **kwargs)
    131 if cls.profiler is None:

File ~/miniconda3/envs/speaker_recog/lib/python3.10/contextlib.py:79, in ContextDecorator.__call__.<locals>.inner(*args, **kwds)
     78 with self._recreate_cm():
---> 79     return func(*args, **kwds)

File ~/miniconda3/envs/speaker_recog/lib/python3.10/site-packages/torch/_dynamo/convert_frame.py:817, in _compile(code, globals, locals, builtins, compiler_fn, one_graph, export, export_constraints, hooks, cache_entry, cache_size, frame, frame_state, compile_id, skip)
    816 try:
--> 817     guarded_code = compile_inner(code, one_graph, hooks, transform)
    818     return guarded_code

File ~/miniconda3/envs/speaker_recog/lib/python3.10/site-packages/torch/_dynamo/utils.py:231, in dynamo_timed.<locals>.dynamo_timed_inner.<locals>.time_wrapper(*args, **kwargs)
    230 t0 = time.time()
--> 231 r = func(*args, **kwargs)
    232 time_spent = time.time() - t0

File ~/miniconda3/envs/speaker_recog/lib/python3.10/site-packages/torch/_dynamo/convert_frame.py:636, in _compile.<locals>.compile_inner(code, one_graph, hooks, transform)
    635 try:
--> 636     out_code = transform_code_object(code, transform)
    637     break

File ~/miniconda3/envs/speaker_recog/lib/python3.10/site-packages/torch/_dynamo/bytecode_transformation.py:1185, in transform_code_object(code, transformations, safe)
   1183 propagate_line_nums(instructions)
-> 1185 transformations(instructions, code_options)
   1186 return clean_and_assemble_instructions(instructions, keys, code_options)[1]

File ~/miniconda3/envs/speaker_recog/lib/python3.10/site-packages/torch/_dynamo/convert_frame.py:178, in preserve_global_state.<locals>._fn(*args, **kwargs)
    177 try:
--> 178     return fn(*args, **kwargs)
    179 finally:

File ~/miniconda3/envs/speaker_recog/lib/python3.10/site-packages/torch/_dynamo/convert_frame.py:582, in _compile.<locals>.transform(instructions, code_options)
    581     with tracing(tracer.output.tracing_context), tracer.set_current_tx():
--> 582         tracer.run()
    583 except exc.UnspecializeRestartAnalysis:

File ~/miniconda3/envs/speaker_recog/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py:2451, in InstructionTranslator.run(self)
   2450 def run(self):
-> 2451     super().run()

File ~/miniconda3/envs/speaker_recog/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py:893, in InstructionTranslatorBase.run(self)
    892 self.output.push_tx(self)
--> 893 while self.step():
    894     pass

File ~/miniconda3/envs/speaker_recog/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py:805, in InstructionTranslatorBase.step(self)
    804 try:
--> 805     self.dispatch_table[inst.opcode](self, inst)
    806     return not self.output.should_exit

File ~/miniconda3/envs/speaker_recog/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py:499, in break_graph_if_unsupported.<locals>.decorator.<locals>.wrapper(self, inst)
    498 try:
--> 499     return inner_fn(self, inst)
    500 except Unsupported as excp:

File ~/miniconda3/envs/speaker_recog/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py:1459, in InstructionTranslatorBase.CALL_FUNCTION(self, inst)
   1458 fn = self.pop()
-> 1459 self.call_function(fn, args, {})

File ~/miniconda3/envs/speaker_recog/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py:743, in InstructionTranslatorBase.call_function(self, fn, args, kwargs)
    742     raise AssertionError(f"Attempt to trace forbidden callable {inner_fn}")
--> 743 self.push(fn.call_function(self, args, kwargs))

File ~/miniconda3/envs/speaker_recog/lib/python3.10/site-packages/torch/_dynamo/variables/nn_module.py:437, in NNModuleVariable.call_function(self, tx, args, kwargs)
    436     assert istype(fn, types.FunctionType)
--> 437 return tx.inline_user_function_return(
    438     variables.UserFunctionVariable(fn, source=fn_source),
    439     args,
    440     kwargs,
    441 )

File ~/miniconda3/envs/speaker_recog/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py:749, in InstructionTranslatorBase.inline_user_function_return(self, fn, args, kwargs)
    746 """
    747 A call to some user defined function by inlining it.
    748 """
--> 749 return InliningInstructionTranslator.inline_call(self, fn, args, kwargs)

File ~/miniconda3/envs/speaker_recog/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py:2666, in InliningInstructionTranslator.inline_call(cls, parent, func, args, kwargs)
   2665 with patch.dict(counters, {"unimplemented": counters["inline_call"]}):
-> 2666     return cls.inline_call_(parent, func, args, kwargs)

File ~/miniconda3/envs/speaker_recog/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py:2782, in InliningInstructionTranslator.inline_call_(parent, func, args, kwargs)
   2781     with strict_ctx:
-> 2782         tracer.run()
   2783 except exc.ObservedException as e:

File ~/miniconda3/envs/speaker_recog/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py:893, in InstructionTranslatorBase.run(self)
    892 self.output.push_tx(self)
--> 893 while self.step():
    894     pass

File ~/miniconda3/envs/speaker_recog/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py:805, in InstructionTranslatorBase.step(self)
    804 try:
--> 805     self.dispatch_table[inst.opcode](self, inst)
    806     return not self.output.should_exit

File ~/miniconda3/envs/speaker_recog/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py:499, in break_graph_if_unsupported.<locals>.decorator.<locals>.wrapper(self, inst)
    498 try:
--> 499     return inner_fn(self, inst)
    500 except Unsupported as excp:

File ~/miniconda3/envs/speaker_recog/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py:1500, in InstructionTranslatorBase.CALL_FUNCTION_EX(self, inst)
   1499 kwargsvars = kwargsvars.keys_as_python_constant()
-> 1500 self.call_function(fn, argsvars.items, kwargsvars)

File ~/miniconda3/envs/speaker_recog/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py:743, in InstructionTranslatorBase.call_function(self, fn, args, kwargs)
    742     raise AssertionError(f"Attempt to trace forbidden callable {inner_fn}")
--> 743 self.push(fn.call_function(self, args, kwargs))

File ~/miniconda3/envs/speaker_recog/lib/python3.10/site-packages/torch/_dynamo/variables/functions.py:344, in UserMethodVariable.call_function(self, tx, args, kwargs)
    343     return invoke_and_store_as_constant(tx, fn, self.get_name(), args, kwargs)
--> 344 return super().call_function(tx, args, kwargs)

File ~/miniconda3/envs/speaker_recog/lib/python3.10/site-packages/torch/_dynamo/variables/functions.py:293, in UserFunctionVariable.call_function(self, tx, args, kwargs)
    289     return invoke_and_store_as_constant(
    290         tx, self.fn, self.get_name(), args, kwargs
    291     )
--> 293 return super().call_function(tx, args, kwargs)

File ~/miniconda3/envs/speaker_recog/lib/python3.10/site-packages/torch/_dynamo/variables/functions.py:90, in BaseUserFunctionVariable.call_function(self, tx, args, kwargs)
     87 def call_function(
     88     self, tx, args: "List[VariableTracker]", kwargs: "Dict[str, VariableTracker]"
     89 ) -> "VariableTracker":
---> 90     return tx.inline_user_function_return(self, [*self.self_args(), *args], kwargs)

File ~/miniconda3/envs/speaker_recog/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py:749, in InstructionTranslatorBase.inline_user_function_return(self, fn, args, kwargs)
    746 """
    747 A call to some user defined function by inlining it.
    748 """
--> 749 return InliningInstructionTranslator.inline_call(self, fn, args, kwargs)

File ~/miniconda3/envs/speaker_recog/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py:2666, in InliningInstructionTranslator.inline_call(cls, parent, func, args, kwargs)
   2665 with patch.dict(counters, {"unimplemented": counters["inline_call"]}):
-> 2666     return cls.inline_call_(parent, func, args, kwargs)

File ~/miniconda3/envs/speaker_recog/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py:2782, in InliningInstructionTranslator.inline_call_(parent, func, args, kwargs)
   2781     with strict_ctx:
-> 2782         tracer.run()
   2783 except exc.ObservedException as e:

File ~/miniconda3/envs/speaker_recog/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py:893, in InstructionTranslatorBase.run(self)
    892 self.output.push_tx(self)
--> 893 while self.step():
    894     pass

File ~/miniconda3/envs/speaker_recog/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py:805, in InstructionTranslatorBase.step(self)
    804 try:
--> 805     self.dispatch_table[inst.opcode](self, inst)
    806     return not self.output.should_exit

File ~/miniconda3/envs/speaker_recog/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py:499, in break_graph_if_unsupported.<locals>.decorator.<locals>.wrapper(self, inst)
    498 try:
--> 499     return inner_fn(self, inst)
    500 except Unsupported as excp:

File ~/miniconda3/envs/speaker_recog/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py:1459, in InstructionTranslatorBase.CALL_FUNCTION(self, inst)
   1458 fn = self.pop()
-> 1459 self.call_function(fn, args, {})

File ~/miniconda3/envs/speaker_recog/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py:743, in InstructionTranslatorBase.call_function(self, fn, args, kwargs)
    742     raise AssertionError(f"Attempt to trace forbidden callable {inner_fn}")
--> 743 self.push(fn.call_function(self, args, kwargs))

File ~/miniconda3/envs/speaker_recog/lib/python3.10/site-packages/torch/_dynamo/variables/nn_module.py:366, in NNModuleVariable.call_function(self, tx, args, kwargs)
    365 for child_name, submod in mod._modules.items():
--> 366     tx.call_function(
    367         tx.output.register_attr_or_module(
    368             submod,
    369             self.module_key,
    370             child_name,
    371             source=NNModuleSource(AttrSource(self.source, child_name)),
    372         ),
    373         [arg],
    374         {},
    375     )
    376     arg = tx.pop()

File ~/miniconda3/envs/speaker_recog/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py:743, in InstructionTranslatorBase.call_function(self, fn, args, kwargs)
    742     raise AssertionError(f"Attempt to trace forbidden callable {inner_fn}")
--> 743 self.push(fn.call_function(self, args, kwargs))

File ~/miniconda3/envs/speaker_recog/lib/python3.10/site-packages/torch/_dynamo/variables/nn_module.py:437, in NNModuleVariable.call_function(self, tx, args, kwargs)
    436     assert istype(fn, types.FunctionType)
--> 437 return tx.inline_user_function_return(
    438     variables.UserFunctionVariable(fn, source=fn_source),
    439     args,
    440     kwargs,
    441 )

File ~/miniconda3/envs/speaker_recog/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py:749, in InstructionTranslatorBase.inline_user_function_return(self, fn, args, kwargs)
    746 """
    747 A call to some user defined function by inlining it.
    748 """
--> 749 return InliningInstructionTranslator.inline_call(self, fn, args, kwargs)

File ~/miniconda3/envs/speaker_recog/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py:2666, in InliningInstructionTranslator.inline_call(cls, parent, func, args, kwargs)
   2665 with patch.dict(counters, {"unimplemented": counters["inline_call"]}):
-> 2666     return cls.inline_call_(parent, func, args, kwargs)

File ~/miniconda3/envs/speaker_recog/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py:2782, in InliningInstructionTranslator.inline_call_(parent, func, args, kwargs)
   2781     with strict_ctx:
-> 2782         tracer.run()
   2783 except exc.ObservedException as e:

File ~/miniconda3/envs/speaker_recog/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py:893, in InstructionTranslatorBase.run(self)
    892 self.output.push_tx(self)
--> 893 while self.step():
    894     pass

File ~/miniconda3/envs/speaker_recog/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py:805, in InstructionTranslatorBase.step(self)
    804 try:
--> 805     self.dispatch_table[inst.opcode](self, inst)
    806     return not self.output.should_exit

File ~/miniconda3/envs/speaker_recog/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py:499, in break_graph_if_unsupported.<locals>.decorator.<locals>.wrapper(self, inst)
    498 try:
--> 499     return inner_fn(self, inst)
    500 except Unsupported as excp:

File ~/miniconda3/envs/speaker_recog/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py:1500, in InstructionTranslatorBase.CALL_FUNCTION_EX(self, inst)
   1499 kwargsvars = kwargsvars.keys_as_python_constant()
-> 1500 self.call_function(fn, argsvars.items, kwargsvars)

File ~/miniconda3/envs/speaker_recog/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py:743, in InstructionTranslatorBase.call_function(self, fn, args, kwargs)
    742     raise AssertionError(f"Attempt to trace forbidden callable {inner_fn}")
--> 743 self.push(fn.call_function(self, args, kwargs))

File ~/miniconda3/envs/speaker_recog/lib/python3.10/site-packages/torch/_dynamo/variables/functions.py:344, in UserMethodVariable.call_function(self, tx, args, kwargs)
    343     return invoke_and_store_as_constant(tx, fn, self.get_name(), args, kwargs)
--> 344 return super().call_function(tx, args, kwargs)

File ~/miniconda3/envs/speaker_recog/lib/python3.10/site-packages/torch/_dynamo/variables/functions.py:293, in UserFunctionVariable.call_function(self, tx, args, kwargs)
    289     return invoke_and_store_as_constant(
    290         tx, self.fn, self.get_name(), args, kwargs
    291     )
--> 293 return super().call_function(tx, args, kwargs)

File ~/miniconda3/envs/speaker_recog/lib/python3.10/site-packages/torch/_dynamo/variables/functions.py:90, in BaseUserFunctionVariable.call_function(self, tx, args, kwargs)
     87 def call_function(
     88     self, tx, args: "List[VariableTracker]", kwargs: "Dict[str, VariableTracker]"
     89 ) -> "VariableTracker":
---> 90     return tx.inline_user_function_return(self, [*self.self_args(), *args], kwargs)

File ~/miniconda3/envs/speaker_recog/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py:749, in InstructionTranslatorBase.inline_user_function_return(self, fn, args, kwargs)
    746 """
    747 A call to some user defined function by inlining it.
    748 """
--> 749 return InliningInstructionTranslator.inline_call(self, fn, args, kwargs)

File ~/miniconda3/envs/speaker_recog/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py:2666, in InliningInstructionTranslator.inline_call(cls, parent, func, args, kwargs)
   2665 with patch.dict(counters, {"unimplemented": counters["inline_call"]}):
-> 2666     return cls.inline_call_(parent, func, args, kwargs)

File ~/miniconda3/envs/speaker_recog/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py:2782, in InliningInstructionTranslator.inline_call_(parent, func, args, kwargs)
   2781     with strict_ctx:
-> 2782         tracer.run()
   2783 except exc.ObservedException as e:

File ~/miniconda3/envs/speaker_recog/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py:893, in InstructionTranslatorBase.run(self)
    892 self.output.push_tx(self)
--> 893 while self.step():
    894     pass

File ~/miniconda3/envs/speaker_recog/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py:805, in InstructionTranslatorBase.step(self)
    804 try:
--> 805     self.dispatch_table[inst.opcode](self, inst)
    806     return not self.output.should_exit

File ~/miniconda3/envs/speaker_recog/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py:499, in break_graph_if_unsupported.<locals>.decorator.<locals>.wrapper(self, inst)
    498 try:
--> 499     return inner_fn(self, inst)
    500 except Unsupported as excp:

File ~/miniconda3/envs/speaker_recog/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py:1459, in InstructionTranslatorBase.CALL_FUNCTION(self, inst)
   1458 fn = self.pop()
-> 1459 self.call_function(fn, args, {})

File ~/miniconda3/envs/speaker_recog/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py:743, in InstructionTranslatorBase.call_function(self, fn, args, kwargs)
    742     raise AssertionError(f"Attempt to trace forbidden callable {inner_fn}")
--> 743 self.push(fn.call_function(self, args, kwargs))

File ~/miniconda3/envs/speaker_recog/lib/python3.10/site-packages/torch/_dynamo/variables/nn_module.py:437, in NNModuleVariable.call_function(self, tx, args, kwargs)
    436     assert istype(fn, types.FunctionType)
--> 437 return tx.inline_user_function_return(
    438     variables.UserFunctionVariable(fn, source=fn_source),
    439     args,
    440     kwargs,
    441 )

File ~/miniconda3/envs/speaker_recog/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py:749, in InstructionTranslatorBase.inline_user_function_return(self, fn, args, kwargs)
    746 """
    747 A call to some user defined function by inlining it.
    748 """
--> 749 return InliningInstructionTranslator.inline_call(self, fn, args, kwargs)

File ~/miniconda3/envs/speaker_recog/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py:2666, in InliningInstructionTranslator.inline_call(cls, parent, func, args, kwargs)
   2665 with patch.dict(counters, {"unimplemented": counters["inline_call"]}):
-> 2666     return cls.inline_call_(parent, func, args, kwargs)

File ~/miniconda3/envs/speaker_recog/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py:2782, in InliningInstructionTranslator.inline_call_(parent, func, args, kwargs)
   2781     with strict_ctx:
-> 2782         tracer.run()
   2783 except exc.ObservedException as e:

File ~/miniconda3/envs/speaker_recog/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py:893, in InstructionTranslatorBase.run(self)
    892 self.output.push_tx(self)
--> 893 while self.step():
    894     pass

File ~/miniconda3/envs/speaker_recog/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py:805, in InstructionTranslatorBase.step(self)
    804 try:
--> 805     self.dispatch_table[inst.opcode](self, inst)
    806     return not self.output.should_exit

File ~/miniconda3/envs/speaker_recog/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py:499, in break_graph_if_unsupported.<locals>.decorator.<locals>.wrapper(self, inst)
    498 try:
--> 499     return inner_fn(self, inst)
    500 except Unsupported as excp:

File ~/miniconda3/envs/speaker_recog/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py:1500, in InstructionTranslatorBase.CALL_FUNCTION_EX(self, inst)
   1499 kwargsvars = kwargsvars.keys_as_python_constant()
-> 1500 self.call_function(fn, argsvars.items, kwargsvars)

File ~/miniconda3/envs/speaker_recog/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py:743, in InstructionTranslatorBase.call_function(self, fn, args, kwargs)
    742     raise AssertionError(f"Attempt to trace forbidden callable {inner_fn}")
--> 743 self.push(fn.call_function(self, args, kwargs))

File ~/miniconda3/envs/speaker_recog/lib/python3.10/site-packages/torch/_dynamo/variables/functions.py:344, in UserMethodVariable.call_function(self, tx, args, kwargs)
    343     return invoke_and_store_as_constant(tx, fn, self.get_name(), args, kwargs)
--> 344 return super().call_function(tx, args, kwargs)

File ~/miniconda3/envs/speaker_recog/lib/python3.10/site-packages/torch/_dynamo/variables/functions.py:293, in UserFunctionVariable.call_function(self, tx, args, kwargs)
    289     return invoke_and_store_as_constant(
    290         tx, self.fn, self.get_name(), args, kwargs
    291     )
--> 293 return super().call_function(tx, args, kwargs)

File ~/miniconda3/envs/speaker_recog/lib/python3.10/site-packages/torch/_dynamo/variables/functions.py:90, in BaseUserFunctionVariable.call_function(self, tx, args, kwargs)
     87 def call_function(
     88     self, tx, args: "List[VariableTracker]", kwargs: "Dict[str, VariableTracker]"
     89 ) -> "VariableTracker":
---> 90     return tx.inline_user_function_return(self, [*self.self_args(), *args], kwargs)

File ~/miniconda3/envs/speaker_recog/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py:749, in InstructionTranslatorBase.inline_user_function_return(self, fn, args, kwargs)
    746 """
    747 A call to some user defined function by inlining it.
    748 """
--> 749 return InliningInstructionTranslator.inline_call(self, fn, args, kwargs)

File ~/miniconda3/envs/speaker_recog/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py:2666, in InliningInstructionTranslator.inline_call(cls, parent, func, args, kwargs)
   2665 with patch.dict(counters, {"unimplemented": counters["inline_call"]}):
-> 2666     return cls.inline_call_(parent, func, args, kwargs)

File ~/miniconda3/envs/speaker_recog/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py:2782, in InliningInstructionTranslator.inline_call_(parent, func, args, kwargs)
   2781     with strict_ctx:
-> 2782         tracer.run()
   2783 except exc.ObservedException as e:

File ~/miniconda3/envs/speaker_recog/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py:893, in InstructionTranslatorBase.run(self)
    892 self.output.push_tx(self)
--> 893 while self.step():
    894     pass

File ~/miniconda3/envs/speaker_recog/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py:805, in InstructionTranslatorBase.step(self)
    804 try:
--> 805     self.dispatch_table[inst.opcode](self, inst)
    806     return not self.output.should_exit

File ~/miniconda3/envs/speaker_recog/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py:499, in break_graph_if_unsupported.<locals>.decorator.<locals>.wrapper(self, inst)
    498 try:
--> 499     return inner_fn(self, inst)
    500 except Unsupported as excp:

File ~/miniconda3/envs/speaker_recog/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py:1459, in InstructionTranslatorBase.CALL_FUNCTION(self, inst)
   1458 fn = self.pop()
-> 1459 self.call_function(fn, args, {})

File ~/miniconda3/envs/speaker_recog/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py:743, in InstructionTranslatorBase.call_function(self, fn, args, kwargs)
    742     raise AssertionError(f"Attempt to trace forbidden callable {inner_fn}")
--> 743 self.push(fn.call_function(self, args, kwargs))

File ~/miniconda3/envs/speaker_recog/lib/python3.10/site-packages/torch/_dynamo/variables/functions.py:293, in UserFunctionVariable.call_function(self, tx, args, kwargs)
    289     return invoke_and_store_as_constant(
    290         tx, self.fn, self.get_name(), args, kwargs
    291     )
--> 293 return super().call_function(tx, args, kwargs)

File ~/miniconda3/envs/speaker_recog/lib/python3.10/site-packages/torch/_dynamo/variables/functions.py:90, in BaseUserFunctionVariable.call_function(self, tx, args, kwargs)
     87 def call_function(
     88     self, tx, args: "List[VariableTracker]", kwargs: "Dict[str, VariableTracker]"
     89 ) -> "VariableTracker":
---> 90     return tx.inline_user_function_return(self, [*self.self_args(), *args], kwargs)

File ~/miniconda3/envs/speaker_recog/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py:749, in InstructionTranslatorBase.inline_user_function_return(self, fn, args, kwargs)
    746 """
    747 A call to some user defined function by inlining it.
    748 """
--> 749 return InliningInstructionTranslator.inline_call(self, fn, args, kwargs)

File ~/miniconda3/envs/speaker_recog/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py:2666, in InliningInstructionTranslator.inline_call(cls, parent, func, args, kwargs)
   2665 with patch.dict(counters, {"unimplemented": counters["inline_call"]}):
-> 2666     return cls.inline_call_(parent, func, args, kwargs)

File ~/miniconda3/envs/speaker_recog/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py:2782, in InliningInstructionTranslator.inline_call_(parent, func, args, kwargs)
   2781     with strict_ctx:
-> 2782         tracer.run()
   2783 except exc.ObservedException as e:

File ~/miniconda3/envs/speaker_recog/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py:893, in InstructionTranslatorBase.run(self)
    892 self.output.push_tx(self)
--> 893 while self.step():
    894     pass

File ~/miniconda3/envs/speaker_recog/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py:805, in InstructionTranslatorBase.step(self)
    804 try:
--> 805     self.dispatch_table[inst.opcode](self, inst)
    806     return not self.output.should_exit

File ~/miniconda3/envs/speaker_recog/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py:499, in break_graph_if_unsupported.<locals>.decorator.<locals>.wrapper(self, inst)
    498 try:
--> 499     return inner_fn(self, inst)
    500 except Unsupported as excp:

File ~/miniconda3/envs/speaker_recog/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py:1459, in InstructionTranslatorBase.CALL_FUNCTION(self, inst)
   1458 fn = self.pop()
-> 1459 self.call_function(fn, args, {})

File ~/miniconda3/envs/speaker_recog/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py:743, in InstructionTranslatorBase.call_function(self, fn, args, kwargs)
    742     raise AssertionError(f"Attempt to trace forbidden callable {inner_fn}")
--> 743 self.push(fn.call_function(self, args, kwargs))

File ~/miniconda3/envs/speaker_recog/lib/python3.10/site-packages/torch/_dynamo/variables/functions.py:293, in UserFunctionVariable.call_function(self, tx, args, kwargs)
    289     return invoke_and_store_as_constant(
    290         tx, self.fn, self.get_name(), args, kwargs
    291     )
--> 293 return super().call_function(tx, args, kwargs)

File ~/miniconda3/envs/speaker_recog/lib/python3.10/site-packages/torch/_dynamo/variables/functions.py:90, in BaseUserFunctionVariable.call_function(self, tx, args, kwargs)
     87 def call_function(
     88     self, tx, args: "List[VariableTracker]", kwargs: "Dict[str, VariableTracker]"
     89 ) -> "VariableTracker":
---> 90     return tx.inline_user_function_return(self, [*self.self_args(), *args], kwargs)

File ~/miniconda3/envs/speaker_recog/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py:749, in InstructionTranslatorBase.inline_user_function_return(self, fn, args, kwargs)
    746 """
    747 A call to some user defined function by inlining it.
    748 """
--> 749 return InliningInstructionTranslator.inline_call(self, fn, args, kwargs)

File ~/miniconda3/envs/speaker_recog/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py:2666, in InliningInstructionTranslator.inline_call(cls, parent, func, args, kwargs)
   2665 with patch.dict(counters, {"unimplemented": counters["inline_call"]}):
-> 2666     return cls.inline_call_(parent, func, args, kwargs)

File ~/miniconda3/envs/speaker_recog/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py:2782, in InliningInstructionTranslator.inline_call_(parent, func, args, kwargs)
   2781     with strict_ctx:
-> 2782         tracer.run()
   2783 except exc.ObservedException as e:

File ~/miniconda3/envs/speaker_recog/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py:893, in InstructionTranslatorBase.run(self)
    892 self.output.push_tx(self)
--> 893 while self.step():
    894     pass

File ~/miniconda3/envs/speaker_recog/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py:805, in InstructionTranslatorBase.step(self)
    804 try:
--> 805     self.dispatch_table[inst.opcode](self, inst)
    806     return not self.output.should_exit

File ~/miniconda3/envs/speaker_recog/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py:499, in break_graph_if_unsupported.<locals>.decorator.<locals>.wrapper(self, inst)
    498 try:
--> 499     return inner_fn(self, inst)
    500 except Unsupported as excp:

File ~/miniconda3/envs/speaker_recog/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py:1459, in InstructionTranslatorBase.CALL_FUNCTION(self, inst)
   1458 fn = self.pop()
-> 1459 self.call_function(fn, args, {})

File ~/miniconda3/envs/speaker_recog/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py:743, in InstructionTranslatorBase.call_function(self, fn, args, kwargs)
    742     raise AssertionError(f"Attempt to trace forbidden callable {inner_fn}")
--> 743 self.push(fn.call_function(self, args, kwargs))

File ~/miniconda3/envs/speaker_recog/lib/python3.10/site-packages/torch/_dynamo/variables/functions.py:665, in SkipFunctionVariable.call_function(self, tx, args, kwargs)
    664 msg += f"', {self.reason}'" if self.reason else ""
--> 665 unimplemented(msg)

File ~/miniconda3/envs/speaker_recog/lib/python3.10/site-packages/torch/_dynamo/exc.py:221, in unimplemented(msg, from_exc)
    220     raise Unsupported(msg) from from_exc
--> 221 raise Unsupported(msg)

Unsupported: 'skip function isinstance in file /home/miko/miniconda3/envs/speaker_recog/lib/python3.10/site-packages/torch/jit/__init__.py'

from user code:
   File "/home/miko/.cache/torch/hub/IDRnD_ReDimNet_master/redimnet.py", line 953, in forward
    x = self.spec(x).unsqueeze(1)
  File "/home/miko/miniconda3/envs/speaker_recog/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1562, in _call_impl
    return forward_call(*args, **kwargs)
  File "/home/miko/.cache/torch/hub/IDRnD_ReDimNet_master/redimnet.py", line 116, in forward
    x = self.torchfbank(x)+1e-6
  File "/home/miko/miniconda3/envs/speaker_recog/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1562, in _call_impl
    return forward_call(*args, **kwargs)
  File "/home/miko/miniconda3/envs/speaker_recog/lib/python3.10/site-packages/torchaudio/transforms/_transforms.py", line 619, in forward
    specgram = self.spectrogram(waveform)
  File "/home/miko/miniconda3/envs/speaker_recog/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1562, in _call_impl
    return forward_call(*args, **kwargs)
  File "/home/miko/miniconda3/envs/speaker_recog/lib/python3.10/site-packages/torchaudio/transforms/_transforms.py", line 110, in forward
    return F.spectrogram(
  File "/home/miko/miniconda3/envs/speaker_recog/lib/python3.10/site-packages/torchaudio/functional/functional.py", line 119, in spectrogram
    frame_length_norm, window_norm = _get_spec_norms(normalized)
  File "/home/miko/miniconda3/envs/speaker_recog/lib/python3.10/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:

OnnxExporterError                         Traceback (most recent call last)
Cell In[43], line 3
      1 model.eval()
      2 with torch.no_grad():
----> 3     onnx_program_redim = torch.onnx.dynamo_export(model, input_sample)

File ~/miniconda3/envs/speaker_recog/lib/python3.10/site-packages/torch/onnx/_internal/exporter.py:1520, in dynamo_export(model, export_options, *model_args, **model_kwargs)
   1512 resolved_export_options.diagnostic_context.dump(sarif_report_path)
   1513 message = (
   1514     f"Failed to export the model to ONNX. Generating SARIF report at '{sarif_report_path}'. "
   1515     "SARIF is a standard format for the output of static analysis tools. "
   (...)
   1518     f"Please report a bug on PyTorch Github: {_PYTORCH_GITHUB_ISSUES_URL}"
   1519 )
-> 1520 raise OnnxExporterError(
   1521     ONNXProgram._from_failure(e, resolved_export_options.diagnostic_context),
   1522     message,
   1523 ) from e

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```

 ```

### Versions

Collecting environment information...
PyTorch version: 2.4.1+cu121
Is debug build: False
CUDA used to build PyTorch: 12.1
ROCM used to build PyTorch: N/A

OS: Ubuntu 20.04.6 LTS (x86_64)
GCC version: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0
Clang version: Could not collect
CMake version: Could not collect
Libc version: glibc-2.31

Python version: 3.10.14 (main, May  6 2024, 19:42:50) [GCC 11.2.0] (64-bit runtime)
Python platform: Linux-5.15.0-122-generic-x86_64-with-glibc2.31
Is CUDA available: True
CUDA runtime version: Could not collect
CUDA_MODULE_LOADING set to: LAZY
GPU models and configuration: GPU 0: NVIDIA GeForce GTX 1650
Nvidia driver version: 535.183.01
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
Address sizes:                        39 bits physical, 48 bits virtual
CPU(s):                               12
On-line CPU(s) list:                  0-11
Thread(s) per core:                   2
Core(s) per socket:                   6
Socket(s):                            1
NUMA node(s):                         1
Vendor ID:                            GenuineIntel
CPU family:                           6
Model:                                165
Model name:                           Intel(R) Core(TM) i7-10750H CPU @ 2.60GHz
Stepping:                             2
CPU MHz:                              2600.000
CPU max MHz:                          5000.0000
CPU min MHz:                          800.0000
BogoMIPS:                             5199.98
Virtualization:                       VT-x
L1d cache:                            192 KiB
L1i cache:                            192 KiB
L2 cache:                             1.5 MiB
L3 cache:                             12 MiB
NUMA node0 CPU(s):                    0-11
Vulnerability Gather data sampling:   Mitigation; Microcode
Vulnerability Itlb multihit:          KVM: Mitigation: VMX disabled
Vulnerability L1tf:                   Not affected
Vulnerability Mds:                    Not affected
Vulnerability Meltdown:               Not affected
Vulnerability Mmio stale data:        Mitigation; Clear CPU buffers; SMT vulnerable
Vulnerability Reg file data sampling: Not affected
Vulnerability Retbleed:               Mitigation; Enhanced IBRS
Vulnerability Spec rstack overflow:   Not affected
Vulnerability Spec store bypass:      Mitigation; Speculative Store Bypass disabled via prctl and seccomp
Vulnerability Spectre v1:             Mitigation; usercopy/swapgs barriers and __user pointer sanitization
Vulnerability Spectre v2:             Mitigation; Enhanced / Automatic IBRS; IBPB conditional; RSB filling; PBRSB-eIBRS SW sequence; BHI SW loop, KVM SW loop
Vulnerability Srbds:                  Mitigation; Microcode
Vulnerability Tsx async abort:        Not affected
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 art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb invpcid_single ssbd ibrs ibpb stibp ibrs_enhanced tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid mpx rdseed adx smap clflushopt intel_pt xsaveopt xsavec xgetbv1 xsaves dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp pku ospke md_clear flush_l1d arch_capabilities

Versions of relevant libraries:
[pip3] numpy==2.1.1
[pip3] nvidia-cublas-cu12==12.1.3.1
[pip3] nvidia-cuda-cupti-cu12==12.1.105
[pip3] nvidia-cuda-nvrtc-cu12==12.1.105
[pip3] nvidia-cuda-runtime-cu12==12.1.105
[pip3] nvidia-cudnn-cu12==9.1.0.70
[pip3] nvidia-cufft-cu12==11.0.2.54
[pip3] nvidia-curand-cu12==10.3.2.106
[pip3] nvidia-cusolver-cu12==11.4.5.107
[pip3] nvidia-cusparse-cu12==12.1.0.106
[pip3] nvidia-nccl-cu12==2.20.5
[pip3] nvidia-nvjitlink-cu12==12.6.68
[pip3] nvidia-nvtx-cu12==12.1.105
[pip3] onnx==1.17.0
[pip3] onnx-tool==0.9.0
[pip3] onnxruntime==1.19.2
[pip3] onnxscript==0.1.0.dev20241011
[pip3] torch==2.4.1
[pip3] torchaudio==2.4.1
[pip3] torchprofile==0.0.4
[pip3] torchvision==0.19.1
[pip3] triton==3.0.0
[conda] numpy                     2.1.1                    pypi_0    pypi
[conda] nvidia-cublas-cu12        12.1.3.1                 pypi_0    pypi
[conda] nvidia-cuda-cupti-cu12    12.1.105                 pypi_0    pypi
[conda] nvidia-cuda-nvrtc-cu12    12.1.105                 pypi_0    pypi
[conda] nvidia-cuda-runtime-cu12  12.1.105                 pypi_0    pypi
[conda] nvidia-cudnn-cu12         9.1.0.70                 pypi_0    pypi
[conda] nvidia-cufft-cu12         11.0.2.54                pypi_0    pypi
[conda] nvidia-curand-cu12        10.3.2.106               pypi_0    pypi
[conda] nvidia-cusolver-cu12      11.4.5.107               pypi_0    pypi
[conda] nvidia-cusparse-cu12      12.1.0.106               pypi_0    pypi
[conda] nvidia-nccl-cu12          2.20.5                   pypi_0    pypi
[conda] nvidia-nvjitlink-cu12     12.6.68                  pypi_0    pypi
[conda] nvidia-nvtx-cu12          12.1.105                 pypi_0    pypi
[conda] torch                     2.4.1                    pypi_0    pypi
[conda] torchaudio                2.4.1                    pypi_0    pypi
[conda] torchprofile              0.0.4                    pypi_0    pypi
[conda] torchvision               0.19.1                   pypi_0    pypi
[conda] triton                    3.0.0                    pypi_0    pypi