class_docstr: HistogramPercentile for calculating min and max values of calibration result.
class_docstr_tok: ["HistogramPercentile","for","calculating","min","and","max","values","of","calibration","result","."]
docstr: Calculates min and max from statistics using calibration options.
  
  A "percentile" is a statistical concept that represents the value below
  which a given percentage of data falls in a dataset. It involves sorting the
  data from smallest to largest and then finding the value at a specified
  percentage position. For example, the 0.01 percentile represents the value
  in a given data set that corresponds to the lowest 0.01% of the data.
  
  HistogramPercentile calibration uses min_percentile and max_percentile to
  find min and max.
  
  min_percentile and max_percentile must be in range [0, 100].
  min_percentile is 0.001 by default.
  max_percentile is 99.999 by default.
  
  Returns:
    (min_value, max_value): Min and max calculated using HistogramPercentile
docstr_tok: ["Calculates","min","and","max","from","statistics","using","calibration","options",".","A","``","percentile","''","is","a","statistical","concept","that","represents","the","value","below","which","a","given","percentage","of","data","falls","in","a","dataset",".","It","involves","sorting","the","data","from","smallest","to","largest","and","then","finding","the","value","at","a","specified","percentage","position",".","For","example",",","the","0.01","percentile","represents","the","value","in","a","given","data","set","that","corresponds","to","the","lowest","0.01","%","of","the","data",".","HistogramPercentile","calibration","uses","min_percentile","and","max_percentile","to","find","min","and","max",".","min_percentile","and","max_percentile","must","be","in","range","[","0",",","100","]",".","min_percentile","is","0.001","by","default",".","max_percentile","is","99.999","by","default",".","Returns",":","(","min_value",",","max_value",")",":","Min","and","max","calculated","using","HistogramPercentile"]
code: def get_min_max_value(self) -> tuple[float, float]:
      """Calculates min and max from statistics using calibration options.
  
      A "percentile" is a statistical concept that represents the value below
      which a given percentage of data falls in a dataset. It involves sorting the
      data from smallest to largest and then finding the value at a specified
      percentage position. For example, the 0.01 percentile represents the value
      in a given data set that corresponds to the lowest 0.01% of the data.
  
      HistogramPercentile calibration uses min_percentile and max_percentile to
      find min and max.
  
      min_percentile and max_percentile must be in range [0, 100].
      min_percentile is 0.001 by default.
      max_percentile is 99.999 by default.
  
      Returns:
        (min_value, max_value): Min and max calculated using HistogramPercentile
      """
      total_freq = sum(self._hist_freq)
      # hist_freq_cumsum is dividing cumulative sum of hist_freq by total_freq
      # hist_freq_cumsum's value is in range [0, 1] by its definition
      hist_freq_cumsum = np.cumsum(self._hist_freq) / total_freq
  
      # min_percentile and max_percentile are converted from [0, 100] to [0, 1].
      min_quantile, max_quantile = (
          self._calib_opts.calibration_parameters.min_percentile
          / 100.0,
          self._calib_opts.calibration_parameters.max_percentile
          / 100.0,
      )
  
      # Get index of min/max quantile.
      min_quantile_idx, max_quantile_idx = (
          np.searchsorted(hist_freq_cumsum, min_quantile, side="right"),
          np.searchsorted(hist_freq_cumsum, max_quantile, side="left"),
      )
  
      # Get value of min/max quantile index.
      min_value, max_value = (
          self._hist_mids[min_quantile_idx],
          self._hist_mids[max_quantile_idx],
      )
  
      return min_value, max_value
  
imports: import abc
  import itertools
  import logging
  import numpy
  from tensorflow.compiler.mlir.quantization.tensorflow import quantization_options_pb2
  from tensorflow.compiler.mlir.quantization.tensorflow.calibrator import calibration_statistics_pb2
label_desc: Use image node_id 1 for calling the _HistogramPercentile obj's underlying member method code with example usage: obj.get_min_max_value() and returns: min_value,  max_value