class_docstr: Configuration for post-training quantization.
  
  Refer to
  https://www.tensorflow.org/lite/performance/post_training_quantization
  for different post-training quantization options.
docstr: Sets input TFLite converter with quantization configurations.
  
  Args:
    converter: input tf.lite.TFLiteConverter.
    **kwargs: arguments used by ds.Dataset.gen_tf_dataset.
  
  Returns:
    tf.lite.TFLiteConverter with quantization configurations.
docstr_tok: ["Sets","input","TFLite","converter","with","quantization","configurations",".","Args",":","converter",":","input","tf.lite.TFLiteConverter",".","*","*","kwargs",":","arguments","used","by","ds.Dataset.gen_tf_dataset",".","Returns",":","tf.lite.TFLiteConverter","with","quantization","configurations","."]
code: def set_converter_with_quantization(
      self, converter: tf.lite.TFLiteConverter, **kwargs: Any
  ) -> tf.lite.TFLiteConverter:
      """Sets input TFLite converter with quantization configurations.
  
      Args:
        converter: input tf.lite.TFLiteConverter.
        **kwargs: arguments used by ds.Dataset.gen_tf_dataset.
  
      Returns:
        tf.lite.TFLiteConverter with quantization configurations.
      """
      converter.optimizations = self.optimizations
  
      if self.representative_data is not None:
          tf_ds = self.representative_data.gen_tf_dataset(
              batch_size=1, is_training=False, **kwargs
          )
          converter.representative_dataset = (
              tf.lite.RepresentativeDataset(
                  _get_representative_dataset_generator(
                      tf_ds, self.quantization_steps
                  )
              )
          )
  
      if self.inference_input_type:
          converter.inference_input_type = self.inference_input_type
      if self.inference_output_type:
          converter.inference_output_type = self.inference_output_type
      if self.supported_ops:
          converter.target_spec.supported_ops = self.supported_ops
      if self.supported_types:
          converter.target_spec.supported_types = self.supported_types
  
      if self.experimental_new_quantizer is not None:
          converter.experimental_new_quantizer = (
              self.experimental_new_quantizer
          )
      return converter
  
file_path: mediapipe/mediapipe/model_maker/python/core/utils/quantization.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from typing import Any, Callable, List, Optional, Union
  import tensorflow
  from mediapipe.model_maker.python.core.data import dataset
label_desc: Use image node_id 5 for calling the QuantizationConfig obj's underlying member method code with example usage: obj.set_converter_with_quantization(converter) and returns: converter