TfLiteInitializationOptions
Stay organized with collections
Save and categorize content based on your preferences.
Options for initializing TFLite.
Public Constructor Summary
Inherited Method Summary
From class java.lang.Object
Object
|
clone()
|
boolean |
|
void |
finalize()
|
final Class<?>
|
getClass()
|
int |
hashCode()
|
final void |
notify()
|
final void |
notifyAll()
|
String
|
toString()
|
final void |
wait(long arg0, int arg1)
|
final void |
wait(long arg0)
|
final void |
wait()
|
Public Constructors
public TfLiteInitializationOptions ()
Public Methods
public abstract boolean
enableGpuDelegateSupport ()
Returns whether GPU delegate support should be enabled.
If this value is false, initialization will not attempt to load the GPU delegate,
and using a GpuDelegate
in TFLite will fail.
Note that if the value is true but the device does not support GPU acceleration for
TFLite, initialization will fail. In this case, your app can optionally fall back to
initializing TFLite without GPU delegate support.
By default, the value is false.
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.
Last updated 2024-10-31 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-10-31 UTC."],[[["\u003cp\u003e\u003ccode\u003eTfLiteInitializationOptions\u003c/code\u003e provides configuration settings for initializing TensorFlow Lite.\u003c/p\u003e\n"],["\u003cp\u003eIt offers control over enabling or disabling GPU delegate support for acceleration.\u003c/p\u003e\n"],["\u003cp\u003eA builder pattern is used to create instances of \u003ccode\u003eTfLiteInitializationOptions\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eEnabling GPU delegate support may lead to initialization failure if the device lacks the necessary hardware or software.\u003c/p\u003e\n"]]],[],null,["# TfLiteInitializationOptions\n\npublic abstract class **TfLiteInitializationOptions** extends [Object](//developer.android.com/reference/java/lang/Object.html) \nOptions for initializing TFLite. \n\n### Nested Class Summary\n\n|-------|---|---|-------------------------------------------------------------------------------------------------------------------------------------------|\n| class | [TfLiteInitializationOptions.Builder](/android/reference/com/google/android/gms/tflite/client/TfLiteInitializationOptions.Builder) || Builder for [TfLiteInitializationOptions](/android/reference/com/google/android/gms/tflite/client/TfLiteInitializationOptions) instances. |\n\n### Public Constructor Summary\n\n|---|----------------------------------------------------------------------------------------------------------------------------------------------------|\n| | [TfLiteInitializationOptions](/android/reference/com/google/android/gms/tflite/client/TfLiteInitializationOptions#TfLiteInitializationOptions())() |\n\n### Public Method Summary\n\n|-------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| static [TfLiteInitializationOptions.Builder](/android/reference/com/google/android/gms/tflite/client/TfLiteInitializationOptions.Builder) | [builder](/android/reference/com/google/android/gms/tflite/client/TfLiteInitializationOptions#builder())() Creates a new [TfLiteInitializationOptions](/android/reference/com/google/android/gms/tflite/client/TfLiteInitializationOptions) builder. |\n| abstract boolean | [enableGpuDelegateSupport](/android/reference/com/google/android/gms/tflite/client/TfLiteInitializationOptions#enableGpuDelegateSupport())() Returns whether GPU delegate support should be enabled. |\n\n### Inherited Method Summary\n\nFrom class java.lang.Object \n\n|----------------------------------------------------------------------------|--------------------------------------------------------------------------------|\n| [Object](//developer.android.com/reference/java/lang/Object.html) | clone() |\n| boolean | equals([Object](//developer.android.com/reference/java/lang/Object.html) arg0) |\n| void | finalize() |\n| final [Class](//developer.android.com/reference/java/lang/Class.html)\\\u003c?\\\u003e | getClass() |\n| int | hashCode() |\n| final void | notify() |\n| final void | notifyAll() |\n| [String](//developer.android.com/reference/java/lang/String.html) | toString() |\n| final void | wait(long arg0, int arg1) |\n| final void | wait(long arg0) |\n| final void | wait() |\n\nPublic Constructors\n-------------------\n\n#### public **TfLiteInitializationOptions** ()\n\nPublic Methods\n--------------\n\n#### public static [TfLiteInitializationOptions.Builder](/android/reference/com/google/android/gms/tflite/client/TfLiteInitializationOptions.Builder) **builder** ()\n\nCreates a new [TfLiteInitializationOptions](/android/reference/com/google/android/gms/tflite/client/TfLiteInitializationOptions) builder. \n\n#### public abstract boolean\n**enableGpuDelegateSupport** ()\n\nReturns whether GPU delegate support should be enabled.\n\nIf this value is false, initialization will not attempt to load the GPU delegate,\nand using a `GpuDelegate` in TFLite will fail.\n\nNote that if the value is true but the device does not support GPU acceleration for\nTFLite, initialization will fail. In this case, your app can optionally fall back to\ninitializing TFLite without GPU delegate support.\n\nBy default, the value is false."]]