tf.lite.Optimize
Stay organized with collections Save and categorize content based on your preferences.
Enum defining the optimizations to apply when generating a tflite model.
DEFAULT The default optimization strategy that enables post-training quantization. The type of post-training quantization that will be used is dependent on the other converter options supplied. Refer to the documentation for further information on the types available and how to use them.
OPTIMIZE_FOR_SIZE Deprecated. Does the same as DEFAULT.
OPTIMIZE_FOR_LATENCY Deprecated. Does the same as DEFAULT.
EXPERIMENTAL_SPARSITY Experimental flag, subject to change.
Enable optimization by taking advantage of the sparse model weights trained with pruning. The converter will inspect the sparsity pattern of the model weights and do its best to improve size and latency. The flag can be used alone to optimize float32 models with sparse weights. It can also be used together with the DEFAULT optimization mode to optimize quantized models with sparse weights.
Class Variables |
DEFAULT | <Optimize.DEFAULT: 'DEFAULT'> |
EXPERIMENTAL_SPARSITY | <Optimize.EXPERIMENTAL_SPARSITY: 'EXPERIMENTAL_SPARSITY'> |
OPTIMIZE_FOR_LATENCY | <Optimize.OPTIMIZE_FOR_LATENCY: 'OPTIMIZE_FOR_LATENCY'> |
OPTIMIZE_FOR_SIZE | <Optimize.OPTIMIZE_FOR_SIZE: 'OPTIMIZE_FOR_SIZE'> |
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates. Some content is licensed under the numpy license.
Last updated 2024-04-26 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-04-26 UTC."],[],[]]