Skip to content

Commit

Permalink
Merge pull request asus4#322 from asus4/build-v2.14.0
Browse files Browse the repository at this point in the history
Build v2.14.0
  • Loading branch information
asus4 authored Nov 24, 2023
2 parents df752d9 + 3d0ebfb commit c32972f
Show file tree
Hide file tree
Showing 34 changed files with 1,222 additions and 280 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ parameters:
default: "git@github.com:tensorflow/tensorflow.git"
tf-branch:
type: string
default: "v2.13.0"
default: "v2.14.0"

jobs:
build-mac:
Expand Down
4 changes: 2 additions & 2 deletions Packages/com.github.asus4.tflite/Plugins/Android/arm64-v8a/libtensorflowlite_gpu_gl.so
100755 → 100644
Git LFS file not shown
4 changes: 2 additions & 2 deletions Packages/com.github.asus4.tflite/Plugins/Android/armeabi-v7a/libtensorflowlite_gpu_gl.so
100755 → 100644
Git LFS file not shown
4 changes: 2 additions & 2 deletions Packages/com.github.asus4.tflite/Plugins/Android/tensorflow-lite-gpu.aar
100755 → 100644
Git LFS file not shown
4 changes: 2 additions & 2 deletions Packages/com.github.asus4.tflite/Plugins/Android/tensorflow-lite.aar
100755 → 100644
Git LFS file not shown
4 changes: 2 additions & 2 deletions Packages/com.github.asus4.tflite/Plugins/Linux/arm64/libtensorflowlite_c.so
100755 → 100644
Git LFS file not shown
4 changes: 2 additions & 2 deletions Packages/com.github.asus4.tflite/Plugins/Linux/x86_64/libtensorflowlite_c.so
100755 → 100644
Git LFS file not shown
Git LFS file not shown
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
#import <TensorFlowLiteC/builtin_ops.h>
#import <TensorFlowLiteC/c_api.h>
#import <TensorFlowLiteC/c_api_experimental.h>
#import <TensorFlowLiteC/c_api_opaque.h>
#import <TensorFlowLiteC/c_api_types.h>
#import <TensorFlowLiteC/common.h>
#import <TensorFlowLiteC/profiler.h>
#import <TensorFlowLiteC/registration_external.h>
#import <TensorFlowLiteC/telemetry_setting.h>
#import <TensorFlowLiteC/types.h>
#import <TensorFlowLiteC/xnnpack_delegate.h>
Empty file.
117 changes: 14 additions & 103 deletions Packages/com.github.asus4.tflite/Plugins/iOS/TensorFlowLiteC.framework/Headers/c_api.h
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@ 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.
==============================================================================*/
/// \warning Users of TensorFlow Lite should not include this file directly,
/// but should instead include "third_party/tensorflow/lite/c/c_api.h".
/// Only the TensorFlow Lite implementation itself should include this
/// file directly.
// \warning Note: Users of TensorFlow Lite should not include this file
// directly, but should instead include
// "third_party/tensorflow/lite/c/c_api.h". Only the TensorFlow Lite
// implementation itself should include this
// file directly.

#ifndef TENSORFLOW_LITE_CORE_C_C_API_H_
#define TENSORFLOW_LITE_CORE_C_C_API_H_

Expand All @@ -27,10 +29,9 @@ limitations under the License.
#include "builtin_ops.h"
#include "types.h"
#include "c_api_types.h" // IWYU pragma: export
#include "registration_external.h" // IWYU pragma: export

// --------------------------------------------------------------------------
/// \file
/// C API for TensorFlow Lite.
/// C API for TensorFlow Lite:
///
/// The API leans towards simplicity and uniformity instead of convenience, as
/// most usage will be by language-specific wrappers. It provides largely the
Expand Down Expand Up @@ -74,13 +75,16 @@ limitations under the License.
/// TfLiteInterpreterDelete(interpreter);
/// TfLiteInterpreterOptionsDelete(options);
/// TfLiteModelDelete(model);
///
/// </code></pre>

