Constructs an InterpreterApi instance, using the specified model and options. The model
will be read from a ByteBuffer.
Parameters
byteBuffer
A pre-trained TF Lite model, in binary serialized form. The ByteBuffer should
not be modified after the construction of an InterpreterApi instance. The ByteBuffer can be either a MappedByteBuffer that memory-maps a model file, or a
direct ByteBuffer of nativeOrder() that contains the bytes content of a model.
options
A set of options for customizing interpreter behavior.
[[["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-05-10 UTC."],[],[],null,["# InterpreterFactory\n\npublic class **InterpreterFactory** \nFactory for constructing InterpreterApi instances.\n\nDeprecated; please use the InterpreterApi.create method instead.\n\n\u003cbr /\u003e\n\n### Public Constructors\n\n|---|-----------------------------------------------------------------------------------------------------------|\n| | [InterpreterFactory](/edge/api/tflite/java/org/tensorflow/lite/InterpreterFactory#InterpreterFactory())() |\n\n### Public Methods\n\n|----------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [InterpreterApi](/edge/api/tflite/java/org/tensorflow/lite/InterpreterApi) | [create](/edge/api/tflite/java/org/tensorflow/lite/InterpreterFactory#create(java.io.File,%20org.tensorflow.lite.InterpreterApi.Options))([File](https://developer.android.com/reference/java/io/File.html) modelFile, [InterpreterApi.Options](/edge/api/tflite/java/org/tensorflow/lite/InterpreterApi.Options) options) Constructs an [InterpreterApi](/edge/api/tflite/java/org/tensorflow/lite/InterpreterApi) instance, using the specified model and options. |\n| [InterpreterApi](/edge/api/tflite/java/org/tensorflow/lite/InterpreterApi) | [create](/edge/api/tflite/java/org/tensorflow/lite/InterpreterFactory#create(java.nio.ByteBuffer,%20org.tensorflow.lite.InterpreterApi.Options))([ByteBuffer](https://developer.android.com/reference/java/nio/ByteBuffer.html) byteBuffer, [InterpreterApi.Options](/edge/api/tflite/java/org/tensorflow/lite/InterpreterApi.Options) options) Constructs an [InterpreterApi](/edge/api/tflite/java/org/tensorflow/lite/InterpreterApi) instance, using the specified model and options. |\n\n### Inherited Methods\n\nFrom class java.lang.Object \n\n|----------------------------------------------------------------------------------|--------------------------------------------------------------------------------------|\n| boolean | equals([Object](https://developer.android.com/reference/java/lang/Object.html) arg0) |\n| final [Class](https://developer.android.com/reference/java/lang/Class.html)\\\u003c?\\\u003e | getClass() |\n| int | hashCode() |\n| final void | notify() |\n| final void | notifyAll() |\n| [String](https://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\n**InterpreterFactory**\n()\n\n\u003cbr /\u003e\n\nPublic Methods\n--------------\n\n#### public [InterpreterApi](/edge/api/tflite/java/org/tensorflow/lite/InterpreterApi)\n**create**\n([File](https://developer.android.com/reference/java/io/File.html) modelFile, [InterpreterApi.Options](/edge/api/tflite/java/org/tensorflow/lite/InterpreterApi.Options) options)\n\nConstructs an [InterpreterApi](/edge/api/tflite/java/org/tensorflow/lite/InterpreterApi) instance, using the specified model and options. The model\nwill be loaded from a file. \n\n##### Parameters\n\n| modelFile | A file containing a pre-trained TF Lite model. |\n| options | A set of options for customizing interpreter behavior. |\n|-----------|--------------------------------------------------------|\n\n##### Throws\n\n| [IllegalArgumentException](https://developer.android.com/reference/java/lang/IllegalArgumentException.html) | if `modelFile` does not encode a valid TensorFlow Lite model. |\n|-------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------|\n\n#### public [InterpreterApi](/edge/api/tflite/java/org/tensorflow/lite/InterpreterApi)\n**create**\n([ByteBuffer](https://developer.android.com/reference/java/nio/ByteBuffer.html) byteBuffer, [InterpreterApi.Options](/edge/api/tflite/java/org/tensorflow/lite/InterpreterApi.Options) options)\n\nConstructs an [InterpreterApi](/edge/api/tflite/java/org/tensorflow/lite/InterpreterApi) instance, using the specified model and options. The model\nwill be read from a `ByteBuffer`. \n\n##### Parameters\n\n| byteBuffer | A pre-trained TF Lite model, in binary serialized form. The ByteBuffer should not be modified after the construction of an [InterpreterApi](/edge/api/tflite/java/org/tensorflow/lite/InterpreterApi) instance. The `ByteBuffer` can be either a `MappedByteBuffer` that memory-maps a model file, or a direct `ByteBuffer` of nativeOrder() that contains the bytes content of a model. |\n| options | A set of options for customizing interpreter behavior. |\n|------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n\n##### Throws\n\n| [IllegalArgumentException](https://developer.android.com/reference/java/lang/IllegalArgumentException.html) | if `byteBuffer` is not a `MappedByteBuffer` nor a direct `ByteBuffer` of nativeOrder. |\n|-------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------|"]]