Skip to content

Commit

Permalink
feat: Upgrade TensorFlow Lite to latest (#21)
Browse files Browse the repository at this point in the history
* Update build-tensorflow-ios.sh

* Update TensorFlowLite to latest

* Revert "Update build-tensorflow-ios.sh"

This reverts commit 832f11a.

* Update build-tensorflow-ios.sh

* Update build-tensorflow-ios.sh

* Update
  • Loading branch information
mrousavy committed Jan 19, 2024
1 parent d91daa3 commit 5938310
Show file tree
Hide file tree
Showing 8 changed files with 72 additions and 39 deletions.
2 changes: 2 additions & 0 deletions ios/TensorFlowLiteC.framework/Headers/c_api_experimental.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ limitations under the License.
#ifndef TENSORFLOW_LITE_CORE_C_C_API_EXPERIMENTAL_H_
#define TENSORFLOW_LITE_CORE_C_C_API_EXPERIMENTAL_H_

#include <stdint.h>

#include "builtin_ops.h"
#include "c_api_types.h"
#include "c_api.h"
Expand Down
39 changes: 39 additions & 0 deletions ios/TensorFlowLiteC.framework/Headers/c_api_opaque.h
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,11 @@ TfLiteOpaqueTensorBuilder* TfLiteOpaqueTensorBuilderSetQuantizationParams(
TfLiteOpaqueTensorBuilder* TfLiteOpaqueTensorBuilderSetQuantization(
TfLiteOpaqueTensorBuilder* builder, TfLiteQuantization quantization);

/// Sets the allocation type of the provided 'tensor' to 'kTfLiteDynamic'.
/// This function has no effect if the 'tensor's allocation type is already
/// 'kTfLiteDynamic'. The provided 'tensor' must not be null.
void TfLiteOpaqueTensorSetAllocationTypeToDynamic(TfLiteOpaqueTensor* tensor);

// --------------------------------------------------------------------------
// Accessors for TfLiteOpaqueNode.

Expand Down Expand Up @@ -770,6 +775,40 @@ void TfLiteOpaqueContextReportErrorVa(
} while (0)
#endif

#ifndef TF_LITE_STATIC_MEMORY
/// Creates an opaque delegate and returns its address. The opaque delegate
/// will behave according to the provided `opaque_delegate_builder`. The
/// lifetime of the objects pointed to by any of the fields within the
/// `opaque_delegate_builder` must outlive the returned
/// `TfLiteOpaqueDelegate` and any `TfLiteInterpreter`,
/// `TfLiteInterpreterOptions`, `tflite::Interpreter`, or
/// `tflite::InterpreterBuilder` that the delegate is added to. The returned
/// address should be passed to `TfLiteOpaqueDelegateDelete` for deletion. If
/// `opaque_delegate_builder` is a null pointer, then a null pointer will be
/// returned.
TfLiteOpaqueDelegate* TfLiteOpaqueDelegateCreate(
const TfLiteOpaqueDelegateBuilder* opaque_delegate_builder);

/// Deletes the provided opaque `delegate`. This function has no effect if the
/// `delegate` is a null pointer.
void TfLiteOpaqueDelegateDelete(TfLiteOpaqueDelegate* delegate);
#endif // TF_LITE_STATIC_MEMORY

/// Returns a pointer to the data associated with the provided opaque
/// `delegate`.
///
/// A null pointer will be returned when:
/// - The `delegate` is null.
/// - The `data` field of the `TfLiteOpaqueDelegateBuilder` used to construct
/// the `delegate` was null.
/// - Or in case of any other error.
/// - The `delegate` has been constructed via a `TfLiteOpaqueDelegateBuilder`,
/// but the `data` field of the `TfLiteOpaqueDelegateBuilder` is null.
///
/// The data_ field of `delegate` will be returned if the
/// `opaque_delegate_builder` field is null.
void* TfLiteOpaqueDelegateGetData(const TfLiteOpaqueDelegate* delegate);

#ifdef __cplusplus
} // extern "C"
#endif // __cplusplus
Expand Down

0 comments on commit 5938310

Please sign in to comment.