class_docstr: Integration tests ensuring supported models are correctly exported.
code: def test_exporters_cli_pytorch_with_optimization(
      self,
      test_name: str,
      model_type: str,
      model_name: str,
      task: str,
      variant: str,
      monolith: bool,
      no_post_process: bool,
  ):
      model_kwargs = None
      if model_type == "speecht5":
          model_kwargs = {"vocoder": "fxmarty/speecht5-hifigan-tiny"}
  
      for optimization_level in ["O1", "O2", "O3"]:
          try:
              self._onnx_export(
                  model_name,
                  task,
                  monolith,
                  no_post_process,
                  optimization_level=optimization_level,
                  variant=variant,
                  model_kwargs=model_kwargs,
              )
          except NotImplementedError as e:
              if "Tried to use ORTOptimizer for the model type" in str(
                  e
              ) or "doesn't support the graph optimization" in str(e):
                  self.skipTest(
                      f"unsupported model type in ORTOptimizer: {model_type}"
                  )
              else:
                  raise e
  
imports: import os
  import subprocess
  import unittest
  from pathlib import Path
  from tempfile import TemporaryDirectory
  from typing import Dict, Optional
  import onnx
  import pytest
  from parameterized import parameterized
  from transformers import AutoModelForSequenceClassification, AutoTokenizer, is_torch_available
  from transformers.testing_utils import require_torch, require_torch_gpu, require_vision, slow
  from optimum.exporters.error_utils import MinimumVersionError
  from optimum.exporters.onnx.__main__ import main_export
  from optimum.onnxruntime import ONNX_DECODER_MERGED_NAME, ONNX_DECODER_NAME, ONNX_DECODER_WITH_PAST_NAME, ONNX_ENCODER_NAME
  from optimum.utils.testing_utils import require_diffusers, require_sentence_transformers, require_timm
  from ..exporters_utils import PYTORCH_EXPORT_MODELS_TINY, PYTORCH_SENTENCE_TRANSFORMERS_MODEL, PYTORCH_STABLE_DIFFUSION_MODEL, PYTORCH_TIMM_MODEL
label_desc: Use image node_id 11 for calling the OnnxCLIExportTestCase obj's underlying member method code with example usage: obj.test_exporters_cli_pytorch_with_optimization(test_name, model_type, model_name, task, variant, monolith, no_post_process) without return types