# lite/c/c_api_types.h

This file declares types used by the pure C inference API defined in c_api.h, some of which are also used in the C++ and C kernel and interpreter APIs.

## Summary

Note: Users of TensorFlow Lite should use

    #include "tensorflow/lite/c/c_api_types.h"

to access the APIs documented on this page.

### Enumerations
`TfLiteStatus{ kTfLiteOk = 0, kTfLiteError = 1, kTfLiteDelegateError = 2, kTfLiteApplicationError = 3, kTfLiteDelegateDataNotFound = 4, kTfLiteDelegateDataWriteError = 5, kTfLiteDelegateDataReadError = 6, kTfLiteUnresolvedOps = 7, kTfLiteCancelled = 8 }` | enum Note that new error status values may be added in future in order to indicate more fine-grained internal states, therefore, applications should not rely on status values being members of the enum.
`TfLiteType` | enum Types supported by tensor.

### Typedefs
`TfLiteDelegate` | typedef `struct TfLiteDelegate` TfLiteDelegate: allows delegation of nodes to alternative backends.
`TfLiteOpaqueContext` | typedef `struct TfLiteOpaqueContext` TfLiteOpaqueContext is an opaque version of TfLiteContext;.
`TfLiteOpaqueDelegate` | typedef `TfLiteDelegate` TfLiteOpaqueDelegate: conditionally opaque version of TfLiteDelegate; allows delegation of nodes to alternative backends.
`TfLiteOpaqueDelegateStruct` | typedef `struct TfLiteOpaqueDelegateStruct` TfLiteOpaqueDelegateStruct: unconditionally opaque version of TfLiteDelegate; allows delegation of nodes to alternative backends.
`TfLiteOpaqueNode` | typedef `struct TfLiteOpaqueNode` TfLiteOpaqueNode is an opaque version of TfLiteNode;.
`TfLiteOpaqueTensor` | typedef `struct TfLiteOpaqueTensor` TfLiteOpaqueTensor is an opaque version of TfLiteTensor;.
`TfLiteQuantizationParams` | typedef `struct TfLiteQuantizationParams` Legacy.
`TfLiteStatus` | typedef `enum TfLiteStatus` Note that new error status values may be added in future in order to indicate more fine-grained internal states, therefore, applications should not rely on status values being members of the enum.

### Structs
TfLiteQuantizationParams | Legacy.

## Enumerations

### TfLiteStatus

     TfLiteStatus

Note that new error status values may be added in future in order to indicate more fine-grained internal states, therefore, applications should not rely on status values being members of the enum.

Properties
`kTfLiteApplicationError` | Generally referring to an error in applying a delegate due to incompatibility between runtime and delegate, e.g., this error is returned when trying to apply a TF Lite delegate onto a model graph that's already immutable.
`kTfLiteCancelled` | Generally referring to invocation cancelled by the user. See `interpreter::Cancel`.
`kTfLiteDelegateDataNotFound` | Generally referring to serialized delegate data not being found. See tflite::delegates::Serialization.
`kTfLiteDelegateDataReadError` | Generally referring to data-reading issues in delegate serialization. See tflite::delegates::Serialization.
`kTfLiteDelegateDataWriteError` | Generally referring to data-writing issues in delegate serialization. See tflite::delegates::Serialization.
`kTfLiteDelegateError` | Generally referring to an error from a TfLiteDelegate itself.
`kTfLiteError` | Generally referring to an error in the runtime (i.e. interpreter)
`kTfLiteOk` | Success.
`kTfLiteUnresolvedOps` | Generally referring to issues when the TF Lite model has ops that cannot be resolved at runtime. This could happen when the specific op is not registered or built with the TF Lite framework.

### TfLiteType

     TfLiteType

Types supported by tensor.

## Typedefs

### TfLiteDelegate

    struct TfLiteDelegate TfLiteDelegate

TfLiteDelegate: allows delegation of nodes to alternative backends.

Forward declaration of concrete type declared in common.h.

### TfLiteOpaqueContext

    struct TfLiteOpaqueContext TfLiteOpaqueContext

TfLiteOpaqueContext is an opaque version of TfLiteContext;.

### TfLiteOpaqueDelegate

    TfLiteDelegate TfLiteOpaqueDelegate

TfLiteOpaqueDelegate: conditionally opaque version of TfLiteDelegate; allows delegation of nodes to alternative backends.

For TF Lite in Play Services, this is an opaque type, but for regular TF Lite, this is just a typedef for TfLiteDelegate.

WARNING: This is an experimental type and subject to change.

### TfLiteOpaqueDelegateStruct

    struct TfLiteOpaqueDelegateStruct TfLiteOpaqueDelegateStruct

TfLiteOpaqueDelegateStruct: unconditionally opaque version of TfLiteDelegate; allows delegation of nodes to alternative backends.

This is an abstract type that is intended to have the same role as TfLiteDelegate, but without exposing the implementation details of how delegates are implemented.

WARNING: This is an experimental type and subject to change.

### TfLiteOpaqueNode

    struct TfLiteOpaqueNode TfLiteOpaqueNode

TfLiteOpaqueNode is an opaque version of TfLiteNode;.

### TfLiteOpaqueTensor

    struct TfLiteOpaqueTensor TfLiteOpaqueTensor

TfLiteOpaqueTensor is an opaque version of TfLiteTensor;.

### TfLiteQuantizationParams

    struct TfLiteQuantizationParams TfLiteQuantizationParams

Legacy.

Will be deprecated in favor of `TfLiteAffineQuantization`. If per-layer quantization is specified this field will still be populated in addition to `TfLiteAffineQuantization`. Parameters for asymmetric quantization. Quantized values can be converted back to float using: `real_value = scale * (quantized_value - zero_point)`

### TfLiteStatus

    enum TfLiteStatus TfLiteStatus

Note that new error status values may be added in future in order to indicate more fine-grained internal states, therefore, applications should not rely on status values being members of the enum.