code: def test_decoder_quantization_with_and_without_cache(
      self, test_name, model_info, use_cache
  ):
      model_cls, model_name, expected_quantized_matmuls = model_info
      qconfig = AutoQuantizationConfig.avx512(
          is_static=False, per_channel=True
      )
      model = model_cls.from_pretrained(
          model_name,
          export=True,
          use_cache=use_cache,
          use_io_binding=use_cache,
      )
  
      with tempfile.TemporaryDirectory() as tmp_dir:
          model.save_pretrained(tmp_dir)
          output_dir = Path(tmp_dir)
          quantizer = ORTQuantizer.from_pretrained(model)
          quantizer.quantize(
              save_dir=output_dir, quantization_config=qconfig
          )
          expected_ort_config = ORTConfig(quantization=qconfig)
          ort_config = ORTConfig.from_pretrained(tmp_dir)
  
          # Verify the ORTConfig was correctly created and saved
          self.assertEqual(
              ort_config.to_dict(), expected_ort_config.to_dict()
          )
          quantized_model = onnx_load(
              output_dir.joinpath("model_quantized.onnx")
          )
          num_quantized_matmul = 0
          for initializer in quantized_model.graph.initializer:
              if (
                  "weight" in initializer.name
                  and "quantized" in initializer.name
              ):
                  num_quantized_matmul += 1
          self.assertEqual(
              expected_quantized_matmuls, num_quantized_matmul
          )
          gc.collect()
  
imports: import gc
  import tempfile
  import unittest
  from functools import partial
  from pathlib import Path
  from onnx import load
  from onnxruntime import __version__
  from onnxruntime.quantization import QuantFormat, QuantizationMode, QuantType
  from packaging.version import Version, parse
  from parameterized import parameterized
  from transformers import AutoTokenizer
  from optimum.onnxruntime import AutoCalibrationConfig, AutoQuantizationConfig, ORTConfig, ORTModelForCausalLM, ORTModelForSeq2SeqLM, ORTModelForSequenceClassification, ORTQuantizer, QuantizationConfig
  from optimum.utils.testing_utils import grid_parameters
label_desc: Use image node_id 3 for calling the ORTDynamicQuantizationTest obj's underlying member method code with example usage: obj.test_decoder_quantization_with_and_without_cache(test_name, model_info, use_cache) without return types