(
model: TFPreTrainedModel
config: TFLiteConfig
output: Path
)
→
Tuple[List[str], List[str]]
Parameters
TFPreTrainedModel
) —
The model to export.
Path
) —
Directory to store the exported TFLite model.
Returns
Tuple[List[str], List[str]]
A tuple with an ordered list of the model’s inputs, and the named inputs from the TFLite configuration.
Exports a TensorFlow model to a TensorFlow Lite model.
( config: TFLiteConfig reference_model: TFPreTrainedModel tflite_model_path: Path tflite_named_outputs: typing.List[str] atol: typing.Optional[float] = None )
Parameters
~TFPreTrainedModel
) —
The model used for the export.
Path
) —
The path to the exported model.
List[str]
) —
The names of the outputs to check.
Optional[float]
, defaults to None
) —
The absolute tolerance in terms of outputs difference between the reference and the exported model.
Raises
ValueError
ValueError
— If the outputs shapes or values do not match between the reference and the exported model.Validates the export by checking that the outputs from both the reference and the exported model match.