tfx.components.trainer.rewriting.tflite_rewriter.TFLiteRewriter

Performs TFLite conversion.

Inherits From: BaseRewriter

name The name to use when identifying the rewriter.
filename The name of the file to use for the tflite model.
enable_experimental_new_converter Whether to use the MLIR converter.
copy_assets Boolean whether to copy the assets directory to the rewritten model directory.
copy_assets_extra Boolean whether to copy the assets.extra directory to the rewritten model directory.
enable_quantization Boolean whether to enable default TFLite quantization.

name The user-specified name of the rewriter.

Methods

perform_rewrite

View source

Invoke all validations and perform the rewrite.

Args
original_model A base_rewriter.ModelDescription object describing the original model.
rewritten_model A base_rewriter.ModelDescription object describing the location and type of the rewritten model.

Raises
ValueError if the model was not successfully rewritten.