From 973e6773e992c8ac1b04adfc11d25d4906e3f353 Mon Sep 17 00:00:00 2001 From: Fergus Henderson Date: Wed, 20 Jan 2021 07:55:18 -0800 Subject: [PATCH] [lite] Include-what-you-use fixes. PiperOrigin-RevId: 352793429 Change-Id: I303a9d3c0549cf11729ddaf854d8d3dace31718c --- tensorflow/lite/BUILD | 43 ++++++++++--------- tensorflow/lite/allocation.cc | 7 +-- tensorflow/lite/allocation.h | 2 + tensorflow/lite/arena_planner.cc | 10 ++++- tensorflow/lite/arena_planner_test.cc | 16 +++++-- tensorflow/lite/context_util.h | 2 + tensorflow/lite/core/api/op_resolver.h | 1 + tensorflow/lite/core/subgraph.cc | 15 +++++++ tensorflow/lite/core/subgraph.h | 5 +++ tensorflow/lite/create_op_resolver.h | 1 + .../lite/external_cpu_backend_context.cc | 2 + tensorflow/lite/graph_info.cc | 1 + tensorflow/lite/graph_info.h | 2 + tensorflow/lite/graph_info_test.cc | 6 ++- tensorflow/lite/interpreter.cc | 25 +++++------ tensorflow/lite/interpreter.h | 8 ++++ tensorflow/lite/interpreter_builder.cc | 21 ++++++--- tensorflow/lite/interpreter_builder.h | 5 +++ tensorflow/lite/interpreter_test.cc | 17 +++++--- tensorflow/lite/minimal_logging_default.cc | 4 +- tensorflow/lite/minimal_logging_test.cc | 2 - tensorflow/lite/mmap_allocation.cc | 2 +- tensorflow/lite/model_builder.cc | 20 ++++----- tensorflow/lite/model_builder.h | 4 ++ tensorflow/lite/model_flex_test.cc | 5 ++- tensorflow/lite/model_test.cc | 19 ++++++-- tensorflow/lite/model_xnnpack_test.cc | 8 +++- tensorflow/lite/mutable_op_resolver.cc | 7 +++ tensorflow/lite/mutable_op_resolver.h | 5 +++ tensorflow/lite/mutable_op_resolver_test.cc | 4 ++ tensorflow/lite/optional_debug_tools.cc | 9 +++- tensorflow/lite/portable_type_to_tflitetype.h | 2 + tensorflow/lite/simple_memory_arena.cc | 7 +++ tensorflow/lite/simple_memory_arena.h | 2 + tensorflow/lite/simple_memory_arena_test.cc | 3 +- tensorflow/lite/stderr_reporter.cc | 3 ++ tensorflow/lite/stderr_reporter_test.cc | 3 +- tensorflow/lite/string_util.cc | 3 ++ tensorflow/lite/string_util.h | 3 ++ tensorflow/lite/string_util_test.cc | 6 ++- .../lite/tflite_with_xnnpack_optional.cc | 3 ++ tensorflow/lite/type_to_tflitetype_test.cc | 3 ++ tensorflow/lite/util.cc | 8 ++++ tensorflow/lite/util.h | 3 ++ tensorflow/lite/util_test.cc | 5 ++- 45 files changed, 249 insertions(+), 83 deletions(-) diff --git a/tensorflow/lite/BUILD b/tensorflow/lite/BUILD index e9ca062dc3c..f41e5bd8d1f 100644 --- a/tensorflow/lite/BUILD +++ b/tensorflow/lite/BUILD @@ -122,7 +122,9 @@ cc_test( ], deps = [ ":arena_planner", + ":graph_info", "//tensorflow/core:tflite_portable_logging", + "//tensorflow/lite/c:common", "//tensorflow/lite/testing:util", "@com_google_googletest//:gtest", ], @@ -247,32 +249,24 @@ cc_library( ], deps = [ ":allocation", - ":arena_planner", ":cc_api", ":external_cpu_backend_context", ":graph_info", ":kernel_api", ":macros", ":memory_planner", - ":minimal_logging", ":mutable_op_resolver", ":optional_debug_tools", - ":shared_library", - ":simple_memory_arena", ":stderr_reporter", ":string", ":type_to_tflitetype", ":util", - ":version", "//tensorflow/lite/c:common", "//tensorflow/lite/core/api", "//tensorflow/lite/core/api:verifier", - "//tensorflow/lite/delegates:telemetry", "//tensorflow/lite/experimental/resource", - "//tensorflow/lite/kernels/internal:compatibility", - "//tensorflow/lite/profiling:platform_profiler", "//tensorflow/lite/schema:schema_fbs", - "//tensorflow/lite/schema:schema_utils", + "@flatbuffers//:runtime_cc", ], alwayslink = 1, # Why?? TODO(b/161243354): eliminate this. ) @@ -289,23 +283,20 @@ cc_library( copts = tflite_copts() + tflite_copts_warnings(), deps = [ ":allocation", - ":arena_planner", ":cc_api", ":external_cpu_backend_context", ":framework_lib", ":graph_info", ":memory_planner", - ":minimal_logging", - ":simple_memory_arena", ":string", ":type_to_tflitetype", ":util", - ":version", "//tensorflow/lite/c:common", "//tensorflow/lite/core/api", "//tensorflow/lite/core/api:verifier", "//tensorflow/lite/experimental/resource", "//tensorflow/lite/schema:schema_fbs", + "@flatbuffers//:runtime_cc", ], ) @@ -360,6 +351,7 @@ cc_library( "//tensorflow/lite/profiling:platform_profiler", "//tensorflow/lite/schema:schema_fbs", "//tensorflow/lite/schema:schema_utils", + "@flatbuffers//:runtime_cc", ], alwayslink = 1, # Why?? TODO(b/161243354): eliminate this. ) @@ -438,6 +430,7 @@ cc_library( ], deps = [ ":util", + "//tensorflow/lite/c:common", "//tensorflow/lite/core/api:op_resolver", "//tensorflow/lite/schema:schema_fbs", ], @@ -534,6 +527,7 @@ cc_test( features = ["-dynamic_link_test_srcs"], # see go/dynamic_link_test_srcs deps = [ ":framework", + ":string", ":string_util", "//tensorflow/lite/c:common", "//tensorflow/lite/testing:util", @@ -577,19 +571,16 @@ cc_test( "tflite_smoke_test", ], deps = [ - ":builtin_op_data", ":external_cpu_backend_context", ":framework", ":interpreter_test_util", + ":string", ":string_util", ":util", - ":version", - "//tensorflow/lite/core/api", + "//tensorflow/lite/c:common", "//tensorflow/lite/kernels:builtin_ops", - "//tensorflow/lite/kernels:cpu_backend_context", "//tensorflow/lite/kernels:kernel_util", "//tensorflow/lite/kernels/internal:compatibility", - "//tensorflow/lite/schema:schema_fbs", "//tensorflow/lite/testing:util", "//third_party/eigen3", "@com_google_googletest//:gtest", @@ -604,6 +595,7 @@ cc_test( features = ["-dynamic_link_test_srcs"], # see go/dynamic_link_test_srcs deps = [ ":framework", + "//tensorflow/lite/c:common", "//tensorflow/lite/testing:util", "@com_google_googletest//:gtest", ], @@ -617,7 +609,7 @@ cc_test( features = ["-dynamic_link_test_srcs"], # see go/dynamic_link_test_srcs deps = [ ":simple_memory_arena", - "//tensorflow/core:tflite_portable_logging", + "//tensorflow/lite/c:common", "//tensorflow/lite/testing:util", "@com_google_googletest//:gtest", ], @@ -648,11 +640,15 @@ cc_test( deps = [ ":framework", ":interpreter_test_util", + ":string", "//tensorflow/lite:string_util", "//tensorflow/lite/core/api", + "//tensorflow/lite/core/api:verifier", "//tensorflow/lite/kernels:builtin_ops", + "//tensorflow/lite/schema:schema_fbs", "//tensorflow/lite/testing:util", "@com_google_googletest//:gtest", + "@flatbuffers//:runtime_cc", ], ) @@ -698,6 +694,7 @@ cc_test( ], deps = [ ":framework", + ":string", ":tflite_with_xnnpack", ":util", "//tensorflow/lite/c:common", @@ -714,6 +711,8 @@ cc_test( features = ["-dynamic_link_test_srcs"], # see go/dynamic_link_test_srcs deps = [ ":framework", + "//tensorflow/lite/c:common", + "//tensorflow/lite/schema:schema_fbs", "//tensorflow/lite/testing:util", "@com_google_googletest//:gtest", ], @@ -724,6 +723,7 @@ cc_test( srcs = ["stderr_reporter_test.cc"], deps = [ ":stderr_reporter", + "//tensorflow/lite/core/api:error_reporter", "@com_google_googletest//:gtest_main", ], ) @@ -748,8 +748,8 @@ cc_library( hdrs = ["create_op_resolver.h"], copts = tflite_copts(), deps = [ - "//tensorflow/lite:op_resolver", - "//tensorflow/lite/core/api", + ":mutable_op_resolver", + ":op_resolver", "//tensorflow/lite/kernels:builtin_ops", ], ) @@ -815,6 +815,7 @@ cc_test( srcs = ["type_to_tflitetype_test.cc"], deps = [ ":type_to_tflitetype", + "//tensorflow/lite/c:c_api_types", "@com_google_googletest//:gtest_main", ], ) diff --git a/tensorflow/lite/allocation.cc b/tensorflow/lite/allocation.cc index 545ddb84a94..b187ef093b5 100644 --- a/tensorflow/lite/allocation.cc +++ b/tensorflow/lite/allocation.cc @@ -15,17 +15,14 @@ limitations under the License. #include "tensorflow/lite/allocation.h" +#include #include #include -#include -#include #include #include -#include -#include +#include -#include "tensorflow/lite/c/common.h" #include "tensorflow/lite/core/api/error_reporter.h" namespace tflite { diff --git a/tensorflow/lite/allocation.h b/tensorflow/lite/allocation.h index cf9ff5c1332..1457b6ebbbe 100644 --- a/tensorflow/lite/allocation.h +++ b/tensorflow/lite/allocation.h @@ -17,6 +17,8 @@ limitations under the License. #ifndef TENSORFLOW_LITE_ALLOCATION_H_ #define TENSORFLOW_LITE_ALLOCATION_H_ +#include + #include #include #include diff --git a/tensorflow/lite/arena_planner.cc b/tensorflow/lite/arena_planner.cc index d4a079a2486..605e9388a20 100644 --- a/tensorflow/lite/arena_planner.cc +++ b/tensorflow/lite/arena_planner.cc @@ -14,12 +14,18 @@ limitations under the License. ==============================================================================*/ #include "tensorflow/lite/arena_planner.h" +#include + #include #include #include -#include -#include +#include #include +#include + +#include "tensorflow/lite/c/common.h" +#include "tensorflow/lite/graph_info.h" +#include "tensorflow/lite/simple_memory_arena.h" namespace tflite { namespace { diff --git a/tensorflow/lite/arena_planner_test.cc b/tensorflow/lite/arena_planner_test.cc index f9d735ec6ce..3ab19f36f65 100644 --- a/tensorflow/lite/arena_planner_test.cc +++ b/tensorflow/lite/arena_planner_test.cc @@ -14,12 +14,22 @@ limitations under the License. ==============================================================================*/ #include "tensorflow/lite/arena_planner.h" -#include -#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include -#include #include #include "tensorflow/core/platform/logging.h" +#include "tensorflow/lite/c/common.h" +#include "tensorflow/lite/graph_info.h" #include "tensorflow/lite/testing/util.h" namespace tflite { diff --git a/tensorflow/lite/context_util.h b/tensorflow/lite/context_util.h index cc1a2ffd090..7c8a5abd3cb 100644 --- a/tensorflow/lite/context_util.h +++ b/tensorflow/lite/context_util.h @@ -17,6 +17,8 @@ limitations under the License. #ifndef TENSORFLOW_LITE_CONTEXT_UTIL_H_ #define TENSORFLOW_LITE_CONTEXT_UTIL_H_ +#include + #include "tensorflow/lite/c/common.h" namespace tflite { diff --git a/tensorflow/lite/core/api/op_resolver.h b/tensorflow/lite/core/api/op_resolver.h index b6a8171d2a3..f43c6ba5658 100644 --- a/tensorflow/lite/core/api/op_resolver.h +++ b/tensorflow/lite/core/api/op_resolver.h @@ -15,6 +15,7 @@ limitations under the License. #ifndef TENSORFLOW_LITE_CORE_API_OP_RESOLVER_H_ #define TENSORFLOW_LITE_CORE_API_OP_RESOLVER_H_ +#include #include #include "tensorflow/lite/c/common.h" diff --git a/tensorflow/lite/core/subgraph.cc b/tensorflow/lite/core/subgraph.cc index 7e031472277..fb68693b1bf 100644 --- a/tensorflow/lite/core/subgraph.cc +++ b/tensorflow/lite/core/subgraph.cc @@ -15,15 +15,30 @@ limitations under the License. #include "tensorflow/lite/core/subgraph.h" +#include +#include + #include #include +#include +#include +#include +#include +#include +#include +#include "tensorflow/lite/allocation.h" #include "tensorflow/lite/arena_planner.h" #include "tensorflow/lite/builtin_ops.h" #include "tensorflow/lite/c/common.h" #include "tensorflow/lite/context_util.h" +#include "tensorflow/lite/core/api/error_reporter.h" +#include "tensorflow/lite/core/api/profiler.h" #include "tensorflow/lite/core/api/tensor_utils.h" +#include "tensorflow/lite/core/macros.h" +#include "tensorflow/lite/experimental/resource/resource_base.h" #include "tensorflow/lite/graph_info.h" +#include "tensorflow/lite/memory_planner.h" #include "tensorflow/lite/minimal_logging.h" #include "tensorflow/lite/schema/schema_generated.h" #include "tensorflow/lite/util.h" diff --git a/tensorflow/lite/core/subgraph.h b/tensorflow/lite/core/subgraph.h index 2ef76df9b3e..413e73a3729 100644 --- a/tensorflow/lite/core/subgraph.h +++ b/tensorflow/lite/core/subgraph.h @@ -15,14 +15,19 @@ limitations under the License. #ifndef TENSORFLOW_LITE_CORE_SUBGRAPH_H_ #define TENSORFLOW_LITE_CORE_SUBGRAPH_H_ +#include +#include + #include #include #include +#include #include #include #include "tensorflow/lite/allocation.h" #include "tensorflow/lite/c/common.h" +#include "tensorflow/lite/core/api/error_reporter.h" #include "tensorflow/lite/core/api/profiler.h" #include "tensorflow/lite/core/macros.h" #include "tensorflow/lite/experimental/resource/resource_base.h" diff --git a/tensorflow/lite/create_op_resolver.h b/tensorflow/lite/create_op_resolver.h index ab00d272f11..0c1123eeb60 100644 --- a/tensorflow/lite/create_op_resolver.h +++ b/tensorflow/lite/create_op_resolver.h @@ -17,6 +17,7 @@ limitations under the License. #include +#include "tensorflow/lite/mutable_op_resolver.h" #include "tensorflow/lite/op_resolver.h" namespace tflite { diff --git a/tensorflow/lite/external_cpu_backend_context.cc b/tensorflow/lite/external_cpu_backend_context.cc index df1fc01b8b9..e53958b59a6 100644 --- a/tensorflow/lite/external_cpu_backend_context.cc +++ b/tensorflow/lite/external_cpu_backend_context.cc @@ -14,6 +14,8 @@ limitations under the License. ==============================================================================*/ #include "tensorflow/lite/external_cpu_backend_context.h" +#include "tensorflow/lite/c/common.h" + namespace tflite { namespace { diff --git a/tensorflow/lite/graph_info.cc b/tensorflow/lite/graph_info.cc index 47fa8ff86b1..7736e025abb 100644 --- a/tensorflow/lite/graph_info.cc +++ b/tensorflow/lite/graph_info.cc @@ -15,6 +15,7 @@ limitations under the License. #include "tensorflow/lite/graph_info.h" #include +#include #include "tensorflow/lite/c/common.h" #include "tensorflow/lite/context_util.h" diff --git a/tensorflow/lite/graph_info.h b/tensorflow/lite/graph_info.h index 2236f99068b..bf91f33a735 100644 --- a/tensorflow/lite/graph_info.h +++ b/tensorflow/lite/graph_info.h @@ -15,6 +15,8 @@ limitations under the License. #ifndef TENSORFLOW_LITE_GRAPH_INFO_H_ #define TENSORFLOW_LITE_GRAPH_INFO_H_ +#include + #include #include "tensorflow/lite/c/common.h" diff --git a/tensorflow/lite/graph_info_test.cc b/tensorflow/lite/graph_info_test.cc index 4ab11d9db18..99f7374ff6d 100644 --- a/tensorflow/lite/graph_info_test.cc +++ b/tensorflow/lite/graph_info_test.cc @@ -15,8 +15,12 @@ limitations under the License. #include "tensorflow/lite/graph_info.h" -#include +#include + +#include + #include +#include "tensorflow/lite/c/common.h" #include "tensorflow/lite/testing/util.h" namespace tflite { diff --git a/tensorflow/lite/interpreter.cc b/tensorflow/lite/interpreter.cc index 6b2d24e9d1c..3924c3e0f54 100644 --- a/tensorflow/lite/interpreter.cc +++ b/tensorflow/lite/interpreter.cc @@ -15,21 +15,22 @@ limitations under the License. #include "tensorflow/lite/interpreter.h" -#include -#include -#include -#include -#include +#include +#include -#include "tensorflow/lite/c/common.h" -#include "tensorflow/lite/context_util.h" +#include +#include +#include +#include +#include + +#include "tensorflow/lite/allocation.h" #include "tensorflow/lite/core/api/error_reporter.h" -#include "tensorflow/lite/delegates/telemetry.h" -#include "tensorflow/lite/graph_info.h" -#include "tensorflow/lite/memory_planner.h" +#include "tensorflow/lite/core/api/profiler.h" +#include "tensorflow/lite/core/subgraph.h" +#include "tensorflow/lite/external_cpu_backend_context.h" #include "tensorflow/lite/minimal_logging.h" -#include "tensorflow/lite/schema/schema_generated.h" -#include "tensorflow/lite/util.h" +#include "tensorflow/lite/stderr_reporter.h" // TODO(b/139446230): Move to portable platform header. #if defined(__ANDROID__) diff --git a/tensorflow/lite/interpreter.h b/tensorflow/lite/interpreter.h index 1c1a40d7be9..d19d4b87949 100644 --- a/tensorflow/lite/interpreter.h +++ b/tensorflow/lite/interpreter.h @@ -18,6 +18,9 @@ limitations under the License. #ifndef TENSORFLOW_LITE_INTERPRETER_H_ #define TENSORFLOW_LITE_INTERPRETER_H_ +#include +#include + #include #include #include @@ -25,6 +28,7 @@ limitations under the License. #include #include #include +#include #include #include "tensorflow/lite/allocation.h" @@ -35,14 +39,18 @@ limitations under the License. #include "tensorflow/lite/experimental/resource/resource_base.h" #include "tensorflow/lite/external_cpu_backend_context.h" #include "tensorflow/lite/memory_planner.h" +#include "tensorflow/lite/portable_type_to_tflitetype.h" #include "tensorflow/lite/stderr_reporter.h" +#include "tensorflow/lite/string_type.h" #include "tensorflow/lite/type_to_tflitetype.h" namespace tflite { class InterpreterTest; // Class for friend declarations. + namespace delegates { class InterpreterUtils; // Class for friend declarations. + namespace test_utils { class TestDelegate; // Class for friend declarations. } // namespace test_utils diff --git a/tensorflow/lite/interpreter_builder.cc b/tensorflow/lite/interpreter_builder.cc index aac1a8cb153..50d96bf5aba 100644 --- a/tensorflow/lite/interpreter_builder.cc +++ b/tensorflow/lite/interpreter_builder.cc @@ -14,26 +14,33 @@ limitations under the License. ==============================================================================*/ #include "tensorflow/lite/interpreter_builder.h" -#include +#include #include -#include #include -#include -#include +#include +#include #include +#include #include +#include +#include -#include "tensorflow/lite/allocation.h" -#include "tensorflow/lite/c/builtin_op_data.h" -#include "tensorflow/lite/c/common.h" +#include "flatbuffers/flatbuffers.h" // from @flatbuffers #include "tensorflow/lite/core/api/error_reporter.h" #include "tensorflow/lite/core/api/flatbuffer_conversions.h" +#include "tensorflow/lite/core/api/op_resolver.h" +#include "tensorflow/lite/core/macros.h" +#include "tensorflow/lite/core/subgraph.h" +#include "tensorflow/lite/interpreter.h" #include "tensorflow/lite/kernels/internal/compatibility.h" +#include "tensorflow/lite/model_builder.h" #include "tensorflow/lite/profiling/platform_profiler.h" #include "tensorflow/lite/schema/schema_generated.h" #include "tensorflow/lite/schema/schema_utils.h" #include "tensorflow/lite/shared_library.h" +#include "tensorflow/lite/stderr_reporter.h" +#include "tensorflow/lite/string_type.h" #include "tensorflow/lite/util.h" #include "tensorflow/lite/version.h" diff --git a/tensorflow/lite/interpreter_builder.h b/tensorflow/lite/interpreter_builder.h index 262d485ca39..7d65dade778 100644 --- a/tensorflow/lite/interpreter_builder.h +++ b/tensorflow/lite/interpreter_builder.h @@ -19,14 +19,19 @@ limitations under the License. #define TENSORFLOW_LITE_INTERPRETER_BUILDER_H_ #include +#include +#include "flatbuffers/flatbuffers.h" // from @flatbuffers +#include "tensorflow/lite/allocation.h" #include "tensorflow/lite/c/common.h" #include "tensorflow/lite/core/api/error_reporter.h" #include "tensorflow/lite/core/api/op_resolver.h" +#include "tensorflow/lite/core/subgraph.h" #include "tensorflow/lite/interpreter.h" #include "tensorflow/lite/model_builder.h" #include "tensorflow/lite/mutable_op_resolver.h" #include "tensorflow/lite/schema/schema_generated.h" +#include "tensorflow/lite/stderr_reporter.h" namespace tflite { diff --git a/tensorflow/lite/interpreter_test.cc b/tensorflow/lite/interpreter_test.cc index dbc87bfb3e3..010beeb8f76 100644 --- a/tensorflow/lite/interpreter_test.cc +++ b/tensorflow/lite/interpreter_test.cc @@ -15,26 +15,31 @@ limitations under the License. #include "tensorflow/lite/interpreter.h" +#include #include +#include +#include +#include #include +#include +#include +#include +#include #include #include #include "third_party/eigen3/Eigen/Core" -#include "tensorflow/lite/builtin_op_data.h" -#include "tensorflow/lite/core/api/error_reporter.h" +#include "tensorflow/lite/c/builtin_op_data.h" #include "tensorflow/lite/external_cpu_backend_context.h" #include "tensorflow/lite/interpreter_test_util.h" #include "tensorflow/lite/kernels/builtin_op_kernels.h" -#include "tensorflow/lite/kernels/cpu_backend_context.h" #include "tensorflow/lite/kernels/internal/compatibility.h" #include "tensorflow/lite/kernels/kernel_util.h" -#include "tensorflow/lite/kernels/register.h" -#include "tensorflow/lite/schema/schema_generated.h" +#include "tensorflow/lite/string_type.h" #include "tensorflow/lite/string_util.h" #include "tensorflow/lite/testing/util.h" -#include "tensorflow/lite/version.h" +#include "tensorflow/lite/util.h" namespace tflite { diff --git a/tensorflow/lite/minimal_logging_default.cc b/tensorflow/lite/minimal_logging_default.cc index 54a355a2dfa..f49481fba8e 100644 --- a/tensorflow/lite/minimal_logging_default.cc +++ b/tensorflow/lite/minimal_logging_default.cc @@ -13,10 +13,12 @@ See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ -#include "tensorflow/lite/minimal_logging.h" +#include #include +#include "tensorflow/lite/minimal_logging.h" + namespace tflite { namespace logging_internal { diff --git a/tensorflow/lite/minimal_logging_test.cc b/tensorflow/lite/minimal_logging_test.cc index b5212452dab..337385618c0 100644 --- a/tensorflow/lite/minimal_logging_test.cc +++ b/tensorflow/lite/minimal_logging_test.cc @@ -15,8 +15,6 @@ limitations under the License. #include "tensorflow/lite/minimal_logging.h" -#include - #include namespace tflite { diff --git a/tensorflow/lite/mmap_allocation.cc b/tensorflow/lite/mmap_allocation.cc index b5074ba58b3..ce6e71b57d2 100644 --- a/tensorflow/lite/mmap_allocation.cc +++ b/tensorflow/lite/mmap_allocation.cc @@ -14,9 +14,9 @@ limitations under the License. ==============================================================================*/ #include +#include #include #include -#include #include #include "tensorflow/lite/allocation.h" diff --git a/tensorflow/lite/model_builder.cc b/tensorflow/lite/model_builder.cc index 23e6ea3322f..b1231bd44d2 100644 --- a/tensorflow/lite/model_builder.cc +++ b/tensorflow/lite/model_builder.cc @@ -14,20 +14,20 @@ limitations under the License. ==============================================================================*/ #include "tensorflow/lite/model_builder.h" -#include +#include #include -#include -#include -#include -#include -#include "tensorflow/lite/c/builtin_op_data.h" -#include "tensorflow/lite/c/common.h" +#include +#include +#include + +#include "flatbuffers/flatbuffers.h" // from @flatbuffers +#include "tensorflow/lite/allocation.h" #include "tensorflow/lite/core/api/error_reporter.h" -#include "tensorflow/lite/core/api/flatbuffer_conversions.h" +#include "tensorflow/lite/core/api/verifier.h" #include "tensorflow/lite/schema/schema_generated.h" -#include "tensorflow/lite/util.h" -#include "tensorflow/lite/version.h" +#include "tensorflow/lite/stderr_reporter.h" +#include "tensorflow/lite/string_type.h" namespace tflite { diff --git a/tensorflow/lite/model_builder.h b/tensorflow/lite/model_builder.h index 9ffb54ce2b8..3bcb68dfcc7 100644 --- a/tensorflow/lite/model_builder.h +++ b/tensorflow/lite/model_builder.h @@ -20,7 +20,10 @@ limitations under the License. #ifndef TENSORFLOW_LITE_MODEL_BUILDER_H_ #define TENSORFLOW_LITE_MODEL_BUILDER_H_ +#include + #include +#include #include "tensorflow/lite/allocation.h" #include "tensorflow/lite/c/common.h" @@ -30,6 +33,7 @@ limitations under the License. #include "tensorflow/lite/mutable_op_resolver.h" #include "tensorflow/lite/schema/schema_generated.h" #include "tensorflow/lite/stderr_reporter.h" +#include "tensorflow/lite/string_type.h" namespace tflite { diff --git a/tensorflow/lite/model_flex_test.cc b/tensorflow/lite/model_flex_test.cc index 88b3c886b21..52d120cdb3b 100644 --- a/tensorflow/lite/model_flex_test.cc +++ b/tensorflow/lite/model_flex_test.cc @@ -12,10 +12,13 @@ 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. ==============================================================================*/ -#include "tensorflow/lite/model.h" +#include #include +#include "tensorflow/lite/interpreter.h" +#include "tensorflow/lite/interpreter_builder.h" #include "tensorflow/lite/kernels/register.h" +#include "tensorflow/lite/model_builder.h" #include "tensorflow/lite/testing/util.h" namespace tflite { diff --git a/tensorflow/lite/model_test.cc b/tensorflow/lite/model_test.cc index c419ad218ff..311cf7a9f6f 100644 --- a/tensorflow/lite/model_test.cc +++ b/tensorflow/lite/model_test.cc @@ -14,18 +14,31 @@ limitations under the License. ==============================================================================*/ #include "tensorflow/lite/model.h" -#include +#include #include -#include #include +#include #include -#include +#include +#include +#include +#include +#include #include +#include "flatbuffers/flatbuffers.h" // from @flatbuffers +#include "tensorflow/lite/allocation.h" #include "tensorflow/lite/core/api/error_reporter.h" +#include "tensorflow/lite/core/api/op_resolver.h" +#include "tensorflow/lite/core/api/verifier.h" +#include "tensorflow/lite/interpreter.h" +#include "tensorflow/lite/interpreter_builder.h" #include "tensorflow/lite/interpreter_test_util.h" #include "tensorflow/lite/kernels/register.h" +#include "tensorflow/lite/model_builder.h" +#include "tensorflow/lite/schema/schema_generated.h" +#include "tensorflow/lite/string_type.h" #include "tensorflow/lite/string_util.h" #include "tensorflow/lite/testing/util.h" diff --git a/tensorflow/lite/model_xnnpack_test.cc b/tensorflow/lite/model_xnnpack_test.cc index f04334c7711..bd2f90d436a 100644 --- a/tensorflow/lite/model_xnnpack_test.cc +++ b/tensorflow/lite/model_xnnpack_test.cc @@ -12,12 +12,18 @@ 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. ==============================================================================*/ +#include #include +#include +#include #include #include "tensorflow/lite/core/macros.h" +#include "tensorflow/lite/interpreter.h" +#include "tensorflow/lite/interpreter_builder.h" #include "tensorflow/lite/kernels/register.h" -#include "tensorflow/lite/model.h" +#include "tensorflow/lite/model_builder.h" +#include "tensorflow/lite/string_type.h" #include "tensorflow/lite/util.h" namespace tflite { diff --git a/tensorflow/lite/mutable_op_resolver.cc b/tensorflow/lite/mutable_op_resolver.cc index 5cb6ed169e7..e8b23201ccf 100644 --- a/tensorflow/lite/mutable_op_resolver.cc +++ b/tensorflow/lite/mutable_op_resolver.cc @@ -15,6 +15,13 @@ limitations under the License. #include "tensorflow/lite/mutable_op_resolver.h" +#include +#include +#include + +#include "tensorflow/lite/c/common.h" +#include "tensorflow/lite/schema/schema_generated.h" + namespace tflite { const TfLiteRegistration* MutableOpResolver::FindOp(tflite::BuiltinOperator op, diff --git a/tensorflow/lite/mutable_op_resolver.h b/tensorflow/lite/mutable_op_resolver.h index 69ecbbd6723..4ad4b034b43 100644 --- a/tensorflow/lite/mutable_op_resolver.h +++ b/tensorflow/lite/mutable_op_resolver.h @@ -15,10 +15,15 @@ limitations under the License. #ifndef TENSORFLOW_LITE_MUTABLE_OP_RESOLVER_H_ #define TENSORFLOW_LITE_MUTABLE_OP_RESOLVER_H_ +#include + #include #include +#include +#include "tensorflow/lite/c/common.h" #include "tensorflow/lite/core/api/op_resolver.h" +#include "tensorflow/lite/schema/schema_generated.h" #include "tensorflow/lite/util.h" namespace tflite { diff --git a/tensorflow/lite/mutable_op_resolver_test.cc b/tensorflow/lite/mutable_op_resolver_test.cc index 71a30d95b16..f93bf234965 100644 --- a/tensorflow/lite/mutable_op_resolver_test.cc +++ b/tensorflow/lite/mutable_op_resolver_test.cc @@ -15,7 +15,11 @@ limitations under the License. #include "tensorflow/lite/mutable_op_resolver.h" +#include + #include +#include "tensorflow/lite/c/common.h" +#include "tensorflow/lite/schema/schema_generated.h" #include "tensorflow/lite/testing/util.h" namespace tflite { diff --git a/tensorflow/lite/optional_debug_tools.cc b/tensorflow/lite/optional_debug_tools.cc index 343f6d341db..a4ba246d6ee 100644 --- a/tensorflow/lite/optional_debug_tools.cc +++ b/tensorflow/lite/optional_debug_tools.cc @@ -14,8 +14,15 @@ limitations under the License. ==============================================================================*/ #include "tensorflow/lite/optional_debug_tools.h" -#include "tensorflow/lite/c/common.h" +#include +#include + +#include +#include + +#include "tensorflow/lite/interpreter.h" #include "tensorflow/lite/schema/schema_generated.h" + namespace tflite { void PrintIntVector(const std::vector& v) { diff --git a/tensorflow/lite/portable_type_to_tflitetype.h b/tensorflow/lite/portable_type_to_tflitetype.h index 9bfaf6b7409..9fbcfb8ed1e 100644 --- a/tensorflow/lite/portable_type_to_tflitetype.h +++ b/tensorflow/lite/portable_type_to_tflitetype.h @@ -25,6 +25,8 @@ limitations under the License. #undef abs #endif +#include + #include "tensorflow/lite/c/common.h" namespace tflite { diff --git a/tensorflow/lite/simple_memory_arena.cc b/tensorflow/lite/simple_memory_arena.cc index 4aa0a1eb2ef..2c16688bed4 100644 --- a/tensorflow/lite/simple_memory_arena.cc +++ b/tensorflow/lite/simple_memory_arena.cc @@ -15,11 +15,18 @@ limitations under the License. #include "tensorflow/lite/simple_memory_arena.h" +#include +#include + #include #include +#include #include +#include #include +#include "tensorflow/lite/c/common.h" + namespace { template diff --git a/tensorflow/lite/simple_memory_arena.h b/tensorflow/lite/simple_memory_arena.h index 803b8be174f..b83ac606b62 100644 --- a/tensorflow/lite/simple_memory_arena.h +++ b/tensorflow/lite/simple_memory_arena.h @@ -15,6 +15,8 @@ limitations under the License. #ifndef TENSORFLOW_LITE_SIMPLE_MEMORY_ARENA_H_ #define TENSORFLOW_LITE_SIMPLE_MEMORY_ARENA_H_ +#include + #include #include #include diff --git a/tensorflow/lite/simple_memory_arena_test.cc b/tensorflow/lite/simple_memory_arena_test.cc index 0196421cc9c..0aecb3d63ab 100644 --- a/tensorflow/lite/simple_memory_arena_test.cc +++ b/tensorflow/lite/simple_memory_arena_test.cc @@ -14,9 +14,8 @@ limitations under the License. ==============================================================================*/ #include "tensorflow/lite/simple_memory_arena.h" -#include #include -#include "tensorflow/core/platform/logging.h" +#include "tensorflow/lite/c/common.h" #include "tensorflow/lite/testing/util.h" namespace tflite { diff --git a/tensorflow/lite/stderr_reporter.cc b/tensorflow/lite/stderr_reporter.cc index 2eecbbf7a93..0a01ba47068 100644 --- a/tensorflow/lite/stderr_reporter.cc +++ b/tensorflow/lite/stderr_reporter.cc @@ -14,6 +14,9 @@ limitations under the License. ==============================================================================*/ #include "tensorflow/lite/stderr_reporter.h" +#include + +#include "tensorflow/lite/core/api/error_reporter.h" #include "tensorflow/lite/minimal_logging.h" namespace tflite { diff --git a/tensorflow/lite/stderr_reporter_test.cc b/tensorflow/lite/stderr_reporter_test.cc index 264b7f7b313..13f54102f44 100644 --- a/tensorflow/lite/stderr_reporter_test.cc +++ b/tensorflow/lite/stderr_reporter_test.cc @@ -14,9 +14,8 @@ limitations under the License. ==============================================================================*/ #include "tensorflow/lite/stderr_reporter.h" -#include - #include +#include "tensorflow/lite/core/api/error_reporter.h" namespace tflite { diff --git a/tensorflow/lite/string_util.cc b/tensorflow/lite/string_util.cc index 799a850a0d4..e83c4aca2ca 100644 --- a/tensorflow/lite/string_util.cc +++ b/tensorflow/lite/string_util.cc @@ -15,6 +15,9 @@ limitations under the License. #include "tensorflow/lite/string_util.h" +#include +#include + #include #include #include diff --git a/tensorflow/lite/string_util.h b/tensorflow/lite/string_util.h index b8f3fcd3b9f..ad4f331674e 100644 --- a/tensorflow/lite/string_util.h +++ b/tensorflow/lite/string_util.h @@ -41,6 +41,9 @@ limitations under the License. #ifndef TENSORFLOW_LITE_STRING_UTIL_H_ #define TENSORFLOW_LITE_STRING_UTIL_H_ +#include +#include + #include #include "tensorflow/lite/c/common.h" diff --git a/tensorflow/lite/string_util_test.cc b/tensorflow/lite/string_util_test.cc index d5c4909fcad..ab77faa7045 100644 --- a/tensorflow/lite/string_util_test.cc +++ b/tensorflow/lite/string_util_test.cc @@ -14,9 +14,13 @@ limitations under the License. ==============================================================================*/ #include "tensorflow/lite/string_util.h" +#include + +#include + #include -#include "tensorflow/lite/c/common.h" #include "tensorflow/lite/interpreter.h" +#include "tensorflow/lite/string_type.h" #include "tensorflow/lite/testing/util.h" namespace tflite { diff --git a/tensorflow/lite/tflite_with_xnnpack_optional.cc b/tensorflow/lite/tflite_with_xnnpack_optional.cc index 31d4ff50f28..a29ab755c1c 100644 --- a/tensorflow/lite/tflite_with_xnnpack_optional.cc +++ b/tensorflow/lite/tflite_with_xnnpack_optional.cc @@ -14,6 +14,9 @@ limitations under the License. ==============================================================================*/ #include "tensorflow/lite/tflite_with_xnnpack_optional.h" +#include + +#include "tensorflow/lite/c/common.h" #include "tensorflow/lite/core/macros.h" #ifdef TFLITE_BUILD_WITH_XNNPACK_DELEGATE diff --git a/tensorflow/lite/type_to_tflitetype_test.cc b/tensorflow/lite/type_to_tflitetype_test.cc index 51148531913..da6d7a63cc7 100644 --- a/tensorflow/lite/type_to_tflitetype_test.cc +++ b/tensorflow/lite/type_to_tflitetype_test.cc @@ -16,8 +16,11 @@ limitations under the License. #include "tensorflow/lite/type_to_tflitetype.h" #include +#include #include +#include "tensorflow/lite/c/c_api_types.h" +#include "tensorflow/lite/portable_type_to_tflitetype.h" namespace tflite { namespace { diff --git a/tensorflow/lite/util.cc b/tensorflow/lite/util.cc index 9cb020408ed..c168ca21df3 100644 --- a/tensorflow/lite/util.cc +++ b/tensorflow/lite/util.cc @@ -14,8 +14,16 @@ limitations under the License. ==============================================================================*/ #include "tensorflow/lite/util.h" +#include +#include + +#include #include #include +#include +#include +#include +#include #include "tensorflow/lite/builtin_ops.h" #include "tensorflow/lite/c/common.h" diff --git a/tensorflow/lite/util.h b/tensorflow/lite/util.h index cf4576db834..9aaab40bf49 100644 --- a/tensorflow/lite/util.h +++ b/tensorflow/lite/util.h @@ -21,6 +21,9 @@ limitations under the License. #ifndef TENSORFLOW_LITE_UTIL_H_ #define TENSORFLOW_LITE_UTIL_H_ +#include + +#include #include #include #include diff --git a/tensorflow/lite/util_test.cc b/tensorflow/lite/util_test.cc index e282431284b..47726bcdb17 100644 --- a/tensorflow/lite/util_test.cc +++ b/tensorflow/lite/util_test.cc @@ -15,9 +15,12 @@ limitations under the License. #include "tensorflow/lite/util.h" +#include +#include + +#include #include -#include #include #include "tensorflow/lite/c/common.h" #include "tensorflow/lite/schema/schema_generated.h"