InterpreterApi.Options.TfLiteRuntime

公開靜態最終列舉 InterpreterApi.Options.TfLiteRuntime

用於表示 TensorFlow Lite 執行階段實作位置的列舉,

此類別與 RuntimeFlavor 類別之間的差異:此類別會指定要使用的執行階段「preference」,而 RuntimeFlavor 會指定「目前」使用哪個執行階段。

繼承的方法

最終 int
int
compareTo(Object arg0)
最終 布林值
equals(Object arg0)
最終 類別<InterpreterApi.Options.TfLiteRuntime>
getDeclaringClass()
最終 int
hashCode()
最終字串
name()
最終 int
ordinal()
字串
toString()
static <T 擴充 Enum<T>> T
valueOf(Class<T> arg0, String arg1)
布林值
equals(Object arg0)
最終 課程<?>
getClass()
int
hashCode()
最終 void
notify()
最終 void
notifyAll()
字串
toString()
最終 void
wait(long arg0, int arg1)
最終 void
wait(long arg0)
最終 void
wait()
抽象 int

列舉值

公開 靜態最終版 解譯 erApi.Options.TfLiteRuntime FROM_APPLICATION_ONLY

使用已連結至應用程式的 TF Lite 執行階段實作。如果應用程式沒有連結合適的 TF Lite 執行階段實作,則嘗試使用這個 TfLiteRuntime 設定建立 解讀 erApi 執行個體時,會擲回 IllegalStateException 例外狀況 (即使作業系統或系統服務可提供 TF Lite 執行階段實作)。

這是預設設定,如果應用程式必須在未提供 TF Lite 執行階段實作的系統上執行,也適合使用這項設定。

public static final UnderstandingerApi.Options.TfLiteRuntime FROM_SYSTEM_ONLY

請使用 OS 或系統服務提供的 TF Lite 執行階段實作。這項資訊會從系統程式庫 / 共用物件 / 服務 (例如 Google Play 服務) 取得。這可能比連結至應用程式的版本 (如果有的話) 還要新。如果系統未提供適當的 TF Lite 執行階段實作,則嘗試以此 TfLiteRuntime 設定建立 解讀 erApi 執行個體時,將擲回 IllegalStateException 例外狀況 (即使應用程式有連結至應用程式的 TF Lite 執行階段實作)。

這項設定適用於使用系統提供的 TF Lite 執行階段的程式碼,這種執行階段可縮減應用程式二進位檔的大小,且能提高更新頻率。

公開 static final UnderstandingerApi.Options.TfLiteRuntime PREFER_SYSTEM_OVER_APPLICATION

使用系統提供的 TF Lite 執行階段實作 (如果有的話),否則請使用連結至應用程式的 TF Lite 執行階段實作 (如果有的話)。如果任何位置都找不到合適的 TF Lite 執行階段,則嘗試以這個 TFLiteRuntime 設定建立 translateerApi 執行個體時,會擲回 IllegalStateException。如果應用程式有適當的 TF Lite 執行階段,同時也有系統提供的適合 TF Lite 執行階段,系統會使用系統提供的那一個。

這項設定適用於不想使用 TF Lite 執行階段來源 (例如中介軟體層) 的程式碼。