Migrate TensorFlow Lite out of tensorflow/contrib

This change moves //tensorflow/contrib/lite to //tensorflow/lite in preparation
for TensorFlow 2.0's deprecation of contrib/. If you refer to TF Lite build
targets or headers, you will need to update them manually. If you use TF Lite
from the TensorFlow python package, "tf.contrib.lite" now points to "tf.lite".
Please update your imports as soon as possible.

For more details, see https://groups.google.com/a/tensorflow.org/forum/#!topic/tflite/iIIXOTOFvwQ

@angersson and @aselle are conducting this migration. Please contact them if
you have any further questions.

PiperOrigin-RevId: 219536476
This commit is contained in:
Austin Anderson 2018-10-31 14:16:59 -07:00 committed by TensorFlower Gardener
parent 0f8f062e89
commit 61c6c84964
1205 changed files with 4283 additions and 4241 deletions

8
.gitignore vendored
View File

@ -24,10 +24,10 @@ Pods
Podfile.lock Podfile.lock
*.pbxproj *.pbxproj
*.xcworkspacedata *.xcworkspacedata
/tensorflow/contrib/lite/downloads/** /tensorflow/lite/downloads/**
/tensorflow/contrib/lite/gen/** /tensorflow/lite/gen/**
/tensorflow/contrib/lite/examples/ios/simple/data/*.txt /tensorflow/lite/examples/ios/simple/data/*.txt
/tensorflow/contrib/lite/examples/ios/simple/data/*.tflite /tensorflow/lite/examples/ios/simple/data/*.tflite
xcuserdata/** xcuserdata/**
/api_init_files_list.txt /api_init_files_list.txt
/estimator_api_init_files_list.txt /estimator_api_init_files_list.txt

View File

@ -258,8 +258,8 @@ Ag Ramesh, Alex Wiltschko, Alexander Pantyukhin, Amogh Mannekote, An Jiaoyang, A
* Update `tf.keras` to the Keras 2.1.6 API. * Update `tf.keras` to the Keras 2.1.6 API.
* Added [`tf.keras.layers.CuDNNGRU`](https://www.tensorflow.org/versions/r1.9/api_docs/python/tf/keras/layers/CuDNNGRU) and [`tf.keras.layers.CuDNNLSTM`](https://www.tensorflow.org/versions/r1.9/api_docs/python/tf/keras/layers/CuDNNLSTM) layers. [Try it](https://colab.sandbox.google.com/github/tensorflow/tensorflow/blob/master/tensorflow/contrib/eager/python/examples/nmt_with_attention/nmt_with_attention.ipynb?linkId=53292082). * Added [`tf.keras.layers.CuDNNGRU`](https://www.tensorflow.org/versions/r1.9/api_docs/python/tf/keras/layers/CuDNNGRU) and [`tf.keras.layers.CuDNNLSTM`](https://www.tensorflow.org/versions/r1.9/api_docs/python/tf/keras/layers/CuDNNLSTM) layers. [Try it](https://colab.sandbox.google.com/github/tensorflow/tensorflow/blob/master/tensorflow/contrib/eager/python/examples/nmt_with_attention/nmt_with_attention.ipynb?linkId=53292082).
* Adding support of core [feature columns](https://www.tensorflow.org/get_started/feature_columns) and [losses](https://www.tensorflow.org/api_docs/python/tf/losses) to [gradient boosted trees estimators](https://github.com/tensorflow/models/tree/master/official/boosted_trees). * Adding support of core [feature columns](https://www.tensorflow.org/get_started/feature_columns) and [losses](https://www.tensorflow.org/api_docs/python/tf/losses) to [gradient boosted trees estimators](https://github.com/tensorflow/models/tree/master/official/boosted_trees).
* The [python interface](https://www.tensorflow.org/versions/r1.9/api_docs/python/tf/contrib/lite) * The [python interface](https://www.tensorflow.org/versions/r1.9/api_docs/python/tf/lite)
for the [TFLite Optimizing Converter](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/contrib/lite/toco/README.md) for the [TFLite Optimizing Converter](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/lite/toco/README.md)
has been expanded, and the command line interface (AKA: `toco`, `tflite_convert`) is once again has been expanded, and the command line interface (AKA: `toco`, `tflite_convert`) is once again
included in the standard `pip` installation. included in the standard `pip` installation.
* Improved data-loading and text processing with: * Improved data-loading and text processing with:
@ -562,7 +562,7 @@ Yoni Tsafir, yordun, Yuan (Terry) Tang, Yuxin Wu, zhengdi, Zhengsheng Wei, 田
## Major Features And Improvements ## Major Features And Improvements
* [Eager execution](https://github.com/tensorflow/tensorflow/tree/r1.5/tensorflow/contrib/eager) * [Eager execution](https://github.com/tensorflow/tensorflow/tree/r1.5/tensorflow/contrib/eager)
preview version is now available. preview version is now available.
* [TensorFlow Lite](https://github.com/tensorflow/tensorflow/tree/r1.5/tensorflow/contrib/lite) * [TensorFlow Lite](https://github.com/tensorflow/tensorflow/tree/r1.5/tensorflow/lite)
dev preview is now available. dev preview is now available.
* CUDA 9.0 and cuDNN 7 support. * CUDA 9.0 and cuDNN 7 support.
* Accelerated Linear Algebra (XLA): * Accelerated Linear Algebra (XLA):
@ -909,7 +909,7 @@ See also [TensorBoard 0.1.4](https://github.com/tensorflow/tensorboard/releases/
* Adds tf.contrib.nn.rank_sampled_softmax_loss, a sampled-softmax variant that can improve rank loss. * Adds tf.contrib.nn.rank_sampled_softmax_loss, a sampled-softmax variant that can improve rank loss.
* `tf.contrib.metrics`.{streaming_covariance,streaming_pearson_correlation} modified to return nan when they have seen less or equal to 1 unit of weight. * `tf.contrib.metrics`.{streaming_covariance,streaming_pearson_correlation} modified to return nan when they have seen less or equal to 1 unit of weight.
* Adds time series models to contrib. See contrib/timeseries/README.md for details. * Adds time series models to contrib. See contrib/timeseries/README.md for details.
* Adds FULLY_CONNECTED Op to tensorflow/contrib/lite/schema.fbs * Adds FULLY_CONNECTED Op to tensorflow/lite/schema.fbs
## Known Issues ## Known Issues
* Tensorflow_gpu compilation fails with Bazel 0.5.3. * Tensorflow_gpu compilation fails with Bazel 0.5.3.

View File

@ -279,10 +279,10 @@ tensorflow/contrib/linear_optimizer/kernels/g3doc
tensorflow/contrib/linear_optimizer/python tensorflow/contrib/linear_optimizer/python
tensorflow/contrib/linear_optimizer/python/ops tensorflow/contrib/linear_optimizer/python/ops
# TODO(drpngx): Fix failing imports # TODO(drpngx): Fix failing imports
# tensorflow/contrib/lite # tensorflow/lite
# tensorflow/contrib/lite/python # tensorflow/lite/python
# tensorflow/contrib/lite/toco # tensorflow/lite/toco
# tensorflow/contrib/lite/toco/python # tensorflow/lite/toco/python
tensorflow/contrib/lookup tensorflow/contrib/lookup
tensorflow/contrib/losses tensorflow/contrib/losses
tensorflow/contrib/losses/python tensorflow/contrib/losses/python

View File

@ -6,7 +6,7 @@ tensorflow/contrib/boosted_trees/proto
tensorflow/contrib/cloud/kernels tensorflow/contrib/cloud/kernels
tensorflow/contrib/decision_trees/proto tensorflow/contrib/decision_trees/proto
tensorflow/contrib/gdr tensorflow/contrib/gdr
tensorflow/contrib/lite/toco tensorflow/lite/toco
tensorflow/contrib/mpi tensorflow/contrib/mpi
tensorflow/contrib/mpi_collectives tensorflow/contrib/mpi_collectives
tensorflow/contrib/session_bundle tensorflow/contrib/session_bundle

View File

@ -222,17 +222,17 @@ endforeach(python_module)
add_custom_command(TARGET tf_python_touchup_modules PRE_BUILD add_custom_command(TARGET tf_python_touchup_modules PRE_BUILD
COMMAND ${CMAKE_COMMAND} -E make_directory COMMAND ${CMAKE_COMMAND} -E make_directory
"${CMAKE_CURRENT_BINARY_DIR}/tf_python/tensorflow/contrib/lite") "${CMAKE_CURRENT_BINARY_DIR}/tf_python/tensorflow/lite")
add_custom_command(TARGET tf_python_touchup_modules PRE_BUILD add_custom_command(TARGET tf_python_touchup_modules PRE_BUILD
COMMAND ${CMAKE_COMMAND} -E make_directory COMMAND ${CMAKE_COMMAND} -E make_directory
"${CMAKE_CURRENT_BINARY_DIR}/tf_python/tensorflow/contrib/lite/python") "${CMAKE_CURRENT_BINARY_DIR}/tf_python/tensorflow/lite/python")
add_custom_command(TARGET tf_python_touchup_modules PRE_BUILD add_custom_command(TARGET tf_python_touchup_modules PRE_BUILD
COMMAND ${CMAKE_COMMAND} -E touch COMMAND ${CMAKE_COMMAND} -E touch
"${CMAKE_CURRENT_BINARY_DIR}/tf_python/tensorflow/contrib/lite/python/__init__.py") "${CMAKE_CURRENT_BINARY_DIR}/tf_python/tensorflow/lite/python/__init__.py")
add_custom_command( add_custom_command(
TARGET tf_python_copy_scripts_to_destination PRE_BUILD TARGET tf_python_copy_scripts_to_destination PRE_BUILD
COMMAND ${CMAKE_COMMAND} -E touch COMMAND ${CMAKE_COMMAND} -E touch
${CMAKE_CURRENT_BINARY_DIR}/tf_python/tensorflow/contrib/lite/python/lite.py) ${CMAKE_CURRENT_BINARY_DIR}/tf_python/tensorflow/lite/python/lite.py)
# Generate the tensorflow.python.platform.build_info module. # Generate the tensorflow.python.platform.build_info module.
set(BUILD_INFO_PY "${CMAKE_CURRENT_BINARY_DIR}/tf_python/tensorflow/python/platform/build_info.py") set(BUILD_INFO_PY "${CMAKE_CURRENT_BINARY_DIR}/tf_python/tensorflow/python/platform/build_info.py")

View File

@ -1,107 +0,0 @@
package(default_visibility = [
"//visibility:public",
])
licenses(["notice"]) # Apache 2.0
load("//tensorflow/contrib/lite:build_def.bzl", "tflite_copts")
load(
"//tensorflow/contrib/lite/experimental/micro/testing:micro_test.bzl",
"tflite_micro_cc_test",
)
cc_library(
name = "micro_ops",
srcs = [
"depthwise_conv.cc",
"fully_connected.cc",
"softmax.cc",
],
hdrs = [
],
copts = tflite_copts(),
deps = [
"//tensorflow/contrib/lite/c:c_api_internal",
"//tensorflow/contrib/lite/experimental/micro:micro_framework",
"//tensorflow/contrib/lite/kernels:kernel_util",
"//tensorflow/contrib/lite/kernels:op_macros",
"//tensorflow/contrib/lite/kernels:padding",
"//tensorflow/contrib/lite/kernels/internal:quantization_util",
"//tensorflow/contrib/lite/kernels/internal:reference_base",
"//tensorflow/contrib/lite/kernels/internal:tensor",
],
)
cc_library(
name = "all_ops_resolver",
srcs = [
"all_ops_resolver.cc",
],
hdrs = [
"all_ops_resolver.h",
],
copts = tflite_copts(),
deps = [
":micro_ops",
"//tensorflow/contrib/lite/c:c_api_internal",
"//tensorflow/contrib/lite/experimental/micro:micro_framework",
],
)
cc_library(
name = "test_utils",
srcs = [
],
hdrs = [
"test_utils.h",
],
copts = tflite_copts(),
deps = [
"//tensorflow/contrib/lite/c:c_api_internal",
"//tensorflow/contrib/lite/core/api",
"//tensorflow/contrib/lite/experimental/micro:micro_framework",
"//tensorflow/contrib/lite/experimental/micro/testing:micro_test",
],
)
tflite_micro_cc_test(
name = "depthwise_conv_test",
srcs = [
"depthwise_conv_test.cc",
],
deps = [
":all_ops_resolver",
":test_utils",
"//tensorflow/contrib/lite/c:c_api_internal",
"//tensorflow/contrib/lite/experimental/micro:micro_framework",
"//tensorflow/contrib/lite/experimental/micro/testing:micro_test",
],
)
tflite_micro_cc_test(
name = "fully_connected_test",
srcs = [
"fully_connected_test.cc",
],
deps = [
":all_ops_resolver",
":test_utils",
"//tensorflow/contrib/lite/c:c_api_internal",
"//tensorflow/contrib/lite/experimental/micro:micro_framework",
"//tensorflow/contrib/lite/experimental/micro/testing:micro_test",
],
)
tflite_micro_cc_test(
name = "softmax_test",
srcs = [
"softmax_test.cc",
],
deps = [
":all_ops_resolver",
":test_utils",
"//tensorflow/contrib/lite/c:c_api_internal",
"//tensorflow/contrib/lite/experimental/micro:micro_framework",
"//tensorflow/contrib/lite/experimental/micro/testing:micro_test",
],
)

View File

@ -1,186 +1,12 @@
licenses(["notice"]) # Apache 2.0 licenses(["notice"])
package(default_visibility = ["//tensorflow:internal"])
load("//tensorflow:tensorflow.bzl", "py_test")
filegroup(
name = "interpreter_test_data",
srcs = glob(["**/testdata/*"]),
visibility = ["//tensorflow:__subpackages__"],
)
py_library(
name = "interpreter",
srcs = [
"interpreter.py",
],
srcs_version = "PY2AND3",
visibility = ["//visibility:public"],
deps = [
"//tensorflow/contrib/lite/python/interpreter_wrapper:tensorflow_wrap_interpreter_wrapper",
"//tensorflow/python:util",
"//third_party/py/numpy",
],
)
py_test(
name = "interpreter_test",
srcs = ["interpreter_test.py"],
data = [":interpreter_test_data"],
srcs_version = "PY2AND3",
tags = ["no_oss"],
deps = [
":interpreter",
"//tensorflow/python:client_testlib",
"//tensorflow/python:framework_test_lib",
"//tensorflow/python:platform",
"//third_party/py/numpy",
],
)
py_binary(
name = "tflite_convert",
srcs = ["tflite_convert.py"],
srcs_version = "PY2AND3",
visibility = ["//visibility:public"],
deps = [
":lite",
],
)
# DO NOT USE THIS TARGET. TensorFlow Lite has moved to tensorflow/lite.
py_library( py_library(
name = "lite", name = "lite",
srcs = ["lite.py"], srcs = ["__init__.py"],
srcs_version = "PY2AND3", srcs_version = "PY2AND3",
visibility = ["//visibility:public"], visibility = ["//visibility:public"],
deps = [ deps = [
":convert", "//tensorflow/lite/python:lite",
":convert_saved_model",
":interpreter",
":lite_constants",
":op_hint",
"//tensorflow/python:graph_util",
"//tensorflow/python/keras",
"//tensorflow/python/saved_model:constants",
"//tensorflow/python/saved_model:loader",
],
)
py_test(
name = "lite_test",
srcs = ["lite_test.py"],
data = ["@tflite_mobilenet_ssd_quant_protobuf//:tflite_graph.pb"],
srcs_version = "PY2AND3",
tags = [
"no_oss",
"no_windows",
],
deps = [
":lite",
"//tensorflow/python:client_testlib",
"//tensorflow/python:framework_test_lib",
],
)
py_library(
name = "lite_constants",
srcs = ["lite_constants.py"],
srcs_version = "PY2AND3",
deps = [
"//tensorflow/contrib/lite/toco:toco_flags_proto_py",
],
)
py_library(
name = "convert",
srcs = ["convert.py"],
srcs_version = "PY2AND3",
visibility = ["//visibility:public"],
deps = [
":lite_constants",
"//tensorflow/contrib/lite/toco:model_flags_proto_py",
"//tensorflow/contrib/lite/toco:toco_flags_proto_py",
"//tensorflow/contrib/lite/toco/python:tensorflow_wrap_toco",
"//tensorflow/contrib/lite/toco/python:toco_from_protos",
"//tensorflow/python:platform",
],
)
py_library(
name = "op_hint",
srcs = ["op_hint.py"],
srcs_version = "PY2AND3",
visibility = ["//visibility:public"],
deps = [
"//tensorflow/contrib/framework:framework_py",
"//tensorflow/contrib/graph_editor:graph_editor_py",
"//tensorflow/core:protos_all_py",
"//tensorflow/python:framework",
"//tensorflow/python:platform",
"//tensorflow/python:util",
],
)
py_test(
name = "convert_test",
srcs = ["convert_test.py"],
srcs_version = "PY2AND3",
deps = [
":convert",
":interpreter",
":op_hint",
"//tensorflow/python:array_ops",
"//tensorflow/python:client_testlib",
"//tensorflow/python:dtypes",
"//tensorflow/python:platform_test",
"//tensorflow/python:session",
],
)
py_library(
name = "convert_saved_model",
srcs = ["convert_saved_model.py"],
srcs_version = "PY2AND3",
visibility = ["//tensorflow/contrib/lite:__subpackages__"],
deps = [
":convert",
"//tensorflow/python:graph_util",
"//tensorflow/python:platform",
"//tensorflow/python/saved_model",
],
)
py_binary(
name = "create_custom_op",
srcs = ["create_custom_op.py"],
srcs_version = "PY2AND3",
visibility = ["//visibility:public"],
deps = [
"//tensorflow/contrib/framework:framework_py",
"//tensorflow/core:protos_all_py",
"//tensorflow/python:platform",
"@absl_py//absl/flags",
],
)
py_test(
name = "convert_saved_model_test",
srcs = ["convert_saved_model_test.py"],
srcs_version = "PY2AND3",
tags = [
"no_windows",
],
visibility = ["//visibility:public"],
deps = [
":convert_saved_model",
"//tensorflow/python:client_testlib",
"//tensorflow/python:layers",
"//tensorflow/python:nn",
"//tensorflow/python:platform_test",
"//tensorflow/python:session",
"//tensorflow/python/keras",
"//tensorflow/python/ops/losses",
"//tensorflow/python/saved_model",
], ],
) )

View File

@ -0,0 +1,26 @@
# Copyright 2018 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.
# ==============================================================================
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensorflow import lite
import warnings as _warnings
WARNING = ("WARNING: TF Lite has moved from tf.contrib.lite to tf.lite. Please "
"update your imports. This will be a breaking error in TensorFlow "
"version 2.0.")
_warnings.warn(WARNING, PendingDeprecationWarning)

View File

@ -740,22 +740,22 @@ ifeq ($(WITH_TFLITE_FLEX), true)
TF_CC_SRCS += $(EAGER_CC_SRCS) TF_CC_SRCS += $(EAGER_CC_SRCS)
TF_LITE_CORE_CC_ALL_SRCS := \ TF_LITE_CORE_CC_ALL_SRCS := \
$(wildcard tensorflow/contrib/lite/*.cc) \ $(wildcard tensorflow/lite/*.cc) \
$(wildcard tensorflow/contrib/lite/*.c) \ $(wildcard tensorflow/lite/*.c) \
$(wildcard tensorflow/contrib/lite/c/*.c) \ $(wildcard tensorflow/lite/c/*.c) \
$(wildcard tensorflow/contrib/lite/core/api/*.cc) $(wildcard tensorflow/lite/core/api/*.cc)
TF_LITE_CORE_CC_ALL_SRCS += \ TF_LITE_CORE_CC_ALL_SRCS += \
$(wildcard tensorflow/contrib/lite/kernels/*.cc) \ $(wildcard tensorflow/lite/kernels/*.cc) \
$(wildcard tensorflow/contrib/lite/kernels/internal/*.cc) \ $(wildcard tensorflow/lite/kernels/internal/*.cc) \
$(wildcard tensorflow/contrib/lite/kernels/internal/optimized/*.cc) \ $(wildcard tensorflow/lite/kernels/internal/optimized/*.cc) \
$(wildcard tensorflow/contrib/lite/kernels/internal/reference/*.cc) \ $(wildcard tensorflow/lite/kernels/internal/reference/*.cc) \
$(PROFILER_SRCS) \ $(PROFILER_SRCS) \
$(wildcard tensorflow/contrib/lite/kernels/*.c) \ $(wildcard tensorflow/lite/kernels/*.c) \
$(wildcard tensorflow/contrib/lite/kernels/internal/*.c) \ $(wildcard tensorflow/lite/kernels/internal/*.c) \
$(wildcard tensorflow/contrib/lite/kernels/internal/optimized/*.c) \ $(wildcard tensorflow/lite/kernels/internal/optimized/*.c) \
$(wildcard tensorflow/contrib/lite/kernels/internal/reference/*.c) \ $(wildcard tensorflow/lite/kernels/internal/reference/*.c) \
$(wildcard tensorflow/contrib/lite/delegates/flex/*.cc) $(wildcard tensorflow/lite/delegates/flex/*.cc)
# Hack. This shouldn't be here? # Hack. This shouldn't be here?
TF_LITE_CORE_CC_ALL_SRCS += \ TF_LITE_CORE_CC_ALL_SRCS += \
@ -764,14 +764,14 @@ ifeq ($(WITH_TFLITE_FLEX), true)
# Remove any duplicates. # Remove any duplicates.
TF_LITE_CORE_CC_ALL_SRCS := $(sort $(TF_LITE_CORE_CC_ALL_SRCS)) TF_LITE_CORE_CC_ALL_SRCS := $(sort $(TF_LITE_CORE_CC_ALL_SRCS))
TF_LITE_CORE_CC_EXCLUDE_SRCS := \ TF_LITE_CORE_CC_EXCLUDE_SRCS := \
$(wildcard tensorflow/contrib/lite/*test.cc) \ $(wildcard tensorflow/lite/*test.cc) \
$(wildcard tensorflow/contrib/lite/*/*test.cc) \ $(wildcard tensorflow/lite/*/*test.cc) \
$(wildcard tensorflow/contrib/lite/*/*/*test.cc) \ $(wildcard tensorflow/lite/*/*/*test.cc) \
$(wildcard tensorflow/contrib/lite/*/*/*/*test.cc) \ $(wildcard tensorflow/lite/*/*/*/*test.cc) \
$(wildcard tensorflow/contrib/lite/kernels/test_util.cc) \ $(wildcard tensorflow/lite/kernels/test_util.cc) \
$(wildcard tensorflow/contrib/lite/delegates/flex/test_util.cc) \ $(wildcard tensorflow/lite/delegates/flex/test_util.cc) \
$(wildcard tensorflow/contrib/lite/nnapi_delegate.cc) \ $(wildcard tensorflow/lite/nnapi_delegate.cc) \
$(wildcard tensorflow/contrib/lite/mmap_allocation_disabled.cc) $(wildcard tensorflow/lite/mmap_allocation_disabled.cc)
# Filter out all the excluded files. # Filter out all the excluded files.
TF_LITE_CC_SRCS := $(filter-out $(TF_LITE_CORE_CC_EXCLUDE_SRCS), $(TF_LITE_CORE_CC_ALL_SRCS)) TF_LITE_CC_SRCS := $(filter-out $(TF_LITE_CORE_CC_EXCLUDE_SRCS), $(TF_LITE_CORE_CC_ALL_SRCS))

View File

@ -34,7 +34,7 @@ echo "********************************************************************"
echo "TensorFlow Lite is the recommended library for mobile and embedded machine learning inference." echo "TensorFlow Lite is the recommended library for mobile and embedded machine learning inference."
echo "You are currently using an older version. Please switch over to TensorFlow Lite." echo "You are currently using an older version. Please switch over to TensorFlow Lite."
echo "" echo ""
echo "Link to the code: https://github.com/tensorflow/tensorflow/tree/master/tensorflow/contrib/lite" echo "Link to the code: https://github.com/tensorflow/tensorflow/tree/master/tensorflow/lite"
echo "********************************************************************" echo "********************************************************************"
echo "" echo ""

View File

@ -35,7 +35,7 @@ echo "********************************************************************"
echo "TensorFlow Lite is the recommended library for mobile and embedded machine learning inference." echo "TensorFlow Lite is the recommended library for mobile and embedded machine learning inference."
echo "You are currently using an older version. Please switch over to TensorFlow Lite." echo "You are currently using an older version. Please switch over to TensorFlow Lite."
echo "" echo ""
echo "Link to the code: https://github.com/tensorflow/tensorflow/tree/master/tensorflow/contrib/lite" echo "Link to the code: https://github.com/tensorflow/tensorflow/tree/master/tensorflow/lite"
echo "********************************************************************" echo "********************************************************************"
echo "" echo ""

View File

@ -145,7 +145,7 @@ Mobilenet-v2, and Inception-v3) using this tool:
</figure> </figure>
Our pre-trained models are available in the Our pre-trained models are available in the
<a href="https://github.com/tensorflow/tensorflow/blob/master/tensorflow/contrib/lite/g3doc/models.md#image-classification-quantized-models" class="external">TensorFlow Lite model repository</a>. The code used to generate <a href="https://github.com/tensorflow/tensorflow/blob/master/tensorflow/lite/g3doc/models.md#image-classification-quantized-models" class="external">TensorFlow Lite model repository</a>. The code used to generate
these models <a href="https://github.com/tensorflow/models/blob/master/research/slim/nets/mobilenet_v1_train.py" class="external">is available</a>. these models <a href="https://github.com/tensorflow/models/blob/master/research/slim/nets/mobilenet_v1_train.py" class="external">is available</a>.

View File

@ -146,4 +146,4 @@ class BeamComparer {
} // namespace tensorflow } // namespace tensorflow
#endif // TENSORFLOW_CORE_UTIL_CTC_CTC_BEAM_ENTRY_H_ #endif // TENSORFLOW_CORE_UTIL_CTC_CTC_BEAM_ENTRY_H_
// LINT.ThenChange(//tensorflow/contrib/lite/experimental/kernels/ctc_beam_entry.h) // LINT.ThenChange(//tensorflow/lite/experimental/kernels/ctc_beam_entry.h)

View File

@ -74,4 +74,4 @@ class BaseBeamScorer {
} // namespace tensorflow } // namespace tensorflow
#endif // TENSORFLOW_CORE_UTIL_CTC_CTC_BEAM_SCORER_H_ #endif // TENSORFLOW_CORE_UTIL_CTC_CTC_BEAM_SCORER_H_
// LINT.ThenChange(//tensorflow/contrib/lite/experimental/kernels/ctc_beam_scorer.h) // LINT.ThenChange(//tensorflow/lite/experimental/kernels/ctc_beam_scorer.h)

View File

@ -431,4 +431,4 @@ Status CTCBeamSearchDecoder<CTCBeamState, CTCBeamComparer>::TopPaths(
} // namespace tensorflow } // namespace tensorflow
#endif // TENSORFLOW_CORE_UTIL_CTC_CTC_BEAM_SEARCH_H_ #endif // TENSORFLOW_CORE_UTIL_CTC_CTC_BEAM_SEARCH_H_
// LINT.ThenChange(//tensorflow/contrib/lite/experimental/kernels/ctc_beam_search.h) // LINT.ThenChange(//tensorflow/lite/experimental/kernels/ctc_beam_search.h)

View File

@ -113,4 +113,4 @@ class CTCGreedyDecoder : public CTCDecoder {
} // namespace tensorflow } // namespace tensorflow
#endif // TENSORFLOW_CORE_UTIL_CTC_CTC_DECODER_H_ #endif // TENSORFLOW_CORE_UTIL_CTC_CTC_DECODER_H_
// LINT.ThenChange(//tensorflow/contrib/lite/experimental/kernels/ctc_decoder.h) // LINT.ThenChange(//tensorflow/lite/experimental/kernels/ctc_decoder.h)

View File

@ -47,4 +47,4 @@ inline float LogSumExp(float log_prob_1, float log_prob_2) {
} // namespace tensorflow } // namespace tensorflow
#endif // TENSORFLOW_CORE_UTIL_CTC_CTC_LOSS_UTIL_H_ #endif // TENSORFLOW_CORE_UTIL_CTC_CTC_LOSS_UTIL_H_
// LINT.ThenChange(//tensorflow/contrib/lite/experimental/kernels/ctc_loss_util.h) // LINT.ThenChange(//tensorflow/lite/experimental/kernels/ctc_loss_util.h)

View File

@ -5,7 +5,7 @@ package(default_visibility = [
licenses(["notice"]) # Apache 2.0 licenses(["notice"]) # Apache 2.0
load("//tensorflow:tensorflow.bzl", "tf_cc_test") load("//tensorflow:tensorflow.bzl", "tf_cc_test")
load("//tensorflow/contrib/lite:build_def.bzl", "tflite_copts", "gen_selected_ops") load("//tensorflow/lite:build_def.bzl", "tflite_copts", "gen_selected_ops")
exports_files(glob([ exports_files(glob([
"testdata/*.bin", "testdata/*.bin",
@ -48,7 +48,7 @@ cc_library(
":graph_info", ":graph_info",
":memory_planner", ":memory_planner",
":simple_memory_arena", ":simple_memory_arena",
"//tensorflow/contrib/lite/c:c_api_internal", "//tensorflow/lite/c:c_api_internal",
], ],
) )
@ -62,9 +62,9 @@ cc_test(
], ],
deps = [ deps = [
":arena_planner", ":arena_planner",
"//tensorflow/contrib/lite/testing:util",
"//tensorflow/core:framework", "//tensorflow/core:framework",
"//tensorflow/core:lib", "//tensorflow/core:lib",
"//tensorflow/lite/testing:util",
"@com_google_googletest//:gtest", "@com_google_googletest//:gtest",
], ],
) )
@ -74,26 +74,26 @@ cc_test(
cc_library( cc_library(
name = "context", name = "context",
hdrs = ["context.h"], hdrs = ["context.h"],
deps = ["//tensorflow/contrib/lite/c:c_api_internal"], deps = ["//tensorflow/lite/c:c_api_internal"],
) )
cc_library( cc_library(
name = "graph_info", name = "graph_info",
hdrs = ["graph_info.h"], hdrs = ["graph_info.h"],
deps = ["//tensorflow/contrib/lite/c:c_api_internal"], deps = ["//tensorflow/lite/c:c_api_internal"],
) )
cc_library( cc_library(
name = "memory_planner", name = "memory_planner",
hdrs = ["memory_planner.h"], hdrs = ["memory_planner.h"],
deps = ["//tensorflow/contrib/lite/c:c_api_internal"], deps = ["//tensorflow/lite/c:c_api_internal"],
) )
cc_library( cc_library(
name = "simple_memory_arena", name = "simple_memory_arena",
srcs = ["simple_memory_arena.cc"], srcs = ["simple_memory_arena.cc"],
hdrs = ["simple_memory_arena.h"], hdrs = ["simple_memory_arena.h"],
deps = ["//tensorflow/contrib/lite/c:c_api_internal"], deps = ["//tensorflow/lite/c:c_api_internal"],
) )
cc_library( cc_library(
@ -101,7 +101,7 @@ cc_library(
hdrs = [ hdrs = [
"builtin_op_data.h", "builtin_op_data.h",
], ],
deps = ["//tensorflow/contrib/lite/c:c_api_internal"], deps = ["//tensorflow/lite/c:c_api_internal"],
) )
cc_library( cc_library(
@ -182,16 +182,16 @@ cc_library(
":simple_memory_arena", ":simple_memory_arena",
":string", ":string",
":util", ":util",
"//tensorflow/contrib/lite/c:c_api_internal", "//tensorflow/lite/c:c_api_internal",
"//tensorflow/contrib/lite/core/api", "//tensorflow/lite/core/api",
"//tensorflow/contrib/lite/kernels:eigen_support", "//tensorflow/lite/kernels:eigen_support",
"//tensorflow/contrib/lite/kernels:gemm_support", "//tensorflow/lite/kernels:gemm_support",
"//tensorflow/contrib/lite/nnapi:nnapi_lib", "//tensorflow/lite/nnapi:nnapi_lib",
"//tensorflow/contrib/lite/profiling:profiler", "//tensorflow/lite/profiling:profiler",
"//tensorflow/contrib/lite/schema:schema_fbs", "//tensorflow/lite/schema:schema_fbs",
] + select({ ] + select({
":with_tflite_flex": [ ":with_tflite_flex": [
"//tensorflow/contrib/lite/delegates/flex:delegate", "//tensorflow/lite/delegates/flex:delegate",
], ],
"//conditions:default": [], "//conditions:default": [],
}), }),
@ -214,7 +214,7 @@ cc_test(
deps = [ deps = [
":framework", ":framework",
":string_util", ":string_util",
"//tensorflow/contrib/lite/testing:util", "//tensorflow/lite/testing:util",
"@com_google_googletest//:gtest", "@com_google_googletest//:gtest",
], ],
) )
@ -227,13 +227,13 @@ cc_test(
deps = [ deps = [
":framework", ":framework",
":string_util", ":string_util",
"//tensorflow/contrib/lite/c:c_api_internal", "//tensorflow/lite/c:c_api_internal",
"//tensorflow/contrib/lite/core/api", "//tensorflow/lite/core/api",
"//tensorflow/contrib/lite/kernels:builtin_ops", "//tensorflow/lite/kernels:builtin_ops",
"//tensorflow/contrib/lite/kernels:kernel_util", "//tensorflow/lite/kernels:kernel_util",
"//tensorflow/contrib/lite/kernels/internal:tensor_utils", "//tensorflow/lite/kernels/internal:tensor_utils",
"//tensorflow/contrib/lite/schema:schema_fbs", "//tensorflow/lite/schema:schema_fbs",
"//tensorflow/contrib/lite/testing:util", "//tensorflow/lite/testing:util",
"@com_google_googletest//:gtest", "@com_google_googletest//:gtest",
], ],
) )
@ -247,7 +247,7 @@ cc_test(
deps = [ deps = [
":framework", ":framework",
":string_util", ":string_util",
"//tensorflow/contrib/lite/testing:util", "//tensorflow/lite/testing:util",
"@com_google_googletest//:gtest", "@com_google_googletest//:gtest",
], ],
) )
@ -259,7 +259,7 @@ cc_test(
srcs = ["simple_memory_arena_test.cc"], srcs = ["simple_memory_arena_test.cc"],
deps = [ deps = [
":simple_memory_arena", ":simple_memory_arena",
"//tensorflow/contrib/lite/testing:util", "//tensorflow/lite/testing:util",
"@com_google_googletest//:gtest", "@com_google_googletest//:gtest",
], ],
) )
@ -279,10 +279,10 @@ cc_test(
], ],
deps = [ deps = [
":framework", ":framework",
"//tensorflow/contrib/lite/c:c_api_internal", "//tensorflow/lite/c:c_api_internal",
"//tensorflow/contrib/lite/core/api", "//tensorflow/lite/core/api",
"//tensorflow/contrib/lite/kernels:builtin_ops", "//tensorflow/lite/kernels:builtin_ops",
"//tensorflow/contrib/lite/testing:util", "//tensorflow/lite/testing:util",
"@com_google_googletest//:gtest", "@com_google_googletest//:gtest",
], ],
) )
@ -298,10 +298,10 @@ tf_cc_test(
tags = ["no_windows"], # TODO(b/116667551): No weak symbols with MSVC. tags = ["no_windows"], # TODO(b/116667551): No weak symbols with MSVC.
deps = [ deps = [
":framework", ":framework",
"//tensorflow/contrib/lite/core/api", "//tensorflow/lite/core/api",
"//tensorflow/contrib/lite/delegates/flex:delegate", "//tensorflow/lite/delegates/flex:delegate",
"//tensorflow/contrib/lite/kernels:builtin_ops", "//tensorflow/lite/kernels:builtin_ops",
"//tensorflow/contrib/lite/testing:util", "//tensorflow/lite/testing:util",
"@com_google_googletest//:gtest", "@com_google_googletest//:gtest",
], ],
) )
@ -314,7 +314,7 @@ cc_test(
tags = ["no_oss"], tags = ["no_oss"],
deps = [ deps = [
":framework", ":framework",
"//tensorflow/contrib/lite/testing:util", "//tensorflow/lite/testing:util",
"@com_google_googletest//:gtest", "@com_google_googletest//:gtest",
], ],
) )
@ -324,7 +324,7 @@ cc_library(
srcs = ["util.cc"], srcs = ["util.cc"],
hdrs = ["util.h"], hdrs = ["util.h"],
deps = [ deps = [
"//tensorflow/contrib/lite/c:c_api_internal", "//tensorflow/lite/c:c_api_internal",
], ],
) )
@ -335,7 +335,7 @@ cc_test(
tags = ["no_oss"], tags = ["no_oss"],
deps = [ deps = [
":util", ":util",
"//tensorflow/contrib/lite/testing:util", "//tensorflow/lite/testing:util",
"@com_google_googletest//:gtest", "@com_google_googletest//:gtest",
], ],
) )

View File

@ -5,4 +5,4 @@ devices. It enables low-latency inference of on-device machine learning models
with a small binary size and fast performance supporting hardware acceleration. with a small binary size and fast performance supporting hardware acceleration.
See the documentation: https://www.tensorflow.org/lite/ See the documentation: https://www.tensorflow.org/lite/
Documentation edits can be made here: [tensorflow/contrib/lite/g3doc](./g3doc/) Documentation edits can be made here: [tensorflow/lite/g3doc](./g3doc/)

View File

@ -13,7 +13,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
==============================================================================*/ ==============================================================================*/
#include "tensorflow/contrib/lite/allocation.h" #include "tensorflow/lite/allocation.h"
#include <sys/stat.h> #include <sys/stat.h>
#include <sys/types.h> #include <sys/types.h>
@ -23,8 +23,8 @@ limitations under the License.
#include <cstring> #include <cstring>
#include <utility> #include <utility>
#include "tensorflow/contrib/lite/c/c_api_internal.h" #include "tensorflow/lite/c/c_api_internal.h"
#include "tensorflow/contrib/lite/core/api/error_reporter.h" #include "tensorflow/lite/core/api/error_reporter.h"
namespace tflite { namespace tflite {

View File

@ -14,16 +14,16 @@ limitations under the License.
==============================================================================*/ ==============================================================================*/
// Main abstraction controlling the tflite interpreter. // Main abstraction controlling the tflite interpreter.
// See context.h for the API for defining operations (TfLiteRegistration). // See context.h for the API for defining operations (TfLiteRegistration).
#ifndef TENSORFLOW_CONTRIB_LITE_ALLOCATION_H_ #ifndef TENSORFLOW_LITE_ALLOCATION_H_
#define TENSORFLOW_CONTRIB_LITE_ALLOCATION_H_ #define TENSORFLOW_LITE_ALLOCATION_H_
#include <cstdio> #include <cstdio>
#include <cstdlib> #include <cstdlib>
#include <vector> #include <vector>
#include "tensorflow/contrib/lite/c/c_api_internal.h" #include "tensorflow/lite/c/c_api_internal.h"
#include "tensorflow/contrib/lite/core/api/error_reporter.h" #include "tensorflow/lite/core/api/error_reporter.h"
#include "tensorflow/contrib/lite/simple_memory_arena.h" #include "tensorflow/lite/simple_memory_arena.h"
#include "tensorflow/contrib/lite/string.h" #include "tensorflow/lite/string.h"
namespace tflite { namespace tflite {
@ -94,4 +94,4 @@ class MemoryAllocation : public Allocation {
} // namespace tflite } // namespace tflite
#endif // TENSORFLOW_CONTRIB_LITE_ALLOCATION_H_ #endif // TENSORFLOW_LITE_ALLOCATION_H_

View File

@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
==============================================================================*/ ==============================================================================*/
#include "tensorflow/contrib/lite/arena_planner.h" #include "tensorflow/lite/arena_planner.h"
#include <utility> #include <utility>
namespace tflite { namespace tflite {

View File

@ -12,16 +12,16 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
==============================================================================*/ ==============================================================================*/
#ifndef TENSORFLOW_CONTRIB_LITE_ARENA_PLANNER_H_ #ifndef TENSORFLOW_LITE_ARENA_PLANNER_H_
#define TENSORFLOW_CONTRIB_LITE_ARENA_PLANNER_H_ #define TENSORFLOW_LITE_ARENA_PLANNER_H_
#include <memory> #include <memory>
#include <vector> #include <vector>
#include "tensorflow/contrib/lite/c/c_api_internal.h" #include "tensorflow/lite/c/c_api_internal.h"
#include "tensorflow/contrib/lite/graph_info.h" #include "tensorflow/lite/graph_info.h"
#include "tensorflow/contrib/lite/memory_planner.h" #include "tensorflow/lite/memory_planner.h"
#include "tensorflow/contrib/lite/simple_memory_arena.h" #include "tensorflow/lite/simple_memory_arena.h"
namespace tflite { namespace tflite {
@ -124,4 +124,4 @@ class ArenaPlanner : public MemoryPlanner {
} // namespace tflite } // namespace tflite
#endif // TENSORFLOW_CONTRIB_LITE_ARENA_PLANNER_H_ #endif // TENSORFLOW_LITE_ARENA_PLANNER_H_

View File

@ -12,13 +12,13 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
==============================================================================*/ ==============================================================================*/
#include "tensorflow/contrib/lite/arena_planner.h" #include "tensorflow/lite/arena_planner.h"
#include <cstdarg> #include <cstdarg>
#include <gmock/gmock.h> #include <gmock/gmock.h>
#include <gtest/gtest.h> #include <gtest/gtest.h>
#include "tensorflow/contrib/lite/testing/util.h" #include "tensorflow/lite/testing/util.h"
#include "tensorflow/core/platform/logging.h" #include "tensorflow/core/platform/logging.h"
namespace tflite { namespace tflite {

View File

@ -38,7 +38,7 @@ def tflite_copts():
return copts return copts
LINKER_SCRIPT = "//tensorflow/contrib/lite/java/src/main/native:version_script.lds" LINKER_SCRIPT = "//tensorflow/lite/java/src/main/native:version_script.lds"
def tflite_linkopts_unstripped(): def tflite_linkopts_unstripped():
"""Defines linker flags to reduce size of TFLite binary. """Defines linker flags to reduce size of TFLite binary.
@ -152,7 +152,7 @@ def tf_to_tflite(name, src, options, out):
""" """
toco_cmdline = " ".join([ toco_cmdline = " ".join([
"//tensorflow/contrib/lite/toco:toco", "//tensorflow/lite/toco:toco",
"--input_format=TENSORFLOW_GRAPHDEF", "--input_format=TENSORFLOW_GRAPHDEF",
"--output_format=TFLITE", "--output_format=TFLITE",
("--input_file=$(location %s)" % src), ("--input_file=$(location %s)" % src),
@ -163,7 +163,7 @@ def tf_to_tflite(name, src, options, out):
srcs = [src], srcs = [src],
outs = [out], outs = [out],
cmd = toco_cmdline, cmd = toco_cmdline,
tools = ["//tensorflow/contrib/lite/toco:toco"], tools = ["//tensorflow/lite/toco:toco"],
) )
def tflite_to_json(name, src, out): def tflite_to_json(name, src, out):
@ -176,7 +176,7 @@ def tflite_to_json(name, src, out):
""" """
flatc = "@flatbuffers//:flatc" flatc = "@flatbuffers//:flatc"
schema = "//tensorflow/contrib/lite/schema:schema.fbs" schema = "//tensorflow/lite/schema:schema.fbs"
native.genrule( native.genrule(
name = name, name = name,
srcs = [schema, src], srcs = [schema, src],
@ -199,7 +199,7 @@ def json_to_tflite(name, src, out):
""" """
flatc = "@flatbuffers//:flatc" flatc = "@flatbuffers//:flatc"
schema = "//tensorflow/contrib/lite/schema:schema_fbs" schema = "//tensorflow/lite/schema:schema_fbs"
native.genrule( native.genrule(
name = name, name = name,
srcs = [schema, src], srcs = [schema, src],
@ -357,12 +357,12 @@ def gen_zip_test(name, test_name, conversion_mode, **kwargs):
list above. list above.
**kwargs: tf_cc_test kwargs **kwargs: tf_cc_test kwargs
""" """
toco = "//tensorflow/contrib/lite/toco:toco" toco = "//tensorflow/lite/toco:toco"
flags = "" flags = ""
if conversion_mode: if conversion_mode:
# TODO(nupurgarg): Comment in when pb2lite is in open source. b/113614050. # TODO(nupurgarg): Comment in when pb2lite is in open source. b/113614050.
# if conversion_mode == "pb2lite": # if conversion_mode == "pb2lite":
# toco = "//tensorflow/contrib/lite/experimental/pb2lite:pb2lite" # toco = "//tensorflow/lite/experimental/pb2lite:pb2lite"
flags = "--ignore_toco_errors --run_with_flex" flags = "--ignore_toco_errors --run_with_flex"
gen_zipped_test_file( gen_zipped_test_file(
@ -406,8 +406,8 @@ def gen_selected_ops(name, model):
model: TFLite model to interpret. model: TFLite model to interpret.
""" """
out = name + "_registration.cc" out = name + "_registration.cc"
tool = "//tensorflow/contrib/lite/tools:generate_op_registrations" tool = "//tensorflow/lite/tools:generate_op_registrations"
tflite_path = "//tensorflow/contrib/lite" tflite_path = "//tensorflow/lite"
native.genrule( native.genrule(
name = name, name = name,
srcs = [model], srcs = [model],
@ -450,8 +450,8 @@ def gen_model_coverage_test(model_name, data, failure_type):
"notap", "notap",
], ],
deps = [ deps = [
"//tensorflow/contrib/lite/testing/model_coverage:model_coverage_lib", "//tensorflow/lite/testing/model_coverage:model_coverage_lib",
"//tensorflow/contrib/lite/python:lite", "//tensorflow/lite/python:lite",
"//tensorflow/python:client_testlib", "//tensorflow/python:client_testlib",
], ],
) )

View File

@ -14,9 +14,9 @@ limitations under the License.
==============================================================================*/ ==============================================================================*/
// Compatibility shim for new location of interface definitions. // Compatibility shim for new location of interface definitions.
#ifndef TENSORFLOW_CONTRIB_LITE_BUILTIN_OP_DATA_H_ #ifndef TENSORFLOW_LITE_BUILTIN_OP_DATA_H_
#define TENSORFLOW_CONTRIB_LITE_BUILTIN_OP_DATA_H_ #define TENSORFLOW_LITE_BUILTIN_OP_DATA_H_
#include "tensorflow/contrib/lite/c/builtin_op_data.h" #include "tensorflow/lite/c/builtin_op_data.h"
#endif // TENSORFLOW_CONTRIB_LITE_BUILTIN_OP_DATA_H_ #endif // TENSORFLOW_LITE_BUILTIN_OP_DATA_H_

View File

@ -13,8 +13,8 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
==============================================================================*/ ==============================================================================*/
#ifndef TENSORFLOW_CONTRIB_LITE_BUILTIN_OPS_H_ #ifndef TENSORFLOW_LITE_BUILTIN_OPS_H_
#define TENSORFLOW_CONTRIB_LITE_BUILTIN_OPS_H_ #define TENSORFLOW_LITE_BUILTIN_OPS_H_
// DO NOT EDIT MANUALLY: This file is automatically generated by // DO NOT EDIT MANUALLY: This file is automatically generated by
// `schema/builtin_ops_header/generator.cc`. // `schema/builtin_ops_header/generator.cc`.
@ -128,4 +128,4 @@ typedef enum {
#ifdef __cplusplus #ifdef __cplusplus
} // extern "C" } // extern "C"
#endif // __cplusplus #endif // __cplusplus
#endif // TENSORFLOW_CONTRIB_LITE_BUILTIN_OPS_H_ #endif // TENSORFLOW_LITE_BUILTIN_OPS_H_

View File

@ -13,6 +13,7 @@ cc_library(
], ],
visibility = [ visibility = [
"//tensorflow/contrib/lite:__subpackages__", "//tensorflow/contrib/lite:__subpackages__",
"//tensorflow/lite:__subpackages__",
], ],
) )

View File

@ -12,12 +12,12 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
==============================================================================*/ ==============================================================================*/
#ifndef TENSORFLOW_CONTRIB_LITE_C_BUILTIN_OP_DATA_H_ #ifndef TENSORFLOW_LITE_C_BUILTIN_OP_DATA_H_
#define TENSORFLOW_CONTRIB_LITE_C_BUILTIN_OP_DATA_H_ #define TENSORFLOW_LITE_C_BUILTIN_OP_DATA_H_
#include <stdint.h> #include <stdint.h>
#include "tensorflow/contrib/lite/c/c_api_internal.h" #include "tensorflow/lite/c/c_api_internal.h"
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
@ -332,4 +332,4 @@ typedef struct {
} // extern "C" } // extern "C"
#endif // __cplusplus #endif // __cplusplus
#endif // TENSORFLOW_CONTRIB_LITE_C_BUILTIN_OP_DATA_H_ #endif // TENSORFLOW_LITE_C_BUILTIN_OP_DATA_H_

View File

@ -13,7 +13,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
==============================================================================*/ ==============================================================================*/
#include "tensorflow/contrib/lite/c/builtin_op_data.h" #include "tensorflow/lite/c/builtin_op_data.h"
#include <gtest/gtest.h> #include <gtest/gtest.h>
namespace tflite { namespace tflite {

View File

@ -13,7 +13,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
==============================================================================*/ ==============================================================================*/
#include "tensorflow/contrib/lite/c/c_api_internal.h" #include "tensorflow/lite/c/c_api_internal.h"
#ifndef TF_LITE_STATIC_MEMORY #ifndef TF_LITE_STATIC_MEMORY
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>

View File

@ -26,8 +26,8 @@ limitations under the License.
// TfLiteRegistration - the implementation of a conceptual operation. // TfLiteRegistration - the implementation of a conceptual operation.
// //
// Some abstractions in this file are created and managed by Interpreter. // Some abstractions in this file are created and managed by Interpreter.
#ifndef TENSORFLOW_CONTRIB_LITE_C_C_API_INTERNAL_H_ #ifndef TENSORFLOW_LITE_C_C_API_INTERNAL_H_
#define TENSORFLOW_CONTRIB_LITE_C_C_API_INTERNAL_H_ #define TENSORFLOW_LITE_C_C_API_INTERNAL_H_
#include <stdbool.h> #include <stdbool.h>
#include <stddef.h> #include <stddef.h>
@ -509,4 +509,4 @@ typedef struct {
#ifdef __cplusplus #ifdef __cplusplus
} // extern "C" } // extern "C"
#endif // __cplusplus #endif // __cplusplus
#endif // TENSORFLOW_CONTRIB_LITE_C_C_API_INTERNAL_H_ #endif // TENSORFLOW_LITE_C_C_API_INTERNAL_H_

View File

@ -13,7 +13,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
==============================================================================*/ ==============================================================================*/
#include "tensorflow/contrib/lite/c/c_api_internal.h" #include "tensorflow/lite/c/c_api_internal.h"
#include <gtest/gtest.h> #include <gtest/gtest.h>
namespace tflite { namespace tflite {

View File

@ -13,9 +13,9 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
==============================================================================*/ ==============================================================================*/
// Compatibility shim for moved header location. // Compatibility shim for moved header location.
#ifndef TENSORFLOW_CONTRIB_LITE_CONTEXT_H_ #ifndef TENSORFLOW_LITE_CONTEXT_H_
#define TENSORFLOW_CONTRIB_LITE_CONTEXT_H_ #define TENSORFLOW_LITE_CONTEXT_H_
#include "tensorflow/contrib/lite/c/c_api_internal.h" #include "tensorflow/lite/c/c_api_internal.h"
#endif // TENSORFLOW_CONTRIB_LITE_CONTEXT_H_ #endif // TENSORFLOW_LITE_CONTEXT_H_

View File

@ -14,10 +14,10 @@ limitations under the License.
==============================================================================*/ ==============================================================================*/
// This provides a few C++ helpers that are useful for manipulating C structures // This provides a few C++ helpers that are useful for manipulating C structures
// in C++. // in C++.
#ifndef TENSORFLOW_CONTRIB_LITE_CONTEXT_UTIL_H_ #ifndef TENSORFLOW_LITE_CONTEXT_UTIL_H_
#define TENSORFLOW_CONTRIB_LITE_CONTEXT_UTIL_H_ #define TENSORFLOW_LITE_CONTEXT_UTIL_H_
#include "tensorflow/contrib/lite/c/c_api_internal.h" #include "tensorflow/lite/c/c_api_internal.h"
namespace tflite { namespace tflite {
@ -45,4 +45,4 @@ class TfLiteIntArrayView {
} // namespace tflite } // namespace tflite
#endif // TENSORFLOW_CONTRIB_LITE_CONTEXT_UTIL_H_ #endif // TENSORFLOW_LITE_CONTEXT_UTIL_H_

View File

@ -4,7 +4,7 @@ package(
licenses(["notice"]) # Apache 2.0 licenses(["notice"]) # Apache 2.0
load("//tensorflow/contrib/lite:build_def.bzl", "tflite_copts") load("//tensorflow/lite:build_def.bzl", "tflite_copts")
cc_library( cc_library(
name = "api", name = "api",
@ -20,8 +20,8 @@ cc_library(
], ],
copts = tflite_copts(), copts = tflite_copts(),
deps = [ deps = [
"//tensorflow/contrib/lite/c:c_api_internal", "//tensorflow/lite/c:c_api_internal",
"//tensorflow/contrib/lite/schema:schema_fbs", "//tensorflow/lite/schema:schema_fbs",
], ],
) )
@ -51,7 +51,7 @@ cc_test(
srcs = ["flatbuffer_conversions_test.cc"], srcs = ["flatbuffer_conversions_test.cc"],
deps = [ deps = [
":api", ":api",
"//tensorflow/contrib/lite/c:c_api_internal", "//tensorflow/lite/c:c_api_internal",
"@com_google_googletest//:gtest", "@com_google_googletest//:gtest",
], ],
) )

View File

@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
==============================================================================*/ ==============================================================================*/
#include "tensorflow/contrib/lite/core/api/error_reporter.h" #include "tensorflow/lite/core/api/error_reporter.h"
#include <cstdarg> #include <cstdarg>
namespace tflite { namespace tflite {

View File

@ -12,8 +12,8 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
==============================================================================*/ ==============================================================================*/
#ifndef TENSORFLOW_CONTRIB_LITE_CORE_API_ERROR_REPORTER_H_ #ifndef TENSORFLOW_LITE_CORE_API_ERROR_REPORTER_H_
#define TENSORFLOW_CONTRIB_LITE_CORE_API_ERROR_REPORTER_H_ #define TENSORFLOW_LITE_CORE_API_ERROR_REPORTER_H_
#include <cstdarg> #include <cstdarg>
@ -42,4 +42,4 @@ class ErrorReporter {
} // namespace tflite } // namespace tflite
#endif // TENSORFLOW_CONTRIB_LITE_CORE_API_ERROR_REPORTER_H_ #endif // TENSORFLOW_LITE_CORE_API_ERROR_REPORTER_H_

View File

@ -13,7 +13,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
==============================================================================*/ ==============================================================================*/
#include "tensorflow/contrib/lite/core/api/error_reporter.h" #include "tensorflow/lite/core/api/error_reporter.h"
#include <cstdio> #include <cstdio>

View File

@ -13,11 +13,11 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
==============================================================================*/ ==============================================================================*/
#include "tensorflow/contrib/lite/core/api/flatbuffer_conversions.h" #include "tensorflow/lite/core/api/flatbuffer_conversions.h"
#include <cstdlib> #include <cstdlib>
#include "tensorflow/contrib/lite/c/builtin_op_data.h" #include "tensorflow/lite/c/builtin_op_data.h"
namespace tflite { namespace tflite {

View File

@ -12,17 +12,17 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
==============================================================================*/ ==============================================================================*/
#ifndef TENSORFLOW_CONTRIB_LITE_CORE_API_FLATBUFFER_CONVERSIONS_H_ #ifndef TENSORFLOW_LITE_CORE_API_FLATBUFFER_CONVERSIONS_H_
#define TENSORFLOW_CONTRIB_LITE_CORE_API_FLATBUFFER_CONVERSIONS_H_ #define TENSORFLOW_LITE_CORE_API_FLATBUFFER_CONVERSIONS_H_
// These functions transform codes and data structures that are defined in the // These functions transform codes and data structures that are defined in the
// flatbuffer serialization format into in-memory values that are used by the // flatbuffer serialization format into in-memory values that are used by the
// runtime API and interpreter. // runtime API and interpreter.
#include "tensorflow/contrib/lite/c/c_api_internal.h" #include "tensorflow/lite/c/c_api_internal.h"
#include "tensorflow/contrib/lite/core/api/error_reporter.h" #include "tensorflow/lite/core/api/error_reporter.h"
#include "tensorflow/contrib/lite/core/api/op_resolver.h" #include "tensorflow/lite/core/api/op_resolver.h"
#include "tensorflow/contrib/lite/schema/schema_generated.h" #include "tensorflow/lite/schema/schema_generated.h"
namespace tflite { namespace tflite {
@ -65,4 +65,4 @@ TfLiteStatus ConvertTensorType(TensorType tensor_type, TfLiteType* type,
} // namespace tflite } // namespace tflite
#endif // TENSORFLOW_CONTRIB_LITE_CORE_API_FLATBUFFER_CONVERSIONS_H_ #endif // TENSORFLOW_LITE_CORE_API_FLATBUFFER_CONVERSIONS_H_

View File

@ -13,12 +13,12 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
==============================================================================*/ ==============================================================================*/
#include "tensorflow/contrib/lite/core/api/flatbuffer_conversions.h" #include "tensorflow/lite/core/api/flatbuffer_conversions.h"
#include <cstring> #include <cstring>
#include <gtest/gtest.h> #include <gtest/gtest.h>
#include "tensorflow/contrib/lite/c/builtin_op_data.h" #include "tensorflow/lite/c/builtin_op_data.h"
namespace tflite { namespace tflite {
namespace { namespace {

View File

@ -13,7 +13,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
==============================================================================*/ ==============================================================================*/
#include "tensorflow/contrib/lite/core/api/op_resolver.h" #include "tensorflow/lite/core/api/op_resolver.h"
namespace tflite { namespace tflite {

View File

@ -12,12 +12,12 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
==============================================================================*/ ==============================================================================*/
#ifndef TENSORFLOW_CONTRIB_LITE_CORE_API_OP_RESOLVER_H_ #ifndef TENSORFLOW_LITE_CORE_API_OP_RESOLVER_H_
#define TENSORFLOW_CONTRIB_LITE_CORE_API_OP_RESOLVER_H_ #define TENSORFLOW_LITE_CORE_API_OP_RESOLVER_H_
#include "tensorflow/contrib/lite/c/c_api_internal.h" #include "tensorflow/lite/c/c_api_internal.h"
#include "tensorflow/contrib/lite/core/api/error_reporter.h" #include "tensorflow/lite/core/api/error_reporter.h"
#include "tensorflow/contrib/lite/schema/schema_generated.h" #include "tensorflow/lite/schema/schema_generated.h"
namespace tflite { namespace tflite {
@ -44,4 +44,4 @@ TfLiteStatus GetRegistrationFromOpCode(const OperatorCode* opcode,
} // namespace tflite } // namespace tflite
#endif // TENSORFLOW_CONTRIB_LITE_CORE_API_OP_RESOLVER_H_ #endif // TENSORFLOW_LITE_CORE_API_OP_RESOLVER_H_

View File

@ -13,7 +13,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
==============================================================================*/ ==============================================================================*/
#include "tensorflow/contrib/lite/core/api/op_resolver.h" #include "tensorflow/lite/core/api/op_resolver.h"
#include <cstring> #include <cstring>

View File

@ -16,9 +16,9 @@ cc_library(
deps = [ deps = [
":util", ":util",
"//tensorflow/c:c_api_internal", "//tensorflow/c:c_api_internal",
"//tensorflow/contrib/lite/c:c_api_internal", "//tensorflow/lite/c:c_api_internal",
"//tensorflow/contrib/lite:string", "//tensorflow/lite:string",
"//tensorflow/contrib/lite:string_util", "//tensorflow/lite:string_util",
] + select({ ] + select({
"//tensorflow:android": [ "//tensorflow:android": [
"//tensorflow/core:android_tensorflow_lib_lite", "//tensorflow/core:android_tensorflow_lib_lite",
@ -36,10 +36,10 @@ tf_cc_test(
srcs = ["buffer_map_test.cc"], srcs = ["buffer_map_test.cc"],
deps = [ deps = [
":buffer_map", ":buffer_map",
"//tensorflow/contrib/lite:framework", "//tensorflow/lite:framework",
"//tensorflow/contrib/lite:string_util", "//tensorflow/lite:string_util",
"//tensorflow/contrib/lite:util", "//tensorflow/lite:util",
"//tensorflow/contrib/lite/testing:util", "//tensorflow/lite/testing:util",
"@com_google_googletest//:gtest", "@com_google_googletest//:gtest",
], ],
) )
@ -81,9 +81,9 @@ cc_library(
":delegate_data", ":delegate_data",
":kernel", ":kernel",
":util", ":util",
"//tensorflow/contrib/lite/c:c_api_internal", "//tensorflow/lite/c:c_api_internal",
"//tensorflow/contrib/lite:kernel_api", "//tensorflow/lite:kernel_api",
"//tensorflow/contrib/lite:util", "//tensorflow/lite:util",
] + select({ ] + select({
"//tensorflow:android": [ "//tensorflow:android": [
"//tensorflow/core:android_tensorflow_lib_lite", "//tensorflow/core:android_tensorflow_lib_lite",
@ -103,7 +103,7 @@ tf_cc_test(
deps = [ deps = [
":delegate", ":delegate",
":test_util", ":test_util",
"//tensorflow/contrib/lite/kernels:test_util", "//tensorflow/lite/kernels:test_util",
"@com_google_googletest//:gtest", "@com_google_googletest//:gtest",
], ],
) )
@ -132,10 +132,10 @@ tf_cc_test(
srcs = ["delegate_data_test.cc"], srcs = ["delegate_data_test.cc"],
deps = [ deps = [
":delegate_data", ":delegate_data",
"//tensorflow/contrib/lite:framework", "//tensorflow/lite:framework",
"//tensorflow/contrib/lite:util", "//tensorflow/lite:util",
"//tensorflow/contrib/lite/c:c_api_internal", "//tensorflow/lite/c:c_api_internal",
"//tensorflow/contrib/lite/testing:util", "//tensorflow/lite/testing:util",
"@com_google_googletest//:gtest", "@com_google_googletest//:gtest",
], ],
) )
@ -148,10 +148,10 @@ cc_library(
":delegate_data", ":delegate_data",
":util", ":util",
"@flatbuffers", "@flatbuffers",
"//tensorflow/contrib/lite/c:c_api_internal", "//tensorflow/lite/c:c_api_internal",
"//tensorflow/contrib/lite:kernel_api", "//tensorflow/lite:kernel_api",
"//tensorflow/contrib/lite:string", "//tensorflow/lite:string",
"//tensorflow/contrib/lite/kernels:kernel_util", "//tensorflow/lite/kernels:kernel_util",
"//tensorflow/core/common_runtime/eager:context", "//tensorflow/core/common_runtime/eager:context",
"//tensorflow/core/common_runtime/eager:execute", "//tensorflow/core/common_runtime/eager:execute",
"//tensorflow/core/common_runtime/eager:tensor_handle", "//tensorflow/core/common_runtime/eager:tensor_handle",
@ -197,8 +197,8 @@ cc_library(
hdrs = ["test_util.h"], hdrs = ["test_util.h"],
deps = [ deps = [
"//tensorflow/c:c_api_internal", "//tensorflow/c:c_api_internal",
"//tensorflow/contrib/lite:string", "//tensorflow/lite:string",
"//tensorflow/contrib/lite/kernels:test_util", "//tensorflow/lite/kernels:test_util",
"@com_google_absl//absl/memory", "@com_google_absl//absl/memory",
"@flatbuffers", "@flatbuffers",
], ],
@ -210,8 +210,8 @@ cc_library(
hdrs = ["util.h"], hdrs = ["util.h"],
deps = [ deps = [
"//tensorflow/c:c_api_internal", "//tensorflow/c:c_api_internal",
"//tensorflow/contrib/lite/c:c_api_internal", "//tensorflow/lite/c:c_api_internal",
"//tensorflow/contrib/lite:kernel_api", "//tensorflow/lite:kernel_api",
] + select({ ] + select({
"//tensorflow:android": [ "//tensorflow:android": [
"//tensorflow/core:android_tensorflow_lib_lite", "//tensorflow/core:android_tensorflow_lib_lite",
@ -229,8 +229,8 @@ tf_cc_test(
srcs = ["util_test.cc"], srcs = ["util_test.cc"],
deps = [ deps = [
":util", ":util",
"//tensorflow/contrib/lite:string", "//tensorflow/lite:string",
"//tensorflow/contrib/lite/testing:util", "//tensorflow/lite/testing:util",
"@com_google_googletest//:gtest", "@com_google_googletest//:gtest",
], ],
) )

View File

@ -12,12 +12,12 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
==============================================================================*/ ==============================================================================*/
#include "tensorflow/contrib/lite/delegates/flex/buffer_map.h" #include "tensorflow/lite/delegates/flex/buffer_map.h"
#include "tensorflow/c/c_api_internal.h" #include "tensorflow/c/c_api_internal.h"
#include "tensorflow/contrib/lite/delegates/flex/util.h" #include "tensorflow/lite/delegates/flex/util.h"
#include "tensorflow/contrib/lite/string.h" #include "tensorflow/lite/string.h"
#include "tensorflow/contrib/lite/string_util.h" #include "tensorflow/lite/string_util.h"
#include "tensorflow/core/framework/allocation_description.pb.h" #include "tensorflow/core/framework/allocation_description.pb.h"
#include "tensorflow/core/framework/log_memory.h" #include "tensorflow/core/framework/log_memory.h"

View File

@ -12,12 +12,12 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
==============================================================================*/ ==============================================================================*/
#ifndef TENSORFLOW_CONTRIB_LITE_DELEGATES_FLEX_BUFFER_MAP_H_ #ifndef TENSORFLOW_LITE_DELEGATES_FLEX_BUFFER_MAP_H_
#define TENSORFLOW_CONTRIB_LITE_DELEGATES_FLEX_BUFFER_MAP_H_ #define TENSORFLOW_LITE_DELEGATES_FLEX_BUFFER_MAP_H_
#include <map> #include <map>
#include "tensorflow/contrib/lite/c/c_api_internal.h" #include "tensorflow/lite/c/c_api_internal.h"
#include "tensorflow/core/framework/tensor.h" #include "tensorflow/core/framework/tensor.h"
namespace tflite { namespace tflite {
@ -58,4 +58,4 @@ class BufferMap {
} // namespace flex } // namespace flex
} // namespace tflite } // namespace tflite
#endif // TENSORFLOW_CONTRIB_LITE_DELEGATES_FLEX_BUFFER_MAP_H_ #endif // TENSORFLOW_LITE_DELEGATES_FLEX_BUFFER_MAP_H_

View File

@ -12,14 +12,14 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
==============================================================================*/ ==============================================================================*/
#include "tensorflow/contrib/lite/delegates/flex/buffer_map.h" #include "tensorflow/lite/delegates/flex/buffer_map.h"
#include <gmock/gmock.h> #include <gmock/gmock.h>
#include <gtest/gtest.h> #include <gtest/gtest.h>
#include "tensorflow/contrib/lite/interpreter.h" #include "tensorflow/lite/interpreter.h"
#include "tensorflow/contrib/lite/string_util.h" #include "tensorflow/lite/string_util.h"
#include "tensorflow/contrib/lite/testing/util.h" #include "tensorflow/lite/testing/util.h"
#include "tensorflow/contrib/lite/util.h" #include "tensorflow/lite/util.h"
namespace tflite { namespace tflite {
namespace flex { namespace flex {

View File

@ -12,15 +12,15 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
==============================================================================*/ ==============================================================================*/
#include "tensorflow/contrib/lite/delegates/flex/delegate.h" #include "tensorflow/lite/delegates/flex/delegate.h"
#include <vector> #include <vector>
#include "tensorflow/contrib/lite/context_util.h" #include "tensorflow/lite/context_util.h"
#include "tensorflow/contrib/lite/delegates/flex/buffer_map.h" #include "tensorflow/lite/delegates/flex/buffer_map.h"
#include "tensorflow/contrib/lite/delegates/flex/kernel.h" #include "tensorflow/lite/delegates/flex/kernel.h"
#include "tensorflow/contrib/lite/delegates/flex/util.h" #include "tensorflow/lite/delegates/flex/util.h"
#include "tensorflow/contrib/lite/util.h" #include "tensorflow/lite/util.h"
#include "tensorflow/core/lib/core/status.h" #include "tensorflow/core/lib/core/status.h"
namespace tflite { namespace tflite {

View File

@ -12,11 +12,11 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
==============================================================================*/ ==============================================================================*/
#ifndef TENSORFLOW_CONTRIB_LITE_DELEGATES_FLEX_DELEGATE_H_ #ifndef TENSORFLOW_LITE_DELEGATES_FLEX_DELEGATE_H_
#define TENSORFLOW_CONTRIB_LITE_DELEGATES_FLEX_DELEGATE_H_ #define TENSORFLOW_LITE_DELEGATES_FLEX_DELEGATE_H_
#include "tensorflow/contrib/lite/c/c_api_internal.h" #include "tensorflow/lite/c/c_api_internal.h"
#include "tensorflow/contrib/lite/delegates/flex/delegate_data.h" #include "tensorflow/lite/delegates/flex/delegate_data.h"
namespace tflite { namespace tflite {
@ -56,4 +56,4 @@ class FlexDelegate : public TfLiteDelegate {
} // namespace tflite } // namespace tflite
#endif // TENSORFLOW_CONTRIB_LITE_DELEGATES_FLEX_DELEGATE_H_ #endif // TENSORFLOW_LITE_DELEGATES_FLEX_DELEGATE_H_

View File

@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
==============================================================================*/ ==============================================================================*/
#include "tensorflow/contrib/lite/delegates/flex/delegate_data.h" #include "tensorflow/lite/delegates/flex/delegate_data.h"
#include "tensorflow/core/common_runtime/device_factory.h" #include "tensorflow/core/common_runtime/device_factory.h"
#include "tensorflow/core/lib/core/status.h" #include "tensorflow/core/lib/core/status.h"

View File

@ -12,10 +12,10 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
==============================================================================*/ ==============================================================================*/
#ifndef TENSORFLOW_CONTRIB_LITE_DELEGATES_FLEX_DELEGATE_DATA_H_ #ifndef TENSORFLOW_LITE_DELEGATES_FLEX_DELEGATE_DATA_H_
#define TENSORFLOW_CONTRIB_LITE_DELEGATES_FLEX_DELEGATE_DATA_H_ #define TENSORFLOW_LITE_DELEGATES_FLEX_DELEGATE_DATA_H_
#include "tensorflow/contrib/lite/delegates/flex/buffer_map.h" #include "tensorflow/lite/delegates/flex/buffer_map.h"
#include "tensorflow/core/common_runtime/eager/context.h" #include "tensorflow/core/common_runtime/eager/context.h"
namespace tflite { namespace tflite {
@ -49,4 +49,4 @@ class DelegateData {
} // namespace flex } // namespace flex
} // namespace tflite } // namespace tflite
#endif // TENSORFLOW_CONTRIB_LITE_DELEGATES_FLEX_DELEGATE_DATA_H_ #endif // TENSORFLOW_LITE_DELEGATES_FLEX_DELEGATE_DATA_H_

View File

@ -12,12 +12,12 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
==============================================================================*/ ==============================================================================*/
#include "tensorflow/contrib/lite/delegates/flex/delegate_data.h" #include "tensorflow/lite/delegates/flex/delegate_data.h"
#include <gmock/gmock.h> #include <gmock/gmock.h>
#include <gtest/gtest.h> #include <gtest/gtest.h>
#include "tensorflow/contrib/lite/c/c_api_internal.h" #include "tensorflow/lite/c/c_api_internal.h"
#include "tensorflow/contrib/lite/testing/util.h" #include "tensorflow/lite/testing/util.h"
namespace tflite { namespace tflite {
namespace flex { namespace flex {

View File

@ -12,11 +12,11 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
==============================================================================*/ ==============================================================================*/
#include "tensorflow/contrib/lite/delegates/flex/delegate.h" #include "tensorflow/lite/delegates/flex/delegate.h"
#include <gmock/gmock.h> #include <gmock/gmock.h>
#include <gtest/gtest.h> #include <gtest/gtest.h>
#include "tensorflow/contrib/lite/delegates/flex/test_util.h" #include "tensorflow/lite/delegates/flex/test_util.h"
namespace tflite { namespace tflite {
namespace flex { namespace flex {

View File

@ -12,16 +12,16 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
==============================================================================*/ ==============================================================================*/
#include "tensorflow/contrib/lite/delegates/flex/kernel.h" #include "tensorflow/lite/delegates/flex/kernel.h"
#include "flatbuffers/flexbuffers.h" // TF:flatbuffers #include "flatbuffers/flexbuffers.h" // TF:flatbuffers
#include "tensorflow/contrib/lite/builtin_ops.h" #include "tensorflow/lite/builtin_ops.h"
#include "tensorflow/contrib/lite/c/c_api_internal.h" #include "tensorflow/lite/c/c_api_internal.h"
#include "tensorflow/contrib/lite/context_util.h" #include "tensorflow/lite/context_util.h"
#include "tensorflow/contrib/lite/delegates/flex/delegate_data.h" #include "tensorflow/lite/delegates/flex/delegate_data.h"
#include "tensorflow/contrib/lite/delegates/flex/util.h" #include "tensorflow/lite/delegates/flex/util.h"
#include "tensorflow/contrib/lite/kernels/kernel_util.h" #include "tensorflow/lite/kernels/kernel_util.h"
#include "tensorflow/contrib/lite/string.h" #include "tensorflow/lite/string.h"
#include "tensorflow/core/common_runtime/eager/context.h" #include "tensorflow/core/common_runtime/eager/context.h"
#include "tensorflow/core/common_runtime/eager/execute.h" #include "tensorflow/core/common_runtime/eager/execute.h"
#include "tensorflow/core/common_runtime/eager/tensor_handle.h" #include "tensorflow/core/common_runtime/eager/tensor_handle.h"

View File

@ -12,10 +12,10 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
==============================================================================*/ ==============================================================================*/
#ifndef TENSORFLOW_CONTRIB_LITE_DELEGATES_FLEX_KERNEL_H_ #ifndef TENSORFLOW_LITE_DELEGATES_FLEX_KERNEL_H_
#define TENSORFLOW_CONTRIB_LITE_DELEGATES_FLEX_KERNEL_H_ #define TENSORFLOW_LITE_DELEGATES_FLEX_KERNEL_H_
#include "tensorflow/contrib/lite/c/c_api_internal.h" #include "tensorflow/lite/c/c_api_internal.h"
namespace tflite { namespace tflite {
namespace flex { namespace flex {
@ -31,4 +31,4 @@ TfLiteRegistration GetKernel();
} // namespace flex } // namespace flex
} // namespace tflite } // namespace tflite
#endif // TENSORFLOW_CONTRIB_LITE_DELEGATES_FLEX_KERNEL_H_ #endif // TENSORFLOW_LITE_DELEGATES_FLEX_KERNEL_H_

View File

@ -12,12 +12,12 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
==============================================================================*/ ==============================================================================*/
#include "tensorflow/contrib/lite/delegates/flex/kernel.h" #include "tensorflow/lite/delegates/flex/kernel.h"
#include <gmock/gmock.h> #include <gmock/gmock.h>
#include <gtest/gtest.h> #include <gtest/gtest.h>
#include "tensorflow/contrib/lite/delegates/flex/delegate_data.h" #include "tensorflow/lite/delegates/flex/delegate_data.h"
#include "tensorflow/contrib/lite/delegates/flex/test_util.h" #include "tensorflow/lite/delegates/flex/test_util.h"
namespace tflite { namespace tflite {
namespace flex { namespace flex {

View File

@ -13,11 +13,11 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
==============================================================================*/ ==============================================================================*/
#include "tensorflow/contrib/lite/delegates/flex/test_util.h" #include "tensorflow/lite/delegates/flex/test_util.h"
#include "absl/memory/memory.h" #include "absl/memory/memory.h"
#include "flatbuffers/flexbuffers.h" // TF:flatbuffers #include "flatbuffers/flexbuffers.h" // TF:flatbuffers
#include "tensorflow/contrib/lite/string.h" #include "tensorflow/lite/string.h"
namespace tflite { namespace tflite {
namespace flex { namespace flex {

View File

@ -13,11 +13,11 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
==============================================================================*/ ==============================================================================*/
#ifndef TENSORFLOW_CONTRIB_LITE_DELEGATES_FLEX_TEST_UTIL_H_ #ifndef TENSORFLOW_LITE_DELEGATES_FLEX_TEST_UTIL_H_
#define TENSORFLOW_CONTRIB_LITE_DELEGATES_FLEX_TEST_UTIL_H_ #define TENSORFLOW_LITE_DELEGATES_FLEX_TEST_UTIL_H_
#include "tensorflow/c/c_api_internal.h" #include "tensorflow/c/c_api_internal.h"
#include "tensorflow/contrib/lite/kernels/test_util.h" #include "tensorflow/lite/kernels/test_util.h"
namespace tflite { namespace tflite {
namespace flex { namespace flex {
@ -116,4 +116,4 @@ class FlexModelTest : public ::testing::Test {
} // namespace flex } // namespace flex
} // namespace tflite } // namespace tflite
#endif // TENSORFLOW_CONTRIB_LITE_DELEGATES_FLEX_TEST_UTIL_H_ #endif // TENSORFLOW_LITE_DELEGATES_FLEX_TEST_UTIL_H_

View File

@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
==============================================================================*/ ==============================================================================*/
#include "tensorflow/contrib/lite/delegates/flex/util.h" #include "tensorflow/lite/delegates/flex/util.h"
namespace tflite { namespace tflite {
namespace flex { namespace flex {

View File

@ -12,11 +12,11 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
==============================================================================*/ ==============================================================================*/
#ifndef TENSORFLOW_CONTRIB_LITE_DELEGATES_FLEX_UTIL_H_ #ifndef TENSORFLOW_LITE_DELEGATES_FLEX_UTIL_H_
#define TENSORFLOW_CONTRIB_LITE_DELEGATES_FLEX_UTIL_H_ #define TENSORFLOW_LITE_DELEGATES_FLEX_UTIL_H_
#include "tensorflow/c/c_api_internal.h" #include "tensorflow/c/c_api_internal.h"
#include "tensorflow/contrib/lite/c/c_api_internal.h" #include "tensorflow/lite/c/c_api_internal.h"
#include "tensorflow/core/framework/tensor.h" #include "tensorflow/core/framework/tensor.h"
#include "tensorflow/core/lib/core/status.h" #include "tensorflow/core/lib/core/status.h"
@ -44,4 +44,4 @@ TfLiteType GetTensorFlowLiteType(TF_DataType);
} // namespace flex } // namespace flex
} // namespace tflite } // namespace tflite
#endif // TENSORFLOW_CONTRIB_LITE_DELEGATES_FLEX_UTIL_H_ #endif // TENSORFLOW_LITE_DELEGATES_FLEX_UTIL_H_

View File

@ -12,14 +12,14 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
==============================================================================*/ ==============================================================================*/
#include "tensorflow/contrib/lite/delegates/flex/util.h" #include "tensorflow/lite/delegates/flex/util.h"
#include <cstdarg> #include <cstdarg>
#include <gmock/gmock.h> #include <gmock/gmock.h>
#include <gtest/gtest.h> #include <gtest/gtest.h>
#include "tensorflow/contrib/lite/string.h" #include "tensorflow/lite/string.h"
#include "tensorflow/contrib/lite/testing/util.h" #include "tensorflow/lite/testing/util.h"
namespace tflite { namespace tflite {
namespace flex { namespace flex {

View File

@ -11,11 +11,11 @@ cc_library(
srcs = ["nnapi_delegate.cc"], srcs = ["nnapi_delegate.cc"],
hdrs = ["nnapi_delegate.h"], hdrs = ["nnapi_delegate.h"],
deps = [ deps = [
"//tensorflow/contrib/lite:framework", "//tensorflow/lite:framework",
"//tensorflow/contrib/lite:kernel_api", "//tensorflow/lite:kernel_api",
"//tensorflow/contrib/lite/c:c_api_internal", "//tensorflow/lite/c:c_api_internal",
"//tensorflow/contrib/lite/kernels:kernel_util", "//tensorflow/lite/kernels:kernel_util",
"//tensorflow/contrib/lite/nnapi:nnapi_lib", "//tensorflow/lite/nnapi:nnapi_lib",
], ],
) )
@ -29,9 +29,9 @@ tf_cc_test(
], ],
deps = [ deps = [
":nnapi_delegate", ":nnapi_delegate",
"//tensorflow/contrib/lite:framework", "//tensorflow/lite:framework",
"//tensorflow/contrib/lite/c:c_api_internal", "//tensorflow/lite/c:c_api_internal",
"//tensorflow/contrib/lite/kernels:test_util", "//tensorflow/lite/kernels:test_util",
"@com_google_googletest//:gtest", "@com_google_googletest//:gtest",
], ],
) )

View File

@ -17,14 +17,14 @@ limitations under the License.
#include <memory> #include <memory>
#include <vector> #include <vector>
#include "tensorflow/contrib/lite/allocation.h" #include "tensorflow/lite/allocation.h"
#include "tensorflow/contrib/lite/builtin_op_data.h" #include "tensorflow/lite/builtin_op_data.h"
#include "tensorflow/contrib/lite/builtin_ops.h" #include "tensorflow/lite/builtin_ops.h"
#include "tensorflow/contrib/lite/c/c_api_internal.h" #include "tensorflow/lite/c/c_api_internal.h"
#include "tensorflow/contrib/lite/context_util.h" #include "tensorflow/lite/context_util.h"
#include "tensorflow/contrib/lite/delegates/nnapi/nnapi_delegate.h" #include "tensorflow/lite/delegates/nnapi/nnapi_delegate.h"
#include "tensorflow/contrib/lite/kernels/kernel_util.h" #include "tensorflow/lite/kernels/kernel_util.h"
#include "tensorflow/contrib/lite/nnapi/NeuralNetworksShim.h" #include "tensorflow/lite/nnapi/NeuralNetworksShim.h"
#ifdef __ANDROID__ #ifdef __ANDROID__
#include <sys/mman.h> #include <sys/mman.h>

View File

@ -12,10 +12,10 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
==============================================================================*/ ==============================================================================*/
#ifndef TENSORFLOW_CONTRIB_LITE_DELEGATES_NNAPI_NNAPI_DELEGATE_H_ #ifndef TENSORFLOW_LITE_DELEGATES_NNAPI_NNAPI_DELEGATE_H_
#define TENSORFLOW_CONTRIB_LITE_DELEGATES_NNAPI_NNAPI_DELEGATE_H_ #define TENSORFLOW_LITE_DELEGATES_NNAPI_NNAPI_DELEGATE_H_
#include "tensorflow/contrib/lite/c/c_api_internal.h" #include "tensorflow/lite/c/c_api_internal.h"
namespace tflite { namespace tflite {
@ -28,4 +28,4 @@ namespace tflite {
TfLiteDelegate* NnApiDelegate(); TfLiteDelegate* NnApiDelegate();
} // namespace tflite } // namespace tflite
#endif // TENSORFLOW_CONTRIB_LITE_DELEGATES_NNAPI_NNAPI_DELEGATE_H_ #endif // TENSORFLOW_LITE_DELEGATES_NNAPI_NNAPI_DELEGATE_H_

View File

@ -12,11 +12,11 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
==============================================================================*/ ==============================================================================*/
#include "tensorflow/contrib/lite/delegates/nnapi/nnapi_delegate.h" #include "tensorflow/lite/delegates/nnapi/nnapi_delegate.h"
#include <gtest/gtest.h> #include <gtest/gtest.h>
#include "tensorflow/contrib/lite/interpreter.h" #include "tensorflow/lite/interpreter.h"
#include "tensorflow/contrib/lite/kernels/test_util.h" #include "tensorflow/lite/kernels/test_util.h"
#include "tensorflow/contrib/lite/model.h" #include "tensorflow/lite/model.h"
namespace tflite { namespace tflite {
namespace { namespace {

View File

@ -13,10 +13,10 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
==============================================================================*/ ==============================================================================*/
// Compatibility shim for moved header location. // Compatibility shim for moved header location.
#ifndef TENSORFLOW_CONTRIB_LITE_ERROR_REPORTER_H_ #ifndef TENSORFLOW_LITE_ERROR_REPORTER_H_
#define TENSORFLOW_CONTRIB_LITE_ERROR_REPORTER_H_ #define TENSORFLOW_LITE_ERROR_REPORTER_H_
#include "tensorflow/contrib/lite/core/api/error_reporter.h" #include "tensorflow/lite/core/api/error_reporter.h"
#include "tensorflow/contrib/lite/stderr_reporter.h" #include "tensorflow/lite/stderr_reporter.h"
#endif // TENSORFLOW_CONTRIB_LITE_ERROR_REPORTER_H_ #endif // TENSORFLOW_LITE_ERROR_REPORTER_H_

View File

@ -33,14 +33,14 @@ android_binary(
# Remove undesired models (and corresponding Activities in source) # Remove undesired models (and corresponding Activities in source)
# to reduce APK size. # to reduce APK size.
assets = [ assets = [
"//tensorflow/contrib/lite/examples/android/app/src/main/assets:labels_mobilenet_quant_v1_224.txt", "//tensorflow/lite/examples/android/app/src/main/assets:labels_mobilenet_quant_v1_224.txt",
"@tflite_mobilenet//:mobilenet_quant_v1_224.tflite", "@tflite_mobilenet//:mobilenet_quant_v1_224.tflite",
"@tflite_conv_actions_frozen//:conv_actions_frozen.tflite", "@tflite_conv_actions_frozen//:conv_actions_frozen.tflite",
"//tensorflow/contrib/lite/examples/android/app/src/main/assets:conv_actions_labels.txt", "//tensorflow/lite/examples/android/app/src/main/assets:conv_actions_labels.txt",
"@tflite_mobilenet_ssd//:mobilenet_ssd.tflite", "@tflite_mobilenet_ssd//:mobilenet_ssd.tflite",
"@tflite_mobilenet_ssd_quant//:detect.tflite", "@tflite_mobilenet_ssd_quant//:detect.tflite",
"//tensorflow/contrib/lite/examples/android/app/src/main/assets:box_priors.txt", "//tensorflow/lite/examples/android/app/src/main/assets:box_priors.txt",
"//tensorflow/contrib/lite/examples/android/app/src/main/assets:coco_labels_list.txt", "//tensorflow/lite/examples/android/app/src/main/assets:coco_labels_list.txt",
], ],
assets_dir = "", assets_dir = "",
custom_package = "org.tensorflow.lite.demo", custom_package = "org.tensorflow.lite.demo",
@ -56,6 +56,6 @@ android_binary(
], ],
deps = [ deps = [
":tensorflow_native_libs", ":tensorflow_native_libs",
"//tensorflow/contrib/lite/java:tensorflowlite", "//tensorflow/lite/java:tensorflowlite",
], ],
) )

View File

@ -43,12 +43,12 @@ for our external and internal code to merge.
```shell ```shell
bazel build -c opt --cxxopt='--std=c++11' --fat_apk_cpu=x86,x86_64,arm64-v8a,armeabi-v7a \ bazel build -c opt --cxxopt='--std=c++11' --fat_apk_cpu=x86,x86_64,arm64-v8a,armeabi-v7a \
//tensorflow/contrib/lite/examples/android:tflite_demo //tensorflow/lite/examples/android:tflite_demo
``` ```
3. Install the demo on a 3. Install the demo on a
[debug-enabled device](https://github.com/tensorflow/tensorflow/tree/master/tensorflow/examples/android#install): [debug-enabled device](https://github.com/tensorflow/tensorflow/tree/master/tensorflow/examples/android#install):
```shell ```shell
adb install bazel-bin/tensorflow/contrib/lite/examples/android/tflite_demo.apk adb install bazel-bin/tensorflow/lite/examples/android/tflite_demo.apk
``` ```

View File

@ -14,7 +14,7 @@ def models = ['conv_actions_tflite.zip',
'mobilenet_ssd_tflite_v1.zip', 'mobilenet_ssd_tflite_v1.zip',
'mobilenet_v1_224_android_quant_2017_11_08.zip', 'mobilenet_v1_224_android_quant_2017_11_08.zip',
'coco_ssd_mobilenet_v1_1.0_quant_2018_06_29.zip'] 'coco_ssd_mobilenet_v1_1.0_quant_2018_06_29.zip']
// LINT.ThenChange(//tensorflow/contrib/lite/examples/android/BUILD) // LINT.ThenChange(//tensorflow/lite/examples/android/BUILD)
// Root URL for model archives // Root URL for model archives
def MODEL_URL = 'https://storage.googleapis.com/download.tensorflow.org/models/tflite' def MODEL_URL = 'https://storage.googleapis.com/download.tensorflow.org/models/tflite'

Some files were not shown because too many files have changed in this diff Show More