Move schema version into micro_interpreter.h

This is a first (somewhat non-intuitive) step towards being able to use
clang as part of the github CI system.

The benefits of this refactor are that we avoid a dependency into
tensorflow/core which reduces the number of files that need to be
downloaded as part of a bazel build from a TFLM CI docker image.

The tflite schema version has been unchanged since at-least Oct 2018
(when tflite was moved out of tensorflow/contrib).

Progress towards preventing a repeat of https://github.com/tensorflow/tensorflow/issues/46415
This commit is contained in:
Advait Jain 2021-01-14 15:53:55 -08:00
parent 4491d6ee3a
commit 4dadd12623
22 changed files with 5 additions and 28 deletions

View File

@ -58,7 +58,6 @@ cc_binary(
],
deps = [
":micro_benchmark",
"//tensorflow/lite:schema_fbs_version",
"//tensorflow/lite/c:common",
"//tensorflow/lite/micro:micro_error_reporter",
"//tensorflow/lite/micro:micro_framework",

View File

@ -24,7 +24,6 @@ limitations under the License.
#include "tensorflow/lite/micro/micro_interpreter.h"
#include "tensorflow/lite/micro/micro_utils.h"
#include "tensorflow/lite/schema/schema_generated.h"
#include "tensorflow/lite/version.h"
/*
* Person Detection benchmark. Evaluates runtime performance of the visual

View File

@ -34,7 +34,6 @@ tflite_micro_cc_test(
],
deps = [
":model",
"//tensorflow/lite:schema_fbs_version",
"//tensorflow/lite/micro:micro_error_reporter",
"//tensorflow/lite/micro:micro_framework",
"//tensorflow/lite/micro:op_resolvers",
@ -85,7 +84,6 @@ cc_binary(
":constants",
":model",
":output_handler",
"//tensorflow/lite:schema_fbs_version",
"//tensorflow/lite/micro:micro_error_reporter",
"//tensorflow/lite/micro:micro_framework",
"//tensorflow/lite/micro:op_resolvers",

View File

@ -21,7 +21,6 @@ limitations under the License.
#include "tensorflow/lite/micro/micro_interpreter.h"
#include "tensorflow/lite/micro/testing/micro_test.h"
#include "tensorflow/lite/schema/schema_generated.h"
#include "tensorflow/lite/version.h"
TF_LITE_MICRO_TESTS_BEGIN

View File

@ -22,7 +22,6 @@ limitations under the License.
#include "tensorflow/lite/micro/micro_error_reporter.h"
#include "tensorflow/lite/micro/micro_interpreter.h"
#include "tensorflow/lite/schema/schema_generated.h"
#include "tensorflow/lite/version.h"
// Globals, used for compatibility with Arduino-style sketches.
namespace {

View File

@ -35,7 +35,6 @@ tflite_micro_cc_test(
],
deps = [
":image_model_data",
"//tensorflow/lite:schema_fbs_version",
"//tensorflow/lite/micro:micro_error_reporter",
"//tensorflow/lite/micro:micro_framework",
"//tensorflow/lite/micro:op_resolvers",

View File

@ -21,7 +21,6 @@ limitations under the License.
#include "tensorflow/lite/micro/micro_mutable_op_resolver.h"
#include "tensorflow/lite/micro/testing/micro_test.h"
#include "tensorflow/lite/schema/schema_generated.h"
#include "tensorflow/lite/version.h"
#define IMAGE_BYTES 3072
#define LABEL_BYTES 1

View File

@ -24,7 +24,6 @@ limitations under the License.
#include "tensorflow/lite/micro/micro_interpreter.h"
#include "tensorflow/lite/micro/micro_mutable_op_resolver.h"
#include "tensorflow/lite/schema/schema_generated.h"
#include "tensorflow/lite/version.h"
#define NUM_OUT_CH 3
#define CNN_IMG_SIZE 32

View File

@ -42,7 +42,6 @@ tflite_micro_cc_test(
deps = [
":magic_wand_model_data",
":sample_feature_data",
"//tensorflow/lite:schema_fbs_version",
"//tensorflow/lite/micro:micro_error_reporter",
"//tensorflow/lite/micro:micro_framework",
"//tensorflow/lite/micro:op_resolvers",
@ -158,7 +157,6 @@ cc_binary(
":gesture_predictor",
":magic_wand_model_data",
":output_handler",
"//tensorflow/lite:schema_fbs_version",
"//tensorflow/lite/micro:micro_error_reporter",
"//tensorflow/lite/micro:micro_framework",
"//tensorflow/lite/micro:op_resolvers",

View File

@ -21,7 +21,6 @@ limitations under the License.
#include "tensorflow/lite/micro/micro_mutable_op_resolver.h"
#include "tensorflow/lite/micro/testing/micro_test.h"
#include "tensorflow/lite/schema/schema_generated.h"
#include "tensorflow/lite/version.h"
TF_LITE_MICRO_TESTS_BEGIN

View File

@ -24,7 +24,6 @@ limitations under the License.
#include "tensorflow/lite/micro/micro_interpreter.h"
#include "tensorflow/lite/micro/micro_mutable_op_resolver.h"
#include "tensorflow/lite/schema/schema_generated.h"
#include "tensorflow/lite/version.h"
// Globals, used for compatibility with Arduino-style sketches.
namespace {

View File

@ -50,7 +50,6 @@ tflite_micro_cc_test(
"micro_speech_test.cc",
],
deps = [
"//tensorflow/lite:schema_fbs_version",
"//tensorflow/lite/micro:micro_error_reporter",
"//tensorflow/lite/micro:micro_framework",
"//tensorflow/lite/micro:op_resolvers",
@ -362,7 +361,6 @@ cc_binary(
":command_responder",
":feature_provider",
":recognize_commands",
"//tensorflow/lite:schema_fbs_version",
"//tensorflow/lite/micro:micro_error_reporter",
"//tensorflow/lite/micro:micro_framework",
"//tensorflow/lite/micro:op_resolvers",
@ -384,7 +382,6 @@ cc_binary(
":command_responder",
":feature_provider",
":recognize_commands",
"//tensorflow/lite:schema_fbs_version",
"//tensorflow/lite/micro:micro_error_reporter",
"//tensorflow/lite/micro:micro_framework",
"//tensorflow/lite/micro:op_resolvers",

View File

@ -24,7 +24,6 @@ limitations under the License.
#include "tensorflow/lite/micro/micro_interpreter.h"
#include "tensorflow/lite/micro/testing/micro_test.h"
#include "tensorflow/lite/schema/schema_generated.h"
#include "tensorflow/lite/version.h"
extern int16_t captured_data[16000];
uint8_t g_silence_score = 0;

View File

@ -28,7 +28,6 @@ limitations under the License.
#include "tensorflow/lite/micro/micro_interpreter.h"
#include "tensorflow/lite/micro/micro_mutable_op_resolver.h"
#include "tensorflow/lite/schema/schema_generated.h"
#include "tensorflow/lite/version.h"
extern int32_t g_latest_audio_timestamp;
void setup_tf();

View File

@ -25,7 +25,6 @@ limitations under the License.
#include "tensorflow/lite/micro/micro_interpreter.h"
#include "tensorflow/lite/micro/micro_mutable_op_resolver.h"
#include "tensorflow/lite/schema/schema_generated.h"
#include "tensorflow/lite/version.h"
// Globals, used for compatibility with Arduino-style sketches.
namespace {

View File

@ -21,7 +21,6 @@ limitations under the License.
#include "tensorflow/lite/micro/micro_mutable_op_resolver.h"
#include "tensorflow/lite/micro/testing/micro_test.h"
#include "tensorflow/lite/schema/schema_generated.h"
#include "tensorflow/lite/version.h"
TF_LITE_MICRO_TESTS_BEGIN

View File

@ -22,7 +22,6 @@ limitations under the License.
#include "tensorflow/lite/micro/micro_utils.h"
#include "tensorflow/lite/micro/testing/micro_test.h"
#include "tensorflow/lite/schema/schema_generated.h"
#include "tensorflow/lite/version.h"
#ifndef TENSOR_ARENA_SIZE
#define TENSOR_ARENA_SIZE (1024)

View File

@ -63,7 +63,6 @@ tflite_micro_cc_test(
":model_settings",
":person_detect_model_data",
":simple_images_test_data",
"//tensorflow/lite:schema_fbs_version",
"//tensorflow/lite/c:common",
"//tensorflow/lite/micro:micro_error_reporter",
"//tensorflow/lite/micro:micro_framework",
@ -142,7 +141,6 @@ cc_binary(
":image_provider",
":model_settings",
":person_detect_model_data",
"//tensorflow/lite:schema_fbs_version",
"//tensorflow/lite/micro:micro_error_reporter",
"//tensorflow/lite/micro:micro_framework",
"//tensorflow/lite/micro:op_resolvers",

View File

@ -23,7 +23,6 @@ limitations under the License.
#include "tensorflow/lite/micro/micro_interpreter.h"
#include "tensorflow/lite/micro/micro_mutable_op_resolver.h"
#include "tensorflow/lite/schema/schema_generated.h"
#include "tensorflow/lite/version.h"
// Globals, used for compatibility with Arduino-style sketches.
namespace {

View File

@ -23,7 +23,6 @@ limitations under the License.
#include "tensorflow/lite/micro/micro_mutable_op_resolver.h"
#include "tensorflow/lite/micro/testing/micro_test.h"
#include "tensorflow/lite/schema/schema_generated.h"
#include "tensorflow/lite/version.h"
// Create an area of memory to use for input, output, and intermediate arrays.
constexpr int tensor_arena_size = 136 * 1024;

View File

@ -28,6 +28,10 @@ limitations under the License.
#include "tensorflow/lite/portable_type_to_tflitetype.h"
#include "tensorflow/lite/schema/schema_generated.h"
// Copied from tensorflow/lite/version.h to avoid a dependency chain into
// tensorflow/core.
#define TFLITE_SCHEMA_VERSION (3)
namespace tflite {
namespace internal {

View File

@ -387,7 +387,6 @@ $(wildcard tensorflow/lite/micro/benchmarks/*model_data.h) \
$(wildcard tensorflow/lite/micro/kernels/*.h) \
$(wildcard tensorflow/lite/micro/memory_planner/*.h) \
LICENSE \
tensorflow/core/public/version.h \
tensorflow/lite/c/builtin_op_data.h \
tensorflow/lite/c/c_api_types.h \
tensorflow/lite/c/common.h \
@ -455,8 +454,7 @@ tensorflow/lite/kernels/op_macros.h \
tensorflow/lite/kernels/padding.h \
tensorflow/lite/portable_type_to_tflitetype.h \
tensorflow/lite/schema/schema_generated.h \
tensorflow/lite/schema/schema_utils.h \
tensorflow/lite/version.h
tensorflow/lite/schema/schema_utils.h
# TODO(b/165940489): Figure out how to avoid including fixed point
# platform-specific headers.