class_docstr: AverageMinMaxCalibrationAlgorithm for calculating min and max values of calibration result.
  
  AverageMinMax calibration calculates the average of min and max values.
  average of min = sum of min values / number of samples
  average of max = sum of max values / number of samples
class_docstr_tok: ["AverageMinMaxCalibrationAlgorithm","for","calculating","min","and","max","values","of","calibration","result",".","AverageMinMax","calibration","calculates","the","average","of","min","and","max","values",".","average","of","min","=","sum","of","min","values","\/","number","of","samples","average","of","max","=","sum","of","max","values","\/","number","of","samples"]
docstr: Calculates the average of min and max values.
  
  Returns:
    (min_value, max_value): Min and max calculated using AverageMinMax
  
  Raises:
    ValueError: num_samples is 0.
docstr_tok: ["Calculates","the","average","of","min","and","max","values",".","Returns",":","(","min_value",",","max_value",")",":","Min","and","max","calculated","using","AverageMinMax","Raises",":","ValueError",":","num_samples","is","0","."]
code: def get_min_max_value(self) -> tuple[float, float]:
      """Calculates the average of min and max values.
  
      Returns:
        (min_value, max_value): Min and max calculated using AverageMinMax
  
      Raises:
        ValueError: num_samples is 0.
      """
      average_min_max_statistics = (
          self._statistics.average_min_max_statistics
      )
      # num_samples is guaranteed to be larger than 0 because
      # get_statistics_from_calibrator throws an exception if num_samples == 0.
      num_samples = average_min_max_statistics.num_samples
      if num_samples == 0:
          raise ValueError(
              "num_samples must not be 0 when calibration method is"
              f" AverageMinMax: {self._calib_opts}"
          )
      min_value, max_value = (
          average_min_max_statistics.min_sum / num_samples,
          average_min_max_statistics.max_sum / num_samples,
      )
  
      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 _AverageMinMax obj's underlying member method code with example usage: obj.get_min_max_value() and returns: min_value,  max_value