TFLiteConfiguration
Options & Configuration · AiDotNet.Deployment.Mobile.TensorFlowLite
Configuration for TensorFlow Lite model export.
For Beginners
TFLiteConfiguration provides AI safety functionality. Default values follow the original paper settings.
Constructors
| Constructor | Summary |
|---|---|
TFLiteConfiguration() |
Properties
| Property | Summary |
|---|---|
QuantizationMode QuantizationMode { get; set; } |
Gets or sets the quantization mode. |
TFLiteTargetSpec TargetSpec { get; set; } |
Gets or sets the target specification for compatibility. |
bool EnableConstantFolding { get; set; } |
Gets or sets whether to enable constant folding (default: true). |
bool EnableGpuDelegate { get; set; } |
Gets or sets whether to enable GPU delegate (default: false). |
bool EnableOperatorFusion { get; set; } |
Gets or sets whether to enable operator fusion (default: true). |
bool UseDynamicRangeQuantization { get; set; } |
Gets or sets whether to use dynamic range quantization (default: false). |
bool UseIntegerOnlyQuantization { get; set; } |
Gets or sets whether to use integer-only quantization (default: false). |
bool UseNnapiDelegate { get; set; } |
Gets or sets whether to use NNAPI delegate for Android (default: false). |
bool UseQuantization { get; set; } |
Gets or sets whether to use post-training quantization (default: true). |
bool UseXnnpackDelegate { get; set; } |
Gets or sets whether to use XNNPACK delegate (default: true). |
int NumThreads { get; set; } |
Gets or sets the number of threads for CPU inference (default: 4). |
string ModelDescription { get; set; } |
Gets or sets the model description. |
string ModelName { get; set; } |
Gets or sets the model name. |
Methods
| Method | Summary |
|---|---|
ExportConfiguration ToExportConfiguration() |
Converts to ExportConfiguration. |
TFLiteConfiguration ForAndroid() |
Creates a configuration for Android deployment. |
TFLiteConfiguration ForCPU(int numThreads) |
Creates a configuration optimized for CPU inference. |
TFLiteConfiguration ForIOS() |
Creates a configuration for iOS deployment. |
TFLiteConfiguration ForIntegerOnly() |
Creates a configuration with full integer quantization. |