ValidatedAccelerationConfigResult
Stay organized with collections
Save and categorize content based on your preferences.
Acceleration config and validation result.
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()
|
From interface
org.tensorflow.lite.acceleration.ValidatedAccelerationConfig
abstract void |
apply(InterpreterApi.Options arg0)
|
abstract byte[] |
serialize()
|
Public Methods
Returns the acceleration config that was tested.
public void apply (InterpreterApi.Options
options)
Applies the acceleration config to interpreter options.
Returns more detailed information about benchmark run failure. This is only
available when
isValid()
is false
.
Returns more detailed information from mini-benchmark. This is only available when
isValid()
is true
.
public boolean isValid ()
Returns whether the model can run successfully with this
accelerationConfig()
. This is the minimum requirement for the acceleration
to be turned on.
public byte[] serialize ()
Serializes config as bytes.
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\u003eValidatedAccelerationConfigResult\u003c/code\u003e stores the results of validating an acceleration configuration for TensorFlow Lite model execution.\u003c/p\u003e\n"],["\u003cp\u003eIt indicates whether the model can run successfully with the specified acceleration configuration using \u003ccode\u003eisValid()\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eIt provides detailed benchmark results and error information through \u003ccode\u003ebenchmarkResult()\u003c/code\u003e and \u003ccode\u003ebenchmarkError()\u003c/code\u003e, respectively.\u003c/p\u003e\n"],["\u003cp\u003eThis class enables serialization and deserialization of the configuration and results with \u003ccode\u003eserialize()\u003c/code\u003e and \u003ccode\u003edeserialize()\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eIt allows applying the validated acceleration configuration to \u003ccode\u003eInterpreterApi.Options\u003c/code\u003e using \u003ccode\u003eapply()\u003c/code\u003e.\u003c/p\u003e\n"]]],["`ValidatedAccelerationConfigResult` manages acceleration configurations and their validation outcomes. Key actions include: retrieving the tested `AccelerationConfig`, applying it to `InterpreterApi.Options`, and checking `isValid()` if the model can run with it. The class provides access to `benchmarkResult` for successful runs and `benchmarkError` for failures. It can `serialize` the configuration to bytes and `deserialize` from bytes, allowing for persistence and transfer. This class is an `Object` which also inherits methods from the interface `ValidatedAccelerationConfig`.\n"],null,["# ValidatedAccelerationConfigResult\n\npublic class **ValidatedAccelerationConfigResult** extends [Object](//developer.android.com/reference/java/lang/Object.html) \nimplements ValidatedAccelerationConfig \nAcceleration config and validation result. \n\n### Public Method Summary\n\n|---------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [AccelerationConfig](/android/reference/com/google/android/gms/tflite/acceleration/AccelerationConfig) | [accelerationConfig](/android/reference/com/google/android/gms/tflite/acceleration/ValidatedAccelerationConfigResult#accelerationConfig())() Returns the acceleration config that was tested. |\n| void | [apply](/android/reference/com/google/android/gms/tflite/acceleration/ValidatedAccelerationConfigResult#apply(org.tensorflow.lite.InterpreterApi.Options))(InterpreterApi.Options options) Applies the acceleration config to interpreter options. |\n| [BenchmarkError](/android/reference/com/google/android/gms/tflite/acceleration/BenchmarkError) | [benchmarkError](/android/reference/com/google/android/gms/tflite/acceleration/ValidatedAccelerationConfigResult#benchmarkError())() Returns more detailed information about benchmark run failure. |\n| [BenchmarkResult](/android/reference/com/google/android/gms/tflite/acceleration/BenchmarkResult) | [benchmarkResult](/android/reference/com/google/android/gms/tflite/acceleration/ValidatedAccelerationConfigResult#benchmarkResult())() Returns more detailed information from mini-benchmark. |\n| static [ValidatedAccelerationConfigResult](/android/reference/com/google/android/gms/tflite/acceleration/ValidatedAccelerationConfigResult) | [deserialize](/android/reference/com/google/android/gms/tflite/acceleration/ValidatedAccelerationConfigResult#deserialize(byte[]))(byte\\[\\] bytes) Deserializes from bytes. |\n| boolean | [isValid](/android/reference/com/google/android/gms/tflite/acceleration/ValidatedAccelerationConfigResult#isValid())() Returns whether the model can run successfully with this [accelerationConfig()](/android/reference/com/google/android/gms/tflite/acceleration/ValidatedAccelerationConfigResult#accelerationConfig()). |\n| byte\\[\\] | [serialize](/android/reference/com/google/android/gms/tflite/acceleration/ValidatedAccelerationConfigResult#serialize())() Serializes config as bytes. |\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\nFrom interface org.tensorflow.lite.acceleration.ValidatedAccelerationConfig \n\n|-------------------|------------------------------------|\n| abstract void | apply(InterpreterApi.Options arg0) |\n| abstract byte\\[\\] | serialize() |\n\nPublic Methods\n--------------\n\n#### public [AccelerationConfig](/android/reference/com/google/android/gms/tflite/acceleration/AccelerationConfig)\n**accelerationConfig** ()\n\nReturns the acceleration config that was tested. \n\n#### public void **apply** (InterpreterApi.Options options)\n\nApplies the acceleration config to interpreter options. \n\n#### public [BenchmarkError](/android/reference/com/google/android/gms/tflite/acceleration/BenchmarkError)\n**benchmarkError** ()\n\nReturns more detailed information about benchmark run failure. This is only\navailable when [isValid()](/android/reference/com/google/android/gms/tflite/acceleration/ValidatedAccelerationConfigResult#isValid()) is `false`. \n\n#### public [BenchmarkResult](/android/reference/com/google/android/gms/tflite/acceleration/BenchmarkResult)\n**benchmarkResult** ()\n\nReturns more detailed information from mini-benchmark. This is only available when\n[isValid()](/android/reference/com/google/android/gms/tflite/acceleration/ValidatedAccelerationConfigResult#isValid()) is `true`. \n\n##### Throws\n\n| [NullPointerException](//developer.android.com/reference/java/lang/NullPointerException.html) | if benchmarkResult is `null` |\n|-----------------------------------------------------------------------------------------------|------------------------------|\n\n#### public static [ValidatedAccelerationConfigResult](/android/reference/com/google/android/gms/tflite/acceleration/ValidatedAccelerationConfigResult) **deserialize** (byte\\[\\] bytes)\n\nDeserializes from bytes. \n\n#### public boolean **isValid** ()\n\nReturns whether the model can run successfully with this [accelerationConfig()](/android/reference/com/google/android/gms/tflite/acceleration/ValidatedAccelerationConfigResult#accelerationConfig()). This is the minimum requirement for the acceleration\nto be turned on. \n\n#### public byte\\[\\] **serialize** ()\n\nSerializes config as bytes."]]