parameters: (self, dataset_gen, input_type, output_type,
                               allow_float)
return_statement: return self._calibrator.QuantizeModel(
          np.dtype(input_type.as_numpy_dtype()).num,
          np.dtype(output_type.as_numpy_dtype()).num, allow_float)
docstring: Calibrates the model with specified generator and then quantizes it.
  
      Returns:
        A quantized model.
  
      Args:
        dataset_gen: A generator that generates calibration samples.
        input_type: A tf.dtype representing the desired real-value input type.
        output_type: A tf.dtype representing the desired real-value output type.
        allow_float: A boolean. False if the resulting model cannot perform float
                     computation, useful when targeting an integer-only backend.
                     If False, an error will be thrown if an operation cannot be
                     quantized, otherwise the model will fallback to float ops.
docstring_summary: Calibrates the model with specified generator and then quantizes it.
docstring_tokens: Calibrates the model with specified generator and then quantizes it .
function: def calibrate_and_quantize(self, dataset_gen, input_type, output_type,
                               allow_float):
      """Calibrates the model with specified generator and then quantizes it.
  
      Returns:
        A quantized model.
  
      Args:
        dataset_gen: A generator that generates calibration samples.
        input_type: A tf.dtype representing the desired real-value input type.
        output_type: A tf.dtype representing the desired real-value output type.
        allow_float: A boolean. False if the resulting model cannot perform float
                     computation, useful when targeting an integer-only backend.
                     If False, an error will be thrown if an operation cannot be
                     quantized, otherwise the model will fallback to float ops.
      """
      self._calibrator.Prepare()
      for calibration_sample in dataset_gen():
        self._calibrator.FeedTensor(calibration_sample)
      return self._calibrator.QuantizeModel(
          np.dtype(input_type.as_numpy_dtype()).num,
          np.dtype(output_type.as_numpy_dtype()).num, allow_float)
function_tokens: def calibrate_and_quantize ( self , dataset_gen , input_type , output_type , allow_float ) : self . _calibrator . Prepare ( ) for calibration_sample in dataset_gen ( ) : self . _calibrator . FeedTensor ( calibration_sample ) return self . _calibrator . QuantizeModel ( np . dtype ( input_type . as_numpy_dtype ( ) ) . num , np . dtype ( output_type . as_numpy_dtype ( ) ) . num , allow_float )