Updates the TensorFlow Lite podspecs.
PiperOrigin-RevId: 240591671
This commit is contained in:
parent
047abbc428
commit
e29d0968f4
@ -13,7 +13,6 @@ load(
|
||||
"//tensorflow/lite:build_def.bzl",
|
||||
"tflite_cc_shared_object",
|
||||
"tflite_copts",
|
||||
"tflite_jni_binary",
|
||||
)
|
||||
|
||||
tflite_cc_shared_object(
|
||||
@ -39,22 +38,28 @@ tflite_cc_shared_object(
|
||||
|
||||
cc_library(
|
||||
name = "c_api_internal",
|
||||
srcs = ["c_api.h"],
|
||||
srcs = [
|
||||
"c_api.h",
|
||||
"c_api_types.h",
|
||||
],
|
||||
hdrs = ["c_api_internal.h"],
|
||||
copts = tflite_copts(),
|
||||
visibility = [
|
||||
"//tensorflow/lite/experimental/c:__subpackages__",
|
||||
],
|
||||
deps = [
|
||||
"//tensorflow/lite:context",
|
||||
"//tensorflow/lite:framework",
|
||||
"//tensorflow/lite/c:c_api_internal",
|
||||
],
|
||||
)
|
||||
|
||||
cc_library(
|
||||
name = "c_api",
|
||||
srcs = ["c_api.cc"],
|
||||
hdrs = ["c_api.h"],
|
||||
hdrs = [
|
||||
"c_api.h",
|
||||
"c_api_types.h",
|
||||
],
|
||||
copts = tflite_copts(),
|
||||
tags = ["swift_module=TensorFlowLiteC"],
|
||||
visibility = [
|
||||
@ -62,9 +67,9 @@ cc_library(
|
||||
],
|
||||
deps = [
|
||||
":c_api_internal",
|
||||
"//tensorflow/lite:context",
|
||||
"//tensorflow/lite:framework",
|
||||
"//tensorflow/lite:version",
|
||||
"//tensorflow/lite/c:c_api_internal",
|
||||
"//tensorflow/lite/kernels:builtin_ops",
|
||||
],
|
||||
)
|
||||
@ -91,7 +96,7 @@ cc_test(
|
||||
],
|
||||
deps = [
|
||||
":c_api",
|
||||
"//tensorflow/lite:context",
|
||||
"//tensorflow/lite/c:c_api_internal",
|
||||
"//tensorflow/lite/testing:util",
|
||||
"@com_google_googletest//:gtest",
|
||||
],
|
||||
|
@ -2,9 +2,9 @@
|
||||
#
|
||||
# Add the build rules below to `//tensorflow/lite/experimental/c/BUILD`.
|
||||
# Build the framework:
|
||||
# bazel build tensorflow/lite/experimental/c:TensorFlowLiteC_framework -c opt --ios_multi_cpus=x86_64,armv7,arm64
|
||||
# bazel build tensorflow/lite/experimental/c:TensorFlowLiteC_framework -c fastbuild --ios_multi_cpus=x86_64,armv7,arm64 --apple_bitcode=embedded --copt=-fembed-bitcode
|
||||
# Unzip the generated framework:
|
||||
# unzip bazel-bin/tensorflow/lite/experimental/c/TensorFlowLiteC_framework.zip -d /Users/path/to/TensorFlowLiteC.framework
|
||||
# unzip bazel-bin/tensorflow/lite/experimental/c/TensorFlowLiteC_framework.zip -d /Users/path/to/tensorflow/Frameworks
|
||||
|
||||
load("@build_bazel_rules_apple//apple:ios.bzl", "ios_static_framework")
|
||||
load("@build_bazel_rules_apple//apple:versioning.bzl", "apple_bundle_version")
|
||||
@ -17,7 +17,10 @@ apple_bundle_version(
|
||||
|
||||
ios_static_framework(
|
||||
name = "TensorFlowLiteC_framework",
|
||||
hdrs = ["c_api.h"],
|
||||
hdrs = [
|
||||
"c_api.h",
|
||||
"c_api_types.h",
|
||||
],
|
||||
bundle_name = "TensorFlowLiteC",
|
||||
minimum_os_version = "9.0",
|
||||
version = ":TensorFlowLiteC_version",
|
||||
|
@ -19,6 +19,5 @@ Pod::Spec.new do |s|
|
||||
|
||||
s.module_name = 'TensorFlowLiteC'
|
||||
s.library = 'c++'
|
||||
s.static_framework = true
|
||||
s.vendored_frameworks = 'Frameworks/TensorFlowLiteC.framework'
|
||||
end
|
||||
|
@ -16,9 +16,9 @@ limitations under the License.
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "tensorflow/lite/context.h"
|
||||
#include "tensorflow/lite/error_reporter.h"
|
||||
#include "tensorflow/lite/experimental/c/c_api_internal.h"
|
||||
#include "tensorflow/lite/experimental/c/c_api_types.h"
|
||||
#include "tensorflow/lite/interpreter.h"
|
||||
#include "tensorflow/lite/kernels/register.h"
|
||||
#include "tensorflow/lite/model.h"
|
||||
|
@ -21,7 +21,7 @@ limitations under the License.
|
||||
// Eventually the various C APIs defined in context.h will be migrated into
|
||||
// the appropriate /c/c_api*.h header. For now, we pull in existing definitions
|
||||
// for convenience.
|
||||
#include "tensorflow/lite/context.h"
|
||||
#include "c_api_types.h"
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
// Experimental C API for TensorFlowLite.
|
||||
|
@ -18,7 +18,7 @@ limitations under the License.
|
||||
#include "tensorflow/lite/experimental/c/c_api.h"
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
#include "tensorflow/lite/context.h"
|
||||
#include "tensorflow/lite/c/c_api_internal.h"
|
||||
#include "tensorflow/lite/testing/util.h"
|
||||
|
||||
namespace {
|
||||
|
1
tensorflow/lite/experimental/c/c_api_types.h
Symbolic link
1
tensorflow/lite/experimental/c/c_api_types.h
Symbolic link
@ -0,0 +1 @@
|
||||
../../c/c_api_internal.h
|
@ -20,7 +20,6 @@ Pod::Spec.new do |s|
|
||||
|
||||
s.module_name = 'TFLTensorFlowLite'
|
||||
s.static_framework = true
|
||||
s.prefix_header_file = false
|
||||
|
||||
base_dir = 'tensorflow/lite/experimental/objc/'
|
||||
s.public_header_files = base_dir + 'apis/*.h'
|
||||
@ -30,7 +29,7 @@ Pod::Spec.new do |s|
|
||||
s.pod_target_xcconfig = {
|
||||
'HEADER_SEARCH_PATHS' =>
|
||||
'"${PODS_TARGET_SRCROOT}" ' +
|
||||
'"${PODS_TARGET_SRCROOT}/"' + base_dir + '"apis"',
|
||||
'"${PODS_TARGET_SRCROOT}/' + base_dir + 'apis"',
|
||||
}
|
||||
|
||||
s.test_spec 'Tests' do |ts|
|
||||
|
@ -54,8 +54,11 @@ public final class Interpreter {
|
||||
if options.isErrorLoggingEnabled {
|
||||
TFL_InterpreterOptionsSetErrorReporter(
|
||||
cOptions,
|
||||
{ (_, format, arguments) in
|
||||
{ (_, format, args) -> Void in
|
||||
// Workaround for Swift optionality bug: https://bugs.swift.org/browse/SR-3429.
|
||||
let optionalArgs: CVaListPointer? = args
|
||||
guard let cFormat = format,
|
||||
let arguments = optionalArgs,
|
||||
let message = String(cFormat: cFormat, arguments: arguments)
|
||||
else {
|
||||
return
|
||||
|
Loading…
Reference in New Issue
Block a user