class_docstr: Base class for histogram calibrators.
class_docstr_tok: ["Base","class","for","histogram","calibrators","."]
docstr: Gets mean squared error between hist_mids and dequantized hist_mids.
  
  Quantization converts the range of numbers from [quant_min, quant_max] to
  [0, 2^num_bits - 1]. Values less than quant_min are converted to 0, and
  values greater than quant_max are converted to 2^num_bits - 1.
  
  Args:
    quant_min: The minimum real value that can be represented by a quantized
      value.
    quant_max: The maximum real value that can be represented by a quantized
      value.
  
  Returns:
    (error, quant_min, quant_max): Tuple of weighted mean squared error.
    error = (hist_mids - dequantized_hist_mids)**2 * hist_freq
docstr_tok: ["Gets","mean","squared","error","between","hist_mids","and","dequantized","hist_mids",".","Quantization","converts","the","range","of","numbers","from","[","quant_min",",","quant_max","]","to","[","0",",","2^num_bits","-","1","]",".","Values","less","than","quant_min","are","converted","to","0",",","and","values","greater","than","quant_max","are","converted","to","2^num_bits","-","1",".","Args",":","quant_min",":","The","minimum","real","value","that","can","be","represented","by","a","quantized","value",".","quant_max",":","The","maximum","real","value","that","can","be","represented","by","a","quantized","value",".","Returns",":","(","error",",","quant_min",",","quant_max",")",":","Tuple","of","weighted","mean","squared","error",".","error","=","(","hist_mids","-","dequantized_hist_mids",")","*","*","2","*","hist_freq"]
code: def _get_weighted_mean_squared_error(
      self, quant_min, quant_max
  ) -> tuple[float, float, float]:
      """Gets mean squared error between hist_mids and dequantized hist_mids.
  
      Quantization converts the range of numbers from [quant_min, quant_max] to
      [0, 2^num_bits - 1]. Values less than quant_min are converted to 0, and
      values greater than quant_max are converted to 2^num_bits - 1.
  
      Args:
        quant_min: The minimum real value that can be represented by a quantized
          value.
        quant_max: The maximum real value that can be represented by a quantized
          value.
  
      Returns:
        (error, quant_min, quant_max): Tuple of weighted mean squared error.
        error = (hist_mids - dequantized_hist_mids)**2 * hist_freq
      """
      dequantized_hist_mids = (
          self._get_dequantized_hist_mids_after_quantize(
              quant_min, quant_max
          )
      )
      squared_error = (self._hist_mids - dequantized_hist_mids) ** 2
      weighted_error = np.sum(squared_error * self._hist_freq)
      return (weighted_error, quant_min, quant_max)
  
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 3 for calling the _HistogramCalibrationAlgorithmBase obj's underlying member method code with example usage: obj._get_weighted_mean_squared_error(quant_min, quant_max) and returns: weighted_error,  quant_min,  quant_max