class_docstr: The abstract base class that represents a custom TensorFlow model.
class_docstr_tok: ["The","abstract","base","class","that","represents","a","custom","TensorFlow","model","."]
docstr: Converts the model to requested formats.
  
  Args:
    export_dir: The directory to save exported files.
    tflite_filename: File name to save TFLite model. The full export path is
      {export_dir}/{tflite_filename}.
    quantization_config: The configuration for model quantization.
    preprocess: A callable to preprocess the representative dataset for
      quantization. The callable takes three arguments in order: feature,
      label, and is_training.
docstr_tok: ["Converts","the","model","to","requested","formats",".","Args",":","export_dir",":","The","directory","to","save","exported","files",".","tflite_filename",":","File","name","to","save","TFLite","model",".","The","full","export","path","is","{","export_dir","}","\/","{","tflite_filename","}",".","quantization_config",":","The","configuration","for","model","quantization",".","preprocess",":","A","callable","to","preprocess","the","representative","dataset","for","quantization",".","The","callable","takes","three","arguments","in","order",":","feature",",","label",",","and","is_training","."]
code: def export_tflite(
      self,
      export_dir: str,
      tflite_filename: str = "model.tflite",
      quantization_config: Optional[
          quantization.QuantizationConfig
      ] = None,
      preprocess: Optional[Callable[..., bool]] = None,
  ):
      """Converts the model to requested formats.
  
      Args:
        export_dir: The directory to save exported files.
        tflite_filename: File name to save TFLite model. The full export path is
          {export_dir}/{tflite_filename}.
        quantization_config: The configuration for model quantization.
        preprocess: A callable to preprocess the representative dataset for
          quantization. The callable takes three arguments in order: feature,
          label, and is_training.
      """
      if not tf.io.gfile.exists(export_dir):
          tf.io.gfile.makedirs(export_dir)
  
      tflite_filepath = os.path.join(export_dir, tflite_filename)
      tflite_model = model_util.convert_to_tflite(
          model=self._model,
          quantization_config=quantization_config,
          preprocess=preprocess,
      )
      model_util.save_tflite(
          tflite_model=tflite_model, tflite_file=tflite_filepath
      )
      tf.compat.v1.logging.info(
          "TensorFlow Lite model exported successfully: %s"
          % tflite_filepath
      )
  
file_path: mediapipe/mediapipe/model_maker/python/core/tasks/custom_model.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import abc
  import os
  from typing import Any, Callable, Optional
  import tensorflow
  from mediapipe.model_maker.python.core.data import dataset
  from mediapipe.model_maker.python.core.utils import model_util
  from mediapipe.model_maker.python.core.utils import quantization
label_desc: Use image node_id 4 for calling the CustomModel obj's underlying member method code with example usage: obj.export_tflite(export_dir, tflite_filename, quantization_config, preprocess) without return types