class_docstr: Handles the ONNX Runtime quantization process for models shared on huggingface.co/models.
class_docstr_tok: ["Handles","the","ONNX","Runtime","quantization","process","for","models","shared","on","huggingface.co\/models","."]
docstr: Computes the quantization ranges.
  
  Returns:
      The dictionary mapping the nodes name to their quantization ranges.
docstr_tok: ["Computes","the","quantization","ranges",".","Returns",":","The","dictionary","mapping","the","nodes","name","to","their","quantization","ranges","."]
code: def compute_ranges(self) -> Dict[str, Tuple[float, float]]:
      """
      Computes the quantization ranges.
  
      Returns:
          The dictionary mapping the nodes name to their quantization ranges.
      """
      if self._calibrator is None:
          raise ValueError(
              "Calibrator is None, please call `partial_fit` or `fit` method at least ones to compute ranges."
          )
  
      LOGGER.info("Computing calibration ranges")
  
      if parse(ort_version) >= Version("1.16.0"):
          return self._calibrator.compute_data()
  
      return self._calibrator.compute_range()
  
imports: import logging
  import os
  from collections import defaultdict
  from pathlib import Path
  from typing import TYPE_CHECKING, Callable, Dict, List, Optional, Tuple, Union
  import onnx
  from datasets import Dataset, load_dataset
  from packaging.version import Version, parse
  from transformers import AutoConfig
  from onnxruntime import __version__
  from onnxruntime.quantization import CalibrationDataReader, QuantFormat, QuantizationMode, QuantType
  from onnxruntime.quantization.onnx_quantizer import ONNXQuantizer
  from onnxruntime.quantization.qdq_quantizer import QDQQuantizer
  from ..quantization_base import OptimumQuantizer
  from ..utils.save_utils import maybe_save_preprocessors
  from .None import ORTQuantizableOperator
  from .configuration import CalibrationConfig, ORTConfig, QuantizationConfig
  from .modeling_ort import ORTModel
  from .modeling_seq2seq import ORTModelForConditionalGeneration
  from .preprocessors import QuantizationPreprocessor
label_desc: Use image node_id 5 for calling the ORTQuantizer obj's underlying member method code with example usage: obj.compute_ranges() and returns: self, self