#ifdef __cplusplus
extern "C" {
#endif // __cplusplus

/** \addtogroup c_api tensorflow/lite/c/c_api.h
* @{
*/

// This header should be valid in both C (e.g. C99) and C++,
// so 'void' in parameters is not redundant.
// NOLINTBEGIN(modernize-redundant-void-arg)
Expand All @@ -101,11 +105,6 @@ typedef struct TfLiteInterpreter TfLiteInterpreter;
/// data including a dimensionality (or NULL if not currently defined).
typedef struct TfLiteTensor TfLiteTensor;

/// TfLiteRegistrationExternal is an external version of TfLiteRegistration to
/// use custom op registration API.
/// \warning This is an experimental type and subject to change.
typedef struct TfLiteRegistrationExternal TfLiteRegistrationExternal;

// --------------------------------------------------------------------------
/// The TensorFlow Lite Runtime version.
///
Expand Down Expand Up @@ -467,98 +466,10 @@ TFL_CAPI_EXPORT extern TfLiteStatus TfLiteTensorCopyToBuffer(
const TfLiteTensor* output_tensor, void* output_data,
size_t output_data_size);

/// Returns a new TfLiteRegistrationExternal instance.
///
/// \note The caller retains ownership and should ensure that
/// the lifetime of the `TfLiteRegistrationExternal` must be at least as long as
/// the lifetime of the `TfLiteInterpreter`.
/// \warning This is an experimental API and subject to change.
TFL_CAPI_EXPORT extern TfLiteRegistrationExternal*
TfLiteRegistrationExternalCreate(TfLiteBuiltinOperator builtin_code,
const char* custom_name, int version);

/// Return the builtin op code of the provided external 'registration'.
///
/// \warning This is an experimental API and subject to change.
TFL_CAPI_EXPORT extern TfLiteBuiltinOperator
TfLiteRegistrationExternalGetBuiltInCode(
const TfLiteRegistrationExternal* registration);

/// Return the OP version of the provided external 'registration'. Return -1
/// in case of error, or if the provided address is null.
///
/// \warning This is an experimental API and subject to change.
TFL_CAPI_EXPORT extern int TfLiteRegistrationExternalGetVersion(
const TfLiteRegistrationExternal* registration);

/// Returns the custom name of the provided 'registration'. The returned pointer
/// will be non-null iff the op is a custom op.
///
/// \warning This is an experimental API and subject to change.
TFL_CAPI_EXPORT extern const char* TfLiteRegistrationExternalGetCustomName(
const TfLiteRegistrationExternal* registration);

/// Destroys the TfLiteRegistrationExternal instance.
/// \warning This is an experimental API and subject to change.
TFL_CAPI_EXPORT extern void TfLiteRegistrationExternalDelete(
TfLiteRegistrationExternal* registration);

/// Sets the initialization callback for the registration.
///
/// The callback is called to initialize the op from serialized data.
/// Please refer `init` of `TfLiteRegistration` for the detail.
/// \warning This is an experimental API and subject to change.
TFL_CAPI_EXPORT extern void TfLiteRegistrationExternalSetInit(
TfLiteRegistrationExternal* registration,
void* (*init)(TfLiteOpaqueContext* context, const char* buffer,
size_t length));

/// Sets the deallocation callback for the registration.
///
/// This callback is called to deallocate the data returned by the init
/// callback. The value passed in the `data` parameter is the value that was
/// returned by the `init` callback.
/// Please refer `free` of `TfLiteRegistration` for the detail.
/// \warning This is an experimental API and subject to change.
TFL_CAPI_EXPORT extern void TfLiteRegistrationExternalSetFree(
TfLiteRegistrationExternal* registration,
void (*free)(TfLiteOpaqueContext* context, void* data));

/// Sets the preparation callback for the registration.
///
/// The callback is called when the inputs of operator have been resized.
/// Please refer `prepare` of `TfLiteRegistration` for the detail.
/// \warning This is an experimental API and subject to change.
TFL_CAPI_EXPORT extern void TfLiteRegistrationExternalSetPrepare(
TfLiteRegistrationExternal* registration,
TfLiteStatus (*prepare)(TfLiteOpaqueContext* context,
TfLiteOpaqueNode* node));

/// Sets the invocation callback for the registration.
///
/// The callback is called when the operator is executed.
/// Please refer `invoke` of `TfLiteRegistration` for the detail.
/// \warning This is an experimental API and subject to change.
TFL_CAPI_EXPORT extern void TfLiteRegistrationExternalSetInvoke(
TfLiteRegistrationExternal* registration,
TfLiteStatus (*invoke)(TfLiteOpaqueContext* context,
TfLiteOpaqueNode* node));

/// Sets the async kernel accessor callback for the registration.
///
/// The callback is called to retrieve the async kernel if the delegate supports
/// it. If the delegate does not support async execution, either this function
/// should not be called, or `async_kernel` needs to be nullptr.
/// `node` is the delegate TfLiteNode created by `ModifyGraphWithDelegate`.
/// Please refer `async_kernel` of `TfLiteRegistration` for the detail.
/// \warning This is an experimental API and subject to change.
TFL_CAPI_EXPORT extern void TfLiteRegistrationExternalSetAsyncKernel(
TfLiteRegistrationExternal* registration,
TfLiteAsyncKernel* (*async_kernel)(TfLiteOpaqueContext* context,
TfLiteOpaqueNode* node));

// NOLINTEND(modernize-redundant-void-arg)

/** @} */

#ifdef __cplusplus
} // extern "C"
#endif // __cplusplus
Expand Down
48 changes: 48 additions & 0 deletions ...om.github.asus4.tflite/Plugins/iOS/TensorFlowLiteC.framework/Headers/c_api_experimental.h
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ TFL_CAPI_EXPORT void TfLiteInterpreterOptionsAddCustomOp(
/// The `TfLiteInterpreterOptionsSetOpResolverExternal` function provides an
/// alternative method for registering builtin ops and/or custom ops, by
/// providing operator resolver callbacks. Unlike using
/// `TfLiteInterpreterOptionsAddRegistrationExternal`,
/// `TfLiteInterpreterOptionsAddBuiltinOp` and/or
/// `TfLiteInterpreterOptionsAddAddCustomOp`, these let you register all the
/// operators in a single call.
Expand All @@ -112,6 +113,10 @@ TFL_CAPI_EXPORT void TfLiteInterpreterOptionsAddCustomOp(
/// If `op_resolver_user_data` is non-null, its lifetime must be at least as
/// long as the lifetime of the `TfLiteInterpreterOptions`.
///
/// The TfLiteRegistrationExternal objects whose addresses are returned by
/// `find_builtin_op` and `find_custom_op` must outlive both the
/// InterpreterOptions object and any Interpreter object created from it.
///
/// WARNING: This is an experimental API and subject to change.
void TfLiteInterpreterOptionsSetOpResolverExternal(
TfLiteInterpreterOptions* options,
Expand All @@ -122,6 +127,34 @@ void TfLiteInterpreterOptionsSetOpResolverExternal(
int version),
void* op_resolver_user_data);

/// \private
/// Registers callbacks for resolving builtin or custom operators.
///
/// This combines the effects of TfLiteInterpreterOptionsSetOpResolverExternal
/// and TfLiteInterpreterOptionsSetOpResolver. The callbacks that return
/// TfLiteRegistrationExternal will be called first, but if they return a
/// TfLiteRegistrationExternal object that has no methods set, then
/// the callbacks that return a TfLiteRegistration will be called to get
/// the methods.
///
/// WARNING: This function is experimental and subject to change.
///
/// WARNING: This function is not an official part of the API,
/// and should not be used by apps. It is intended for use only from
/// TF Lite itself.
void TfLiteInterpreterOptionsSetOpResolverExternalWithFallback(
TfLiteInterpreterOptions* options,
const TfLiteRegistrationExternal* (*find_builtin_op_external)(
void* user_data, int op, int version),
const TfLiteRegistrationExternal* (*find_custom_op_external)(
void* user_data, const char* custom_op, int version),
const TfLiteRegistration* (*find_builtin_op)(void* user_data,
TfLiteBuiltinOperator op,
int version),
const TfLiteRegistration* (*find_custom_op)(void* user_data, const char* op,
int version),
void* op_resolver_user_data);

/// Registers callbacks for resolving builtin or custom operators.
///
/// The `TfLiteInterpreterOptionsSetOpResolver` function provides an alternative
Expand Down Expand Up @@ -150,6 +183,21 @@ void TfLiteInterpreterOptionsSetOpResolver(
int version),
void* op_resolver_user_data);

/// \private
/// Backward-compat version of TfLiteInterpreterOptionsSetOpResolver.
///
/// WARNING: This function is deprecated / not an official part of the API, is
/// only for binary backwards compatibility, and should not be called.
void TfLiteInterpreterOptionsSetOpResolverV3(
TfLiteInterpreterOptions* options,
const TfLiteRegistration_V3* (*find_builtin_op_v3)(void* user_data,
TfLiteBuiltinOperator op,
int version),
const TfLiteRegistration_V3* (*find_custom_op_v3)(void* user_data,
const char* op,
int version),
void* op_resolver_user_data);

/// \private
/// Backward-compat version of TfLiteInterpreterOptionsSetOpResolver.
///
Expand Down
Loading

0 comments on commit c32972f

Please sign in to comment.