chore: import upstream snapshot with attribution
cffconvert / validate (push) Has been skipped
License Check / license-check (push) Failing after 2s

This commit is contained in:
wehub-resource-sync
2026-07-13 12:14:16 +08:00
commit 8a852e4b4e
36502 changed files with 9277225 additions and 0 deletions
@@ -0,0 +1,85 @@
# Copyright 2026 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
# Generated by c2devsite (go/c2devsite)
toc:
- title: Modules
section:
- title: "lite/abi/tflite.h"
path: /lite/api_docs/c/group/tflite
- title: "lite/acceleration/configuration/c/delegate_plugin.h"
path: /lite/api_docs/c/group/delegate-plugin
- title: "lite/acceleration/configuration/c/gpu_plugin.h"
path: /lite/api_docs/c/group/gpu-plugin
- title: "lite/acceleration/configuration/c/xnnpack_plugin.h"
path: /lite/api_docs/c/group/xnnpack-plugin
- title: "lite/c/c_api.h"
path: /lite/api_docs/c/group/c-api
- title: "lite/c/c_api_opaque.h"
path: /lite/api_docs/c/group/c-api-opaque
- title: "lite/c/c_api_types.h"
path: /lite/api_docs/c/group/c-api-types
- title: "lite/c/common.h"
path: /lite/api_docs/c/group/common
- title: Structs
section:
- title: "TfLiteAffineQuantization"
path: /lite/api_docs/c/struct/tf-lite-affine-quantization
- title: "TfLiteComplex128"
path: /lite/api_docs/c/struct/tf-lite-complex128
- title: "TfLiteComplex64"
path: /lite/api_docs/c/struct/tf-lite-complex64
- title: "TfLiteContext"
path: /lite/api_docs/c/struct/tf-lite-context
- title: "TfLiteCustomAllocation"
path: /lite/api_docs/c/struct/tf-lite-custom-allocation
- title: "TfLiteDelegate"
path: /lite/api_docs/c/struct/tf-lite-delegate
- title: "TfLiteDelegateParams"
path: /lite/api_docs/c/struct/tf-lite-delegate-params
- title: "TfLiteDelegatePlugin"
path: /lite/api_docs/c/struct/tf-lite-delegate-plugin
- title: "TfLiteDimensionMetadata"
path: /lite/api_docs/c/struct/tf-lite-dimension-metadata
- title: "TfLiteEvalTensor"
path: /lite/api_docs/c/struct/tf-lite-eval-tensor
- title: "TfLiteExternalContext"
path: /lite/api_docs/c/struct/tf-lite-external-context
- title: "TfLiteFloat16"
path: /lite/api_docs/c/struct/tf-lite-float16
- title: "TfLiteFloatArray"
path: /lite/api_docs/c/struct/tf-lite-float-array
- title: "TfLiteIntArray"
path: /lite/api_docs/c/struct/tf-lite-int-array
- title: "TfLiteNode"
path: /lite/api_docs/c/struct/tf-lite-node
- title: "TfLiteOpaqueDelegateBuilder"
path: /lite/api_docs/c/struct/tf-lite-opaque-delegate-builder
- title: "TfLiteOpaqueDelegateParams"
path: /lite/api_docs/c/struct/tf-lite-opaque-delegate-params
- title: "TfLiteQuantization"
path: /lite/api_docs/c/struct/tf-lite-quantization
- title: "TfLiteQuantizationParams"
path: /lite/api_docs/c/struct/tf-lite-quantization-params
- title: "TfLiteRegistration"
path: /lite/api_docs/c/struct/tf-lite-registration
- title: "TfLiteSparsity"
path: /lite/api_docs/c/struct/tf-lite-sparsity
- title: "TfLiteTensor"
path: /lite/api_docs/c/struct/tf-lite-tensor
- title: Unions
section:
- title: "TfLitePtrUnion"
path: /lite/api_docs/c/union/tf-lite-ptr-union
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,281 @@
<!DOCTYPE html>
<html devsite>
<head>
<title>lite/c/c_api_types.h</title>
<meta name="page_type" value="reference" />
</head>
<body>
<div id="top"><!-- do not remove this div --></div>
<h1>lite/c/c_api_types.h</h1>
<p>This file declares types used by the pure C inference API defined in <a href="/lite/api_docs/c/c/api-8h-source.html#c__api_8h_source">c_api.h</a>, some of which are also used in the C++ and C kernel and interpreter APIs. </p>
<h2>Summary</h2>
<p>
<aside class="note"><strong>Note:</strong> Users of TensorFlow Lite should use <pre class="prettyprint">#include "tensorflow/lite/c/c_api_types.h"</pre> to access the APIs documented on this page. </aside>
</p>
<table class="constants responsive">
<tr>
<th colspan="2">
<h3>Enumerations</h3>
</th>
</tr>
<tr>
<td>
<code><a href="#group__c__api__types_1gacf79d2fb5fa520303014d1303f1f6361">TfLiteStatus</a>{<br>&nbsp;&nbsp;<a href="#group__c__api__types_1ggacf79d2fb5fa520303014d1303f1f6361ab25fe210808197f1b6601df8ccdcd699">kTfLiteOk</a> = 0,<br>&nbsp;&nbsp;<a href="#group__c__api__types_1ggacf79d2fb5fa520303014d1303f1f6361a0bf230cf34a88de9e37834dc127437db">kTfLiteError</a> = 1,<br>&nbsp;&nbsp;<a href="#group__c__api__types_1ggacf79d2fb5fa520303014d1303f1f6361a73a5cedf4e108bb964c0a24e2a4470e1">kTfLiteDelegateError</a> = 2,<br>&nbsp;&nbsp;<a href="#group__c__api__types_1ggacf79d2fb5fa520303014d1303f1f6361a007a36e9810b4a7ae835ffc124e0a32c">kTfLiteApplicationError</a> = 3,<br>&nbsp;&nbsp;<a href="#group__c__api__types_1ggacf79d2fb5fa520303014d1303f1f6361a558db700e43e10a7c451d2c1551fda98">kTfLiteDelegateDataNotFound</a> = 4,<br>&nbsp;&nbsp;<a href="#group__c__api__types_1ggacf79d2fb5fa520303014d1303f1f6361a45c0f5eb58b0d5696d373d81b412e49a">kTfLiteDelegateDataWriteError</a> = 5,<br>&nbsp;&nbsp;<a href="#group__c__api__types_1ggacf79d2fb5fa520303014d1303f1f6361aeff408401134dd5c601de782e68d065e">kTfLiteDelegateDataReadError</a> = 6,<br>&nbsp;&nbsp;<a href="#group__c__api__types_1ggacf79d2fb5fa520303014d1303f1f6361ace42b5a195672087346b67784778104d">kTfLiteUnresolvedOps</a> = 7,<br>&nbsp;&nbsp;<a href="#group__c__api__types_1ggacf79d2fb5fa520303014d1303f1f6361a558a51ea592f1c4ccddb3d83af6cb0e4">kTfLiteCancelled</a> = 8<br>}</code>
</td>
<td>enum<div>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. </div></td>
</tr>
<tr>
<td>
<code><a href="#group__c__api__types_1ga8a47ba81bdef28b5c479ee7928a7d123">TfLiteType</a></code>
</td>
<td>enum<div>Types supported by tensor. </div></td>
</tr>
</table>
<table class="properties responsive">
<tr>
<th colspan="2">
<h3>Typedefs</h3>
</th>
</tr>
<tr>
<td>
<code><a href="#group__c__api__types_1ga792f1fcdea49b08878248dd0553294c0">TfLiteDelegate</a></code>
</td>
<td>typedef<div>
<code>struct <a href="/lite/api_docs/c/struct/tf-lite-delegate.html#struct_tf_lite_delegate">TfLiteDelegate</a></code>
</div><div><a href="/lite/api_docs/c/struct/tf-lite-delegate.html#struct_tf_lite_delegate">TfLiteDelegate</a>: allows delegation of nodes to alternative backends. </div></td>
</tr>
<tr>
<td>
<code><a href="#group__c__api__types_1gaa4ce7746ca46ee3e8021d61b30a4a278">TfLiteOpaqueContext</a></code>
</td>
<td>typedef<div>
<code>struct <a href="/lite/api_docs/c/group/c-api-types.html#group__c__api__types_1gaa4ce7746ca46ee3e8021d61b30a4a278">TfLiteOpaqueContext</a></code>
</div><div>TfLiteOpaqueContext is an opaque version of <a href="/lite/api_docs/c/struct/tf-lite-context.html#struct_tf_lite_context">TfLiteContext</a>;. </div></td>
</tr>
<tr>
<td>
<code><a href="#group__c__api__types_1gac2bc3e65b2b4dfe997134c006faa442f">TfLiteOpaqueDelegate</a></code>
</td>
<td>typedef<div>
<code><a href="/lite/api_docs/c/struct/tf-lite-delegate.html#struct_tf_lite_delegate">TfLiteDelegate</a></code>
</div><div>TfLiteOpaqueDelegate: conditionally opaque version of <a href="/lite/api_docs/c/struct/tf-lite-delegate.html#struct_tf_lite_delegate">TfLiteDelegate</a>; allows delegation of nodes to alternative backends. </div></td>
</tr>
<tr>
<td>
<code><a href="#group__c__api__types_1gaeacdfb2509c8e128ad7814d76c841d2b">TfLiteOpaqueDelegateStruct</a></code>
</td>
<td>typedef<div>
<code>struct <a href="/lite/api_docs/c/group/c-api-types.html#group__c__api__types_1gaeacdfb2509c8e128ad7814d76c841d2b">TfLiteOpaqueDelegateStruct</a></code>
</div><div>TfLiteOpaqueDelegateStruct: unconditionally opaque version of <a href="/lite/api_docs/c/struct/tf-lite-delegate.html#struct_tf_lite_delegate">TfLiteDelegate</a>; allows delegation of nodes to alternative backends. </div></td>
</tr>
<tr>
<td>
<code><a href="#group__c__api__types_1gab12a07755992ecd4881d888a170c4c4b">TfLiteOpaqueNode</a></code>
</td>
<td>typedef<div>
<code>struct <a href="/lite/api_docs/c/group/c-api-types.html#group__c__api__types_1gab12a07755992ecd4881d888a170c4c4b">TfLiteOpaqueNode</a></code>
</div><div>TfLiteOpaqueNode is an opaque version of <a href="/lite/api_docs/c/struct/tf-lite-node.html#struct_tf_lite_node">TfLiteNode</a>;. </div></td>
</tr>
<tr>
<td>
<code><a href="#group__c__api__types_1gab8d233ce3c69ac5f291ecd5ae52b3a12">TfLiteOpaqueTensor</a></code>
</td>
<td>typedef<div>
<code>struct <a href="/lite/api_docs/c/group/c-api-types.html#group__c__api__types_1gab8d233ce3c69ac5f291ecd5ae52b3a12">TfLiteOpaqueTensor</a></code>
</div><div>TfLiteOpaqueTensor is an opaque version of <a href="/lite/api_docs/c/struct/tf-lite-tensor.html#struct_tf_lite_tensor">TfLiteTensor</a>;. </div></td>
</tr>
<tr>
<td>
<code><a href="#group__c__api__types_1gaa681a1e2a35b583f6902663b77414dbc">TfLiteQuantizationParams</a></code>
</td>
<td>typedef<div>
<code>struct <a href="/lite/api_docs/c/struct/tf-lite-quantization-params.html#struct_tf_lite_quantization_params">TfLiteQuantizationParams</a></code>
</div><div>Legacy. </div></td>
</tr>
<tr>
<td>
<code><a href="#group__c__api__types_1gacc04b4e16e98f3b2e9f8082679e597e3">TfLiteStatus</a></code>
</td>
<td>typedef<div>
<code>enum <a href="/lite/api_docs/c/group/c-api-types.html#group__c__api__types_1gacf79d2fb5fa520303014d1303f1f6361">TfLiteStatus</a></code>
</div><div>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. </div></td>
</tr>
</table>
<table class="constants responsive">
<tr>
<th colspan="2">
<h3>Structs</h3>
</th>
</tr>
<tr>
<td>
<a href="/lite/api_docs/c/struct/tf-lite-quantization-params">TfLiteQuantizationParams</a>
</td>
<td>
<p>Legacy. </p>
</td>
</tr>
</table>
<h2>Enumerations</h2>
<div id="group__c__api__types_1gacf79d2fb5fa520303014d1303f1f6361">
<h3>TfLiteStatus</h3>
<pre class="prettyprint"> TfLiteStatus</pre>
<div>
<p>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. </p>
<table class="properties responsive">
<tr>
<th colspan="2">Properties</th>
</tr>
<tr>
<td>
<code><a id="group__c__api__types_1ggacf79d2fb5fa520303014d1303f1f6361a007a36e9810b4a7ae835ffc124e0a32c" />kTfLiteApplicationError</code>
</td>
<td>
<p>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. </p>
</td>
</tr>
<tr>
<td>
<code><a id="group__c__api__types_1ggacf79d2fb5fa520303014d1303f1f6361a558a51ea592f1c4ccddb3d83af6cb0e4" />kTfLiteCancelled</code>
</td>
<td>
<p>Generally referring to invocation cancelled by the user. </p>
<p>See <code>interpreter::Cancel</code>. </p>
</td>
</tr>
<tr>
<td>
<code><a id="group__c__api__types_1ggacf79d2fb5fa520303014d1303f1f6361a558db700e43e10a7c451d2c1551fda98" />kTfLiteDelegateDataNotFound</code>
</td>
<td>
<p>Generally referring to serialized delegate data not being found. </p>
<p>See tflite::delegates::Serialization. </p>
</td>
</tr>
<tr>
<td>
<code><a id="group__c__api__types_1ggacf79d2fb5fa520303014d1303f1f6361aeff408401134dd5c601de782e68d065e" />kTfLiteDelegateDataReadError</code>
</td>
<td>
<p>Generally referring to data-reading issues in delegate serialization. </p>
<p>See tflite::delegates::Serialization. </p>
</td>
</tr>
<tr>
<td>
<code><a id="group__c__api__types_1ggacf79d2fb5fa520303014d1303f1f6361a45c0f5eb58b0d5696d373d81b412e49a" />kTfLiteDelegateDataWriteError</code>
</td>
<td>
<p>Generally referring to data-writing issues in delegate serialization. </p>
<p>See tflite::delegates::Serialization. </p>
</td>
</tr>
<tr>
<td>
<code><a id="group__c__api__types_1ggacf79d2fb5fa520303014d1303f1f6361a73a5cedf4e108bb964c0a24e2a4470e1" />kTfLiteDelegateError</code>
</td>
<td>
<p>Generally referring to an error from a <a href="/lite/api_docs/c/struct/tf-lite-delegate.html#struct_tf_lite_delegate">TfLiteDelegate</a> itself. </p>
</td>
</tr>
<tr>
<td>
<code><a id="group__c__api__types_1ggacf79d2fb5fa520303014d1303f1f6361a0bf230cf34a88de9e37834dc127437db" />kTfLiteError</code>
</td>
<td>
<p>Generally referring to an error in the runtime (i.e. interpreter) </p>
</td>
</tr>
<tr>
<td>
<code><a id="group__c__api__types_1ggacf79d2fb5fa520303014d1303f1f6361ab25fe210808197f1b6601df8ccdcd699" />kTfLiteOk</code>
</td>
<td>
<p>Success. </p>
</td>
</tr>
<tr>
<td>
<code><a id="group__c__api__types_1ggacf79d2fb5fa520303014d1303f1f6361ace42b5a195672087346b67784778104d" />kTfLiteUnresolvedOps</code>
</td>
<td>
<p>Generally referring to issues when the TF Lite model has ops that cannot be resolved at runtime. </p>
<p>This could happen when the specific op is not registered or built with the TF Lite framework. </p>
</td>
</tr>
</table>
</div>
</div>
<div id="group__c__api__types_1ga8a47ba81bdef28b5c479ee7928a7d123">
<h3>TfLiteType</h3>
<pre class="prettyprint"> TfLiteType</pre>
<div>
<p>Types supported by tensor. </p>
</div>
</div>
<h2>Typedefs</h2>
<div id="group__c__api__types_1ga792f1fcdea49b08878248dd0553294c0">
<h3>TfLiteDelegate</h3>
<pre class="prettyprint">struct <a href="/lite/api_docs/c/struct/tf-lite-delegate.html#struct_tf_lite_delegate">TfLiteDelegate</a> TfLiteDelegate</pre>
<div>
<p><a href="/lite/api_docs/c/struct/tf-lite-delegate.html#struct_tf_lite_delegate">TfLiteDelegate</a>: allows delegation of nodes to alternative backends. </p>
<p>Forward declaration of concrete type declared in <a href="/lite/api_docs/c/common/8h-source.html#common_8h_source">common.h</a>. </p>
</div>
</div>
<div id="group__c__api__types_1gaa4ce7746ca46ee3e8021d61b30a4a278">
<h3>TfLiteOpaqueContext</h3>
<pre class="prettyprint">struct <a href="/lite/api_docs/c/group/c-api-types.html#group__c__api__types_1gaa4ce7746ca46ee3e8021d61b30a4a278">TfLiteOpaqueContext</a> TfLiteOpaqueContext</pre>
<div>
<p>TfLiteOpaqueContext is an opaque version of <a href="/lite/api_docs/c/struct/tf-lite-context.html#struct_tf_lite_context">TfLiteContext</a>;. </p>
</div>
</div>
<div id="group__c__api__types_1gac2bc3e65b2b4dfe997134c006faa442f">
<h3>TfLiteOpaqueDelegate</h3>
<pre class="prettyprint"><a href="/lite/api_docs/c/struct/tf-lite-delegate.html#struct_tf_lite_delegate">TfLiteDelegate</a> TfLiteOpaqueDelegate</pre>
<div>
<p>TfLiteOpaqueDelegate: conditionally opaque version of <a href="/lite/api_docs/c/struct/tf-lite-delegate.html#struct_tf_lite_delegate">TfLiteDelegate</a>; allows delegation of nodes to alternative backends. </p>
<p>For TF Lite in Play Services, this is an opaque type, but for regular TF Lite, this is just a typedef for <a href="/lite/api_docs/c/struct/tf-lite-delegate.html#struct_tf_lite_delegate">TfLiteDelegate</a>.</p>
<p>WARNING: This is an experimental type and subject to change. </p>
</div>
</div>
<div id="group__c__api__types_1gaeacdfb2509c8e128ad7814d76c841d2b">
<h3>TfLiteOpaqueDelegateStruct</h3>
<pre class="prettyprint">struct <a href="/lite/api_docs/c/group/c-api-types.html#group__c__api__types_1gaeacdfb2509c8e128ad7814d76c841d2b">TfLiteOpaqueDelegateStruct</a> TfLiteOpaqueDelegateStruct</pre>
<div>
<p>TfLiteOpaqueDelegateStruct: unconditionally opaque version of <a href="/lite/api_docs/c/struct/tf-lite-delegate.html#struct_tf_lite_delegate">TfLiteDelegate</a>; allows delegation of nodes to alternative backends. </p>
<p>This is an abstract type that is intended to have the same role as <a href="/lite/api_docs/c/struct/tf-lite-delegate.html#struct_tf_lite_delegate">TfLiteDelegate</a>, but without exposing the implementation details of how delegates are implemented.</p>
<p>WARNING: This is an experimental type and subject to change. </p>
</div>
</div>
<div id="group__c__api__types_1gab12a07755992ecd4881d888a170c4c4b">
<h3>TfLiteOpaqueNode</h3>
<pre class="prettyprint">struct <a href="/lite/api_docs/c/group/c-api-types.html#group__c__api__types_1gab12a07755992ecd4881d888a170c4c4b">TfLiteOpaqueNode</a> TfLiteOpaqueNode</pre>
<div>
<p>TfLiteOpaqueNode is an opaque version of <a href="/lite/api_docs/c/struct/tf-lite-node.html#struct_tf_lite_node">TfLiteNode</a>;. </p>
</div>
</div>
<div id="group__c__api__types_1gab8d233ce3c69ac5f291ecd5ae52b3a12">
<h3>TfLiteOpaqueTensor</h3>
<pre class="prettyprint">struct <a href="/lite/api_docs/c/group/c-api-types.html#group__c__api__types_1gab8d233ce3c69ac5f291ecd5ae52b3a12">TfLiteOpaqueTensor</a> TfLiteOpaqueTensor</pre>
<div>
<p>TfLiteOpaqueTensor is an opaque version of <a href="/lite/api_docs/c/struct/tf-lite-tensor.html#struct_tf_lite_tensor">TfLiteTensor</a>;. </p>
</div>
</div>
<div id="group__c__api__types_1gaa681a1e2a35b583f6902663b77414dbc">
<h3>TfLiteQuantizationParams</h3>
<pre class="prettyprint">struct <a href="/lite/api_docs/c/struct/tf-lite-quantization-params.html#struct_tf_lite_quantization_params">TfLiteQuantizationParams</a> TfLiteQuantizationParams</pre>
<div>
<p>Legacy. </p>
<p>Will be deprecated in favor of <code><a href="/lite/api_docs/c/struct/tf-lite-affine-quantization.html#struct_tf_lite_affine_quantization">TfLiteAffineQuantization</a></code>. If per-layer quantization is specified this field will still be populated in addition to <code><a href="/lite/api_docs/c/struct/tf-lite-affine-quantization.html#struct_tf_lite_affine_quantization">TfLiteAffineQuantization</a></code>. Parameters for asymmetric quantization. Quantized values can be converted back to float using: <code>real_value = scale * (quantized_value - zero_point)</code></p>
</div>
</div>
<div id="group__c__api__types_1gacc04b4e16e98f3b2e9f8082679e597e3">
<h3>TfLiteStatus</h3>
<pre class="prettyprint">enum <a href="/lite/api_docs/c/group/c-api-types.html#group__c__api__types_1gacf79d2fb5fa520303014d1303f1f6361">TfLiteStatus</a> TfLiteStatus</pre>
<div>
<p>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. </p>
</div>
</div>
</body>
</html>
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,156 @@
<!DOCTYPE html>
<html devsite>
<head>
<title>lite/acceleration/configuration/c/delegate_plugin.h</title>
<meta name="page_type" value="reference" />
</head>
<body>
<div id="top"><!-- do not remove this div --></div>
<h1>lite/acceleration/configuration/c/delegate_plugin.h</h1>
<p>C API types for TF Lite delegate plugins. </p>
<h2>Summary</h2>
<p>
<aside class="note"><strong>Note:</strong> Users of TensorFlow Lite should use <pre class="prettyprint">#include "tensorflow/lite/acceleration/configuration/c/delegate_plugin.h"</pre> to access the APIs documented on this page. </aside>
</p>
<table class="properties responsive">
<tr>
<th colspan="2">
<h3>Typedefs</h3>
</th>
</tr>
<tr>
<td>
<code><a href="#group__delegate__plugin_1ga148ca1be6a1af9540686b7b65a371a8d">TfLiteDelegatePlugin</a></code>
</td>
<td>typedef<div>
<code>struct <a href="/lite/api_docs/c/struct/tf-lite-delegate-plugin.html#struct_tf_lite_delegate_plugin">TfLiteDelegatePlugin</a></code>
</div><div>Struct to hold all the methods for a delegate plugin. </div></td>
</tr>
<tr>
<td>
<code><a href="#group__delegate__plugin_1ga3688949cd80282bac66e3e8e1c118ca1">TfLiteDelegatePluginCreateFunc</a>(const void *tflite_settings)</code>
</td>
<td>typedef<div>
<code><a href="/lite/api_docs/c/struct/tf-lite-delegate.html#struct_tf_lite_delegate">TfLiteDelegate</a> *</code>
</div><div>Type of delegate creation function used to allocate and construct a delegate. </div></td>
</tr>
<tr>
<td>
<code><a href="#group__delegate__plugin_1ga56c8ce15c6841dc756d4295f19c92c7f">TfLiteDelegatePluginDestroyFunc</a>(TfLiteDelegate *)</code>
</td>
<td>typedef<div>
<code>void</code>
</div><div>Type of function to destroy and deallocate a delegate. </div></td>
</tr>
<tr>
<td>
<code><a href="#group__delegate__plugin_1ga843989c081ce4f553578baea93858b1e">TfLiteDelegatePluginGetDelegateErrnoFunc</a>(TfLiteDelegate *)</code>
</td>
<td>typedef<div>
<code>int</code>
</div><div>Type of function to return an error code for the last delegate operation. </div></td>
</tr>
<tr>
<td>
<code><a href="#group__delegate__plugin_1ga8f0fafe3eb5588737436726ad7049bea">TfLiteOpaqueDelegatePlugin</a></code>
</td>
<td>typedef<div>
<code><a href="/lite/api_docs/c/struct/tf-lite-delegate-plugin.html#struct_tf_lite_delegate_plugin">TfLiteDelegatePlugin</a></code>
</div></td>
</tr>
<tr>
<td>
<code><a href="#group__delegate__plugin_1gacedb45c5eb5ccc01b06e75641c03b9c2">TfLiteOpaqueDelegatePluginCreateFunc</a></code>
</td>
<td>typedef<div>
<code><a href="/lite/api_docs/c/group/delegate-plugin.html#group__delegate__plugin_1ga3688949cd80282bac66e3e8e1c118ca1">TfLiteDelegatePluginCreateFunc</a></code>
</div></td>
</tr>
<tr>
<td>
<code><a href="#group__delegate__plugin_1gad3d837f94c2ecb53105d102961bc1f52">TfLiteOpaqueDelegatePluginDestroyFunc</a></code>
</td>
<td>typedef<div>
<code><a href="/lite/api_docs/c/group/delegate-plugin.html#group__delegate__plugin_1ga56c8ce15c6841dc756d4295f19c92c7f">TfLiteDelegatePluginDestroyFunc</a></code>
</div></td>
</tr>
<tr>
<td>
<code><a href="#group__delegate__plugin_1ga8005a0549e59f5dbc08cdd0d265a267b">TfLiteOpaqueDelegatePluginGetDelegateErrnoFunc</a></code>
</td>
<td>typedef<div>
<code><a href="/lite/api_docs/c/group/delegate-plugin.html#group__delegate__plugin_1ga843989c081ce4f553578baea93858b1e">TfLiteDelegatePluginGetDelegateErrnoFunc</a></code>
</div></td>
</tr>
</table>
<table class="constants responsive">
<tr>
<th colspan="2">
<h3>Structs</h3>
</th>
</tr>
<tr>
<td>
<a href="/lite/api_docs/c/struct/tf-lite-delegate-plugin">TfLiteDelegatePlugin</a>
</td>
<td>
<p>Struct to hold all the methods for a delegate plugin. </p>
</td>
</tr>
</table>
<h2>Typedefs</h2>
<div id="group__delegate__plugin_1ga148ca1be6a1af9540686b7b65a371a8d">
<h3>TfLiteDelegatePlugin</h3>
<pre class="prettyprint">struct <a href="/lite/api_docs/c/struct/tf-lite-delegate-plugin.html#struct_tf_lite_delegate_plugin">TfLiteDelegatePlugin</a> TfLiteDelegatePlugin</pre>
<div>
<p>Struct to hold all the methods for a delegate plugin. </p>
</div>
</div>
<div id="group__delegate__plugin_1ga3688949cd80282bac66e3e8e1c118ca1">
<h3>TfLiteDelegatePluginCreateFunc</h3>
<pre class="prettyprint"><a href="/lite/api_docs/c/struct/tf-lite-delegate.html#struct_tf_lite_delegate">TfLiteDelegate</a> * TfLiteDelegatePluginCreateFunc(const void *tflite_settings)</pre>
<div>
<p>Type of delegate creation function used to allocate and construct a delegate. </p>
<p>The <code>tflite_settings</code> parameter passed to the delegate creation function should be a pointer to a FlatBuffer table object of type <code>tflite::TFLiteSettings</code>. We use <code>const void *</code> here rather than <code>const tflite::TFLiteSettings*</code> since this is a C API so we don't want to directly reference C++ types such as <code>tflite::TFLiteSettings</code>. But note that this address should point to the 'parsed' FlatBuffer object, not the raw byte buffer. (Note that 'parsing' FlatBuffers is very cheap, it's just an offset load.)</p>
<p>If you are using the FlatBuffers C API, then you can alternatively pass in a value of type <code>tflite_TFLiteSettings_table_t</code>, which is a typedef for <code>const struct tflite_TFLiteSettings_table*</code> that is the corresponding type for the 'parsed' FlatBuffer object in the FlatBuffers C API.</p>
<p>Ownership of the <code>tflite_settings</code> flatbuffer remains with the caller. The caller of a delegate creation function may end the lifetime of the <code>tflite_settings</code> FlatBuffer immediately after the call to the function. So the delegate creation function should ensure that any settings that the delegate may need to reference later, after the delegate has been constructed, are copied from the FlatBuffer into storage owned by the delegate. </p>
</div>
</div>
<div id="group__delegate__plugin_1ga56c8ce15c6841dc756d4295f19c92c7f">
<h3>TfLiteDelegatePluginDestroyFunc</h3>
<pre class="prettyprint">void TfLiteDelegatePluginDestroyFunc(TfLiteDelegate *)</pre>
<div>
<p>Type of function to destroy and deallocate a delegate. </p>
<p>The delegate argument must have been created with the corresponding create function from the same delegate plugin. </p>
</div>
</div>
<div id="group__delegate__plugin_1ga843989c081ce4f553578baea93858b1e">
<h3>TfLiteDelegatePluginGetDelegateErrnoFunc</h3>
<pre class="prettyprint">int TfLiteDelegatePluginGetDelegateErrnoFunc(TfLiteDelegate *)</pre>
<div>
<p>Type of function to return an error code for the last delegate operation. </p>
<p>The delegate argument must have been created with the corresponding create function from the same delegate plugin. </p>
</div>
</div>
<div id="group__delegate__plugin_1ga8f0fafe3eb5588737436726ad7049bea">
<h3>TfLiteOpaqueDelegatePlugin</h3>
<pre class="prettyprint"><a href="/lite/api_docs/c/struct/tf-lite-delegate-plugin.html#struct_tf_lite_delegate_plugin">TfLiteDelegatePlugin</a> TfLiteOpaqueDelegatePlugin</pre>
<div />
</div>
<div id="group__delegate__plugin_1gacedb45c5eb5ccc01b06e75641c03b9c2">
<h3>TfLiteOpaqueDelegatePluginCreateFunc</h3>
<pre class="prettyprint"><a href="/lite/api_docs/c/group/delegate-plugin.html#group__delegate__plugin_1ga3688949cd80282bac66e3e8e1c118ca1">TfLiteDelegatePluginCreateFunc</a> TfLiteOpaqueDelegatePluginCreateFunc</pre>
<div />
</div>
<div id="group__delegate__plugin_1gad3d837f94c2ecb53105d102961bc1f52">
<h3>TfLiteOpaqueDelegatePluginDestroyFunc</h3>
<pre class="prettyprint"><a href="/lite/api_docs/c/group/delegate-plugin.html#group__delegate__plugin_1ga56c8ce15c6841dc756d4295f19c92c7f">TfLiteDelegatePluginDestroyFunc</a> TfLiteOpaqueDelegatePluginDestroyFunc</pre>
<div />
</div>
<div id="group__delegate__plugin_1ga8005a0549e59f5dbc08cdd0d265a267b">
<h3>TfLiteOpaqueDelegatePluginGetDelegateErrnoFunc</h3>
<pre class="prettyprint"><a href="/lite/api_docs/c/group/delegate-plugin.html#group__delegate__plugin_1ga843989c081ce4f553578baea93858b1e">TfLiteDelegatePluginGetDelegateErrnoFunc</a> TfLiteOpaqueDelegatePluginGetDelegateErrnoFunc</pre>
<div />
</div>
</body>
</html>
@@ -0,0 +1,42 @@
<!DOCTYPE html>
<html devsite>
<head>
<title>lite/acceleration/configuration/c/gpu_plugin.h</title>
<meta name="page_type" value="reference" />
</head>
<body>
<div id="top"><!-- do not remove this div --></div>
<h1>lite/acceleration/configuration/c/gpu_plugin.h</h1>
<p>This header file is for the delegate plugin for GPU. </p>
<h2>Summary</h2>
<p>For the C++ delegate plugin interface, the GPU delegate plugin is added to the <code>DelegatePluginRegistry</code> by the side effect of a constructor for a static object, so there's no public API needed for this plugin, other than the API of <code>tflite::delegates::DelegatePluginRegistry</code>s, which is declared in delegate_registry.h.</p>
<p>But to provide a C API to access the GPU delegate plugin, we do expose some functions, which are declared below.<aside class="note"><strong>Note:</strong> Users of TensorFlow Lite should use <pre class="prettyprint">#include "tensorflow/lite/acceleration/configuration/c/gpu_plugin.h"</pre> to access the APIs documented on this page. </aside></p>
<table class="methods responsive">
<tr>
<th colspan="2">
<h3>Functions</h3>
</th>
</tr>
<tr>
<td>
<code><a href="#group__gpu__plugin_1ga5b1e9a75e753da0244806c28a18d0df4">TfLiteGpuDelegatePluginCApi</a>()</code>
</td>
<td>
<div>
<code>const <a href="/lite/api_docs/c/struct/tf-lite-delegate-plugin.html#struct_tf_lite_delegate_plugin">TfLiteDelegatePlugin</a> *</code>
</div>
<div>C API for the GPU delegate plugin. </div>
</td>
</tr>
</table>
<h2>Functions</h2>
<div id="group__gpu__plugin_1ga5b1e9a75e753da0244806c28a18d0df4">
<h3>TfLiteGpuDelegatePluginCApi</h3>
<pre class="prettyprint">const <a href="/lite/api_docs/c/struct/tf-lite-delegate-plugin.html#struct_tf_lite_delegate_plugin">TfLiteDelegatePlugin</a> * TfLiteGpuDelegatePluginCApi()</pre>
<div>
<p>C API for the GPU delegate plugin. </p>
<p>Returns a pointer to a statically allocated table of function pointers. </p>
</div>
</div>
</body>
</html>
@@ -0,0 +1,326 @@
<!DOCTYPE html>
<html devsite>
<head>
<title>lite/abi/tflite.h</title>
<meta name="page_type" value="reference" />
</head>
<body>
<div id="top"><!-- do not remove this div --></div>
<h1>lite/abi/tflite.h</h1>
<p>Native functions for initializing and shutting down the TensorFlow Lite (TFLite) in Google Play Services Native API. </p>
<h2>Summary</h2>
<p>One of the following functions <b>must</b> be called (and must return successfully) before any of the TFLite C API functions are called:<ul>
<li>the <code><a href="/lite/api_docs/c/group/tflite.html#group__tflite_1ga40651c6fffc109794e7eb0bccc5c5d43">GmsTfLiteInitialize()</a></code> or <code><a href="/lite/api_docs/c/group/tflite.html#group__tflite_1ga80ddd6ab10621facef60ae21f1154ba8">GmsTfLiteInitializeOrThrow()</a></code> native functions defined in this header file.</li>
<li>the <code>com.google.android.gms.tflite.java.TfLiteNative.initialize(Context context)</code> or <code>com.google.android.gms.tflite.java.TfLiteNative.initialize(Context context, TfLiteInitializationOptions options)</code> methods defined in the Java API. </li>
</ul></p>
<table class="methods responsive">
<tr>
<th colspan="2">
<h3>Functions</h3>
</th>
</tr>
<tr>
<td>
<code><a href="#group__tflite_1ga5f35f35f093e2c29ede5a2b692659fa1">GmsTfLiteCheckInitializedOrThrow</a>(JNIEnv *env)</code>
</td>
<td>
<div>
<code>bool</code>
</div>
<div>Checks whether the TFLite API has been initialized, throwing a Java exception otherwise. </div>
</td>
</tr>
<tr>
<td>
<code><a href="#group__tflite_1ga61ba1accae8e30eaf9d9aa418890a0c1">GmsTfLiteErrorCodeVersionTooNew</a>(int error_code)</code>
</td>
<td>
<div>
<code>bool</code>
</div>
<div>Returns true if the error code indicates the TFLite ABI version is too new. </div>
</td>
</tr>
<tr>
<td>
<code><a href="#group__tflite_1gaea70a5ef6f7d157d779e6c96b248b05e">GmsTfLiteErrorCodeVersionTooOld</a>(int error_code)</code>
</td>
<td>
<div>
<code>bool</code>
</div>
<div>Returns true if the error code indicates that the TFLite ABI version is too old. </div>
</td>
</tr>
<tr>
<td>
<code><a href="#group__tflite_1ga40651c6fffc109794e7eb0bccc5c5d43">GmsTfLiteInitialize</a>(JNIEnv *env, jobjecthandle)</code>
</td>
<td>
<div>
<code>int</code>
</div>
<div>Initialize TFLite with a handle acquired from Google Play Services API. </div>
</td>
</tr>
<tr>
<td>
<code><a href="#group__tflite_1ga80ddd6ab10621facef60ae21f1154ba8">GmsTfLiteInitializeOrThrow</a>(JNIEnv *env, jobjecthandle)</code>
</td>
<td>
<div>
<code>bool</code>
</div>
<div>Initialize TFLite with a handle acquired from Google Play Services API, throwing a Java exception on failure. </div>
</td>
</tr>
<tr>
<td>
<code><a href="#group__tflite_1gaf0e9a103a2a1cff5292d839d93cba9ab">GmsTfLiteShutdown</a>(void)</code>
</td>
<td>
<div>
<code>void</code>
</div>
<div>Resets the TFLite API. </div>
</td>
</tr>
</table>
<h2>Functions</h2>
<div id="group__tflite_1ga5f35f35f093e2c29ede5a2b692659fa1">
<h3>GmsTfLiteCheckInitializedOrThrow</h3>
<pre class="prettyprint">bool GmsTfLiteCheckInitializedOrThrow(
JNIEnv *env
)</pre>
<div>
<p>Checks whether the TFLite API has been initialized, throwing a Java exception otherwise. </p>
<p />
<table class="details responsive">
<thead>
<th colspan="2">Details</th>
</thead>
<tbody>
<tr>
<td>Parameters</td>
<td>
<table class="function param responsive">
<tbody>
<tr>
<td>
<code>env</code>
</td>
<td>
<div>The JNIEnv for the current thread (which has to be attached to the JVM). </div>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>
<b>Returns</b>
</td>
<td>
<div>Whether or not the TFLite API has been initialized. If this method returns false, no other JNI method should be called until the pending exception has been handled (typically by returning to Java). </div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div id="group__tflite_1ga61ba1accae8e30eaf9d9aa418890a0c1">
<h3>GmsTfLiteErrorCodeVersionTooNew</h3>
<pre class="prettyprint">bool GmsTfLiteErrorCodeVersionTooNew(
int error_code
)</pre>
<div>
<p>Returns true if the error code indicates the TFLite ABI version is too new. </p>
<p>In this case, the client should be updated to a newer version.</p>
<p>To avoid this error, make sure that your app is built against the latest version of the TFLite in Google Play Services client library code.</p>
<p>If TFLite is important for the functionality of the app, then we recommend that the calling code notify the user in this case. Suggested actions for the user could include:<ul>
<li>Try updating the app to the latest version</li>
</ul></p>
<p>If the in-app update API (<a href="https://developer.android.com/guide/playcore/in-app-updates">https://developer.android.com/guide/playcore/in-app-updates</a>) is available, we also recommend using the in-app update API to allow the user to automatically update the app if a new version is available.</p>
<p />
<table class="details responsive">
<thead>
<th colspan="2">Details</th>
</thead>
<tbody>
<tr>
<td>Parameters</td>
<td>
<table class="function param responsive">
<tbody>
<tr>
<td>
<code>error_code</code>
</td>
<td>
<div>An error code returned by GmsTfLiteInitialize. </div>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div id="group__tflite_1gaea70a5ef6f7d157d779e6c96b248b05e">
<h3>GmsTfLiteErrorCodeVersionTooOld</h3>
<pre class="prettyprint">bool GmsTfLiteErrorCodeVersionTooOld(
int error_code
)</pre>
<div>
<p>Returns true if the error code indicates that the TFLite ABI version is too old. </p>
<p>In this case, the TFLite in Google Play Services module should be updated to a newer version.</p>
<p>If TFLite is important for the functionality of the app, then we recommend that the calling code notify the user in this case. Suggested actions for the user could include:<ul>
<li>Make sure your device is connected to the internet, and</li>
<li>Try updating Google Play services <a href="https://support.google.com/googleplay/answer/9037938">https://support.google.com/googleplay/answer/9037938</a>.</li>
</ul></p>
<p />
<table class="details responsive">
<thead>
<th colspan="2">Details</th>
</thead>
<tbody>
<tr>
<td>Parameters</td>
<td>
<table class="function param responsive">
<tbody>
<tr>
<td>
<code>error_code</code>
</td>
<td>
<div>An error code returned by GmsTfLiteInitialize. </div>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div id="group__tflite_1ga40651c6fffc109794e7eb0bccc5c5d43">
<h3>GmsTfLiteInitialize</h3>
<pre class="prettyprint">int GmsTfLiteInitialize(
JNIEnv *env,
jobjecthandle
)</pre>
<div>
<p>Initialize TFLite with a handle acquired from Google Play Services API. </p>
<p>
This method (along with <code><a href="/lite/api_docs/c/group/tflite.html#group__tflite_1ga80ddd6ab10621facef60ae21f1154ba8">GmsTfLiteInitializeOrThrow()</a></code>) can be called multiple times with the same handle; attempting to initialize with a different handle (without a call to <code><a href="/lite/api_docs/c/group/tflite.html#group__tflite_1gaf0e9a103a2a1cff5292d839d93cba9ab">GmsTfLiteShutdown()</a></code> in between) will fail. </p>
<table class="details responsive">
<thead>
<th colspan="2">Details</th>
</thead>
<tbody>
<tr>
<td>Parameters</td>
<td>
<table class="function param responsive">
<tbody>
<tr>
<td>
<code>env</code>
</td>
<td>
<div>The JNIEnv for the current thread (which has to be attached to the JVM). </div>
</td>
</tr>
<tr>
<td>
<code>handle</code>
</td>
<td>
<div>An InternalNativeInitializationHandle object acquired through the Google Play Services API.</div>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>
<b>Returns</b>
</td>
<td>
<div>0 on success, or a non-zero error code on failure. The error codes are implementation-specific, but error conditions that clients may need to deal with can be tested using the <code><a href="/lite/api_docs/c/group/tflite.html#group__tflite_1gaea70a5ef6f7d157d779e6c96b248b05e">GmsTfLiteErrorCodeVersionTooOld()</a></code> and <code><a href="/lite/api_docs/c/group/tflite.html#group__tflite_1ga61ba1accae8e30eaf9d9aa418890a0c1">GmsTfLiteErrorCodeVersionTooNew()</a></code> functions. Clients may also wish to log the specific error code for ease of debugging.</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div id="group__tflite_1ga80ddd6ab10621facef60ae21f1154ba8">
<h3>GmsTfLiteInitializeOrThrow</h3>
<pre class="prettyprint">bool GmsTfLiteInitializeOrThrow(
JNIEnv *env,
jobjecthandle
)</pre>
<div>
<p>Initialize TFLite with a handle acquired from Google Play Services API, throwing a Java exception on failure. </p>
<p>
This method (along with <code><a href="/lite/api_docs/c/group/tflite.html#group__tflite_1ga40651c6fffc109794e7eb0bccc5c5d43">GmsTfLiteInitialize()</a></code>) can be called multiple times with the same handle; attempting to initialize with a different handle (without a call to <code><a href="/lite/api_docs/c/group/tflite.html#group__tflite_1gaf0e9a103a2a1cff5292d839d93cba9ab">GmsTfLiteShutdown()</a></code> in between) will fail. </p>
<table class="details responsive">
<thead>
<th colspan="2">Details</th>
</thead>
<tbody>
<tr>
<td>Parameters</td>
<td>
<table class="function param responsive">
<tbody>
<tr>
<td>
<code>env</code>
</td>
<td>
<div>The JNIEnv for the current thread (which has to be attached to the JVM). </div>
</td>
</tr>
<tr>
<td>
<code>handle</code>
</td>
<td>
<div>An InternalNativeInitializationHandle object acquired through the Google Play Services API.</div>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>
<b>Returns</b>
</td>
<td>
<div>Whether or not initialization was successful. If this method returns false, no other JNI method should be called until the pending exception has been handled (typically by returning to Java).</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div id="group__tflite_1gaf0e9a103a2a1cff5292d839d93cba9ab">
<h3>GmsTfLiteShutdown</h3>
<pre class="prettyprint">void GmsTfLiteShutdown(
void
)</pre>
<div>
<p>Resets the TFLite API. </p>
<p>After this method is called, the TFLite API will be unusable until a subsequent call to <code><a href="/lite/api_docs/c/group/tflite.html#group__tflite_1ga40651c6fffc109794e7eb0bccc5c5d43">GmsTfLiteInitialize()</a></code> or <code><a href="/lite/api_docs/c/group/tflite.html#group__tflite_1ga80ddd6ab10621facef60ae21f1154ba8">GmsTfLiteInitializeOrThrow()</a></code>. This can be used to switch to a different version of the TFLite library. </p>
</div>
</div>
</body>
</html>
@@ -0,0 +1,42 @@
<!DOCTYPE html>
<html devsite>
<head>
<title>lite/acceleration/configuration/c/xnnpack_plugin.h</title>
<meta name="page_type" value="reference" />
</head>
<body>
<div id="top"><!-- do not remove this div --></div>
<h1>lite/acceleration/configuration/c/xnnpack_plugin.h</h1>
<p>This header file is for the delegate plugin for XNNPACK. </p>
<h2>Summary</h2>
<p>For the C++ delegate plugin interface, the XNNPACK delegate plugin is added to the DelegatePluginRegistry by the side effect of a constructor for a static object, so there's no public API needed for this plugin, other than the API of <code>tflite::delegates::DelegatePluginRegistry</code>, which is declared in delegate_registry.h.</p>
<p>But to provide a C API to access the XNNPACK delegate plugin, we do expose some functions, which are declared below.<aside class="note"><strong>Note:</strong> Users of TensorFlow Lite should use <pre class="prettyprint">#include "tensorflow/lite/acceleration/configuration/c/xnnpack_plugin.h"</pre> to access the APIs documented on this page. </aside></p>
<table class="methods responsive">
<tr>
<th colspan="2">
<h3>Functions</h3>
</th>
</tr>
<tr>
<td>
<code><a href="#group__xnnpack__plugin_1gabad7d7035f0ec03b7c07b767930113df">TfLiteXnnpackDelegatePluginCApi</a>()</code>
</td>
<td>
<div>
<code>const <a href="/lite/api_docs/c/struct/tf-lite-delegate-plugin.html#struct_tf_lite_delegate_plugin">TfLiteDelegatePlugin</a> *</code>
</div>
<div>C API for the XNNPACK delegate plugin. </div>
</td>
</tr>
</table>
<h2>Functions</h2>
<div id="group__xnnpack__plugin_1gabad7d7035f0ec03b7c07b767930113df">
<h3>TfLiteXnnpackDelegatePluginCApi</h3>
<pre class="prettyprint">const <a href="/lite/api_docs/c/struct/tf-lite-delegate-plugin.html#struct_tf_lite_delegate_plugin">TfLiteDelegatePlugin</a> * TfLiteXnnpackDelegatePluginCApi()</pre>
<div>
<p>C API for the XNNPACK delegate plugin. </p>
<p>Returns a pointer to a statically allocated table of function pointers. </p>
</div>
</div>
</body>
</html>
+224
View File
@@ -0,0 +1,224 @@
<!DOCTYPE html>
<html devsite>
<head>
<title>TensorFlow Lite C API Reference</title>
<meta name="page_type" value="reference" />
</head>
<body>
<div id="top"><!-- do not remove this div --></div>
<h1>TensorFlow Lite C API Reference</h1>
<table class="nested-classes responsive">
<tbody>
<tr>
<th colspan="2">
<h2>Modules</h2>
</th>
</tr>
<tr>
<td>
<a href="/lite/api_docs/c/group/tflite.html">lite/abi/tflite.h</a>
</td>
<td>Native functions for initializing and shutting down the TensorFlow Lite (TFLite) in Google Play Services Native API. </td>
</tr>
<tr>
<td>
<a href="/lite/api_docs/c/group/delegate-plugin.html">lite/acceleration/configuration/c/delegate_plugin.h</a>
</td>
<td>C API types for TF Lite delegate plugins. </td>
</tr>
<tr>
<td>
<a href="/lite/api_docs/c/group/gpu-plugin.html">lite/acceleration/configuration/c/gpu_plugin.h</a>
</td>
<td>This header file is for the delegate plugin for GPU. </td>
</tr>
<tr>
<td>
<a href="/lite/api_docs/c/group/xnnpack-plugin.html">lite/acceleration/configuration/c/xnnpack_plugin.h</a>
</td>
<td>This header file is for the delegate plugin for XNNPACK. </td>
</tr>
<tr>
<td>
<a href="/lite/api_docs/c/group/c-api.html">lite/c/c_api.h</a>
</td>
<td>C API for TensorFlow Lite. </td>
</tr>
<tr>
<td>
<a href="/lite/api_docs/c/group/c-api-opaque.html">lite/c/c_api_opaque.h</a>
</td>
<td>C API for TensorFlow Lite Opaque Types. </td>
</tr>
<tr>
<td>
<a href="/lite/api_docs/c/group/c-api-types.html">lite/c/c_api_types.h</a>
</td>
<td>This file declares types used by the pure C inference API defined in <a href="/lite/api_docs/c/c/api-8h-source.html#c__api_8h_source">c_api.h</a>, some of which are also used in the C++ and C kernel and interpreter APIs. </td>
</tr>
<tr>
<td>
<a href="/lite/api_docs/c/group/common.html">lite/c/common.h</a>
</td>
<td>This file defines common C types and APIs for implementing operations, delegates and other constructs in TensorFlow Lite. </td>
</tr>
</tbody>
</table>
<table class="constants responsive">
<tbody>
<tr>
<th colspan="2">
<h2>Structs</h2>
</th>
</tr>
<tr>
<td>
<a href="/lite/api_docs/c/struct/tf-lite-affine-quantization.html">TfLiteAffineQuantization</a>
</td>
<td>Parameters for asymmetric quantization across a dimension (i.e per output channel quantization). </td>
</tr>
<tr>
<td>
<a href="/lite/api_docs/c/struct/tf-lite-complex128.html">TfLiteComplex128</a>
</td>
<td>Double-precision complex data type compatible with the C99 definition. </td>
</tr>
<tr>
<td>
<a href="/lite/api_docs/c/struct/tf-lite-complex64.html">TfLiteComplex64</a>
</td>
<td>Single-precision complex data type compatible with the C99 definition. </td>
</tr>
<tr>
<td>
<a href="/lite/api_docs/c/struct/tf-lite-context.html">TfLiteContext</a>
</td>
<td><code><a href="/lite/api_docs/c/struct/tf-lite-context.html#struct_tf_lite_context">TfLiteContext</a></code> allows an op to access the tensors. </td>
</tr>
<tr>
<td>
<a href="/lite/api_docs/c/struct/tf-lite-custom-allocation.html">TfLiteCustomAllocation</a>
</td>
<td>Defines a custom memory allocation not owned by the runtime. </td>
</tr>
<tr>
<td>
<a href="/lite/api_docs/c/struct/tf-lite-delegate.html">TfLiteDelegate</a>
</td>
<td>WARNING: This is an experimental interface that is subject to change. </td>
</tr>
<tr>
<td>
<a href="/lite/api_docs/c/struct/tf-lite-delegate-params.html">TfLiteDelegateParams</a>
</td>
<td>WARNING: This is an experimental interface that is subject to change. </td>
</tr>
<tr>
<td>
<a href="/lite/api_docs/c/struct/tf-lite-delegate-plugin.html">TfLiteDelegatePlugin</a>
</td>
<td>Struct to hold all the methods for a delegate plugin. </td>
</tr>
<tr>
<td>
<a href="/lite/api_docs/c/struct/tf-lite-dimension-metadata.html">TfLiteDimensionMetadata</a>
</td>
<td>Metadata to encode each dimension in a sparse tensor. </td>
</tr>
<tr>
<td>
<a href="/lite/api_docs/c/struct/tf-lite-eval-tensor.html">TfLiteEvalTensor</a>
</td>
<td>Light-weight tensor struct for TF Micro runtime. </td>
</tr>
<tr>
<td>
<a href="/lite/api_docs/c/struct/tf-lite-external-context.html">TfLiteExternalContext</a>
</td>
<td>An external context is a collection of information unrelated to the TF Lite framework, but useful to a subset of the ops. </td>
</tr>
<tr>
<td>
<a href="/lite/api_docs/c/struct/tf-lite-float16.html">TfLiteFloat16</a>
</td>
<td>Half precision data type compatible with the C99 definition. </td>
</tr>
<tr>
<td>
<a href="/lite/api_docs/c/struct/tf-lite-float-array.html">TfLiteFloatArray</a>
</td>
<td>Fixed size list of floats. Used for per-channel quantization. </td>
</tr>
<tr>
<td>
<a href="/lite/api_docs/c/struct/tf-lite-int-array.html">TfLiteIntArray</a>
</td>
<td>Fixed size list of integers. </td>
</tr>
<tr>
<td>
<a href="/lite/api_docs/c/struct/tf-lite-node.html">TfLiteNode</a>
</td>
<td>A structure representing an instance of a node. </td>
</tr>
<tr>
<td>
<a href="/lite/api_docs/c/struct/tf-lite-opaque-delegate-builder.html">TfLiteOpaqueDelegateBuilder</a>
</td>
<td><code><a href="/lite/api_docs/c/struct/tf-lite-opaque-delegate-builder.html#struct_tf_lite_opaque_delegate_builder">TfLiteOpaqueDelegateBuilder</a></code> is used for constructing <code>TfLiteOpaqueDelegate</code>, see <code>TfLiteOpaqueDelegateCreate</code> below. </td>
</tr>
<tr>
<td>
<a href="/lite/api_docs/c/struct/tf-lite-opaque-delegate-params.html">TfLiteOpaqueDelegateParams</a>
</td>
<td>WARNING: This is an experimental interface that is subject to change. </td>
</tr>
<tr>
<td>
<a href="/lite/api_docs/c/struct/tf-lite-quantization.html">TfLiteQuantization</a>
</td>
<td>Structure specifying the quantization used by the tensor, if-any. </td>
</tr>
<tr>
<td>
<a href="/lite/api_docs/c/struct/tf-lite-quantization-params.html">TfLiteQuantizationParams</a>
</td>
<td>Legacy. </td>
</tr>
<tr>
<td>
<a href="/lite/api_docs/c/struct/tf-lite-registration.html">TfLiteRegistration</a>
</td>
<td><code><a href="/lite/api_docs/c/struct/tf-lite-registration.html#struct_tf_lite_registration">TfLiteRegistration</a></code> defines the implementation of an operation (a built-in op, custom op, or custom delegate kernel). </td>
</tr>
<tr>
<td>
<a href="/lite/api_docs/c/struct/tf-lite-sparsity.html">TfLiteSparsity</a>
</td>
<td>Parameters used to encode a sparse tensor. </td>
</tr>
<tr>
<td>
<a href="/lite/api_docs/c/struct/tf-lite-tensor.html">TfLiteTensor</a>
</td>
<td>A tensor in the interpreter system which is a wrapper around a buffer of data including a dimensionality (or NULL if not currently defined). </td>
</tr>
</tbody>
</table>
<table class="constants responsive">
<tbody>
<tr>
<th colspan="2">
<h2>Unions</h2>
</th>
</tr>
<tr>
<td>
<a href="/lite/api_docs/c/union/tf-lite-ptr-union.html">TfLitePtrUnion</a>
</td>
<td>A union of pointers that points to memory for a given tensor. </td>
</tr>
</tbody>
</table>
</body>
</html>
@@ -0,0 +1,68 @@
<!DOCTYPE html>
<html devsite>
<head>
<title>TfLiteAffineQuantization Struct Reference</title>
<meta name="page_type" value="reference" />
</head>
<body>
<div id="top"><!-- do not remove this div --></div>
<h1>TfLiteAffineQuantization</h1>
<code>#include &lt;common.h&gt;</code>
<p>Parameters for asymmetric quantization across a dimension (i.e per output channel quantization). </p>
<h2>Summary</h2>
<p>quantized_dimension specifies which dimension the scales and zero_points correspond to. For a particular value in quantized_dimension, quantized values can be converted back to float using: <code>real_value = scale * (quantized_value - zero_point)</code></p>
<table class="properties responsive">
<tr>
<th colspan="2">
<h3>Public attributes</h3>
</th>
</tr>
<tr>
<td>
<code><a href="#struct_tf_lite_affine_quantization_1ab59ebe2c790ca6067e9792f2c7eb3a19">quantized_dimension</a></code>
</td>
<td>
<div>
<code>int32_t</code>
</div>
</td>
</tr>
<tr>
<td>
<code><a href="#struct_tf_lite_affine_quantization_1affb59a5c94701600af48d007595e9890">scale</a></code>
</td>
<td>
<div>
<code><a href="/lite/api_docs/c/struct/tf-lite-float-array.html#struct_tf_lite_float_array">TfLiteFloatArray</a> *</code>
</div>
</td>
</tr>
<tr>
<td>
<code><a href="#struct_tf_lite_affine_quantization_1a7cc2b014f80312b2bb3f766ede8c12b0">zero_point</a></code>
</td>
<td>
<div>
<code><a href="/lite/api_docs/c/struct/tf-lite-int-array.html#struct_tf_lite_int_array">TfLiteIntArray</a> *</code>
</div>
</td>
</tr>
</table>
<h2>Public attributes</h2>
<div id="struct_tf_lite_affine_quantization_1ab59ebe2c790ca6067e9792f2c7eb3a19">
<h3>quantized_dimension</h3>
<pre class="prettyprint">int32_t TfLiteAffineQuantization::quantized_dimension</pre>
<div />
</div>
<div id="struct_tf_lite_affine_quantization_1affb59a5c94701600af48d007595e9890">
<h3>scale</h3>
<pre class="prettyprint"><a href="/lite/api_docs/c/struct/tf-lite-float-array.html#struct_tf_lite_float_array">TfLiteFloatArray</a> * TfLiteAffineQuantization::scale</pre>
<div />
</div>
<div id="struct_tf_lite_affine_quantization_1a7cc2b014f80312b2bb3f766ede8c12b0">
<h3>zero_point</h3>
<pre class="prettyprint"><a href="/lite/api_docs/c/struct/tf-lite-int-array.html#struct_tf_lite_int_array">TfLiteIntArray</a> * TfLiteAffineQuantization::zero_point</pre>
<div />
</div>
</body>
</html>
@@ -0,0 +1,52 @@
<!DOCTYPE html>
<html devsite>
<head>
<title>TfLiteComplex128 Struct Reference</title>
<meta name="page_type" value="reference" />
</head>
<body>
<div id="top"><!-- do not remove this div --></div>
<h1>TfLiteComplex128</h1>
<code>#include &lt;common.h&gt;</code>
<p>Double-precision complex data type compatible with the C99 definition. </p>
<h2>Summary</h2>
<table class="properties responsive">
<tr>
<th colspan="2">
<h3>Public attributes</h3>
</th>
</tr>
<tr>
<td>
<code><a href="#struct_tf_lite_complex128_1a5a75087283d24b08ca4f216b6ce74f82">im</a></code>
</td>
<td>
<div>
<code>double</code>
</div>
</td>
</tr>
<tr>
<td>
<code><a href="#struct_tf_lite_complex128_1a24d10b5606005a00f2e608ba6f3ac960">re</a></code>
</td>
<td>
<div>
<code>double</code>
</div>
</td>
</tr>
</table>
<h2>Public attributes</h2>
<div id="struct_tf_lite_complex128_1a5a75087283d24b08ca4f216b6ce74f82">
<h3>im</h3>
<pre class="prettyprint">double TfLiteComplex128::im</pre>
<div />
</div>
<div id="struct_tf_lite_complex128_1a24d10b5606005a00f2e608ba6f3ac960">
<h3>re</h3>
<pre class="prettyprint">double TfLiteComplex128::re</pre>
<div />
</div>
</body>
</html>
@@ -0,0 +1,52 @@
<!DOCTYPE html>
<html devsite>
<head>
<title>TfLiteComplex64 Struct Reference</title>
<meta name="page_type" value="reference" />
</head>
<body>
<div id="top"><!-- do not remove this div --></div>
<h1>TfLiteComplex64</h1>
<code>#include &lt;common.h&gt;</code>
<p>Single-precision complex data type compatible with the C99 definition. </p>
<h2>Summary</h2>
<table class="properties responsive">
<tr>
<th colspan="2">
<h3>Public attributes</h3>
</th>
</tr>
<tr>
<td>
<code><a href="#struct_tf_lite_complex64_1a12377a9578af3d32bf464fcb7f1d230d">im</a></code>
</td>
<td>
<div>
<code>float</code>
</div>
</td>
</tr>
<tr>
<td>
<code><a href="#struct_tf_lite_complex64_1aba2e3dda641619f2e9e42c842c16d1a1">re</a></code>
</td>
<td>
<div>
<code>float</code>
</div>
</td>
</tr>
</table>
<h2>Public attributes</h2>
<div id="struct_tf_lite_complex64_1a12377a9578af3d32bf464fcb7f1d230d">
<h3>im</h3>
<pre class="prettyprint">float TfLiteComplex64::im</pre>
<div />
</div>
<div id="struct_tf_lite_complex64_1aba2e3dda641619f2e9e42c842c16d1a1">
<h3>re</h3>
<pre class="prettyprint">float TfLiteComplex64::re</pre>
<div />
</div>
</body>
</html>
@@ -0,0 +1,552 @@
<!DOCTYPE html>
<html devsite>
<head>
<title>TfLiteContext Struct Reference</title>
<meta name="page_type" value="reference" />
</head>
<body>
<div id="top"><!-- do not remove this div --></div>
<h1>TfLiteContext</h1>
<code>#include &lt;common.h&gt;</code>
<p><code><a href="/lite/api_docs/c/struct/tf-lite-context.html#struct_tf_lite_context">TfLiteContext</a></code> allows an op to access the tensors. </p>
<h2>Summary</h2>
<p><code><a href="/lite/api_docs/c/struct/tf-lite-context.html#struct_tf_lite_context">TfLiteContext</a></code> is a struct that is created by the TF Lite runtime and passed to the "methods" (C function pointers) in the <code><a href="/lite/api_docs/c/struct/tf-lite-registration.html#struct_tf_lite_registration">TfLiteRegistration</a></code> struct that are used to define custom ops and custom delegate kernels. It contains information and methods (C function pointers) that can be called by the code implementing a custom op or a custom delegate kernel. These methods provide access to the context in which that custom op or custom delegate kernel occurs, such as access to the input and output tensors for that op, as well as methods for allocating memory buffers and intermediate tensors, etc.</p>
<p>See also <code>TfLiteOpaqueContext</code>, which is an more ABI-stable equivalent. </p>
<table class="properties responsive">
<tr>
<th colspan="2">
<h3>Public attributes</h3>
</th>
</tr>
<tr>
<td>
<code><a href="#struct_tf_lite_context_1a3c7b83d2e2e0d10fac40e74fcc5501c9">AcquireSubgraphContext</a>)(struct TfLiteContext *context, int subgraph_index, struct TfLiteContext **acquired_context)</code>
</td>
<td>
<div>
<code><a href="/lite/api_docs/c/group/c-api-types.html#group__c__api__types_1gacf79d2fb5fa520303014d1303f1f6361">TfLiteStatus</a>(*</code>
</div>
<div>Retrieves the corresponding <a href="/lite/api_docs/c/struct/tf-lite-context.html#struct_tf_lite_context">TfLiteContext</a> of a subgraph that the given subgraph_index points to and switches to the delegate context for that subgraph. </div>
</td>
</tr>
<tr>
<td>
<code><a href="#struct_tf_lite_context_1af42843f0aa27c86616f13b89d918c7fa">AddTensors</a>)(struct TfLiteContext *, int tensors_to_add, int *first_new_tensor_index)</code>
</td>
<td>
<div>
<code><a href="/lite/api_docs/c/group/c-api-types.html#group__c__api__types_1gacf79d2fb5fa520303014d1303f1f6361">TfLiteStatus</a>(*</code>
</div>
<div>Add <code>tensors_to_add</code> tensors, preserving pre-existing Tensor entries. </div>
</td>
</tr>
<tr>
<td>
<code><a href="#struct_tf_lite_context_1ae58057987f38a9d4ad2c59612fa69e81">AllocateBufferForEval</a>)(struct TfLiteContext *ctx, size_t bytes, void **ptr)</code>
</td>
<td>
<div>
<code><a href="/lite/api_docs/c/group/c-api-types.html#group__c__api__types_1gacf79d2fb5fa520303014d1303f1f6361">TfLiteStatus</a>(*</code>
</div>
<div>Allocate a buffer which will be deallocated right after invoke phase. </div>
</td>
</tr>
<tr>
<td>
<code><a href="#struct_tf_lite_context_1a6be0a7dc5e0b26df0818f47b775369c3">AllocatePersistentBuffer</a>)(struct TfLiteContext *ctx, size_t bytes)</code>
</td>
<td>
<div>
<code>void *(*</code>
</div>
<div>Allocate persistent buffer which has the same life time as the interpreter. </div>
</td>
</tr>
<tr>
<td>
<code><a href="#struct_tf_lite_context_1a7967c64f2435042d5f6d80baf045a097">GetEvalTensor</a>)(const struct TfLiteContext *context, int tensor_idx)</code>
</td>
<td>
<div>
<code><a href="/lite/api_docs/c/struct/tf-lite-eval-tensor.html#struct_tf_lite_eval_tensor">TfLiteEvalTensor</a> *(*</code>
</div>
<div>Returns a <a href="/lite/api_docs/c/struct/tf-lite-eval-tensor.html#struct_tf_lite_eval_tensor">TfLiteEvalTensor</a> struct for a given index. </div>
</td>
</tr>
<tr>
<td>
<code><a href="#struct_tf_lite_context_1aa5cdeaf32eb9b734e84dcb73445c21c2">GetExecutionPlan</a>)(struct TfLiteContext *context, TfLiteIntArray **execution_plan)</code>
</td>
<td>
<div>
<code><a href="/lite/api_docs/c/group/c-api-types.html#group__c__api__types_1gacf79d2fb5fa520303014d1303f1f6361">TfLiteStatus</a>(*</code>
</div>
<div>The execution plan contains a list of the node indices in execution order. </div>
</td>
</tr>
<tr>
<td>
<code><a href="#struct_tf_lite_context_1a88569659197f9afb84c4b1d64763dbe1">GetExternalContext</a>)(struct TfLiteContext *, TfLiteExternalContextType)</code>
</td>
<td>
<div>
<code><a href="/lite/api_docs/c/struct/tf-lite-external-context.html#struct_tf_lite_external_context">TfLiteExternalContext</a> *(*</code>
</div>
<div>Access external contexts by type. </div>
</td>
</tr>
<tr>
<td>
<code><a href="#struct_tf_lite_context_1af98e01da8d4d602737f2de09cf82f1ca">GetModelMetadata</a>)(const struct TfLiteContext *context, const char *name, const char **ptr, size_t *bytes)</code>
</td>
<td>
<div>
<code><a href="/lite/api_docs/c/group/c-api-types.html#group__c__api__types_1gacf79d2fb5fa520303014d1303f1f6361">TfLiteStatus</a>(*</code>
</div>
<div>Retrieves named metadata buffer from the TFLite model. </div>
</td>
</tr>
<tr>
<td>
<code><a href="#struct_tf_lite_context_1ad9e4688ba7cc45a5686b2e6fdf78a96b">GetNodeAndRegistration</a>)(struct TfLiteContext *, int node_index, TfLiteNode **node, struct TfLiteRegistration **registration)</code>
</td>
<td>
<div>
<code><a href="/lite/api_docs/c/group/c-api-types.html#group__c__api__types_1gacf79d2fb5fa520303014d1303f1f6361">TfLiteStatus</a>(*</code>
</div>
<div>Get a Tensor node by node_index. </div>
</td>
</tr>
<tr>
<td>
<code><a href="#struct_tf_lite_context_1a7a475accf4aa157a9ed65f1e6d700eb1">GetScratchBuffer</a>)(struct TfLiteContext *ctx, int buffer_idx)</code>
</td>
<td>
<div>
<code>void *(*</code>
</div>
<div>Get the scratch buffer pointer. </div>
</td>
</tr>
<tr>
<td>
<code><a href="#struct_tf_lite_context_1a205d79ec6870754eebac003f883ee923">GetTensor</a>)(const struct TfLiteContext *context, int tensor_idx)</code>
</td>
<td>
<div>
<code><a href="/lite/api_docs/c/struct/tf-lite-tensor.html#struct_tf_lite_tensor">TfLiteTensor</a> *(*</code>
</div>
<div>Returns a <a href="/lite/api_docs/c/struct/tf-lite-tensor.html#struct_tf_lite_tensor">TfLiteTensor</a> struct for a given index. </div>
</td>
</tr>
<tr>
<td>
<code><a href="#struct_tf_lite_context_1afaaf502811bbcf1441c3879e9c47b8ec">PreviewDelegatePartitioning</a>)(struct TfLiteContext *context, const TfLiteIntArray *nodes_to_replace, TfLiteDelegateParams **partition_params_array, int *num_partitions)</code>
</td>
<td>
<div>
<code><a href="/lite/api_docs/c/group/c-api-types.html#group__c__api__types_1gacf79d2fb5fa520303014d1303f1f6361">TfLiteStatus</a>(*</code>
</div>
<div>This method provides a preview of post-delegation partitioning. </div>
</td>
</tr>
<tr>
<td>
<code><a href="#struct_tf_lite_context_1a3efba668c1f270366bd4203ca1c4fde9">ReleaseSubgraphContext</a>)(struct TfLiteContext *context, int subgraph_index)</code>
</td>
<td>
<div>
<code><a href="/lite/api_docs/c/group/c-api-types.html#group__c__api__types_1gacf79d2fb5fa520303014d1303f1f6361">TfLiteStatus</a>(*</code>
</div>
<div>Releases the subgraph context by switching back to the TFLite kernel context for the subgraph that the given subgraph_index points to. </div>
</td>
</tr>
<tr>
<td>
<code><a href="#struct_tf_lite_context_1a3ca1af96f5dcbcfe5ae72665dd9c27df">ReplaceNodeSubsetsWithDelegateKernels</a>)(struct TfLiteContext *, struct TfLiteRegistration registration, const TfLiteIntArray *nodes_to_replace, struct TfLiteDelegate *delegate)</code>
</td>
<td>
<div>
<code><a href="/lite/api_docs/c/group/c-api-types.html#group__c__api__types_1gacf79d2fb5fa520303014d1303f1f6361">TfLiteStatus</a>(*</code>
</div>
<div>Replace ops with one or more stub delegate operations. </div>
</td>
</tr>
<tr>
<td>
<code><a href="#struct_tf_lite_context_1aefe130a452e108010d3f8fd428b0bf23">ReportError</a>)(struct TfLiteContext *, const char *msg,...)</code>
</td>
<td>
<div>
<code>void(*</code>
</div>
<div>Request that an error be reported with format string msg. </div>
</td>
</tr>
<tr>
<td>
<code><a href="#struct_tf_lite_context_1a7a3778903dc181d98fe1f10a4f6e15c9">RequestScratchBufferInArena</a>)(struct TfLiteContext *ctx, size_t bytes, int *buffer_idx)</code>
</td>
<td>
<div>
<code><a href="/lite/api_docs/c/group/c-api-types.html#group__c__api__types_1gacf79d2fb5fa520303014d1303f1f6361">TfLiteStatus</a>(*</code>
</div>
<div>Request a scratch buffer in the arena through static memory planning. </div>
</td>
</tr>
<tr>
<td>
<code><a href="#struct_tf_lite_context_1af37c2aaccdca191c9ac3bf2b9b00b59a">ResizeTensor</a>)(struct TfLiteContext *, TfLiteTensor *tensor, TfLiteIntArray *new_size)</code>
</td>
<td>
<div>
<code><a href="/lite/api_docs/c/group/c-api-types.html#group__c__api__types_1gacf79d2fb5fa520303014d1303f1f6361">TfLiteStatus</a>(*</code>
</div>
<div>Request memory pointer be resized. </div>
</td>
</tr>
<tr>
<td>
<code><a href="#struct_tf_lite_context_1adcbd972b5271979f35c18e83e28511b7">ResizeTensorExplicit</a>)(struct TfLiteContext *ctx, TfLiteTensor *tensor, int dims, const int *shape)</code>
</td>
<td>
<div>
<code><a href="/lite/api_docs/c/group/c-api-types.html#group__c__api__types_1gacf79d2fb5fa520303014d1303f1f6361">TfLiteStatus</a>(*</code>
</div>
<div>Resize the memory pointer of the <code>tensor</code>. </div>
</td>
</tr>
<tr>
<td>
<code><a href="#struct_tf_lite_context_1a46dd8ae6f6b945bee9caefa39528d954">SetExternalContext</a>)(struct TfLiteContext *, TfLiteExternalContextType, TfLiteExternalContext *)</code>
</td>
<td>
<div>
<code>void(*</code>
</div>
<div>Set the value of a external context. </div>
</td>
</tr>
<tr>
<td>
<code><a href="#struct_tf_lite_context_1a2c14aa723ed7d38a33fb8c0f611b1ad2">allow_fp32_relax_to_fp16</a></code>
</td>
<td>
<div>
<code>bool</code>
</div>
<div>Flag for allowing float16 precision for FP32 calculation. </div>
</td>
</tr>
<tr>
<td>
<code><a href="#struct_tf_lite_context_1ad66dfab7fa23723499f600668adb7684">impl_</a></code>
</td>
<td>
<div>
<code>void *</code>
</div>
<div>opaque full context ptr (an opaque c++ data structure) </div>
</td>
</tr>
<tr>
<td>
<code><a href="#struct_tf_lite_context_1a63073f6c160cf0c0ff56537a6c57888e">profiler</a></code>
</td>
<td>
<div>
<code>void *</code>
</div>
<div>Pointer to the op-level profiler, if set; nullptr otherwise. </div>
</td>
</tr>
<tr>
<td>
<code><a href="#struct_tf_lite_context_1a76dc6ac92f9ff38e377f48b1d0b165ad">recommended_num_threads</a></code>
</td>
<td>
<div>
<code>int</code>
</div>
<div>Number of threads that are recommended to subsystems like gemmlowp and eigen. </div>
</td>
</tr>
<tr>
<td>
<code><a href="#struct_tf_lite_context_1a4c2b2195a11468ab3009a961fdf1bbe5">tensors</a></code>
</td>
<td>
<div>
<code><a href="/lite/api_docs/c/struct/tf-lite-tensor.html#struct_tf_lite_tensor">TfLiteTensor</a> *</code>
</div>
<div>An array of tensors in the interpreter context (of length <code>tensors_size</code>) </div>
</td>
</tr>
<tr>
<td>
<code><a href="#struct_tf_lite_context_1a70d1aa6ac0773caf8bb9f20b07cfd595">tensors_size</a></code>
</td>
<td>
<div>
<code>size_t</code>
</div>
<div>Number of tensors in the context. </div>
</td>
</tr>
</table>
<h2>Public attributes</h2>
<div id="struct_tf_lite_context_1a3c7b83d2e2e0d10fac40e74fcc5501c9">
<h3>AcquireSubgraphContext</h3>
<pre class="prettyprint"><a href="/lite/api_docs/c/group/c-api-types.html#group__c__api__types_1gacf79d2fb5fa520303014d1303f1f6361">TfLiteStatus</a>(* TfLiteContext::AcquireSubgraphContext)(struct TfLiteContext *context, int subgraph_index, struct TfLiteContext **acquired_context)</pre>
<div>
<p>Retrieves the corresponding <a href="/lite/api_docs/c/struct/tf-lite-context.html#struct_tf_lite_context">TfLiteContext</a> of a subgraph that the given subgraph_index points to and switches to the delegate context for that subgraph. </p>
<p>If an invalid subgraph index is given, returns kTfLiteError.</p>
<p>NOTE: This function is expected to be paired with <a href="/lite/api_docs/c/struct/tf-lite-context.html#struct_tf_lite_context_1a3efba668c1f270366bd4203ca1c4fde9">ReleaseSubgraphContext()</a> once the delegate preparation is done and/or the delegate context functions are no longer needed.</p>
<p>WARNING: This is an experimental interface that is subject to change. </p>
</div>
</div>
<div id="struct_tf_lite_context_1af42843f0aa27c86616f13b89d918c7fa">
<h3>AddTensors</h3>
<pre class="prettyprint"><a href="/lite/api_docs/c/group/c-api-types.html#group__c__api__types_1gacf79d2fb5fa520303014d1303f1f6361">TfLiteStatus</a>(* TfLiteContext::AddTensors)(struct TfLiteContext *, int tensors_to_add, int *first_new_tensor_index)</pre>
<div>
<p>Add <code>tensors_to_add</code> tensors, preserving pre-existing Tensor entries. </p>
<p>If non-null, the value pointed to by <code>first_new_tensor_index</code> will be set to the index of the first new tensor. </p>
</div>
</div>
<div id="struct_tf_lite_context_1ae58057987f38a9d4ad2c59612fa69e81">
<h3>AllocateBufferForEval</h3>
<pre class="prettyprint"><a href="/lite/api_docs/c/group/c-api-types.html#group__c__api__types_1gacf79d2fb5fa520303014d1303f1f6361">TfLiteStatus</a>(* TfLiteContext::AllocateBufferForEval)(struct TfLiteContext *ctx, size_t bytes, void **ptr)</pre>
<div>
<p>Allocate a buffer which will be deallocated right after invoke phase. </p>
<p>The memory is allocated from heap in TFL, and from volatile arena in TFLM. This method is only available in invoke stage.</p>
<p>NOTE: If possible use <code>RequestScratchBufferInArena</code> method to avoid memory allocation during inference time.</p>
<p>WARNING: This is an experimental interface that is subject to change. </p>
</div>
</div>
<div id="struct_tf_lite_context_1a6be0a7dc5e0b26df0818f47b775369c3">
<h3>AllocatePersistentBuffer</h3>
<pre class="prettyprint">void *(* TfLiteContext::AllocatePersistentBuffer)(struct TfLiteContext *ctx, size_t bytes)</pre>
<div>
<p>Allocate persistent buffer which has the same life time as the interpreter. </p>
<p>Returns <code>nullptr</code> on failure. The memory is allocated from heap for TFL, and from tail in TFLM. This method is only available in <code>Init</code> or <code>Prepare</code> stage.</p>
<p>WARNING: This is an experimental interface that is subject to change. </p>
</div>
</div>
<div id="struct_tf_lite_context_1a7967c64f2435042d5f6d80baf045a097">
<h3>GetEvalTensor</h3>
<pre class="prettyprint"><a href="/lite/api_docs/c/struct/tf-lite-eval-tensor.html#struct_tf_lite_eval_tensor">TfLiteEvalTensor</a> *(* TfLiteContext::GetEvalTensor)(const struct TfLiteContext *context, int tensor_idx)</pre>
<div>
<p>Returns a <a href="/lite/api_docs/c/struct/tf-lite-eval-tensor.html#struct_tf_lite_eval_tensor">TfLiteEvalTensor</a> struct for a given index. </p>
<p>WARNING: This is an experimental interface that is subject to change.</p>
<p>WARNING: This method may not be available on all platforms. </p>
</div>
</div>
<div id="struct_tf_lite_context_1aa5cdeaf32eb9b734e84dcb73445c21c2">
<h3>GetExecutionPlan</h3>
<pre class="prettyprint"><a href="/lite/api_docs/c/group/c-api-types.html#group__c__api__types_1gacf79d2fb5fa520303014d1303f1f6361">TfLiteStatus</a>(* TfLiteContext::GetExecutionPlan)(struct TfLiteContext *context, TfLiteIntArray **execution_plan)</pre>
<div>
<p>The execution plan contains a list of the node indices in execution order. </p>
<p>execution_plan->size is the current number of nodes. And, execution_plan->data[0] is the first node that needs to be run. TfLiteDelegates can traverse the current execution plan by iterating through each member of this array and using <a href="/lite/api_docs/c/struct/tf-lite-context.html#struct_tf_lite_context_1ad9e4688ba7cc45a5686b2e6fdf78a96b">GetNodeAndRegistration()</a> to access details about a node. i.e.</p>
<p>
<pre class="prettyprint">TfLiteIntArray* execution_plan;
TF_LITE_ENSURE_STATUS(context->GetExecutionPlan(context,
&execution_plan));
for (int exec_index = 0; exec_index < execution_plan->size;
exec_index++) {
int node_index = execution_plan->data[exec_index];
TfLiteNode* node;
TfLiteRegistration* reg;
context->GetNodeAndRegistration(context, node_index, &node, &reg);
}
</pre>
</p>
<p>Note: the memory pointed by '<code>*execution_plan</code> is OWNED by TfLite runtime. Future calls to GetExecutionPlan invalidates earlier outputs. The following code snippet shows the issue of such an invocation pattern. After calling CheckNode, subsequent access to <code>plan_1st</code> is undefined. <pre class="prettyprint">void CheckNode(const TfLiteNode* node) {
...
TfLiteIntArray* plan_2nd;
TF_LITE_ENSURE_STATUS(
context->GetExecutionPlan(context, &plan_2nd)
);
...
}
TfLiteIntArray* plan_1st;
TF_LITE_ENSURE_STATUS(context->GetExecutionPlan(context, &plan_1st));
for (int exec_index = 0; exec_index < plan_1st->size; exec_index++) {
int node_index = plan_1st->data[exec_index];
TfLiteNode* node;
TfLiteRegistration* reg;
context->GetNodeAndRegistration(context, node_index, &node, &reg);
CheckNode(node);
}
</pre></p>
<p>WARNING: This is an experimental interface that is subject to change. </p>
</div>
</div>
<div id="struct_tf_lite_context_1a88569659197f9afb84c4b1d64763dbe1">
<h3>GetExternalContext</h3>
<pre class="prettyprint"><a href="/lite/api_docs/c/struct/tf-lite-external-context.html#struct_tf_lite_external_context">TfLiteExternalContext</a> *(* TfLiteContext::GetExternalContext)(struct TfLiteContext *, TfLiteExternalContextType)</pre>
<div>
<p>Access external contexts by type. </p>
<p>WARNING: This is an experimental interface that is subject to change. </p>
</div>
</div>
<div id="struct_tf_lite_context_1af98e01da8d4d602737f2de09cf82f1ca">
<h3>GetModelMetadata</h3>
<pre class="prettyprint"><a href="/lite/api_docs/c/group/c-api-types.html#group__c__api__types_1gacf79d2fb5fa520303014d1303f1f6361">TfLiteStatus</a>(* TfLiteContext::GetModelMetadata)(const struct TfLiteContext *context, const char *name, const char **ptr, size_t *bytes)</pre>
<div>
<p>Retrieves named metadata buffer from the TFLite model. </p>
<p>Returns kTfLiteOk if metadata is successfully obtained from the flatbuffer Model: that is, there exists a <code>metadata</code> entry with given <code>name</code> string. (see TFLite's schema.fbs). The corresponding <code>buffer</code> information is populated in <code>ptr</code> & <code>bytes</code>. The data from <code>ptr</code> is valid for the lifetime of the Interpreter.</p>
<p>WARNING: This is an experimental interface that is subject to change. </p>
</div>
</div>
<div id="struct_tf_lite_context_1ad9e4688ba7cc45a5686b2e6fdf78a96b">
<h3>GetNodeAndRegistration</h3>
<pre class="prettyprint"><a href="/lite/api_docs/c/group/c-api-types.html#group__c__api__types_1gacf79d2fb5fa520303014d1303f1f6361">TfLiteStatus</a>(* TfLiteContext::GetNodeAndRegistration)(struct TfLiteContext *, int node_index, TfLiteNode **node, struct TfLiteRegistration **registration)</pre>
<div>
<p>Get a Tensor node by node_index. </p>
<p>WARNING: This is an experimental interface that is subject to change. </p>
</div>
</div>
<div id="struct_tf_lite_context_1a7a475accf4aa157a9ed65f1e6d700eb1">
<h3>GetScratchBuffer</h3>
<pre class="prettyprint">void *(* TfLiteContext::GetScratchBuffer)(struct TfLiteContext *ctx, int buffer_idx)</pre>
<div>
<p>Get the scratch buffer pointer. </p>
<p>This method is only available in Eval stage.</p>
<p>WARNING: This is an experimental interface that is subject to change. </p>
</div>
</div>
<div id="struct_tf_lite_context_1a205d79ec6870754eebac003f883ee923">
<h3>GetTensor</h3>
<pre class="prettyprint"><a href="/lite/api_docs/c/struct/tf-lite-tensor.html#struct_tf_lite_tensor">TfLiteTensor</a> *(* TfLiteContext::GetTensor)(const struct TfLiteContext *context, int tensor_idx)</pre>
<div>
<p>Returns a <a href="/lite/api_docs/c/struct/tf-lite-tensor.html#struct_tf_lite_tensor">TfLiteTensor</a> struct for a given index. </p>
<p>WARNING: This is an experimental interface that is subject to change.</p>
<p>WARNING: This method may not be available on all platforms. </p>
</div>
</div>
<div id="struct_tf_lite_context_1afaaf502811bbcf1441c3879e9c47b8ec">
<h3>PreviewDelegatePartitioning</h3>
<pre class="prettyprint"><a href="/lite/api_docs/c/group/c-api-types.html#group__c__api__types_1gacf79d2fb5fa520303014d1303f1f6361">TfLiteStatus</a>(* TfLiteContext::PreviewDelegatePartitioning)(struct TfLiteContext *context, const TfLiteIntArray *nodes_to_replace, TfLiteDelegateParams **partition_params_array, int *num_partitions)</pre>
<div>
<p>This method provides a preview of post-delegation partitioning. </p>
<p>Each <a href="/lite/api_docs/c/struct/tf-lite-delegate-params.html#struct_tf_lite_delegate_params">TfLiteDelegateParams</a> in the referenced array corresponds to one instance of the delegate kernel. Example usage: <pre class="prettyprint">TfLiteIntArray* nodes_to_replace = ...;
TfLiteDelegateParams* params_array;
int num_partitions = 0;
TF_LITE_ENSURE_STATUS(context->PreviewDelegatePartitioning(
context, delegate, nodes_to_replace, &params_array,
&num_partitions));
for (int idx = 0; idx < num_partitions; idx++) {
const auto& partition_params = params_array[idx];
...
}
</pre></p>
<p>NOTE: The context owns the memory referenced by partition_params_array. It will be cleared with another call to PreviewDelegatePartitioning, or after TfLiteDelegateParams::Prepare returns.</p>
<p>WARNING: This is an experimental interface that is subject to change. </p>
</div>
</div>
<div id="struct_tf_lite_context_1a3efba668c1f270366bd4203ca1c4fde9">
<h3>ReleaseSubgraphContext</h3>
<pre class="prettyprint"><a href="/lite/api_docs/c/group/c-api-types.html#group__c__api__types_1gacf79d2fb5fa520303014d1303f1f6361">TfLiteStatus</a>(* TfLiteContext::ReleaseSubgraphContext)(struct TfLiteContext *context, int subgraph_index)</pre>
<div>
<p>Releases the subgraph context by switching back to the TFLite kernel context for the subgraph that the given subgraph_index points to. </p>
<p>NOTE: This function is expected to be used after <a href="/lite/api_docs/c/struct/tf-lite-context.html#struct_tf_lite_context_1a3c7b83d2e2e0d10fac40e74fcc5501c9">AcquireSubgraphContext()</a> once the delegate preparation is done and/or the delegate context functions are no longer needed.</p>
<p>WARNING: This is an experimental interface that is subject to change. </p>
</div>
</div>
<div id="struct_tf_lite_context_1a3ca1af96f5dcbcfe5ae72665dd9c27df">
<h3>ReplaceNodeSubsetsWithDelegateKernels</h3>
<pre class="prettyprint"><a href="/lite/api_docs/c/group/c-api-types.html#group__c__api__types_1gacf79d2fb5fa520303014d1303f1f6361">TfLiteStatus</a>(* TfLiteContext::ReplaceNodeSubsetsWithDelegateKernels)(struct TfLiteContext *, struct TfLiteRegistration registration, const TfLiteIntArray *nodes_to_replace, struct TfLiteDelegate *delegate)</pre>
<div>
<p>Replace ops with one or more stub delegate operations. </p>
<p>This function does not take ownership of <code>nodes_to_replace</code>. </p>
</div>
</div>
<div id="struct_tf_lite_context_1aefe130a452e108010d3f8fd428b0bf23">
<h3>ReportError</h3>
<pre class="prettyprint">void(* TfLiteContext::ReportError)(struct TfLiteContext *, const char *msg,...)</pre>
<div>
<p>Request that an error be reported with format string msg. </p>
</div>
</div>
<div id="struct_tf_lite_context_1a7a3778903dc181d98fe1f10a4f6e15c9">
<h3>RequestScratchBufferInArena</h3>
<pre class="prettyprint"><a href="/lite/api_docs/c/group/c-api-types.html#group__c__api__types_1gacf79d2fb5fa520303014d1303f1f6361">TfLiteStatus</a>(* TfLiteContext::RequestScratchBufferInArena)(struct TfLiteContext *ctx, size_t bytes, int *buffer_idx)</pre>
<div>
<p>Request a scratch buffer in the arena through static memory planning. </p>
<p>This method is only available in <code>Prepare</code> stage and the buffer is allocated by the interpreter between Prepare and Eval stage. In <code>Eval</code> stage, <code>GetScratchBuffer</code> API can be used to fetch the address.</p>
<p>WARNING: This is an experimental interface that is subject to change. </p>
</div>
</div>
<div id="struct_tf_lite_context_1af37c2aaccdca191c9ac3bf2b9b00b59a">
<h3>ResizeTensor</h3>
<pre class="prettyprint"><a href="/lite/api_docs/c/group/c-api-types.html#group__c__api__types_1gacf79d2fb5fa520303014d1303f1f6361">TfLiteStatus</a>(* TfLiteContext::ResizeTensor)(struct TfLiteContext *, TfLiteTensor *tensor, TfLiteIntArray *new_size)</pre>
<div>
<p>Request memory pointer be resized. </p>
<p>Updates dimensions on the tensor. NOTE: ResizeTensor takes ownership of newSize. </p>
</div>
</div>
<div id="struct_tf_lite_context_1adcbd972b5271979f35c18e83e28511b7">
<h3>ResizeTensorExplicit</h3>
<pre class="prettyprint"><a href="/lite/api_docs/c/group/c-api-types.html#group__c__api__types_1gacf79d2fb5fa520303014d1303f1f6361">TfLiteStatus</a>(* TfLiteContext::ResizeTensorExplicit)(struct TfLiteContext *ctx, TfLiteTensor *tensor, int dims, const int *shape)</pre>
<div>
<p>Resize the memory pointer of the <code>tensor</code>. </p>
<p>This method behaves the same as <code>ResizeTensor</code>, except that it makes a copy of the shape array internally so the shape array could be deallocated right afterwards.</p>
<p>WARNING: This is an experimental interface that is subject to change. </p>
</div>
</div>
<div id="struct_tf_lite_context_1a46dd8ae6f6b945bee9caefa39528d954">
<h3>SetExternalContext</h3>
<pre class="prettyprint">void(* TfLiteContext::SetExternalContext)(struct TfLiteContext *, TfLiteExternalContextType, TfLiteExternalContext *)</pre>
<div>
<p>Set the value of a external context. </p>
<p>Does not take ownership of the pointer.</p>
<p>WARNING: This is an experimental interface that is subject to change. </p>
</div>
</div>
<div id="struct_tf_lite_context_1a2c14aa723ed7d38a33fb8c0f611b1ad2">
<h3>allow_fp32_relax_to_fp16</h3>
<pre class="prettyprint">bool TfLiteContext::allow_fp32_relax_to_fp16</pre>
<div>
<p>Flag for allowing float16 precision for FP32 calculation. </p>
<p>default: false.</p>
<p>WARNING: This is an experimental API and subject to change. </p>
</div>
</div>
<div id="struct_tf_lite_context_1ad66dfab7fa23723499f600668adb7684">
<h3>impl_</h3>
<pre class="prettyprint">void * TfLiteContext::impl_</pre>
<div>
<p>opaque full context ptr (an opaque c++ data structure) </p>
</div>
</div>
<div id="struct_tf_lite_context_1a63073f6c160cf0c0ff56537a6c57888e">
<h3>profiler</h3>
<pre class="prettyprint">void * TfLiteContext::profiler</pre>
<div>
<p>Pointer to the op-level profiler, if set; nullptr otherwise. </p>
</div>
</div>
<div id="struct_tf_lite_context_1a76dc6ac92f9ff38e377f48b1d0b165ad">
<h3>recommended_num_threads</h3>
<pre class="prettyprint">int TfLiteContext::recommended_num_threads</pre>
<div>
<p>Number of threads that are recommended to subsystems like gemmlowp and eigen. </p>
</div>
</div>
<div id="struct_tf_lite_context_1a4c2b2195a11468ab3009a961fdf1bbe5">
<h3>tensors</h3>
<pre class="prettyprint"><a href="/lite/api_docs/c/struct/tf-lite-tensor.html#struct_tf_lite_tensor">TfLiteTensor</a> * TfLiteContext::tensors</pre>
<div>
<p>An array of tensors in the interpreter context (of length <code>tensors_size</code>) </p>
</div>
</div>
<div id="struct_tf_lite_context_1a70d1aa6ac0773caf8bb9f20b07cfd595">
<h3>tensors_size</h3>
<pre class="prettyprint">size_t TfLiteContext::tensors_size</pre>
<div>
<p>Number of tensors in the context. </p>
</div>
</div>
</body>
</html>
@@ -0,0 +1,53 @@
<!DOCTYPE html>
<html devsite>
<head>
<title>TfLiteCustomAllocation Struct Reference</title>
<meta name="page_type" value="reference" />
</head>
<body>
<div id="top"><!-- do not remove this div --></div>
<h1>TfLiteCustomAllocation</h1>
<code>#include &lt;common.h&gt;</code>
<p>Defines a custom memory allocation not owned by the runtime. </p>
<h2>Summary</h2>
<p><code>data</code> should be aligned to kDefaultTensorAlignment defined in lite/util.h. (Currently 64 bytes) NOTE: See <code>Interpreter::SetCustomAllocationForTensor</code> for details on usage. </p>
<table class="properties responsive">
<tr>
<th colspan="2">
<h3>Public attributes</h3>
</th>
</tr>
<tr>
<td>
<code><a href="#struct_tf_lite_custom_allocation_1ac144cef6a7bf9b69f0ce3cb084028786">bytes</a></code>
</td>
<td>
<div>
<code>size_t</code>
</div>
</td>
</tr>
<tr>
<td>
<code><a href="#struct_tf_lite_custom_allocation_1a88083398e4505b76dc2b55a413307bc1">data</a></code>
</td>
<td>
<div>
<code>void *</code>
</div>
</td>
</tr>
</table>
<h2>Public attributes</h2>
<div id="struct_tf_lite_custom_allocation_1ac144cef6a7bf9b69f0ce3cb084028786">
<h3>bytes</h3>
<pre class="prettyprint">size_t TfLiteCustomAllocation::bytes</pre>
<div />
</div>
<div id="struct_tf_lite_custom_allocation_1a88083398e4505b76dc2b55a413307bc1">
<h3>data</h3>
<pre class="prettyprint">void * TfLiteCustomAllocation::data</pre>
<div />
</div>
</body>
</html>
@@ -0,0 +1,84 @@
<!DOCTYPE html>
<html devsite>
<head>
<title>TfLiteDelegateParams Struct Reference</title>
<meta name="page_type" value="reference" />
</head>
<body>
<div id="top"><!-- do not remove this div --></div>
<h1>TfLiteDelegateParams</h1>
<code>#include &lt;common.h&gt;</code>
<p>WARNING: This is an experimental interface that is subject to change. </p>
<h2>Summary</h2>
<p>Currently, <a href="/lite/api_docs/c/struct/tf-lite-delegate-params.html#struct_tf_lite_delegate_params">TfLiteDelegateParams</a> has to be allocated in a way that it's trivially destructable. It will be stored as <code>builtin_data</code> field in <code><a href="/lite/api_docs/c/struct/tf-lite-node.html#struct_tf_lite_node">TfLiteNode</a></code> of the delegate node.</p>
<p>See also the <code>CreateDelegateParams</code> function in <code>interpreter.cc</code> details. </p>
<table class="properties responsive">
<tr>
<th colspan="2">
<h3>Public attributes</h3>
</th>
</tr>
<tr>
<td>
<code><a href="#struct_tf_lite_delegate_params_1a5cdf68982baff1ed62955571d3949b7a">delegate</a></code>
</td>
<td>
<div>
<code>struct <a href="/lite/api_docs/c/struct/tf-lite-delegate.html#struct_tf_lite_delegate">TfLiteDelegate</a> *</code>
</div>
</td>
</tr>
<tr>
<td>
<code><a href="#struct_tf_lite_delegate_params_1aefc34d7cc88d4c352bae1a4d428c2e97">input_tensors</a></code>
</td>
<td>
<div>
<code><a href="/lite/api_docs/c/struct/tf-lite-int-array.html#struct_tf_lite_int_array">TfLiteIntArray</a> *</code>
</div>
</td>
</tr>
<tr>
<td>
<code><a href="#struct_tf_lite_delegate_params_1a75e64c392d7ef2d62d85cb9963a915f1">nodes_to_replace</a></code>
</td>
<td>
<div>
<code><a href="/lite/api_docs/c/struct/tf-lite-int-array.html#struct_tf_lite_int_array">TfLiteIntArray</a> *</code>
</div>
</td>
</tr>
<tr>
<td>
<code><a href="#struct_tf_lite_delegate_params_1a576c0111aae50b9d4d82d6dde7c37d93">output_tensors</a></code>
</td>
<td>
<div>
<code><a href="/lite/api_docs/c/struct/tf-lite-int-array.html#struct_tf_lite_int_array">TfLiteIntArray</a> *</code>
</div>
</td>
</tr>
</table>
<h2>Public attributes</h2>
<div id="struct_tf_lite_delegate_params_1a5cdf68982baff1ed62955571d3949b7a">
<h3>delegate</h3>
<pre class="prettyprint">struct <a href="/lite/api_docs/c/struct/tf-lite-delegate.html#struct_tf_lite_delegate">TfLiteDelegate</a> * TfLiteDelegateParams::delegate</pre>
<div />
</div>
<div id="struct_tf_lite_delegate_params_1aefc34d7cc88d4c352bae1a4d428c2e97">
<h3>input_tensors</h3>
<pre class="prettyprint"><a href="/lite/api_docs/c/struct/tf-lite-int-array.html#struct_tf_lite_int_array">TfLiteIntArray</a> * TfLiteDelegateParams::input_tensors</pre>
<div />
</div>
<div id="struct_tf_lite_delegate_params_1a75e64c392d7ef2d62d85cb9963a915f1">
<h3>nodes_to_replace</h3>
<pre class="prettyprint"><a href="/lite/api_docs/c/struct/tf-lite-int-array.html#struct_tf_lite_int_array">TfLiteIntArray</a> * TfLiteDelegateParams::nodes_to_replace</pre>
<div />
</div>
<div id="struct_tf_lite_delegate_params_1a576c0111aae50b9d4d82d6dde7c37d93">
<h3>output_tensors</h3>
<pre class="prettyprint"><a href="/lite/api_docs/c/struct/tf-lite-int-array.html#struct_tf_lite_int_array">TfLiteIntArray</a> * TfLiteDelegateParams::output_tensors</pre>
<div />
</div>
</body>
</html>
@@ -0,0 +1,76 @@
<!DOCTYPE html>
<html devsite>
<head>
<title>TfLiteDelegatePlugin Struct Reference</title>
<meta name="page_type" value="reference" />
</head>
<body>
<div id="top"><!-- do not remove this div --></div>
<h1>TfLiteDelegatePlugin</h1>
<code>#include &lt;delegate_plugin.h&gt;</code>
<p>Struct to hold all the methods for a delegate plugin. </p>
<h2>Summary</h2>
<table class="properties responsive">
<tr>
<th colspan="2">
<h3>Public attributes</h3>
</th>
</tr>
<tr>
<td>
<code><a href="#struct_tf_lite_delegate_plugin_1a45430a8de817d139d1d3f160e27af56a">create</a></code>
</td>
<td>
<div>
<code><a href="/lite/api_docs/c/group/delegate-plugin.html#group__delegate__plugin_1ga3688949cd80282bac66e3e8e1c118ca1">TfLiteDelegatePluginCreateFunc</a> *</code>
</div>
<div>Function to allocate and construct a delegate. </div>
</td>
</tr>
<tr>
<td>
<code><a href="#struct_tf_lite_delegate_plugin_1a845baf5938f37f5a0c0311a323029b94">destroy</a></code>
</td>
<td>
<div>
<code><a href="/lite/api_docs/c/group/delegate-plugin.html#group__delegate__plugin_1ga56c8ce15c6841dc756d4295f19c92c7f">TfLiteDelegatePluginDestroyFunc</a> *</code>
</div>
<div>Function to deallocate a delegate. </div>
</td>
</tr>
<tr>
<td>
<code><a href="#struct_tf_lite_delegate_plugin_1a57f1a2adf8a3bf2422d9358624631f5e">get_delegate_errno</a></code>
</td>
<td>
<div>
<code><a href="/lite/api_docs/c/group/delegate-plugin.html#group__delegate__plugin_1ga843989c081ce4f553578baea93858b1e">TfLiteDelegatePluginGetDelegateErrnoFunc</a> *</code>
</div>
<div>Function to return an error code for the last delegate operation. </div>
</td>
</tr>
</table>
<h2>Public attributes</h2>
<div id="struct_tf_lite_delegate_plugin_1a45430a8de817d139d1d3f160e27af56a">
<h3>create</h3>
<pre class="prettyprint"><a href="/lite/api_docs/c/group/delegate-plugin.html#group__delegate__plugin_1ga3688949cd80282bac66e3e8e1c118ca1">TfLiteDelegatePluginCreateFunc</a> * TfLiteDelegatePlugin::create</pre>
<div>
<p>Function to allocate and construct a delegate. </p>
</div>
</div>
<div id="struct_tf_lite_delegate_plugin_1a845baf5938f37f5a0c0311a323029b94">
<h3>destroy</h3>
<pre class="prettyprint"><a href="/lite/api_docs/c/group/delegate-plugin.html#group__delegate__plugin_1ga56c8ce15c6841dc756d4295f19c92c7f">TfLiteDelegatePluginDestroyFunc</a> * TfLiteDelegatePlugin::destroy</pre>
<div>
<p>Function to deallocate a delegate. </p>
</div>
</div>
<div id="struct_tf_lite_delegate_plugin_1a57f1a2adf8a3bf2422d9358624631f5e">
<h3>get_delegate_errno</h3>
<pre class="prettyprint"><a href="/lite/api_docs/c/group/delegate-plugin.html#group__delegate__plugin_1ga843989c081ce4f553578baea93858b1e">TfLiteDelegatePluginGetDelegateErrnoFunc</a> * TfLiteDelegatePlugin::get_delegate_errno</pre>
<div>
<p>Function to return an error code for the last delegate operation. </p>
</div>
</div>
</body>
</html>
@@ -0,0 +1,155 @@
<!DOCTYPE html>
<html devsite>
<head>
<title>TfLiteDelegate Struct Reference</title>
<meta name="page_type" value="reference" />
</head>
<body>
<div id="top"><!-- do not remove this div --></div>
<h1>TfLiteDelegate</h1>
<code>#include &lt;common.h&gt;</code>
<p>WARNING: This is an experimental interface that is subject to change. </p>
<h2>Summary</h2>
<table class="properties responsive">
<tr>
<th colspan="2">
<h3>Public attributes</h3>
</th>
</tr>
<tr>
<td>
<code><a href="#struct_tf_lite_delegate_1a4fee5ac7e1ba441d4c364c323930c8d3">CopyFromBufferHandle</a>)(TfLiteContext *context, struct TfLiteDelegate *delegate, TfLiteBufferHandle buffer_handle, TfLiteTensor *tensor)</code>
</td>
<td>
<div>
<code><a href="/lite/api_docs/c/group/c-api-types.html#group__c__api__types_1gacf79d2fb5fa520303014d1303f1f6361">TfLiteStatus</a>(*</code>
</div>
<div>Copy the data from delegate buffer handle into raw memory of the given <code>tensor</code>. </div>
</td>
</tr>
<tr>
<td>
<code><a href="#struct_tf_lite_delegate_1a94f6b1d6e2c16a2e9944012a93f5e70d">CopyToBufferHandle</a>)(TfLiteContext *context, struct TfLiteDelegate *delegate, TfLiteBufferHandle buffer_handle, TfLiteTensor *tensor)</code>
</td>
<td>
<div>
<code><a href="/lite/api_docs/c/group/c-api-types.html#group__c__api__types_1gacf79d2fb5fa520303014d1303f1f6361">TfLiteStatus</a>(*</code>
</div>
<div>Copy the data from raw memory of the given <code>tensor</code> to delegate buffer handle. </div>
</td>
</tr>
<tr>
<td>
<code><a href="#struct_tf_lite_delegate_1a66da14187ba32cbfd8e65f5b06d7c0ea">FreeBufferHandle</a>)(TfLiteContext *context, struct TfLiteDelegate *delegate, TfLiteBufferHandle *handle)</code>
</td>
<td>
<div>
<code>void(*</code>
</div>
<div>Free the Delegate Buffer Handle. </div>
</td>
</tr>
<tr>
<td>
<code><a href="#struct_tf_lite_delegate_1aa5f8c5a4ceb1bfb26c4d33a33d2afd3a">Prepare</a>)(TfLiteContext *context, struct TfLiteDelegate *delegate)</code>
</td>
<td>
<div>
<code><a href="/lite/api_docs/c/group/c-api-types.html#group__c__api__types_1gacf79d2fb5fa520303014d1303f1f6361">TfLiteStatus</a>(*</code>
</div>
<div>Invoked by <code>ModifyGraphWithDelegate</code>. </div>
</td>
</tr>
<tr>
<td>
<code><a href="#struct_tf_lite_delegate_1a90d8880e87c24835171a14eff0a22d98">data_</a></code>
</td>
<td>
<div>
<code>void *</code>
</div>
<div>Data that delegate needs to identify itself. </div>
</td>
</tr>
<tr>
<td>
<code><a href="#struct_tf_lite_delegate_1a4c32a68d8020c616f31338a048f055c5">flags</a></code>
</td>
<td>
<div>
<code>int64_t</code>
</div>
<div>Bitmask flags. See the comments in <code>TfLiteDelegateFlags</code>. </div>
</td>
</tr>
<tr>
<td>
<code><a href="#struct_tf_lite_delegate_1a5a0db5f3d47c3a069c9b1d6dc7326e0e">opaque_delegate_builder</a></code>
</td>
<td>
<div>
<code>struct <a href="/lite/api_docs/c/struct/tf-lite-opaque-delegate-builder.html#struct_tf_lite_opaque_delegate_builder">TfLiteOpaqueDelegateBuilder</a> *</code>
</div>
<div>The opaque delegate builder associated with this object. </div>
</td>
</tr>
</table>
<h2>Public attributes</h2>
<div id="struct_tf_lite_delegate_1a4fee5ac7e1ba441d4c364c323930c8d3">
<h3>CopyFromBufferHandle</h3>
<pre class="prettyprint"><a href="/lite/api_docs/c/group/c-api-types.html#group__c__api__types_1gacf79d2fb5fa520303014d1303f1f6361">TfLiteStatus</a>(* TfLiteDelegate::CopyFromBufferHandle)(TfLiteContext *context, struct TfLiteDelegate *delegate, TfLiteBufferHandle buffer_handle, TfLiteTensor *tensor)</pre>
<div>
<p>Copy the data from delegate buffer handle into raw memory of the given <code>tensor</code>. </p>
<p>Note that the delegate is allowed to allocate the raw bytes as long as it follows the rules for <code>kTfLiteDynamic</code> tensors, in which case this cannot be null. </p>
</div>
</div>
<div id="struct_tf_lite_delegate_1a94f6b1d6e2c16a2e9944012a93f5e70d">
<h3>CopyToBufferHandle</h3>
<pre class="prettyprint"><a href="/lite/api_docs/c/group/c-api-types.html#group__c__api__types_1gacf79d2fb5fa520303014d1303f1f6361">TfLiteStatus</a>(* TfLiteDelegate::CopyToBufferHandle)(TfLiteContext *context, struct TfLiteDelegate *delegate, TfLiteBufferHandle buffer_handle, TfLiteTensor *tensor)</pre>
<div>
<p>Copy the data from raw memory of the given <code>tensor</code> to delegate buffer handle. </p>
<p>This can be null if the delegate doesn't use its own buffer. </p>
</div>
</div>
<div id="struct_tf_lite_delegate_1a66da14187ba32cbfd8e65f5b06d7c0ea">
<h3>FreeBufferHandle</h3>
<pre class="prettyprint">void(* TfLiteDelegate::FreeBufferHandle)(TfLiteContext *context, struct TfLiteDelegate *delegate, TfLiteBufferHandle *handle)</pre>
<div>
<p>Free the Delegate Buffer Handle. </p>
<p>Note: This only frees the handle, but this doesn't release the underlying resource (e.g. textures). The resources are either owned by application layer or the delegate. This can be null if the delegate doesn't use its own buffer. </p>
</div>
</div>
<div id="struct_tf_lite_delegate_1aa5f8c5a4ceb1bfb26c4d33a33d2afd3a">
<h3>Prepare</h3>
<pre class="prettyprint"><a href="/lite/api_docs/c/group/c-api-types.html#group__c__api__types_1gacf79d2fb5fa520303014d1303f1f6361">TfLiteStatus</a>(* TfLiteDelegate::Prepare)(TfLiteContext *context, struct TfLiteDelegate *delegate)</pre>
<div>
<p>Invoked by <code>ModifyGraphWithDelegate</code>. </p>
<p>This prepare is called, giving the delegate a view of the current graph through <code>TfLiteContext*</code>. It typically will look at the nodes and call <code>ReplaceNodeSubsetsWithDelegateKernels()</code> to ask the TensorFlow lite runtime to create macro-nodes to represent delegated subgraphs of the original graph. </p>
</div>
</div>
<div id="struct_tf_lite_delegate_1a90d8880e87c24835171a14eff0a22d98">
<h3>data_</h3>
<pre class="prettyprint">void * TfLiteDelegate::data_</pre>
<div>
<p>Data that delegate needs to identify itself. </p>
<p>This data is owned by the delegate. The delegate is owned in the user code, so the delegate is responsible for deallocating this when it is destroyed. </p>
</div>
</div>
<div id="struct_tf_lite_delegate_1a4c32a68d8020c616f31338a048f055c5">
<h3>flags</h3>
<pre class="prettyprint">int64_t TfLiteDelegate::flags</pre>
<div>
<p>Bitmask flags. See the comments in <code>TfLiteDelegateFlags</code>. </p>
</div>
</div>
<div id="struct_tf_lite_delegate_1a5a0db5f3d47c3a069c9b1d6dc7326e0e">
<h3>opaque_delegate_builder</h3>
<pre class="prettyprint">struct <a href="/lite/api_docs/c/struct/tf-lite-opaque-delegate-builder.html#struct_tf_lite_opaque_delegate_builder">TfLiteOpaqueDelegateBuilder</a> * TfLiteDelegate::opaque_delegate_builder</pre>
<div>
<p>The opaque delegate builder associated with this object. </p>
<p>If set then the TF Lite runtime will give precedence to this field. E.g. instead of invoking <code>Prepare</code> via the function pointer inside the <code><a href="/lite/api_docs/c/struct/tf-lite-delegate.html#struct_tf_lite_delegate">TfLiteDelegate</a></code> object, the runtime will first check if the corresponding function pointer inside <code>opaque_delegate_builder</code> is set and if so invoke that.</p>
<p>If this field is non-null, then the <code>Prepare</code> field (of the <code><a href="/lite/api_docs/c/struct/tf-lite-delegate.html#struct_tf_lite_delegate">TfLiteDelegate</a></code>) should be null. </p>
</div>
</div>
</body>
</html>
@@ -0,0 +1,82 @@
<!DOCTYPE html>
<html devsite>
<head>
<title>TfLiteDimensionMetadata Struct Reference</title>
<meta name="page_type" value="reference" />
</head>
<body>
<div id="top"><!-- do not remove this div --></div>
<h1>TfLiteDimensionMetadata</h1>
<code>#include &lt;common.h&gt;</code>
<p>Metadata to encode each dimension in a sparse tensor. </p>
<h2>Summary</h2>
<table class="properties responsive">
<tr>
<th colspan="2">
<h3>Public attributes</h3>
</th>
</tr>
<tr>
<td>
<code><a href="#struct_tf_lite_dimension_metadata_1ab74d3059dfe2170e209090d587390423">array_indices</a></code>
</td>
<td>
<div>
<code><a href="/lite/api_docs/c/struct/tf-lite-int-array.html#struct_tf_lite_int_array">TfLiteIntArray</a> *</code>
</div>
</td>
</tr>
<tr>
<td>
<code><a href="#struct_tf_lite_dimension_metadata_1abc68ebd8dacbc459b4245730fe7ed56a">array_segments</a></code>
</td>
<td>
<div>
<code><a href="/lite/api_docs/c/struct/tf-lite-int-array.html#struct_tf_lite_int_array">TfLiteIntArray</a> *</code>
</div>
</td>
</tr>
<tr>
<td>
<code><a href="#struct_tf_lite_dimension_metadata_1a76e6253977a63d1c1c85feeb523f3b9e">dense_size</a></code>
</td>
<td>
<div>
<code>int</code>
</div>
</td>
</tr>
<tr>
<td>
<code><a href="#struct_tf_lite_dimension_metadata_1a5b6c1e235227cad2db9d09af297c0d41">format</a></code>
</td>
<td>
<div>
<code><a href="/lite/api_docs/c/group/common.html#group__common_1ga71e0001719140df24b5ae660cd0c322e">TfLiteDimensionType</a></code>
</div>
</td>
</tr>
</table>
<h2>Public attributes</h2>
<div id="struct_tf_lite_dimension_metadata_1ab74d3059dfe2170e209090d587390423">
<h3>array_indices</h3>
<pre class="prettyprint"><a href="/lite/api_docs/c/struct/tf-lite-int-array.html#struct_tf_lite_int_array">TfLiteIntArray</a> * TfLiteDimensionMetadata::array_indices</pre>
<div />
</div>
<div id="struct_tf_lite_dimension_metadata_1abc68ebd8dacbc459b4245730fe7ed56a">
<h3>array_segments</h3>
<pre class="prettyprint"><a href="/lite/api_docs/c/struct/tf-lite-int-array.html#struct_tf_lite_int_array">TfLiteIntArray</a> * TfLiteDimensionMetadata::array_segments</pre>
<div />
</div>
<div id="struct_tf_lite_dimension_metadata_1a76e6253977a63d1c1c85feeb523f3b9e">
<h3>dense_size</h3>
<pre class="prettyprint">int TfLiteDimensionMetadata::dense_size</pre>
<div />
</div>
<div id="struct_tf_lite_dimension_metadata_1a5b6c1e235227cad2db9d09af297c0d41">
<h3>format</h3>
<pre class="prettyprint"><a href="/lite/api_docs/c/group/common.html#group__common_1ga71e0001719140df24b5ae660cd0c322e">TfLiteDimensionType</a> TfLiteDimensionMetadata::format</pre>
<div />
</div>
</body>
</html>
@@ -0,0 +1,79 @@
<!DOCTYPE html>
<html devsite>
<head>
<title>TfLiteEvalTensor Struct Reference</title>
<meta name="page_type" value="reference" />
</head>
<body>
<div id="top"><!-- do not remove this div --></div>
<h1>TfLiteEvalTensor</h1>
<code>#include &lt;common.h&gt;</code>
<p>Light-weight tensor struct for TF Micro runtime. </p>
<h2>Summary</h2>
<p>Provides the minimal amount of information required for a kernel to run during TfLiteRegistration::Eval. </p>
<table class="properties responsive">
<tr>
<th colspan="2">
<h3>Public attributes</h3>
</th>
</tr>
<tr>
<td>
<code><a href="#struct_tf_lite_eval_tensor_1a82292e62c5af51d1f96ff418361f8205">data</a></code>
</td>
<td>
<div>
<code><a href="/lite/api_docs/c/union/tf-lite-ptr-union.html#union_tf_lite_ptr_union">TfLitePtrUnion</a></code>
</div>
<div>A union of data pointers. </div>
</td>
</tr>
<tr>
<td>
<code><a href="#struct_tf_lite_eval_tensor_1a0c4cf82f4bf15dee9a92fa7cf999d759">dims</a></code>
</td>
<td>
<div>
<code><a href="/lite/api_docs/c/struct/tf-lite-int-array.html#struct_tf_lite_int_array">TfLiteIntArray</a> *</code>
</div>
<div>A pointer to a structure representing the dimensionality interpretation that the buffer should have. </div>
</td>
</tr>
<tr>
<td>
<code><a href="#struct_tf_lite_eval_tensor_1a180bc742f14353dd12e73a872f0e0cb5">type</a></code>
</td>
<td>
<div>
<code><a href="/lite/api_docs/c/group/c-api-types.html#group__c__api__types_1ga8a47ba81bdef28b5c479ee7928a7d123">TfLiteType</a></code>
</div>
<div>The data type specification for data stored in <code>data</code>. </div>
</td>
</tr>
</table>
<h2>Public attributes</h2>
<div id="struct_tf_lite_eval_tensor_1a82292e62c5af51d1f96ff418361f8205">
<h3>data</h3>
<pre class="prettyprint"><a href="/lite/api_docs/c/union/tf-lite-ptr-union.html#union_tf_lite_ptr_union">TfLitePtrUnion</a> TfLiteEvalTensor::data</pre>
<div>
<p>A union of data pointers. </p>
<p>The appropriate type should be used for a typed tensor based on <code>type</code>. </p>
</div>
</div>
<div id="struct_tf_lite_eval_tensor_1a0c4cf82f4bf15dee9a92fa7cf999d759">
<h3>dims</h3>
<pre class="prettyprint"><a href="/lite/api_docs/c/struct/tf-lite-int-array.html#struct_tf_lite_int_array">TfLiteIntArray</a> * TfLiteEvalTensor::dims</pre>
<div>
<p>A pointer to a structure representing the dimensionality interpretation that the buffer should have. </p>
</div>
</div>
<div id="struct_tf_lite_eval_tensor_1a180bc742f14353dd12e73a872f0e0cb5">
<h3>type</h3>
<pre class="prettyprint"><a href="/lite/api_docs/c/group/c-api-types.html#group__c__api__types_1ga8a47ba81bdef28b5c479ee7928a7d123">TfLiteType</a> TfLiteEvalTensor::type</pre>
<div>
<p>The data type specification for data stored in <code>data</code>. </p>
<p>This affects what member of <code>data</code> union should be used. </p>
</div>
</div>
</body>
</html>
@@ -0,0 +1,53 @@
<!DOCTYPE html>
<html devsite>
<head>
<title>TfLiteExternalContext Struct Reference</title>
<meta name="page_type" value="reference" />
</head>
<body>
<div id="top"><!-- do not remove this div --></div>
<h1>TfLiteExternalContext</h1>
<code>#include &lt;common.h&gt;</code>
<p>An external context is a collection of information unrelated to the TF Lite framework, but useful to a subset of the ops. </p>
<h2>Summary</h2>
<p>TF Lite knows very little about the actual contexts, but it keeps a list of them, and is able to refresh them if configurations like the number of recommended threads change. </p>
<table class="properties responsive">
<tr>
<th colspan="2">
<h3>Public attributes</h3>
</th>
</tr>
<tr>
<td>
<code><a href="#struct_tf_lite_external_context_1ab74f92fa424495126f964a409d0bba10">Refresh</a>)(struct TfLiteContext *context)</code>
</td>
<td>
<div>
<code><a href="/lite/api_docs/c/group/c-api-types.html#group__c__api__types_1gacf79d2fb5fa520303014d1303f1f6361">TfLiteStatus</a>(*</code>
</div>
</td>
</tr>
<tr>
<td>
<code><a href="#struct_tf_lite_external_context_1a22bbe8229d57cd397e4ef3f8b9a03e61">type</a></code>
</td>
<td>
<div>
<code><a href="/lite/api_docs/c/group/common.html#group__common_1ga6d1d3582ab46e837f9f108839232dc03">TfLiteExternalContextType</a></code>
</div>
</td>
</tr>
</table>
<h2>Public attributes</h2>
<div id="struct_tf_lite_external_context_1ab74f92fa424495126f964a409d0bba10">
<h3>Refresh</h3>
<pre class="prettyprint"><a href="/lite/api_docs/c/group/c-api-types.html#group__c__api__types_1gacf79d2fb5fa520303014d1303f1f6361">TfLiteStatus</a>(* TfLiteExternalContext::Refresh)(struct TfLiteContext *context)</pre>
<div />
</div>
<div id="struct_tf_lite_external_context_1a22bbe8229d57cd397e4ef3f8b9a03e61">
<h3>type</h3>
<pre class="prettyprint"><a href="/lite/api_docs/c/group/common.html#group__common_1ga6d1d3582ab46e837f9f108839232dc03">TfLiteExternalContextType</a> TfLiteExternalContext::type</pre>
<div />
</div>
</body>
</html>
@@ -0,0 +1,52 @@
<!DOCTYPE html>
<html devsite>
<head>
<title>TfLiteFloatArray Struct Reference</title>
<meta name="page_type" value="reference" />
</head>
<body>
<div id="top"><!-- do not remove this div --></div>
<h1>TfLiteFloatArray</h1>
<code>#include &lt;common.h&gt;</code>
<p>Fixed size list of floats. Used for per-channel quantization. </p>
<h2>Summary</h2>
<table class="properties responsive">
<tr>
<th colspan="2">
<h3>Public attributes</h3>
</th>
</tr>
<tr>
<td>
<code><a href="#struct_tf_lite_float_array_1a38adf3ecdb0e73fa23681c7614638d67">data</a>[]</code>
</td>
<td>
<div>
<code>float</code>
</div>
</td>
</tr>
<tr>
<td>
<code><a href="#struct_tf_lite_float_array_1abaa1355710d1126165a4745bf26ebded">size</a></code>
</td>
<td>
<div>
<code>int</code>
</div>
</td>
</tr>
</table>
<h2>Public attributes</h2>
<div id="struct_tf_lite_float_array_1a38adf3ecdb0e73fa23681c7614638d67">
<h3>data</h3>
<pre class="prettyprint">float TfLiteFloatArray::data[]</pre>
<div />
</div>
<div id="struct_tf_lite_float_array_1abaa1355710d1126165a4745bf26ebded">
<h3>size</h3>
<pre class="prettyprint">int TfLiteFloatArray::size</pre>
<div />
</div>
</body>
</html>
@@ -0,0 +1,37 @@
<!DOCTYPE html>
<html devsite>
<head>
<title>TfLiteFloat16 Struct Reference</title>
<meta name="page_type" value="reference" />
</head>
<body>
<div id="top"><!-- do not remove this div --></div>
<h1>TfLiteFloat16</h1>
<code>#include &lt;common.h&gt;</code>
<p>Half precision data type compatible with the C99 definition. </p>
<h2>Summary</h2>
<table class="properties responsive">
<tr>
<th colspan="2">
<h3>Public attributes</h3>
</th>
</tr>
<tr>
<td>
<code><a href="#struct_tf_lite_float16_1ad855c2a783cba2d550015340ef39e819">data</a></code>
</td>
<td>
<div>
<code>uint16_t</code>
</div>
</td>
</tr>
</table>
<h2>Public attributes</h2>
<div id="struct_tf_lite_float16_1ad855c2a783cba2d550015340ef39e819">
<h3>data</h3>
<pre class="prettyprint">uint16_t TfLiteFloat16::data</pre>
<div />
</div>
</body>
</html>
@@ -0,0 +1,53 @@
<!DOCTYPE html>
<html devsite>
<head>
<title>TfLiteIntArray Struct Reference</title>
<meta name="page_type" value="reference" />
</head>
<body>
<div id="top"><!-- do not remove this div --></div>
<h1>TfLiteIntArray</h1>
<code>#include &lt;common.h&gt;</code>
<p>Fixed size list of integers. </p>
<h2>Summary</h2>
<p>Used for dimensions and inputs/outputs tensor indices </p>
<table class="properties responsive">
<tr>
<th colspan="2">
<h3>Public attributes</h3>
</th>
</tr>
<tr>
<td>
<code><a href="#struct_tf_lite_int_array_1ae2b5e1775496017e31b4d56aed3c63c8">data</a>[]</code>
</td>
<td>
<div>
<code>int</code>
</div>
</td>
</tr>
<tr>
<td>
<code><a href="#struct_tf_lite_int_array_1aaaa4554b9c73a68a4d6a99f1285be320">size</a></code>
</td>
<td>
<div>
<code>int</code>
</div>
</td>
</tr>
</table>
<h2>Public attributes</h2>
<div id="struct_tf_lite_int_array_1ae2b5e1775496017e31b4d56aed3c63c8">
<h3>data</h3>
<pre class="prettyprint">int TfLiteIntArray::data[]</pre>
<div />
</div>
<div id="struct_tf_lite_int_array_1aaaa4554b9c73a68a4d6a99f1285be320">
<h3>size</h3>
<pre class="prettyprint">int TfLiteIntArray::size</pre>
<div />
</div>
</body>
</html>
@@ -0,0 +1,206 @@
<!DOCTYPE html>
<html devsite>
<head>
<title>TfLiteNode Struct Reference</title>
<meta name="page_type" value="reference" />
</head>
<body>
<div id="top"><!-- do not remove this div --></div>
<h1>TfLiteNode</h1>
<code>#include &lt;common.h&gt;</code>
<p>A structure representing an instance of a node. </p>
<h2>Summary</h2>
<p>This structure only exhibits the inputs, outputs, user defined data and some node properties (like statefulness), not other features like the type. </p>
<table class="properties responsive">
<tr>
<th colspan="2">
<h3>Public attributes</h3>
</th>
</tr>
<tr>
<td>
<code><a href="#struct_tf_lite_node_1aff1f8ea7dab2340d3fa9ec1a7b529918">builtin_data</a></code>
</td>
<td>
<div>
<code>void *</code>
</div>
<div>Opaque data provided to the node if the node is a builtin. </div>
</td>
</tr>
<tr>
<td>
<code><a href="#struct_tf_lite_node_1aa1d200ff3b21ec2c855e9471e639e5a2">custom_initial_data</a></code>
</td>
<td>
<div>
<code>const void *</code>
</div>
<div>Custom initial data. </div>
</td>
</tr>
<tr>
<td>
<code><a href="#struct_tf_lite_node_1a81687d360956a3388e0c8d446495f3a4">custom_initial_data_size</a></code>
</td>
<td>
<div>
<code>int</code>
</div>
</td>
</tr>
<tr>
<td>
<code><a href="#struct_tf_lite_node_1a4a1e6b47396e69375b1d4da5db85cbd5">delegate</a></code>
</td>
<td>
<div>
<code>struct <a href="/lite/api_docs/c/struct/tf-lite-delegate.html#struct_tf_lite_delegate">TfLiteDelegate</a> *</code>
</div>
<div>The pointer to the delegate. </div>
</td>
</tr>
<tr>
<td>
<code><a href="#struct_tf_lite_node_1a6478a2fde56a7df96d7a68c140e4e4b7">inputs</a></code>
</td>
<td>
<div>
<code><a href="/lite/api_docs/c/struct/tf-lite-int-array.html#struct_tf_lite_int_array">TfLiteIntArray</a> *</code>
</div>
<div>Inputs to this node expressed as indices into the simulator's tensors. </div>
</td>
</tr>
<tr>
<td>
<code><a href="#struct_tf_lite_node_1a0a5ac4c977729c1fca4412f30698c5e5">intermediates</a></code>
</td>
<td>
<div>
<code><a href="/lite/api_docs/c/struct/tf-lite-int-array.html#struct_tf_lite_int_array">TfLiteIntArray</a> *</code>
</div>
<div>intermediate tensors to this node expressed as indices into the simulator's tensors. </div>
</td>
</tr>
<tr>
<td>
<code><a href="#struct_tf_lite_node_1a74c8653d6b0287c2591ba0d4e45bbee2">might_have_side_effect</a></code>
</td>
<td>
<div>
<code>bool</code>
</div>
<div>Whether this op might have side effect (e.g. stateful op). </div>
</td>
</tr>
<tr>
<td>
<code><a href="#struct_tf_lite_node_1af4834a2c09a90b144859dd637105018e">outputs</a></code>
</td>
<td>
<div>
<code><a href="/lite/api_docs/c/struct/tf-lite-int-array.html#struct_tf_lite_int_array">TfLiteIntArray</a> *</code>
</div>
<div>Outputs to this node expressed as indices into the simulator's tensors. </div>
</td>
</tr>
<tr>
<td>
<code><a href="#struct_tf_lite_node_1aea5a5ff7466b35f8e31c269b844702eb">temporaries</a></code>
</td>
<td>
<div>
<code><a href="/lite/api_docs/c/struct/tf-lite-int-array.html#struct_tf_lite_int_array">TfLiteIntArray</a> *</code>
</div>
<div>Temporary tensors uses during the computations. </div>
</td>
</tr>
<tr>
<td>
<code><a href="#struct_tf_lite_node_1aef728ff402f774f7a3418f343ec5bcdb">user_data</a></code>
</td>
<td>
<div>
<code>void *</code>
</div>
<div>Opaque data provided by the node implementer through <code>Registration.init</code>. </div>
</td>
</tr>
</table>
<h2>Public attributes</h2>
<div id="struct_tf_lite_node_1aff1f8ea7dab2340d3fa9ec1a7b529918">
<h3>builtin_data</h3>
<pre class="prettyprint">void * TfLiteNode::builtin_data</pre>
<div>
<p>Opaque data provided to the node if the node is a builtin. </p>
<p>This is usually a structure defined in builtin_op_data.h </p>
</div>
</div>
<div id="struct_tf_lite_node_1aa1d200ff3b21ec2c855e9471e639e5a2">
<h3>custom_initial_data</h3>
<pre class="prettyprint">const void * TfLiteNode::custom_initial_data</pre>
<div>
<p>Custom initial data. </p>
<p>This is the opaque data provided in the flatbuffer.</p>
<p>WARNING: This is an experimental interface that is subject to change. </p>
</div>
</div>
<div id="struct_tf_lite_node_1a81687d360956a3388e0c8d446495f3a4">
<h3>custom_initial_data_size</h3>
<pre class="prettyprint">int TfLiteNode::custom_initial_data_size</pre>
<div />
</div>
<div id="struct_tf_lite_node_1a4a1e6b47396e69375b1d4da5db85cbd5">
<h3>delegate</h3>
<pre class="prettyprint">struct <a href="/lite/api_docs/c/struct/tf-lite-delegate.html#struct_tf_lite_delegate">TfLiteDelegate</a> * TfLiteNode::delegate</pre>
<div>
<p>The pointer to the delegate. </p>
<p>This is non-null only when the node is created by calling <code>interpreter.ModifyGraphWithDelegate</code>.</p>
<p>WARNING: This is an experimental interface that is subject to change. </p>
</div>
</div>
<div id="struct_tf_lite_node_1a6478a2fde56a7df96d7a68c140e4e4b7">
<h3>inputs</h3>
<pre class="prettyprint"><a href="/lite/api_docs/c/struct/tf-lite-int-array.html#struct_tf_lite_int_array">TfLiteIntArray</a> * TfLiteNode::inputs</pre>
<div>
<p>Inputs to this node expressed as indices into the simulator's tensors. </p>
</div>
</div>
<div id="struct_tf_lite_node_1a0a5ac4c977729c1fca4412f30698c5e5">
<h3>intermediates</h3>
<pre class="prettyprint"><a href="/lite/api_docs/c/struct/tf-lite-int-array.html#struct_tf_lite_int_array">TfLiteIntArray</a> * TfLiteNode::intermediates</pre>
<div>
<p>intermediate tensors to this node expressed as indices into the simulator's tensors. </p>
</div>
</div>
<div id="struct_tf_lite_node_1a74c8653d6b0287c2591ba0d4e45bbee2">
<h3>might_have_side_effect</h3>
<pre class="prettyprint">bool TfLiteNode::might_have_side_effect</pre>
<div>
<p>Whether this op might have side effect (e.g. stateful op). </p>
</div>
</div>
<div id="struct_tf_lite_node_1af4834a2c09a90b144859dd637105018e">
<h3>outputs</h3>
<pre class="prettyprint"><a href="/lite/api_docs/c/struct/tf-lite-int-array.html#struct_tf_lite_int_array">TfLiteIntArray</a> * TfLiteNode::outputs</pre>
<div>
<p>Outputs to this node expressed as indices into the simulator's tensors. </p>
</div>
</div>
<div id="struct_tf_lite_node_1aea5a5ff7466b35f8e31c269b844702eb">
<h3>temporaries</h3>
<pre class="prettyprint"><a href="/lite/api_docs/c/struct/tf-lite-int-array.html#struct_tf_lite_int_array">TfLiteIntArray</a> * TfLiteNode::temporaries</pre>
<div>
<p>Temporary tensors uses during the computations. </p>
<p>This usually contains no tensors, but ops are allowed to change that if they need scratch space of any sort. </p>
</div>
</div>
<div id="struct_tf_lite_node_1aef728ff402f774f7a3418f343ec5bcdb">
<h3>user_data</h3>
<pre class="prettyprint">void * TfLiteNode::user_data</pre>
<div>
<p>Opaque data provided by the node implementer through <code>Registration.init</code>. </p>
</div>
</div>
</body>
</html>
@@ -0,0 +1,138 @@
<!DOCTYPE html>
<html devsite>
<head>
<title>TfLiteOpaqueDelegateBuilder Struct Reference</title>
<meta name="page_type" value="reference" />
</head>
<body>
<div id="top"><!-- do not remove this div --></div>
<h1>TfLiteOpaqueDelegateBuilder</h1>
<code>#include &lt;common.h&gt;</code>
<p><code><a href="/lite/api_docs/c/struct/tf-lite-opaque-delegate-builder.html#struct_tf_lite_opaque_delegate_builder">TfLiteOpaqueDelegateBuilder</a></code> is used for constructing <code>TfLiteOpaqueDelegate</code>, see <code>TfLiteOpaqueDelegateCreate</code> below. </p>
<h2>Summary</h2>
<p>Note: This struct is not ABI stable.</p>
<p>For forward source compatibility <code><a href="/lite/api_docs/c/struct/tf-lite-opaque-delegate-builder.html#struct_tf_lite_opaque_delegate_builder">TfLiteOpaqueDelegateBuilder</a></code> objects should be brace-initialized, so that all fields (including any that might be added in the future) get zero-initialized. The purpose of each field is exactly the same as with <code><a href="/lite/api_docs/c/struct/tf-lite-delegate.html#struct_tf_lite_delegate">TfLiteDelegate</a></code>.</p>
<p>WARNING: This is an experimental interface that is subject to change. </p>
<table class="properties responsive">
<tr>
<th colspan="2">
<h3>Public attributes</h3>
</th>
</tr>
<tr>
<td>
<code><a href="#struct_tf_lite_opaque_delegate_builder_1a5e9463b374756c6de8431be431175540">CopyFromBufferHandle</a>)(TfLiteOpaqueContext *context, TfLiteOpaqueDelegate *delegate, void *data, TfLiteBufferHandle buffer_handle, TfLiteOpaqueTensor *tensor)</code>
</td>
<td>
<div>
<code><a href="/lite/api_docs/c/group/c-api-types.html#group__c__api__types_1gacf79d2fb5fa520303014d1303f1f6361">TfLiteStatus</a>(*</code>
</div>
<div>Copies the data from delegate buffer handle into raw memory of the given <code>tensor</code>. </div>
</td>
</tr>
<tr>
<td>
<code><a href="#struct_tf_lite_opaque_delegate_builder_1a827f5c9feda6c97979f29db928ef451b">CopyToBufferHandle</a>)(TfLiteOpaqueContext *context, TfLiteOpaqueDelegate *delegate, void *data, TfLiteBufferHandle buffer_handle, TfLiteOpaqueTensor *tensor)</code>
</td>
<td>
<div>
<code><a href="/lite/api_docs/c/group/c-api-types.html#group__c__api__types_1gacf79d2fb5fa520303014d1303f1f6361">TfLiteStatus</a>(*</code>
</div>
<div>Copies the data from raw memory of the given <code>tensor</code> to delegate buffer handle. </div>
</td>
</tr>
<tr>
<td>
<code><a href="#struct_tf_lite_opaque_delegate_builder_1aa92d66ba53e7b29899ea59c2cc2ad5e7">FreeBufferHandle</a>)(TfLiteOpaqueContext *context, TfLiteOpaqueDelegate *delegate, void *data, TfLiteBufferHandle *handle)</code>
</td>
<td>
<div>
<code>void(*</code>
</div>
<div>Frees the Delegate Buffer Handle. </div>
</td>
</tr>
<tr>
<td>
<code><a href="#struct_tf_lite_opaque_delegate_builder_1a02bf326e9df6018285ade841c4f0363a">Prepare</a>)(TfLiteOpaqueContext *context, TfLiteOpaqueDelegate *delegate, void *data)</code>
</td>
<td>
<div>
<code><a href="/lite/api_docs/c/group/c-api-types.html#group__c__api__types_1gacf79d2fb5fa520303014d1303f1f6361">TfLiteStatus</a>(*</code>
</div>
<div>Invoked by ModifyGraphWithDelegate. </div>
</td>
</tr>
<tr>
<td>
<code><a href="#struct_tf_lite_opaque_delegate_builder_1a2c974a9e2ba6efabd530e3534f65176a">data</a></code>
</td>
<td>
<div>
<code>void *</code>
</div>
<div>Data that delegate needs to identify itself. </div>
</td>
</tr>
<tr>
<td>
<code><a href="#struct_tf_lite_opaque_delegate_builder_1a87d94c234238c4f44fd353ff5b7c91eb">flags</a></code>
</td>
<td>
<div>
<code>int64_t</code>
</div>
<div>Bitmask flags. See the comments in <code>TfLiteDelegateFlags</code>. </div>
</td>
</tr>
</table>
<h2>Public attributes</h2>
<div id="struct_tf_lite_opaque_delegate_builder_1a5e9463b374756c6de8431be431175540">
<h3>CopyFromBufferHandle</h3>
<pre class="prettyprint"><a href="/lite/api_docs/c/group/c-api-types.html#group__c__api__types_1gacf79d2fb5fa520303014d1303f1f6361">TfLiteStatus</a>(* TfLiteOpaqueDelegateBuilder::CopyFromBufferHandle)(TfLiteOpaqueContext *context, TfLiteOpaqueDelegate *delegate, void *data, TfLiteBufferHandle buffer_handle, TfLiteOpaqueTensor *tensor)</pre>
<div>
<p>Copies the data from delegate buffer handle into raw memory of the given <code>tensor</code>. </p>
<p>Note that the delegate is allowed to allocate the raw bytes as long as it follows the rules for kTfLiteDynamic tensors, in which case this cannot be null. </p>
</div>
</div>
<div id="struct_tf_lite_opaque_delegate_builder_1a827f5c9feda6c97979f29db928ef451b">
<h3>CopyToBufferHandle</h3>
<pre class="prettyprint"><a href="/lite/api_docs/c/group/c-api-types.html#group__c__api__types_1gacf79d2fb5fa520303014d1303f1f6361">TfLiteStatus</a>(* TfLiteOpaqueDelegateBuilder::CopyToBufferHandle)(TfLiteOpaqueContext *context, TfLiteOpaqueDelegate *delegate, void *data, TfLiteBufferHandle buffer_handle, TfLiteOpaqueTensor *tensor)</pre>
<div>
<p>Copies the data from raw memory of the given <code>tensor</code> to delegate buffer handle. </p>
<p>This can be null if the delegate doesn't use its own buffer. </p>
</div>
</div>
<div id="struct_tf_lite_opaque_delegate_builder_1aa92d66ba53e7b29899ea59c2cc2ad5e7">
<h3>FreeBufferHandle</h3>
<pre class="prettyprint">void(* TfLiteOpaqueDelegateBuilder::FreeBufferHandle)(TfLiteOpaqueContext *context, TfLiteOpaqueDelegate *delegate, void *data, TfLiteBufferHandle *handle)</pre>
<div>
<p>Frees the Delegate Buffer Handle. </p>
<p>Note: This only frees the handle, but this doesn't release the underlying resource (e.g. textures). The resources are either owned by application layer or the delegate. This can be null if the delegate doesn't use its own buffer. </p>
</div>
</div>
<div id="struct_tf_lite_opaque_delegate_builder_1a02bf326e9df6018285ade841c4f0363a">
<h3>Prepare</h3>
<pre class="prettyprint"><a href="/lite/api_docs/c/group/c-api-types.html#group__c__api__types_1gacf79d2fb5fa520303014d1303f1f6361">TfLiteStatus</a>(* TfLiteOpaqueDelegateBuilder::Prepare)(TfLiteOpaqueContext *context, TfLiteOpaqueDelegate *delegate, void *data)</pre>
<div>
<p>Invoked by ModifyGraphWithDelegate. </p>
<p>This prepare is called, giving the delegate a view of the current graph through <code>TfLiteContext*</code>. It typically will look at the nodes and call <code>ReplaceNodeSubsetsWithDelegateKernels()</code> to ask the TensorFlow lite runtime to create macro-nodes to represent delegated subgraphs of the original graph. </p>
</div>
</div>
<div id="struct_tf_lite_opaque_delegate_builder_1a2c974a9e2ba6efabd530e3534f65176a">
<h3>data</h3>
<pre class="prettyprint">void * TfLiteOpaqueDelegateBuilder::data</pre>
<div>
<p>Data that delegate needs to identify itself. </p>
<p>This data is owned by the delegate. The delegate is owned in the user code, so the delegate is responsible for deallocating this when it is destroyed. </p>
</div>
</div>
<div id="struct_tf_lite_opaque_delegate_builder_1a87d94c234238c4f44fd353ff5b7c91eb">
<h3>flags</h3>
<pre class="prettyprint">int64_t TfLiteOpaqueDelegateBuilder::flags</pre>
<div>
<p>Bitmask flags. See the comments in <code>TfLiteDelegateFlags</code>. </p>
</div>
</div>
</body>
</html>
@@ -0,0 +1,99 @@
<!DOCTYPE html>
<html devsite>
<head>
<title>TfLiteOpaqueDelegateParams Struct Reference</title>
<meta name="page_type" value="reference" />
</head>
<body>
<div id="top"><!-- do not remove this div --></div>
<h1>TfLiteOpaqueDelegateParams</h1>
<code>#include &lt;common.h&gt;</code>
<p>WARNING: This is an experimental interface that is subject to change. </p>
<h2>Summary</h2>
<p>Currently, <a href="/lite/api_docs/c/struct/tf-lite-opaque-delegate-params.html#struct_tf_lite_opaque_delegate_params">TfLiteOpaqueDelegateParams</a> has to be allocated in a way that it's trivially destructable. It will be stored as <code>builtin_data</code> field in <code><a href="/lite/api_docs/c/struct/tf-lite-node.html#struct_tf_lite_node">TfLiteNode</a></code> of the delegate node.</p>
<p>See also the <code>CreateOpaqueDelegateParams</code> function in <code>subgraph.cc</code> details. </p>
<table class="properties responsive">
<tr>
<th colspan="2">
<h3>Public attributes</h3>
</th>
</tr>
<tr>
<td>
<code><a href="#struct_tf_lite_opaque_delegate_params_1a4bb8eeea7b77182c934f4b073dfcf029">delegate</a></code>
</td>
<td>
<div>
<code><a href="/lite/api_docs/c/group/c-api-types.html#group__c__api__types_1gac2bc3e65b2b4dfe997134c006faa442f">TfLiteOpaqueDelegate</a> *</code>
</div>
</td>
</tr>
<tr>
<td>
<code><a href="#struct_tf_lite_opaque_delegate_params_1a2288e943be3693269273cf2e279fe2df">delegate_data</a></code>
</td>
<td>
<div>
<code>void *</code>
</div>
</td>
</tr>
<tr>
<td>
<code><a href="#struct_tf_lite_opaque_delegate_params_1aa10ce130e68d235f858051c440b9e98e">input_tensors</a></code>
</td>
<td>
<div>
<code><a href="/lite/api_docs/c/struct/tf-lite-int-array.html#struct_tf_lite_int_array">TfLiteIntArray</a> *</code>
</div>
</td>
</tr>
<tr>
<td>
<code><a href="#struct_tf_lite_opaque_delegate_params_1a53216b38bdf9a7c74461d77a8858ba90">nodes_to_replace</a></code>
</td>
<td>
<div>
<code><a href="/lite/api_docs/c/struct/tf-lite-int-array.html#struct_tf_lite_int_array">TfLiteIntArray</a> *</code>
</div>
</td>
</tr>
<tr>
<td>
<code><a href="#struct_tf_lite_opaque_delegate_params_1a4c98e60c927df9bed5e2a19b45be7e21">output_tensors</a></code>
</td>
<td>
<div>
<code><a href="/lite/api_docs/c/struct/tf-lite-int-array.html#struct_tf_lite_int_array">TfLiteIntArray</a> *</code>
</div>
</td>
</tr>
</table>
<h2>Public attributes</h2>
<div id="struct_tf_lite_opaque_delegate_params_1a4bb8eeea7b77182c934f4b073dfcf029">
<h3>delegate</h3>
<pre class="prettyprint"><a href="/lite/api_docs/c/group/c-api-types.html#group__c__api__types_1gac2bc3e65b2b4dfe997134c006faa442f">TfLiteOpaqueDelegate</a> * TfLiteOpaqueDelegateParams::delegate</pre>
<div />
</div>
<div id="struct_tf_lite_opaque_delegate_params_1a2288e943be3693269273cf2e279fe2df">
<h3>delegate_data</h3>
<pre class="prettyprint">void * TfLiteOpaqueDelegateParams::delegate_data</pre>
<div />
</div>
<div id="struct_tf_lite_opaque_delegate_params_1aa10ce130e68d235f858051c440b9e98e">
<h3>input_tensors</h3>
<pre class="prettyprint"><a href="/lite/api_docs/c/struct/tf-lite-int-array.html#struct_tf_lite_int_array">TfLiteIntArray</a> * TfLiteOpaqueDelegateParams::input_tensors</pre>
<div />
</div>
<div id="struct_tf_lite_opaque_delegate_params_1a53216b38bdf9a7c74461d77a8858ba90">
<h3>nodes_to_replace</h3>
<pre class="prettyprint"><a href="/lite/api_docs/c/struct/tf-lite-int-array.html#struct_tf_lite_int_array">TfLiteIntArray</a> * TfLiteOpaqueDelegateParams::nodes_to_replace</pre>
<div />
</div>
<div id="struct_tf_lite_opaque_delegate_params_1a4c98e60c927df9bed5e2a19b45be7e21">
<h3>output_tensors</h3>
<pre class="prettyprint"><a href="/lite/api_docs/c/struct/tf-lite-int-array.html#struct_tf_lite_int_array">TfLiteIntArray</a> * TfLiteOpaqueDelegateParams::output_tensors</pre>
<div />
</div>
</body>
</html>
@@ -0,0 +1,53 @@
<!DOCTYPE html>
<html devsite>
<head>
<title>TfLiteQuantizationParams Struct Reference</title>
<meta name="page_type" value="reference" />
</head>
<body>
<div id="top"><!-- do not remove this div --></div>
<h1>TfLiteQuantizationParams</h1>
<code>#include &lt;c_api_types.h&gt;</code>
<p>Legacy. </p>
<h2>Summary</h2>
<p>Will be deprecated in favor of <code><a href="/lite/api_docs/c/struct/tf-lite-affine-quantization.html#struct_tf_lite_affine_quantization">TfLiteAffineQuantization</a></code>. If per-layer quantization is specified this field will still be populated in addition to <code><a href="/lite/api_docs/c/struct/tf-lite-affine-quantization.html#struct_tf_lite_affine_quantization">TfLiteAffineQuantization</a></code>. Parameters for asymmetric quantization. Quantized values can be converted back to float using: <code>real_value = scale * (quantized_value - zero_point)</code></p>
<table class="properties responsive">
<tr>
<th colspan="2">
<h3>Public attributes</h3>
</th>
</tr>
<tr>
<td>
<code><a href="#struct_tf_lite_quantization_params_1aedc85f69317ce1c27e6e88f886ea8af8">scale</a></code>
</td>
<td>
<div>
<code>float</code>
</div>
</td>
</tr>
<tr>
<td>
<code><a href="#struct_tf_lite_quantization_params_1a7bfb85a682ab431a6c0c609d3938ab6e">zero_point</a></code>
</td>
<td>
<div>
<code>int32_t</code>
</div>
</td>
</tr>
</table>
<h2>Public attributes</h2>
<div id="struct_tf_lite_quantization_params_1aedc85f69317ce1c27e6e88f886ea8af8">
<h3>scale</h3>
<pre class="prettyprint">float TfLiteQuantizationParams::scale</pre>
<div />
</div>
<div id="struct_tf_lite_quantization_params_1a7bfb85a682ab431a6c0c609d3938ab6e">
<h3>zero_point</h3>
<pre class="prettyprint">int32_t TfLiteQuantizationParams::zero_point</pre>
<div />
</div>
</body>
</html>
@@ -0,0 +1,59 @@
<!DOCTYPE html>
<html devsite>
<head>
<title>TfLiteQuantization Struct Reference</title>
<meta name="page_type" value="reference" />
</head>
<body>
<div id="top"><!-- do not remove this div --></div>
<h1>TfLiteQuantization</h1>
<code>#include &lt;common.h&gt;</code>
<p>Structure specifying the quantization used by the tensor, if-any. </p>
<h2>Summary</h2>
<table class="properties responsive">
<tr>
<th colspan="2">
<h3>Public attributes</h3>
</th>
</tr>
<tr>
<td>
<code><a href="#struct_tf_lite_quantization_1ab108c61c41594a7c51e727ace335d388">params</a></code>
</td>
<td>
<div>
<code>void *</code>
</div>
<div>Holds an optional reference to a quantization param structure. </div>
</td>
</tr>
<tr>
<td>
<code><a href="#struct_tf_lite_quantization_1abf88d8c9d94c2788b69928e2727fd56b">type</a></code>
</td>
<td>
<div>
<code><a href="/lite/api_docs/c/group/common.html#group__common_1ga9a7dad0b2e1bc9afe44b055915cbddb8">TfLiteQuantizationType</a></code>
</div>
<div>The type of quantization held by params. </div>
</td>
</tr>
</table>
<h2>Public attributes</h2>
<div id="struct_tf_lite_quantization_1ab108c61c41594a7c51e727ace335d388">
<h3>params</h3>
<pre class="prettyprint">void * TfLiteQuantization::params</pre>
<div>
<p>Holds an optional reference to a quantization param structure. </p>
<p>The actual type depends on the value of the <code>type</code> field (see the comment there for the values and corresponding types). </p>
</div>
</div>
<div id="struct_tf_lite_quantization_1abf88d8c9d94c2788b69928e2727fd56b">
<h3>type</h3>
<pre class="prettyprint"><a href="/lite/api_docs/c/group/common.html#group__common_1ga9a7dad0b2e1bc9afe44b055915cbddb8">TfLiteQuantizationType</a> TfLiteQuantization::type</pre>
<div>
<p>The type of quantization held by params. </p>
</div>
</div>
</body>
</html>
@@ -0,0 +1,251 @@
<!DOCTYPE html>
<html devsite>
<head>
<title>TfLiteRegistration Struct Reference</title>
<meta name="page_type" value="reference" />
</head>
<body>
<div id="top"><!-- do not remove this div --></div>
<h1>TfLiteRegistration</h1>
<code>#include &lt;common.h&gt;</code>
<p><code><a href="/lite/api_docs/c/struct/tf-lite-registration.html#struct_tf_lite_registration">TfLiteRegistration</a></code> defines the implementation of an operation (a built-in op, custom op, or custom delegate kernel). </p>
<h2>Summary</h2>
<p>It is a struct containing "methods" (C function pointers) that will be invoked by the TF Lite runtime to evaluate instances of the operation.</p>
<p>See also <code>TfLiteRegistrationExternal</code> which is a more ABI-stable equivalent. </p>
<table class="properties responsive">
<tr>
<th colspan="2">
<h3>Public attributes</h3>
</th>
</tr>
<tr>
<td>
<code><a href="#struct_tf_lite_registration_1a1a98307d27c2ea9c39bcd4b48da2c4fa">async_kernel</a>)(TfLiteContext *context, TfLiteNode *node)</code>
</td>
<td>
<div>
<code>struct TfLiteAsyncKernel *(*</code>
</div>
<div>Retrieves asynchronous kernel. </div>
</td>
</tr>
<tr>
<td>
<code><a href="#struct_tf_lite_registration_1a1a87f0c20fb23deaa745c25a4e84a08f">builtin_code</a></code>
</td>
<td>
<div>
<code>int32_t</code>
</div>
<div>Builtin codes. </div>
</td>
</tr>
<tr>
<td>
<code><a href="#struct_tf_lite_registration_1aacbf4a103db7471e451428f409481c20">custom_name</a></code>
</td>
<td>
<div>
<code>const char *</code>
</div>
<div>Custom op name. </div>
</td>
</tr>
<tr>
<td>
<code><a href="#struct_tf_lite_registration_1acb0eef469a41aa024925e88d0486eca8">free</a>)(TfLiteContext *context, void *buffer)</code>
</td>
<td>
<div>
<code>void(*</code>
</div>
<div>The pointer <code>buffer</code> is the data previously returned by an init invocation. </div>
</td>
</tr>
<tr>
<td>
<code><a href="#struct_tf_lite_registration_1a93d4631a7edc80ef73cbebb579ab3a93">init</a>)(TfLiteContext *context, const char *buffer, size_t length)</code>
</td>
<td>
<div>
<code>void *(*</code>
</div>
<div>Initializes the op from serialized data. </div>
</td>
</tr>
<tr>
<td>
<code><a href="#struct_tf_lite_registration_1a343fad1f4d69c5007ec9da7f084b32d9">inplace_operator</a></code>
</td>
<td>
<div>
<code>uint64_t</code>
</div>
<div>Indicates if an operator's output may safely overwrite its inputs. </div>
</td>
</tr>
<tr>
<td>
<code><a href="#struct_tf_lite_registration_1aa146bb84a2c7c75d3590d8e556ddfb97">invoke</a>)(TfLiteContext *context, TfLiteNode *node)</code>
</td>
<td>
<div>
<code><a href="/lite/api_docs/c/group/c-api-types.html#group__c__api__types_1gacf79d2fb5fa520303014d1303f1f6361">TfLiteStatus</a>(*</code>
</div>
<div>Execute the node (should read <code>node->inputs</code> and output to <code>node->outputs</code>). </div>
</td>
</tr>
<tr>
<td>
<code><a href="#struct_tf_lite_registration_1a6ecffde4e6466f86aa8f28d25de553d7">prepare</a>)(TfLiteContext *context, TfLiteNode *node)</code>
</td>
<td>
<div>
<code><a href="/lite/api_docs/c/group/c-api-types.html#group__c__api__types_1gacf79d2fb5fa520303014d1303f1f6361">TfLiteStatus</a>(*</code>
</div>
<div>prepare is called when the inputs this node depends on have been resized. </div>
</td>
</tr>
<tr>
<td>
<code><a href="#struct_tf_lite_registration_1ae06b37ce1c0e8bd2445948fe68797b77">profiling_string</a>)(const TfLiteContext *context, const TfLiteNode *node)</code>
</td>
<td>
<div>
<code>const char *(*</code>
</div>
<div><code>profiling_string</code> is called during summarization of profiling information in order to group executions together. </div>
</td>
</tr>
<tr>
<td>
<code><a href="#struct_tf_lite_registration_1a37b871c080e442f44926c13564032438">registration_external</a></code>
</td>
<td>
<div>
<code><a href="/lite/api_docs/c/group/common.html#group__common_1gac0d70c820dfb7187a23e38e14deec7eb">TfLiteRegistrationExternal</a> *</code>
</div>
<div>The external version of <code><a href="/lite/api_docs/c/struct/tf-lite-registration.html#struct_tf_lite_registration">TfLiteRegistration</a></code>. </div>
</td>
</tr>
<tr>
<td>
<code><a href="#struct_tf_lite_registration_1a8b6739c5e206a0976db9bad12e150f86">version</a></code>
</td>
<td>
<div>
<code>int</code>
</div>
<div>The version of the op. </div>
</td>
</tr>
</table>
<h2>Public attributes</h2>
<div id="struct_tf_lite_registration_1a1a98307d27c2ea9c39bcd4b48da2c4fa">
<h3>async_kernel</h3>
<pre class="prettyprint">struct TfLiteAsyncKernel *(* TfLiteRegistration::async_kernel)(TfLiteContext *context, TfLiteNode *node)</pre>
<div>
<p>Retrieves asynchronous kernel. </p>
<p>If the <code>async_kernel</code> field is nullptr, it means the operation described by this <a href="/lite/api_docs/c/struct/tf-lite-registration.html#struct_tf_lite_registration">TfLiteRegistration</a> object does not support asynchronous execution. Otherwise, the function that the field points to should only be called for delegate kernel nodes, i.e. <code>node</code> should be a delegate kernel node created by applying a delegate. If the function returns nullptr, that means that the underlying delegate does not support asynchronous execution for this <code>node</code>. </p>
</div>
</div>
<div id="struct_tf_lite_registration_1a1a87f0c20fb23deaa745c25a4e84a08f">
<h3>builtin_code</h3>
<pre class="prettyprint">int32_t TfLiteRegistration::builtin_code</pre>
<div>
<p>Builtin codes. </p>
<p>If this kernel refers to a builtin this is the code of the builtin. This is so we can do marshaling to other frameworks like NN API.</p>
<p>Note: It is the responsibility of the registration binder to set this properly. </p>
</div>
</div>
<div id="struct_tf_lite_registration_1aacbf4a103db7471e451428f409481c20">
<h3>custom_name</h3>
<pre class="prettyprint">const char * TfLiteRegistration::custom_name</pre>
<div>
<p>Custom op name. </p>
<p>If the op is a builtin, this will be <code>null</code>.</p>
<p>Note: It is the responsibility of the registration binder to set this properly.</p>
<p>WARNING: This is an experimental interface that is subject to change. </p>
</div>
</div>
<div id="struct_tf_lite_registration_1acb0eef469a41aa024925e88d0486eca8">
<h3>free</h3>
<pre class="prettyprint">void(* TfLiteRegistration::free)(TfLiteContext *context, void *buffer)</pre>
<div>
<p>The pointer <code>buffer</code> is the data previously returned by an init invocation. </p>
</div>
</div>
<div id="struct_tf_lite_registration_1a93d4631a7edc80ef73cbebb579ab3a93">
<h3>init</h3>
<pre class="prettyprint">void *(* TfLiteRegistration::init)(TfLiteContext *context, const char *buffer, size_t length)</pre>
<div>
<p>Initializes the op from serialized data. </p>
<p>Called only <i>once</i> for the lifetime of the op, so any one-time allocations should be made here (unless they depend on tensor sizes).</p>
<p>
<ul>
<li>If a built-in op:<ul>
<li><code>buffer</code> is the op's params data (TfLiteLSTMParams*).</li>
<li><code>length</code> is zero.</li>
</ul></li>
<li>If custom op:<ul>
<li><code>buffer</code> is the op's <code>custom_options</code>.</li>
<li><code>length</code> is the size of the buffer.</li>
</ul></li>
</ul>
</p>
<p>Returns a type-punned (i.e. void*) opaque data (e.g. a primitive pointer or an instance of a struct).</p>
<p>The returned pointer will be stored with the node in the <code>user_data</code> field, accessible within prepare and invoke functions below.</p>
<p>NOTE: if the data is already in the desired format, simply implement this function to return <code>nullptr</code> and implement the free function to be a no-op. </p>
</div>
</div>
<div id="struct_tf_lite_registration_1a343fad1f4d69c5007ec9da7f084b32d9">
<h3>inplace_operator</h3>
<pre class="prettyprint">uint64_t TfLiteRegistration::inplace_operator</pre>
<div>
<p>Indicates if an operator's output may safely overwrite its inputs. </p>
<p>See the comments in <code>TfLiteInPlaceOp</code>. </p>
</div>
</div>
<div id="struct_tf_lite_registration_1aa146bb84a2c7c75d3590d8e556ddfb97">
<h3>invoke</h3>
<pre class="prettyprint"><a href="/lite/api_docs/c/group/c-api-types.html#group__c__api__types_1gacf79d2fb5fa520303014d1303f1f6361">TfLiteStatus</a>(* TfLiteRegistration::invoke)(TfLiteContext *context, TfLiteNode *node)</pre>
<div>
<p>Execute the node (should read <code>node->inputs</code> and output to <code>node->outputs</code>). </p>
<p>Returns <code>kTfLiteOk</code> on success. </p>
</div>
</div>
<div id="struct_tf_lite_registration_1a6ecffde4e6466f86aa8f28d25de553d7">
<h3>prepare</h3>
<pre class="prettyprint"><a href="/lite/api_docs/c/group/c-api-types.html#group__c__api__types_1gacf79d2fb5fa520303014d1303f1f6361">TfLiteStatus</a>(* TfLiteRegistration::prepare)(TfLiteContext *context, TfLiteNode *node)</pre>
<div>
<p>prepare is called when the inputs this node depends on have been resized. </p>
<p><code>context->ResizeTensor()</code> can be called to request output tensors to be resized. Can be called multiple times for the lifetime of the op.</p>
<p>Returns <code>kTfLiteOk</code> on success. </p>
</div>
</div>
<div id="struct_tf_lite_registration_1ae06b37ce1c0e8bd2445948fe68797b77">
<h3>profiling_string</h3>
<pre class="prettyprint">const char *(* TfLiteRegistration::profiling_string)(const TfLiteContext *context, const TfLiteNode *node)</pre>
<div>
<p><code>profiling_string</code> is called during summarization of profiling information in order to group executions together. </p>
<p>Providing a value here will cause a given op to appear multiple times is the profiling report. This is particularly useful for custom ops that can perform significantly different calculations depending on their <code>user-data</code>. </p>
</div>
</div>
<div id="struct_tf_lite_registration_1a37b871c080e442f44926c13564032438">
<h3>registration_external</h3>
<pre class="prettyprint"><a href="/lite/api_docs/c/group/common.html#group__common_1gac0d70c820dfb7187a23e38e14deec7eb">TfLiteRegistrationExternal</a> * TfLiteRegistration::registration_external</pre>
<div>
<p>The external version of <code><a href="/lite/api_docs/c/struct/tf-lite-registration.html#struct_tf_lite_registration">TfLiteRegistration</a></code>. </p>
<p>Since we can't use internal types (such as <code><a href="/lite/api_docs/c/struct/tf-lite-context.html#struct_tf_lite_context">TfLiteContext</a></code>) for C API to maintain ABI stability. C API user will provide <code>TfLiteRegistrationExternal</code> to implement custom ops. We keep it inside of <code><a href="/lite/api_docs/c/struct/tf-lite-registration.html#struct_tf_lite_registration">TfLiteRegistration</a></code> and use it to route callbacks properly. </p>
</div>
</div>
<div id="struct_tf_lite_registration_1a8b6739c5e206a0976db9bad12e150f86">
<h3>version</h3>
<pre class="prettyprint">int TfLiteRegistration::version</pre>
<div>
<p>The version of the op. </p>
<p>Note: It is the responsibility of the registration binder to set this properly. </p>
</div>
</div>
</body>
</html>
@@ -0,0 +1,83 @@
<!DOCTYPE html>
<html devsite>
<head>
<title>TfLiteSparsity Struct Reference</title>
<meta name="page_type" value="reference" />
</head>
<body>
<div id="top"><!-- do not remove this div --></div>
<h1>TfLiteSparsity</h1>
<code>#include &lt;common.h&gt;</code>
<p>Parameters used to encode a sparse tensor. </p>
<h2>Summary</h2>
<p>For detailed explanation of each field please refer to lite/schema/schema.fbs. </p>
<table class="properties responsive">
<tr>
<th colspan="2">
<h3>Public attributes</h3>
</th>
</tr>
<tr>
<td>
<code><a href="#struct_tf_lite_sparsity_1aa813b8553a1cb8a84d97c9cdd836f7bd">block_map</a></code>
</td>
<td>
<div>
<code><a href="/lite/api_docs/c/struct/tf-lite-int-array.html#struct_tf_lite_int_array">TfLiteIntArray</a> *</code>
</div>
</td>
</tr>
<tr>
<td>
<code><a href="#struct_tf_lite_sparsity_1a5258ee28546ec1c95fa1331cbeefdba7">dim_metadata</a></code>
</td>
<td>
<div>
<code><a href="/lite/api_docs/c/struct/tf-lite-dimension-metadata.html#struct_tf_lite_dimension_metadata">TfLiteDimensionMetadata</a> *</code>
</div>
</td>
</tr>
<tr>
<td>
<code><a href="#struct_tf_lite_sparsity_1a96145078d17f4bf14c291b5d5184592a">dim_metadata_size</a></code>
</td>
<td>
<div>
<code>int</code>
</div>
</td>
</tr>
<tr>
<td>
<code><a href="#struct_tf_lite_sparsity_1a5e0e873cd494e76954dc1d81bb23d259">traversal_order</a></code>
</td>
<td>
<div>
<code><a href="/lite/api_docs/c/struct/tf-lite-int-array.html#struct_tf_lite_int_array">TfLiteIntArray</a> *</code>
</div>
</td>
</tr>
</table>
<h2>Public attributes</h2>
<div id="struct_tf_lite_sparsity_1aa813b8553a1cb8a84d97c9cdd836f7bd">
<h3>block_map</h3>
<pre class="prettyprint"><a href="/lite/api_docs/c/struct/tf-lite-int-array.html#struct_tf_lite_int_array">TfLiteIntArray</a> * TfLiteSparsity::block_map</pre>
<div />
</div>
<div id="struct_tf_lite_sparsity_1a5258ee28546ec1c95fa1331cbeefdba7">
<h3>dim_metadata</h3>
<pre class="prettyprint"><a href="/lite/api_docs/c/struct/tf-lite-dimension-metadata.html#struct_tf_lite_dimension_metadata">TfLiteDimensionMetadata</a> * TfLiteSparsity::dim_metadata</pre>
<div />
</div>
<div id="struct_tf_lite_sparsity_1a96145078d17f4bf14c291b5d5184592a">
<h3>dim_metadata_size</h3>
<pre class="prettyprint">int TfLiteSparsity::dim_metadata_size</pre>
<div />
</div>
<div id="struct_tf_lite_sparsity_1a5e0e873cd494e76954dc1d81bb23d259">
<h3>traversal_order</h3>
<pre class="prettyprint"><a href="/lite/api_docs/c/struct/tf-lite-int-array.html#struct_tf_lite_int_array">TfLiteIntArray</a> * TfLiteSparsity::traversal_order</pre>
<div />
</div>
</body>
</html>
@@ -0,0 +1,305 @@
<!DOCTYPE html>
<html devsite>
<head>
<title>TfLiteTensor Struct Reference</title>
<meta name="page_type" value="reference" />
</head>
<body>
<div id="top"><!-- do not remove this div --></div>
<h1>TfLiteTensor</h1>
<code>#include &lt;common.h&gt;</code>
<p>A tensor in the interpreter system which is a wrapper around a buffer of data including a dimensionality (or NULL if not currently defined). </p>
<h2>Summary</h2>
<table class="properties responsive">
<tr>
<th colspan="2">
<h3>Public attributes</h3>
</th>
</tr>
<tr>
<td>
<code><a href="#struct_tf_lite_tensor_1ab5dcd15fd342f9365a599b37e7e5ee18">allocation</a></code>
</td>
<td>
<div>
<code>const void *</code>
</div>
<div>An opaque pointer to a tflite::MMapAllocation. </div>
</td>
</tr>
<tr>
<td>
<code><a href="#struct_tf_lite_tensor_1a4b21e89c9d432fcde19e5cecdcd18acf">allocation_type</a></code>
</td>
<td>
<div>
<code><a href="/lite/api_docs/c/group/common.html#group__common_1gae48332e93fec6c3fe7c4ee4897770d4b">TfLiteAllocationType</a></code>
</div>
<div>How memory is mapped kTfLiteMmapRo: Memory mapped read only. </div>
</td>
</tr>
<tr>
<td>
<code><a href="#struct_tf_lite_tensor_1a784b0cd1be5d43ea2292e75f6a15c11b">buffer_handle</a></code>
</td>
<td>
<div>
<code><a href="/lite/api_docs/c/group/common.html#group__common_1ga837e524d72cc15f4790178c2e7bf57e1">TfLiteBufferHandle</a></code>
</div>
<div>An integer buffer handle that can be handled by <code>delegate</code>. </div>
</td>
</tr>
<tr>
<td>
<code><a href="#struct_tf_lite_tensor_1a65082739eecbd6d52d7d339d43b87606">bytes</a></code>
</td>
<td>
<div>
<code>size_t</code>
</div>
<div>The number of bytes required to store the data of this Tensor. </div>
</td>
</tr>
<tr>
<td>
<code><a href="#struct_tf_lite_tensor_1a31678fd0752ef9e3b3debb11e7956fb0">data</a></code>
</td>
<td>
<div>
<code><a href="/lite/api_docs/c/union/tf-lite-ptr-union.html#union_tf_lite_ptr_union">TfLitePtrUnion</a></code>
</div>
<div>A union of data pointers. </div>
</td>
</tr>
<tr>
<td>
<code><a href="#struct_tf_lite_tensor_1abbb1c8fb4b382e3ffa1aec69f9a04619">data_is_stale</a></code>
</td>
<td>
<div>
<code>bool</code>
</div>
<div>If the delegate uses its own buffer (e.g. </div>
</td>
</tr>
<tr>
<td>
<code><a href="#struct_tf_lite_tensor_1a9491f4d29e4e8423cdc1861ac2a4eb74">delegate</a></code>
</td>
<td>
<div>
<code>struct <a href="/lite/api_docs/c/struct/tf-lite-delegate.html#struct_tf_lite_delegate">TfLiteDelegate</a> *</code>
</div>
<div>The delegate which knows how to handle <code>buffer_handle</code>. </div>
</td>
</tr>
<tr>
<td>
<code><a href="#struct_tf_lite_tensor_1a9826437410d81b21035c89847d526c81">dims</a></code>
</td>
<td>
<div>
<code><a href="/lite/api_docs/c/struct/tf-lite-int-array.html#struct_tf_lite_int_array">TfLiteIntArray</a> *</code>
</div>
<div>A pointer to a structure representing the dimensionality interpretation that the buffer should have. </div>
</td>
</tr>
<tr>
<td>
<code><a href="#struct_tf_lite_tensor_1ace0611c9e0f0683e5075e4b2768d96b8">dims_signature</a></code>
</td>
<td>
<div>
<code>const <a href="/lite/api_docs/c/struct/tf-lite-int-array.html#struct_tf_lite_int_array">TfLiteIntArray</a> *</code>
</div>
<div>Optional. </div>
</td>
</tr>
<tr>
<td>
<code><a href="#struct_tf_lite_tensor_1a39290cf2770c0eebc8bd63faf12dac2f">is_variable</a></code>
</td>
<td>
<div>
<code>bool</code>
</div>
<div>True if the tensor is a variable. </div>
</td>
</tr>
<tr>
<td>
<code><a href="#struct_tf_lite_tensor_1adb13df6dd8e7223f9b3abf318a034209">name</a></code>
</td>
<td>
<div>
<code>const char *</code>
</div>
<div>Null-terminated name of this tensor. </div>
</td>
</tr>
<tr>
<td>
<code><a href="#struct_tf_lite_tensor_1ad0fbad4e97f0be0a6e4bfa1b2be0e3fe">params</a></code>
</td>
<td>
<div>
<code><a href="/lite/api_docs/c/struct/tf-lite-quantization-params.html#struct_tf_lite_quantization_params">TfLiteQuantizationParams</a></code>
</div>
<div>Quantization information. </div>
</td>
</tr>
<tr>
<td>
<code><a href="#struct_tf_lite_tensor_1aa4efa609d9ad9c78c5f53a592020de9e">quantization</a></code>
</td>
<td>
<div>
<code><a href="/lite/api_docs/c/struct/tf-lite-quantization.html#struct_tf_lite_quantization">TfLiteQuantization</a></code>
</div>
<div>Quantization information. Replaces params field above. </div>
</td>
</tr>
<tr>
<td>
<code><a href="#struct_tf_lite_tensor_1a40010fa2bfbebd59bf060459d95b65c6">sparsity</a></code>
</td>
<td>
<div>
<code><a href="/lite/api_docs/c/struct/tf-lite-sparsity.html#struct_tf_lite_sparsity">TfLiteSparsity</a> *</code>
</div>
<div>Parameters used to encode a sparse tensor. </div>
</td>
</tr>
<tr>
<td>
<code><a href="#struct_tf_lite_tensor_1a24d579d439274a598ce79f0ec6bf6f50">type</a></code>
</td>
<td>
<div>
<code><a href="/lite/api_docs/c/group/c-api-types.html#group__c__api__types_1ga8a47ba81bdef28b5c479ee7928a7d123">TfLiteType</a></code>
</div>
<div>The data type specification for data stored in <code>data</code>. </div>
</td>
</tr>
</table>
<h2>Public attributes</h2>
<div id="struct_tf_lite_tensor_1ab5dcd15fd342f9365a599b37e7e5ee18">
<h3>allocation</h3>
<pre class="prettyprint">const void * TfLiteTensor::allocation</pre>
<div>
<p>An opaque pointer to a tflite::MMapAllocation. </p>
</div>
</div>
<div id="struct_tf_lite_tensor_1a4b21e89c9d432fcde19e5cecdcd18acf">
<h3>allocation_type</h3>
<pre class="prettyprint"><a href="/lite/api_docs/c/group/common.html#group__common_1gae48332e93fec6c3fe7c4ee4897770d4b">TfLiteAllocationType</a> TfLiteTensor::allocation_type</pre>
<div>
<p>How memory is mapped kTfLiteMmapRo: Memory mapped read only. </p>
<p>i.e. weights kTfLiteArenaRw: Arena allocated read write memory (i.e. temporaries, outputs). </p>
</div>
</div>
<div id="struct_tf_lite_tensor_1a784b0cd1be5d43ea2292e75f6a15c11b">
<h3>buffer_handle</h3>
<pre class="prettyprint"><a href="/lite/api_docs/c/group/common.html#group__common_1ga837e524d72cc15f4790178c2e7bf57e1">TfLiteBufferHandle</a> TfLiteTensor::buffer_handle</pre>
<div>
<p>An integer buffer handle that can be handled by <code>delegate</code>. </p>
<p>The value is valid only when delegate is not null.</p>
<p>WARNING: This is an experimental interface that is subject to change. </p>
</div>
</div>
<div id="struct_tf_lite_tensor_1a65082739eecbd6d52d7d339d43b87606">
<h3>bytes</h3>
<pre class="prettyprint">size_t TfLiteTensor::bytes</pre>
<div>
<p>The number of bytes required to store the data of this Tensor. </p>
<p>I.e. (bytes of each element) * dims[0] * ... * dims[n-1]. For example, if type is kTfLiteFloat32 and dims = {3, 2} then bytes = sizeof(float) * 3 * 2 = 4 * 3 * 2 = 24. </p>
</div>
</div>
<div id="struct_tf_lite_tensor_1a31678fd0752ef9e3b3debb11e7956fb0">
<h3>data</h3>
<pre class="prettyprint"><a href="/lite/api_docs/c/union/tf-lite-ptr-union.html#union_tf_lite_ptr_union">TfLitePtrUnion</a> TfLiteTensor::data</pre>
<div>
<p>A union of data pointers. </p>
<p>The appropriate type should be used for a typed tensor based on <code>type</code>. </p>
</div>
</div>
<div id="struct_tf_lite_tensor_1abbb1c8fb4b382e3ffa1aec69f9a04619">
<h3>data_is_stale</h3>
<pre class="prettyprint">bool TfLiteTensor::data_is_stale</pre>
<div>
<p>If the delegate uses its own buffer (e.g. </p>
<p>GPU memory), the delegate is responsible to set data_is_stale to true. <code>delegate->CopyFromBufferHandle</code> can be called to copy the data from delegate buffer.</p>
<p>WARNING: This is an experimental interface that is subject to change. </p>
</div>
</div>
<div id="struct_tf_lite_tensor_1a9491f4d29e4e8423cdc1861ac2a4eb74">
<h3>delegate</h3>
<pre class="prettyprint">struct <a href="/lite/api_docs/c/struct/tf-lite-delegate.html#struct_tf_lite_delegate">TfLiteDelegate</a> * TfLiteTensor::delegate</pre>
<div>
<p>The delegate which knows how to handle <code>buffer_handle</code>. </p>
<p>WARNING: This is an experimental interface that is subject to change. </p>
</div>
</div>
<div id="struct_tf_lite_tensor_1a9826437410d81b21035c89847d526c81">
<h3>dims</h3>
<pre class="prettyprint"><a href="/lite/api_docs/c/struct/tf-lite-int-array.html#struct_tf_lite_int_array">TfLiteIntArray</a> * TfLiteTensor::dims</pre>
<div>
<p>A pointer to a structure representing the dimensionality interpretation that the buffer should have. </p>
<p>NOTE: the product of elements of <code>dims</code> and the element datatype size should be equal to <code>bytes</code> below. </p>
</div>
</div>
<div id="struct_tf_lite_tensor_1ace0611c9e0f0683e5075e4b2768d96b8">
<h3>dims_signature</h3>
<pre class="prettyprint">const <a href="/lite/api_docs/c/struct/tf-lite-int-array.html#struct_tf_lite_int_array">TfLiteIntArray</a> * TfLiteTensor::dims_signature</pre>
<div>
<p>Optional. </p>
<p>Encodes shapes with unknown dimensions with -1. This field is only populated when unknown dimensions exist in a read-write tensor (i.e. an input or output tensor). (e.g. <code>dims</code> contains [1, 1, 1, 3] and <code>dims_signature</code> contains [1, -1, -1, 3]). If no unknown dimensions exist then <code>dims_signature</code> is either null, or set to an empty array. Note that this field only exists when TF_LITE_STATIC_MEMORY is not defined. </p>
</div>
</div>
<div id="struct_tf_lite_tensor_1a39290cf2770c0eebc8bd63faf12dac2f">
<h3>is_variable</h3>
<pre class="prettyprint">bool TfLiteTensor::is_variable</pre>
<div>
<p>True if the tensor is a variable. </p>
</div>
</div>
<div id="struct_tf_lite_tensor_1adb13df6dd8e7223f9b3abf318a034209">
<h3>name</h3>
<pre class="prettyprint">const char * TfLiteTensor::name</pre>
<div>
<p>Null-terminated name of this tensor. </p>
</div>
</div>
<div id="struct_tf_lite_tensor_1ad0fbad4e97f0be0a6e4bfa1b2be0e3fe">
<h3>params</h3>
<pre class="prettyprint"><a href="/lite/api_docs/c/struct/tf-lite-quantization-params.html#struct_tf_lite_quantization_params">TfLiteQuantizationParams</a> TfLiteTensor::params</pre>
<div>
<p>Quantization information. </p>
</div>
</div>
<div id="struct_tf_lite_tensor_1aa4efa609d9ad9c78c5f53a592020de9e">
<h3>quantization</h3>
<pre class="prettyprint"><a href="/lite/api_docs/c/struct/tf-lite-quantization.html#struct_tf_lite_quantization">TfLiteQuantization</a> TfLiteTensor::quantization</pre>
<div>
<p>Quantization information. Replaces params field above. </p>
</div>
</div>
<div id="struct_tf_lite_tensor_1a40010fa2bfbebd59bf060459d95b65c6">
<h3>sparsity</h3>
<pre class="prettyprint"><a href="/lite/api_docs/c/struct/tf-lite-sparsity.html#struct_tf_lite_sparsity">TfLiteSparsity</a> * TfLiteTensor::sparsity</pre>
<div>
<p>Parameters used to encode a sparse tensor. </p>
<p>This is optional. The field is NULL if a tensor is dense.</p>
<p>WARNING: This is an experimental interface that is subject to change. </p>
</div>
</div>
<div id="struct_tf_lite_tensor_1a24d579d439274a598ce79f0ec6bf6f50">
<h3>type</h3>
<pre class="prettyprint"><a href="/lite/api_docs/c/group/c-api-types.html#group__c__api__types_1ga8a47ba81bdef28b5c479ee7928a7d123">TfLiteType</a> TfLiteTensor::type</pre>
<div>
<p>The data type specification for data stored in <code>data</code>. </p>
<p>This affects what member of <code>data</code> union should be used. </p>
</div>
</div>
</body>
</html>
@@ -0,0 +1,281 @@
<!DOCTYPE html>
<html devsite>
<head>
<title>TfLitePtrUnion Union Reference</title>
<meta name="page_type" value="reference" />
</head>
<body>
<div id="top"><!-- do not remove this div --></div>
<h1>TfLitePtrUnion</h1>
<code>#include &lt;common.h&gt;</code>
<p>A union of pointers that points to memory for a given tensor. </p>
<h2>Summary</h2>
<p>Do not access these members directly, if possible, use <code>GetTensorData<TYPE>(tensor)</code> instead, otherwise only access <code>.data</code>, as other members are deprecated. </p>
<table class="properties responsive">
<tr>
<th colspan="2">
<h3>Public attributes</h3>
</th>
</tr>
<tr>
<td>
<code><a href="#union_tf_lite_ptr_union_1a0a529d9e09c05b17faffd61c07c52a54">b</a></code>
</td>
<td>
<div>
<code>bool *</code>
</div>
</td>
</tr>
<tr>
<td>
<code><a href="#union_tf_lite_ptr_union_1aae61e795a0c8d7e2b29ce2b03a0efa69">c128</a></code>
</td>
<td>
<div>
<code><a href="/lite/api_docs/c/struct/tf-lite-complex128.html#struct_tf_lite_complex128">TfLiteComplex128</a> *</code>
</div>
</td>
</tr>
<tr>
<td>
<code><a href="#union_tf_lite_ptr_union_1acc593362cafcbd03b15b6260738d7af8">c64</a></code>
</td>
<td>
<div>
<code><a href="/lite/api_docs/c/struct/tf-lite-complex64.html#struct_tf_lite_complex64">TfLiteComplex64</a> *</code>
</div>
</td>
</tr>
<tr>
<td>
<code><a href="#union_tf_lite_ptr_union_1a2045bb9cf02ac8b80a586f29b18d851b">data</a></code>
</td>
<td>
<div>
<code>void *</code>
</div>
<div>Only use this member. </div>
</td>
</tr>
<tr>
<td>
<code><a href="#union_tf_lite_ptr_union_1ac8eb9281e0894ebe40a4c29765148bbb">f</a></code>
</td>
<td>
<div>
<code>float *</code>
</div>
</td>
</tr>
<tr>
<td>
<code><a href="#union_tf_lite_ptr_union_1a6360d848024571a502534aebfc266ea8">f16</a></code>
</td>
<td>
<div>
<code><a href="/lite/api_docs/c/struct/tf-lite-float16.html#struct_tf_lite_float16">TfLiteFloat16</a> *</code>
</div>
</td>
</tr>
<tr>
<td>
<code><a href="#union_tf_lite_ptr_union_1a866c09d481a90345f8f2ebe0d748d300">f64</a></code>
</td>
<td>
<div>
<code>double *</code>
</div>
</td>
</tr>
<tr>
<td>
<code><a href="#union_tf_lite_ptr_union_1af53e67413285f91aabf2c8420a11a52a">i16</a></code>
</td>
<td>
<div>
<code>int16_t *</code>
</div>
</td>
</tr>
<tr>
<td>
<code><a href="#union_tf_lite_ptr_union_1a2601f170ecd1335ea8211f98b5e46a9c">i32</a></code>
</td>
<td>
<div>
<code>int32_t *</code>
</div>
</td>
</tr>
<tr>
<td>
<code><a href="#union_tf_lite_ptr_union_1af45bc91e8569cba73447247e1e210970">i64</a></code>
</td>
<td>
<div>
<code>int64_t *</code>
</div>
</td>
</tr>
<tr>
<td>
<code><a href="#union_tf_lite_ptr_union_1a0bf74439fb3aa2e1ff978f90ae6e9763">int8</a></code>
</td>
<td>
<div>
<code>int8_t *</code>
</div>
</td>
</tr>
<tr>
<td>
<code><a href="#union_tf_lite_ptr_union_1a6941a989f073e07710ec823a3424f57d">raw</a></code>
</td>
<td>
<div>
<code>char *</code>
</div>
</td>
</tr>
<tr>
<td>
<code><a href="#union_tf_lite_ptr_union_1af381b6358aafa90f8d3bd75f2ec82b3b">raw_const</a></code>
</td>
<td>
<div>
<code>const char *</code>
</div>
</td>
</tr>
<tr>
<td>
<code><a href="#union_tf_lite_ptr_union_1ac578fa5886fce9c561cee5030302347f">u32</a></code>
</td>
<td>
<div>
<code>uint32_t *</code>
</div>
</td>
</tr>
<tr>
<td>
<code><a href="#union_tf_lite_ptr_union_1a7d20a91fbed9d53b44ecbc9aced1633f">u64</a></code>
</td>
<td>
<div>
<code>uint64_t *</code>
</div>
</td>
</tr>
<tr>
<td>
<code><a href="#union_tf_lite_ptr_union_1a44ea6c217261de811235f7e72ebb6de6">ui16</a></code>
</td>
<td>
<div>
<code>uint16_t *</code>
</div>
</td>
</tr>
<tr>
<td>
<code><a href="#union_tf_lite_ptr_union_1add4c13ab4a368f46181e9ff84341b389">uint8</a></code>
</td>
<td>
<div>
<code>uint8_t *</code>
</div>
</td>
</tr>
</table>
<h2>Public attributes</h2>
<div id="union_tf_lite_ptr_union_1a0a529d9e09c05b17faffd61c07c52a54">
<h3>b</h3>
<pre class="prettyprint">bool * b</pre>
<div />
</div>
<div id="union_tf_lite_ptr_union_1aae61e795a0c8d7e2b29ce2b03a0efa69">
<h3>c128</h3>
<pre class="prettyprint"><a href="/lite/api_docs/c/struct/tf-lite-complex128.html#struct_tf_lite_complex128">TfLiteComplex128</a> * c128</pre>
<div />
</div>
<div id="union_tf_lite_ptr_union_1acc593362cafcbd03b15b6260738d7af8">
<h3>c64</h3>
<pre class="prettyprint"><a href="/lite/api_docs/c/struct/tf-lite-complex64.html#struct_tf_lite_complex64">TfLiteComplex64</a> * c64</pre>
<div />
</div>
<div id="union_tf_lite_ptr_union_1a2045bb9cf02ac8b80a586f29b18d851b">
<h3>data</h3>
<pre class="prettyprint">void * data</pre>
<div>
<p>Only use this member. </p>
</div>
</div>
<div id="union_tf_lite_ptr_union_1ac8eb9281e0894ebe40a4c29765148bbb">
<h3>f</h3>
<pre class="prettyprint">float * f</pre>
<div />
</div>
<div id="union_tf_lite_ptr_union_1a6360d848024571a502534aebfc266ea8">
<h3>f16</h3>
<pre class="prettyprint"><a href="/lite/api_docs/c/struct/tf-lite-float16.html#struct_tf_lite_float16">TfLiteFloat16</a> * f16</pre>
<div />
</div>
<div id="union_tf_lite_ptr_union_1a866c09d481a90345f8f2ebe0d748d300">
<h3>f64</h3>
<pre class="prettyprint">double * f64</pre>
<div />
</div>
<div id="union_tf_lite_ptr_union_1af53e67413285f91aabf2c8420a11a52a">
<h3>i16</h3>
<pre class="prettyprint">int16_t * i16</pre>
<div />
</div>
<div id="union_tf_lite_ptr_union_1a2601f170ecd1335ea8211f98b5e46a9c">
<h3>i32</h3>
<pre class="prettyprint">int32_t * i32</pre>
<div />
</div>
<div id="union_tf_lite_ptr_union_1af45bc91e8569cba73447247e1e210970">
<h3>i64</h3>
<pre class="prettyprint">int64_t * i64</pre>
<div />
</div>
<div id="union_tf_lite_ptr_union_1a0bf74439fb3aa2e1ff978f90ae6e9763">
<h3>int8</h3>
<pre class="prettyprint">int8_t * int8</pre>
<div />
</div>
<div id="union_tf_lite_ptr_union_1a6941a989f073e07710ec823a3424f57d">
<h3>raw</h3>
<pre class="prettyprint">char * raw</pre>
<div />
</div>
<div id="union_tf_lite_ptr_union_1af381b6358aafa90f8d3bd75f2ec82b3b">
<h3>raw_const</h3>
<pre class="prettyprint">const char * raw_const</pre>
<div />
</div>
<div id="union_tf_lite_ptr_union_1ac578fa5886fce9c561cee5030302347f">
<h3>u32</h3>
<pre class="prettyprint">uint32_t * u32</pre>
<div />
</div>
<div id="union_tf_lite_ptr_union_1a7d20a91fbed9d53b44ecbc9aced1633f">
<h3>u64</h3>
<pre class="prettyprint">uint64_t * u64</pre>
<div />
</div>
<div id="union_tf_lite_ptr_union_1a44ea6c217261de811235f7e72ebb6de6">
<h3>ui16</h3>
<pre class="prettyprint">uint16_t * ui16</pre>
<div />
</div>
<div id="union_tf_lite_ptr_union_1add4c13ab4a368f46181e9ff84341b389">
<h3>uint8</h3>
<pre class="prettyprint">uint8_t * uint8</pre>
<div />
</div>
</body>
</html>