# InterpreterApi.Options.TfLiteRuntime

```
enum InterpreterApi.Options.TfLiteRuntime
```

*** ** * ** ***

Enum to represent where to get the TensorFlow Lite runtime implementation from.

The difference between this class and the RuntimeFlavor class: This class specifies a *preference* which runtime to use, whereas `https://developers.google.com/edge/api/litert/kotlin/org/tensorflow/lite/RuntimeFlavor` specifies which exact runtime *is* being used.

## Summary

| ### Enum Values |
|---|---|
| `https://developers.google.com/edge/api/litert/kotlin/org/tensorflow/lite/InterpreterApi.Options.TfLiteRuntime#FROM_APPLICATION_ONLY` | Use a TF Lite runtime implementation that is linked into the application. |
| `https://developers.google.com/edge/api/litert/kotlin/org/tensorflow/lite/InterpreterApi.Options.TfLiteRuntime#FROM_SYSTEM_ONLY` | Use a TF Lite runtime implementation provided by the OS or system services. |
| `https://developers.google.com/edge/api/litert/kotlin/org/tensorflow/lite/InterpreterApi.Options.TfLiteRuntime#PREFER_SYSTEM_OVER_APPLICATION` | Use a system-provided TF Lite runtime implementation, if any, otherwise use the TF Lite runtime implementation linked into the application, if any. |

| ### Public functions |
|---|---|
| `java-static https://developers.google.com/edge/api/litert/kotlin/org/tensorflow/lite/InterpreterApi.Options.TfLiteRuntime!` | `https://developers.google.com/edge/api/litert/kotlin/org/tensorflow/lite/InterpreterApi.Options.TfLiteRuntime#valueOf(java.lang.String)(name: https://developers.google.com/edge/api/litert/kotlin/kotlin/String!)` Returns the enum constant of this type with the specified name. |
| `java-static https://developers.google.com/edge/api/litert/kotlin/kotlin/Array<https://developers.google.com/edge/api/litert/kotlin/org/tensorflow/lite/InterpreterApi.Options.TfLiteRuntime!>!` | `https://developers.google.com/edge/api/litert/kotlin/org/tensorflow/lite/InterpreterApi.Options.TfLiteRuntime#values()()` Returns an array containing the constants of this enum type, in the order they're declared. |

## Enum Values

### FROM_APPLICATION_ONLY

```
val InterpreterApi.Options.TfLiteRuntime.FROM_APPLICATION_ONLY: InterpreterApi.Options.TfLiteRuntime
```

Use a TF Lite runtime implementation that is linked into the application. If there is no suitable TF Lite runtime implementation linked into the application, then attempting to create an InterpreterApi instance with this TfLiteRuntime setting will throw an IllegalStateException exception (even if the OS or system services could provide a TF Lite runtime implementation).

This is the default setting. This setting is also appropriate for apps that must run on systems that don't provide a TF Lite runtime implementation.

### FROM_SYSTEM_ONLY

```
val InterpreterApi.Options.TfLiteRuntime.FROM_SYSTEM_ONLY: InterpreterApi.Options.TfLiteRuntime
```

Use a TF Lite runtime implementation provided by the OS or system services. This will be obtained from a system library / shared object / service, such as Google Play services. It may be newer than the version linked into the application (if any). If there is no suitable TF Lite runtime implementation provided by the system, then attempting to create an InterpreterApi instance with this TfLiteRuntime setting will throw an IllegalStateException exception (even if there is a TF Lite runtime implementation linked into the application).

This setting is appropriate for code that will use a system-provided TF Lite runtime, which can reduce app binary size and can be updated more frequently.

### PREFER_SYSTEM_OVER_APPLICATION

```
val InterpreterApi.Options.TfLiteRuntime.PREFER_SYSTEM_OVER_APPLICATION: InterpreterApi.Options.TfLiteRuntime
```

Use a system-provided TF Lite runtime implementation, if any, otherwise use the TF Lite runtime implementation linked into the application, if any. If no suitable TF Lite runtime can be found in any location, then attempting to create an InterpreterApi instance with this TFLiteRuntime setting will throw an IllegalStateException. If there is both a suitable TF Lite runtime linked into the application and also a suitable TF Lite runtime provided by the system, the one provided by the system will be used.

This setting is suitable for use in code that doesn't care where the TF Lite runtime is coming from (e.g. middleware layers).

## Public functions

### valueOf

```
java-static fun valueOf(name: String!): InterpreterApi.Options.TfLiteRuntime!
```

Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

| Returns |
|---|---|
| `https://developers.google.com/edge/api/litert/kotlin/org/tensorflow/lite/InterpreterApi.Options.TfLiteRuntime!` | the enum constant with the specified name |

| Throws |
|---|---|
| `https://developers.google.com/edge/api/litert/kotlin/java/lang/IllegalArgumentException` | if this enum type has no constant with the specified name |

### values

```
java-static fun values(): Array<InterpreterApi.Options.TfLiteRuntime!>!
```

Returns an array containing the constants of this enum type, in the order they're declared. This method may be used to iterate over the constants.

| Returns |
|---|---|
| `https://developers.google.com/edge/api/litert/kotlin/kotlin/Array<https://developers.google.com/edge/api/litert/kotlin/org/tensorflow/lite/InterpreterApi.Options.TfLiteRuntime!>!` | an array containing the constants of this enum type, in the order they're declared |