docstr: Args:
      dataset (`Dataset`):
          The dataset to use when performing the calibration step.
      num_bins (`int`):
          The number of bins to use when creating the histogram.
      num_quantized_bins (`int`):
          The number of quantized bins used to find the optimal threshold when computing the activations
          quantization ranges.
  
  Returns:
      The calibration configuration.
docstr_tok: ["Args",":","dataset","(","`","Dataset","`",")",":","The","dataset","to","use","when","performing","the","calibration","step",".","num_bins","(","`","int","`",")",":","The","number","of","bins","to","use","when","creating","the","histogram",".","num_quantized_bins","(","`","int","`",")",":","The","number","of","quantized","bins","used","to","find","the","optimal","threshold","when","computing","the","activations","quantization","ranges",".","Returns",":","The","calibration","configuration","."]
code: def entropy(
      dataset: Dataset,
      num_bins: int = 128,
      num_quantized_bins: int = 128,
  ) -> CalibrationConfig:
      """
      Args:
          dataset (`Dataset`):
              The dataset to use when performing the calibration step.
          num_bins (`int`):
              The number of bins to use when creating the histogram.
          num_quantized_bins (`int`):
              The number of quantized bins used to find the optimal threshold when computing the activations
              quantization ranges.
  
      Returns:
          The calibration configuration.
      """
      if parse(ort_version) < Version("1.11.0"):
          raise NotImplementedError(
              "Entropy calibration method is only implemented for onnxruntime >= 1.11.0"
          )
  
      if num_bins <= 0:
          raise ValueError(
              f"Invalid value num_bins ({num_bins}) should be >= 1"
          )
  
      if num_quantized_bins <= 0:
          raise ValueError(
              f"Invalid value num_quantized_bins ({num_quantized_bins}) should be >= 1"
          )
  
      return CalibrationConfig(
          dataset_name=dataset.info.builder_name,
          dataset_config_name=dataset.info.config_name,
          dataset_split=str(dataset.split),
          dataset_num_samples=dataset.num_rows,
          method=CalibrationMethod.Entropy,
          num_bins=num_bins,
          num_quantized_bins=num_quantized_bins,
      )
  
imports: import os
  import warnings
  from dataclasses import asdict, dataclass, field
  from enum import Enum
  from pathlib import Path
  from typing import Dict, List, Optional, Tuple, Union
  from datasets import Dataset
  from packaging.version import Version, parse
  from onnxruntime import __version__
  from onnxruntime.quantization import CalibraterBase, CalibrationMethod, QuantFormat, QuantizationMode, QuantType
  from onnxruntime.quantization.calibrate import create_calibrator
  from onnxruntime.quantization.registry import IntegerOpsRegistry, QDQRegistry, QLinearOpsRegistry
  from onnxruntime.transformers.fusion_options import FusionOptions
  from ..configuration_utils import BaseConfig
  from ..utils import logging
label_desc: Use image node_id 2 for calling the AutoCalibrationConfig obj's underlying member method code with example usage: obj.entropy(dataset, num_bins, num_quantized_bins) and returns: CalibrationConfig