diff --git a/tensorflow/lite/g3doc/microcontrollers/get_started.md b/tensorflow/lite/g3doc/microcontrollers/get_started.md index 96fa336c2ef..7602145df1f 100644 --- a/tensorflow/lite/g3doc/microcontrollers/get_started.md +++ b/tensorflow/lite/g3doc/microcontrollers/get_started.md @@ -95,14 +95,14 @@ To use the TensorFlow Lite for Microcontrollers library, we must include the following header files: ```C++ -#include "tensorflow/lite/micro/kernels/all_ops_resolver.h" +#include "tensorflow/lite/micro/all_ops_resolver.h" #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" ``` -- [`all_ops_resolver.h`](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/lite/micro/kernels/all_ops_resolver.h) +- [`all_ops_resolver.h`](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/lite/micro/all_ops_resolver.h) provides the operations used by the interpreter to run the model. - [`micro_error_reporter.h`](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/lite/micro/micro_error_reporter.h) outputs debug information. @@ -182,12 +182,12 @@ if (model->version() != TFLITE_SCHEMA_VERSION) { ### 6. Instantiate operations resolver An -[`AllOpsResolver`](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/lite/micro/kernels/all_ops_resolver.h) +[`AllOpsResolver`](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/lite/micro/all_ops_resolver.h) instance is declared. This will be used by the interpreter to access the operations that are used by the model: ```C++ -tflite::ops::micro::AllOpsResolver resolver; +tflite::AllOpsResolver resolver; ``` The `AllOpsResolver` loads all of the operations available in TensorFlow Lite diff --git a/tensorflow/lite/micro/BUILD b/tensorflow/lite/micro/BUILD index ae4ba2fefd6..e8e489141ed 100644 --- a/tensorflow/lite/micro/BUILD +++ b/tensorflow/lite/micro/BUILD @@ -36,8 +36,6 @@ cc_library( "memory_helpers.h", "micro_allocator.h", "micro_interpreter.h", - "micro_mutable_op_resolver.h", - "micro_op_resolver.h", "micro_optional_debug_tools.h", "simple_memory_allocator.h", "test_helpers.h", @@ -47,6 +45,7 @@ cc_library( deps = [ ":micro_compatibility", ":micro_utils", + ":op_resolvers", "//tensorflow/lite:type_to_tflitetype", "//tensorflow/lite/c:common", "//tensorflow/lite/core/api", @@ -59,6 +58,49 @@ cc_library( ], ) +cc_library( + name = "op_resolvers", + srcs = [ + "all_ops_resolver.cc", + ], + hdrs = [ + "all_ops_resolver.h", + "micro_mutable_op_resolver.h", + "micro_op_resolver.h", + ], + build_for_embedded = True, + copts = micro_copts(), + deps = [ + ":micro_compatibility", + "//tensorflow/lite/c:common", + "//tensorflow/lite/core/api", + "//tensorflow/lite/micro/kernels:micro_ops", + "//tensorflow/lite/schema:schema_fbs", + ], +) + +# TODO(b/144176795): This target should really be handled differently so that we +# do not have a fork in the build graph. The bug has some initial ideas. +cc_library( + name = "portable_optimized_op_resolver", + srcs = [ + "all_ops_resolver.cc", + "micro_mutable_op_resolver.h", + "micro_op_resolver.h", + ], + hdrs = [ + "all_ops_resolver.h", + ], + copts = micro_copts(), + deps = [ + ":micro_compatibility", + "//tensorflow/lite/c:common", + "//tensorflow/lite/core/api", + "//tensorflow/lite/micro/kernels:portable_optimized_micro_ops", + "//tensorflow/lite/schema:schema_fbs", + ], +) + cc_library( name = "debug_log", srcs = [ @@ -164,6 +206,7 @@ tflite_micro_cc_test( ], deps = [ ":micro_framework", + ":op_resolvers", "//tensorflow/lite/micro/testing:micro_test", ], ) @@ -176,6 +219,7 @@ tflite_micro_cc_test( deps = [ ":micro_framework", ":micro_utils", + ":op_resolvers", "//tensorflow/lite/core/api", "//tensorflow/lite/kernels:kernel_util", "//tensorflow/lite/micro/testing:micro_test", diff --git a/tensorflow/lite/micro/all_ops_resolver.cc b/tensorflow/lite/micro/all_ops_resolver.cc new file mode 100644 index 00000000000..591b67dcfe0 --- /dev/null +++ b/tensorflow/lite/micro/all_ops_resolver.cc @@ -0,0 +1,90 @@ +/* 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. +==============================================================================*/ + +#include "tensorflow/lite/micro/all_ops_resolver.h" + +#include "tensorflow/lite/micro/kernels/micro_ops.h" + +namespace tflite { + +AllOpsResolver::AllOpsResolver() { + // Please keep this list of Builtin Operators in alphabetical order. + AddBuiltin(BuiltinOperator_ABS, tflite::ops::micro::Register_ABS()); + AddBuiltin(BuiltinOperator_ADD, tflite::ops::micro::Register_ADD()); + AddBuiltin(BuiltinOperator_ARG_MAX, tflite::ops::micro::Register_ARG_MAX()); + AddBuiltin(BuiltinOperator_ARG_MIN, tflite::ops::micro::Register_ARG_MIN()); + AddBuiltin(BuiltinOperator_AVERAGE_POOL_2D, + tflite::ops::micro::Register_AVERAGE_POOL_2D()); + AddBuiltin(BuiltinOperator_CEIL, tflite::ops::micro::Register_CEIL()); + AddBuiltin(BuiltinOperator_CONCATENATION, + tflite::ops::micro::Register_CONCATENATION()); + AddBuiltin(BuiltinOperator_CONV_2D, tflite::ops::micro::Register_CONV_2D()); + AddBuiltin(BuiltinOperator_COS, tflite::ops::micro::Register_COS()); + AddBuiltin(BuiltinOperator_DEPTHWISE_CONV_2D, + tflite::ops::micro::Register_DEPTHWISE_CONV_2D()); + AddBuiltin(BuiltinOperator_DEQUANTIZE, + tflite::ops::micro::Register_DEQUANTIZE()); + AddBuiltin(BuiltinOperator_EQUAL, tflite::ops::micro::Register_EQUAL()); + AddBuiltin(BuiltinOperator_FLOOR, tflite::ops::micro::Register_FLOOR()); + AddBuiltin(BuiltinOperator_FULLY_CONNECTED, + tflite::ops::micro::Register_FULLY_CONNECTED()); + AddBuiltin(BuiltinOperator_GREATER, tflite::ops::micro::Register_GREATER()); + AddBuiltin(BuiltinOperator_GREATER_EQUAL, + tflite::ops::micro::Register_GREATER_EQUAL()); + AddBuiltin(BuiltinOperator_L2_NORMALIZATION, + tflite::ops::micro::Register_L2_NORMALIZATION()); + AddBuiltin(BuiltinOperator_LESS, tflite::ops::micro::Register_LESS()); + AddBuiltin(BuiltinOperator_LESS_EQUAL, + tflite::ops::micro::Register_LESS_EQUAL()); + AddBuiltin(BuiltinOperator_LOG, tflite::ops::micro::Register_LOG()); + AddBuiltin(BuiltinOperator_LOGICAL_AND, + tflite::ops::micro::Register_LOGICAL_AND()); + AddBuiltin(BuiltinOperator_LOGICAL_NOT, + tflite::ops::micro::Register_LOGICAL_NOT()); + AddBuiltin(BuiltinOperator_LOGICAL_OR, + tflite::ops::micro::Register_LOGICAL_OR()); + AddBuiltin(BuiltinOperator_LOGISTIC, tflite::ops::micro::Register_LOGISTIC()); + AddBuiltin(BuiltinOperator_MAX_POOL_2D, + tflite::ops::micro::Register_MAX_POOL_2D()); + AddBuiltin(BuiltinOperator_MAXIMUM, tflite::ops::micro::Register_MAXIMUM()); + AddBuiltin(BuiltinOperator_MEAN, tflite::ops::micro::Register_MEAN()); + AddBuiltin(BuiltinOperator_MINIMUM, tflite::ops::micro::Register_MINIMUM()); + AddBuiltin(BuiltinOperator_MUL, tflite::ops::micro::Register_MUL()); + AddBuiltin(BuiltinOperator_NEG, tflite::ops::micro::Register_NEG()); + AddBuiltin(BuiltinOperator_NOT_EQUAL, + tflite::ops::micro::Register_NOT_EQUAL()); + AddBuiltin(BuiltinOperator_PACK, tflite::ops::micro::Register_PACK()); + AddBuiltin(BuiltinOperator_PAD, tflite::ops::micro::Register_PAD()); + AddBuiltin(BuiltinOperator_PADV2, tflite::ops::micro::Register_PADV2()); + AddBuiltin(BuiltinOperator_PRELU, tflite::ops::micro::Register_PRELU()); + AddBuiltin(BuiltinOperator_QUANTIZE, tflite::ops::micro::Register_QUANTIZE()); + AddBuiltin(BuiltinOperator_RELU, tflite::ops::micro::Register_RELU()); + AddBuiltin(BuiltinOperator_RELU6, tflite::ops::micro::Register_RELU6()); + AddBuiltin(BuiltinOperator_RESHAPE, tflite::ops::micro::Register_RESHAPE()); + AddBuiltin(BuiltinOperator_RESIZE_NEAREST_NEIGHBOR, + tflite::ops::micro::Register_RESIZE_NEAREST_NEIGHBOR()); + AddBuiltin(BuiltinOperator_ROUND, tflite::ops::micro::Register_ROUND()); + AddBuiltin(BuiltinOperator_RSQRT, tflite::ops::micro::Register_RSQRT()); + AddBuiltin(BuiltinOperator_SIN, tflite::ops::micro::Register_SIN()); + AddBuiltin(BuiltinOperator_SOFTMAX, tflite::ops::micro::Register_SOFTMAX()); + AddBuiltin(BuiltinOperator_SPLIT, tflite::ops::micro::Register_SPLIT()); + AddBuiltin(BuiltinOperator_SQRT, tflite::ops::micro::Register_SQRT()); + AddBuiltin(BuiltinOperator_SQUARE, tflite::ops::micro::Register_SQUARE()); + AddBuiltin(BuiltinOperator_STRIDED_SLICE, + tflite::ops::micro::Register_STRIDED_SLICE()); + AddBuiltin(BuiltinOperator_SUB, tflite::ops::micro::Register_SUB()); + AddBuiltin(BuiltinOperator_SVDF, tflite::ops::micro::Register_SVDF()); + AddBuiltin(BuiltinOperator_TANH, tflite::ops::micro::Register_TANH()); + AddBuiltin(BuiltinOperator_UNPACK, tflite::ops::micro::Register_UNPACK()); +} + +} // namespace tflite diff --git a/tensorflow/lite/micro/kernels/all_ops_resolver.h b/tensorflow/lite/micro/all_ops_resolver.h similarity index 83% rename from tensorflow/lite/micro/kernels/all_ops_resolver.h rename to tensorflow/lite/micro/all_ops_resolver.h index 5637316d0da..e8105b96e44 100644 --- a/tensorflow/lite/micro/kernels/all_ops_resolver.h +++ b/tensorflow/lite/micro/all_ops_resolver.h @@ -9,15 +9,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. ==============================================================================*/ -#ifndef TENSORFLOW_LITE_MICRO_KERNELS_ALL_OPS_RESOLVER_H_ -#define TENSORFLOW_LITE_MICRO_KERNELS_ALL_OPS_RESOLVER_H_ +#ifndef TENSORFLOW_LITE_MICRO_ALL_OPS_RESOLVER_H_ +#define TENSORFLOW_LITE_MICRO_ALL_OPS_RESOLVER_H_ #include "tensorflow/lite/micro/compatibility.h" #include "tensorflow/lite/micro/micro_mutable_op_resolver.h" namespace tflite { -namespace ops { -namespace micro { // The magic number in the template parameter is the maximum number of ops that // can be added to AllOpsResolver. It can be increased if needed. And most @@ -32,8 +30,6 @@ class AllOpsResolver : public MicroMutableOpResolver<128> { TF_LITE_REMOVE_VIRTUAL_DELETE }; -} // namespace micro -} // namespace ops } // namespace tflite -#endif // TENSORFLOW_LITE_MICRO_KERNELS_ALL_OPS_RESOLVER_H_ +#endif // TENSORFLOW_LITE_MICRO_ALL_OPS_RESOLVER_H_ diff --git a/tensorflow/lite/micro/benchmarks/BUILD b/tensorflow/lite/micro/benchmarks/BUILD index 73b288d2bc1..8c5238ef56b 100644 --- a/tensorflow/lite/micro/benchmarks/BUILD +++ b/tensorflow/lite/micro/benchmarks/BUILD @@ -48,6 +48,7 @@ cc_binary( "//tensorflow/lite/c:common", "//tensorflow/lite/micro:micro_error_reporter", "//tensorflow/lite/micro:micro_framework", + "//tensorflow/lite/micro:op_resolvers", "//tensorflow/lite/micro/kernels:micro_ops", "//tensorflow/lite/micro/testing:micro_benchmark", ], @@ -62,6 +63,7 @@ cc_binary( "//tensorflow/lite/micro:micro_error_reporter", "//tensorflow/lite/micro:micro_framework", "//tensorflow/lite/micro:micro_utils", + "//tensorflow/lite/micro:op_resolvers", "//tensorflow/lite/micro/examples/person_detection:model_settings", "//tensorflow/lite/micro/examples/person_detection:person_detect_model_data", "//tensorflow/lite/micro/examples/person_detection:simple_images_test_data", diff --git a/tensorflow/lite/micro/examples/hello_world/BUILD b/tensorflow/lite/micro/examples/hello_world/BUILD index 4488c192abb..7287ff41ff5 100644 --- a/tensorflow/lite/micro/examples/hello_world/BUILD +++ b/tensorflow/lite/micro/examples/hello_world/BUILD @@ -37,7 +37,7 @@ tflite_micro_cc_test( "//tensorflow/lite:schema_fbs_version", "//tensorflow/lite/micro:micro_error_reporter", "//tensorflow/lite/micro:micro_framework", - "//tensorflow/lite/micro/kernels:all_ops_resolver", + "//tensorflow/lite/micro:op_resolvers", "//tensorflow/lite/micro/kernels:micro_ops", "//tensorflow/lite/micro/testing:micro_test", "//tensorflow/lite/schema:schema_fbs", @@ -89,7 +89,7 @@ cc_binary( "//tensorflow/lite:schema_fbs_version", "//tensorflow/lite/micro:micro_error_reporter", "//tensorflow/lite/micro:micro_framework", - "//tensorflow/lite/micro/kernels:all_ops_resolver", + "//tensorflow/lite/micro:op_resolvers", "//tensorflow/lite/schema:schema_fbs", ], ) diff --git a/tensorflow/lite/micro/examples/hello_world/hello_world_test.cc b/tensorflow/lite/micro/examples/hello_world/hello_world_test.cc index 46976f30ecb..0a447440aea 100644 --- a/tensorflow/lite/micro/examples/hello_world/hello_world_test.cc +++ b/tensorflow/lite/micro/examples/hello_world/hello_world_test.cc @@ -14,8 +14,8 @@ limitations under the License. ==============================================================================*/ // #include "tensorflow/lite/c/common.h" +#include "tensorflow/lite/micro/all_ops_resolver.h" #include "tensorflow/lite/micro/examples/hello_world/model.h" -#include "tensorflow/lite/micro/kernels/all_ops_resolver.h" #include "tensorflow/lite/micro/micro_error_reporter.h" #include "tensorflow/lite/micro/micro_interpreter.h" #include "tensorflow/lite/micro/testing/micro_test.h" @@ -40,7 +40,7 @@ TF_LITE_MICRO_TEST(LoadModelAndPerformInference) { } // This pulls in all the operation implementations we need - tflite::ops::micro::AllOpsResolver resolver; + tflite::AllOpsResolver resolver; // Create an area of memory to use for input, output, and intermediate arrays. diff --git a/tensorflow/lite/micro/examples/hello_world/main_functions.cc b/tensorflow/lite/micro/examples/hello_world/main_functions.cc index d1c2cafe850..62db659374d 100644 --- a/tensorflow/lite/micro/examples/hello_world/main_functions.cc +++ b/tensorflow/lite/micro/examples/hello_world/main_functions.cc @@ -15,10 +15,10 @@ limitations under the License. #include "tensorflow/lite/micro/examples/hello_world/main_functions.h" +#include "tensorflow/lite/micro/all_ops_resolver.h" #include "tensorflow/lite/micro/examples/hello_world/constants.h" #include "tensorflow/lite/micro/examples/hello_world/model.h" #include "tensorflow/lite/micro/examples/hello_world/output_handler.h" -#include "tensorflow/lite/micro/kernels/all_ops_resolver.h" #include "tensorflow/lite/micro/micro_error_reporter.h" #include "tensorflow/lite/micro/micro_interpreter.h" #include "tensorflow/lite/schema/schema_generated.h" @@ -64,7 +64,7 @@ void setup() { // This pulls in all the operation implementations we need. // NOLINTNEXTLINE(runtime-global-variables) - static tflite::ops::micro::AllOpsResolver resolver; + static tflite::AllOpsResolver resolver; // Build an interpreter to run the model with. static tflite::MicroInterpreter static_interpreter( diff --git a/tensorflow/lite/micro/examples/magic_wand/BUILD b/tensorflow/lite/micro/examples/magic_wand/BUILD index b0be47c1eeb..3822e2b05af 100644 --- a/tensorflow/lite/micro/examples/magic_wand/BUILD +++ b/tensorflow/lite/micro/examples/magic_wand/BUILD @@ -43,7 +43,7 @@ tflite_micro_cc_test( "//tensorflow/lite:schema_fbs_version", "//tensorflow/lite/micro:micro_error_reporter", "//tensorflow/lite/micro:micro_framework", - "//tensorflow/lite/micro/kernels:all_ops_resolver", + "//tensorflow/lite/micro:op_resolvers", "//tensorflow/lite/micro/kernels:micro_ops", "//tensorflow/lite/micro/testing:micro_test", "//tensorflow/lite/schema:schema_fbs", @@ -81,6 +81,7 @@ tflite_micro_cc_test( "//tensorflow/lite/c:common", "//tensorflow/lite/micro:micro_error_reporter", "//tensorflow/lite/micro:micro_framework", + "//tensorflow/lite/micro:op_resolvers", "//tensorflow/lite/micro/testing:micro_test", ], ) @@ -159,6 +160,7 @@ cc_binary( "//tensorflow/lite:schema_fbs_version", "//tensorflow/lite/micro:micro_error_reporter", "//tensorflow/lite/micro:micro_framework", + "//tensorflow/lite/micro:op_resolvers", "//tensorflow/lite/micro/kernels:micro_ops", "//tensorflow/lite/schema:schema_fbs", ], diff --git a/tensorflow/lite/micro/examples/micro_speech/BUILD b/tensorflow/lite/micro/examples/micro_speech/BUILD index b487b895f7a..522b68e205f 100644 --- a/tensorflow/lite/micro/examples/micro_speech/BUILD +++ b/tensorflow/lite/micro/examples/micro_speech/BUILD @@ -52,9 +52,9 @@ tflite_micro_cc_test( "//tensorflow/lite:schema_fbs_version", "//tensorflow/lite/micro:micro_error_reporter", "//tensorflow/lite/micro:micro_framework", + "//tensorflow/lite/micro:op_resolvers", "//tensorflow/lite/micro/examples/micro_speech/micro_features:micro_features_test_data", "//tensorflow/lite/micro/examples/micro_speech/micro_features:model", - "//tensorflow/lite/micro/kernels:all_ops_resolver", "//tensorflow/lite/micro/kernels:micro_ops", "//tensorflow/lite/micro/testing:micro_test", "//tensorflow/lite/schema:schema_fbs", @@ -364,6 +364,7 @@ cc_binary( "//tensorflow/lite:schema_fbs_version", "//tensorflow/lite/micro:micro_error_reporter", "//tensorflow/lite/micro:micro_framework", + "//tensorflow/lite/micro:op_resolvers", "//tensorflow/lite/micro/examples/micro_speech/micro_features:micro_model_settings", "//tensorflow/lite/micro/examples/micro_speech/micro_features:model", "//tensorflow/lite/micro/kernels:micro_ops", @@ -386,6 +387,7 @@ cc_binary( "//tensorflow/lite:schema_fbs_version", "//tensorflow/lite/micro:micro_error_reporter", "//tensorflow/lite/micro:micro_framework", + "//tensorflow/lite/micro:op_resolvers", "//tensorflow/lite/micro/examples/micro_speech/micro_features:micro_model_settings", "//tensorflow/lite/micro/examples/micro_speech/micro_features:model", "//tensorflow/lite/micro/kernels:micro_ops", diff --git a/tensorflow/lite/micro/examples/micro_speech/apollo3/pushbutton_test.cc b/tensorflow/lite/micro/examples/micro_speech/apollo3/pushbutton_test.cc index 1126d7db4d1..a9ca638905f 100644 --- a/tensorflow/lite/micro/examples/micro_speech/apollo3/pushbutton_test.cc +++ b/tensorflow/lite/micro/examples/micro_speech/apollo3/pushbutton_test.cc @@ -17,9 +17,9 @@ limitations under the License. * micro_speech_test.cc */ #include "tensorflow/lite/c/common.h" +#include "tensorflow/lite/micro/all_ops_resolver.h" #include "tensorflow/lite/micro/examples/micro_speech/simple_features/model.h" #include "tensorflow/lite/micro/examples/micro_speech/simple_features/simple_features_generator.h" -#include "tensorflow/lite/micro/kernels/all_ops_resolver.h" #include "tensorflow/lite/micro/micro_error_reporter.h" #include "tensorflow/lite/micro/micro_interpreter.h" #include "tensorflow/lite/micro/testing/micro_test.h" @@ -69,7 +69,7 @@ TF_LITE_MICRO_TEST(TestSimpleFeaturesGenerator) { } // This pulls in all the operation implementations we need. - tflite::ops::micro::AllOpsResolver resolver; + tflite::AllOpsResolver resolver; // Create an area of memory to use for input, output, and intermediate arrays. const int tensor_arena_size = 10 * 1024; diff --git a/tensorflow/lite/micro/examples/micro_speech/main_functions.cc b/tensorflow/lite/micro/examples/micro_speech/main_functions.cc index 5369008182b..8360bba9f00 100644 --- a/tensorflow/lite/micro/examples/micro_speech/main_functions.cc +++ b/tensorflow/lite/micro/examples/micro_speech/main_functions.cc @@ -72,7 +72,7 @@ void setup() { // incur some penalty in code space for op implementations that are not // needed by this graph. // - // tflite::ops::micro::AllOpsResolver resolver; + // tflite::AllOpsResolver resolver; // NOLINTNEXTLINE(runtime-global-variables) static tflite::MicroMutableOpResolver<4> micro_op_resolver(error_reporter); if (micro_op_resolver.AddBuiltin( diff --git a/tensorflow/lite/micro/examples/micro_speech/micro_speech_test.cc b/tensorflow/lite/micro/examples/micro_speech/micro_speech_test.cc index b1b224c9391..30837092e88 100644 --- a/tensorflow/lite/micro/examples/micro_speech/micro_speech_test.cc +++ b/tensorflow/lite/micro/examples/micro_speech/micro_speech_test.cc @@ -47,7 +47,7 @@ TF_LITE_MICRO_TEST(TestInvoke) { // incur some penalty in code space for op implementations that are not // needed by this graph. // - // tflite::ops::micro::AllOpsResolver resolver; + // tflite::AllOpsResolver resolver; tflite::MicroMutableOpResolver<4> micro_op_resolver; micro_op_resolver.AddBuiltin(tflite::BuiltinOperator_DEPTHWISE_CONV_2D, tflite::ops::micro::Register_DEPTHWISE_CONV_2D(), diff --git a/tensorflow/lite/micro/examples/network_tester/network_tester_test.cc b/tensorflow/lite/micro/examples/network_tester/network_tester_test.cc index 0650222b970..9295c87063b 100644 --- a/tensorflow/lite/micro/examples/network_tester/network_tester_test.cc +++ b/tensorflow/lite/micro/examples/network_tester/network_tester_test.cc @@ -10,10 +10,10 @@ See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ +#include "tensorflow/lite/micro/all_ops_resolver.h" #include "tensorflow/lite/micro/examples/network_tester/expected_output_data.h" #include "tensorflow/lite/micro/examples/network_tester/input_data.h" #include "tensorflow/lite/micro/examples/network_tester/network_model.h" -#include "tensorflow/lite/micro/kernels/all_ops_resolver.h" #include "tensorflow/lite/micro/micro_error_reporter.h" #include "tensorflow/lite/micro/micro_interpreter.h" #include "tensorflow/lite/micro/testing/micro_test.h" @@ -66,7 +66,7 @@ TF_LITE_MICRO_TEST(TestInvoke) { return 1; } - tflite::ops::micro::AllOpsResolver resolver; + tflite::AllOpsResolver resolver; tflite::MicroInterpreter interpreter(model, resolver, tensor_arena, TENSOR_ARENA_SIZE, error_reporter); diff --git a/tensorflow/lite/micro/examples/person_detection/BUILD b/tensorflow/lite/micro/examples/person_detection/BUILD index 84eddba73d4..8617373cb41 100644 --- a/tensorflow/lite/micro/examples/person_detection/BUILD +++ b/tensorflow/lite/micro/examples/person_detection/BUILD @@ -114,6 +114,7 @@ cc_binary( "//tensorflow/lite:schema_fbs_version", "//tensorflow/lite/micro:micro_error_reporter", "//tensorflow/lite/micro:micro_framework", + "//tensorflow/lite/micro:op_resolvers", "//tensorflow/lite/micro/kernels:micro_ops", "//tensorflow/lite/schema:schema_fbs", ], diff --git a/tensorflow/lite/micro/examples/person_detection/main_functions.cc b/tensorflow/lite/micro/examples/person_detection/main_functions.cc index 6b07f6514d5..aa4d83a3334 100644 --- a/tensorflow/lite/micro/examples/person_detection/main_functions.cc +++ b/tensorflow/lite/micro/examples/person_detection/main_functions.cc @@ -63,7 +63,7 @@ void setup() { // incur some penalty in code space for op implementations that are not // needed by this graph. // - // tflite::ops::micro::AllOpsResolver resolver; + // tflite::AllOpsResolver resolver; // NOLINTNEXTLINE(runtime-global-variables) static tflite::MicroMutableOpResolver<3> micro_op_resolver; micro_op_resolver.AddBuiltin( diff --git a/tensorflow/lite/micro/examples/person_detection/person_detection_test.cc b/tensorflow/lite/micro/examples/person_detection/person_detection_test.cc index dafed8089e3..abe87636284 100644 --- a/tensorflow/lite/micro/examples/person_detection/person_detection_test.cc +++ b/tensorflow/lite/micro/examples/person_detection/person_detection_test.cc @@ -53,7 +53,7 @@ TF_LITE_MICRO_TEST(TestInvoke) { // incur some penalty in code space for op implementations that are not // needed by this graph. // - // tflite::ops::micro::AllOpsResolver resolver; + // tflite::AllOpsResolver resolver; tflite::MicroMutableOpResolver<3> micro_op_resolver; micro_op_resolver.AddBuiltin( tflite::BuiltinOperator_DEPTHWISE_CONV_2D, diff --git a/tensorflow/lite/micro/examples/person_detection_experimental/BUILD b/tensorflow/lite/micro/examples/person_detection_experimental/BUILD index 49f10c814cb..fd726544be3 100644 --- a/tensorflow/lite/micro/examples/person_detection_experimental/BUILD +++ b/tensorflow/lite/micro/examples/person_detection_experimental/BUILD @@ -71,6 +71,7 @@ tflite_micro_cc_test( "//tensorflow/lite/c:common", "//tensorflow/lite/micro:micro_error_reporter", "//tensorflow/lite/micro:micro_framework", + "//tensorflow/lite/micro/kernels:micro_ops", "//tensorflow/lite/micro/testing:micro_test", ], ) @@ -115,6 +116,7 @@ cc_binary( "//tensorflow/lite:schema_fbs_version", "//tensorflow/lite/micro:micro_error_reporter", "//tensorflow/lite/micro:micro_framework", + "//tensorflow/lite/micro:op_resolvers", "//tensorflow/lite/micro/kernels:micro_ops", "//tensorflow/lite/schema:schema_fbs", ], diff --git a/tensorflow/lite/micro/examples/person_detection_experimental/main_functions.cc b/tensorflow/lite/micro/examples/person_detection_experimental/main_functions.cc index 3090356ee0d..ac47e36ff8f 100644 --- a/tensorflow/lite/micro/examples/person_detection_experimental/main_functions.cc +++ b/tensorflow/lite/micro/examples/person_detection_experimental/main_functions.cc @@ -70,7 +70,7 @@ void setup() { // incur some penalty in code space for op implementations that are not // needed by this graph. // - // tflite::ops::micro::AllOpsResolver resolver; + // tflite::AllOpsResolver resolver; // NOLINTNEXTLINE(runtime-global-variables) static tflite::MicroMutableOpResolver<5> micro_op_resolver; micro_op_resolver.AddBuiltin( diff --git a/tensorflow/lite/micro/kernels/BUILD b/tensorflow/lite/micro/kernels/BUILD index bbb5c67d9e5..374462f6ec0 100644 --- a/tensorflow/lite/micro/kernels/BUILD +++ b/tensorflow/lite/micro/kernels/BUILD @@ -8,18 +8,18 @@ load( "micro_copts", ) -package( - default_visibility = [ - "//visibility:public", - ], - licenses = ["notice"], # Apache 2.0 -) +licenses(["notice"]) # Apache 2.0 config_setting( name = "xtensa_hifimini", define_values = {"tflm_build": "xtensa_hifimini"}, ) +package_group( + name = "micro_top_level", + packages = ["//tensorflow/lite/micro"], +) + # LINT.IfChange(micro_ops) cc_library( name = "micro_ops", @@ -76,6 +76,14 @@ cc_library( # TODO(b/153609488): enable embedded build once we can properly support it. #build_for_embedded = True, copts = micro_copts(), + visibility = [ + # Needed for micro:op_resolvers but visibility can not be + # finer-grained than a package. + #":micro_top_level", + # Currently setting to public for legacy reasons. Can be made more + # restrictive once cl/314173854 lands. + "//visibility:public", + ], deps = [ ":activation_utils", ":micro_utils", @@ -99,24 +107,6 @@ cc_library( ) # LINT.ThenChange(//tensorflow/lite/micro/kernels/BUILD:portable_optimized_micro_ops) -cc_library( - name = "all_ops_resolver", - srcs = [ - "all_ops_resolver.cc", - ], - hdrs = [ - "all_ops_resolver.h", - ], - # TODO(b/153609488): enable embedded build once we can properly support it. - #build_for_embedded = True, - copts = micro_copts(), - deps = [ - ":micro_ops", - "//tensorflow/lite/micro:micro_compatibility", - "//tensorflow/lite/micro:micro_framework", - ], -) - # LINT.IfChange(portable_optimized_micro_ops) cc_library( name = "portable_optimized_micro_ops", @@ -159,6 +149,11 @@ cc_library( ], hdrs = ["micro_ops.h"], copts = micro_copts(), + visibility = [ + # Needed for micro:portable_optimized_ops_resolver but visibility can not be + # finer-grained than a package. + ":micro_top_level", + ], deps = [ ":activation_utils", ":micro_utils", @@ -175,23 +170,7 @@ cc_library( "//tensorflow/lite/micro:micro_utils", ], ) - # LINT.ThenChange(//tensorflow/lite/micro/kernels/BUILD:micro_ops) -cc_library( - name = "portable_optimized_ops_resolver", - srcs = [ - "all_ops_resolver.cc", - ], - hdrs = [ - "all_ops_resolver.h", - ], - copts = micro_copts(), - deps = [ - ":portable_optimized_micro_ops", - "//tensorflow/lite/micro:micro_compatibility", - "//tensorflow/lite/micro:micro_framework", - ], -) test_suite( name = "all_tests", @@ -201,9 +180,9 @@ tflite_micro_cc_test( name = "elementwise_test", srcs = ["elementwise_test.cc"], deps = [ - ":all_ops_resolver", "//tensorflow/lite/c:common", "//tensorflow/lite/micro:debug_log", + "//tensorflow/lite/micro:op_resolvers", "//tensorflow/lite/micro/testing:micro_test", ], ) @@ -214,8 +193,8 @@ tflite_micro_cc_test( "pooling_test.cc", ], deps = [ - ":all_ops_resolver", "//tensorflow/lite/c:common", + "//tensorflow/lite/micro:op_resolvers", "//tensorflow/lite/micro/testing:micro_test", ], ) @@ -226,9 +205,9 @@ tflite_micro_cc_test( "depthwise_conv_test.cc", ], deps = [ - ":all_ops_resolver", "//tensorflow/lite/c:common", "//tensorflow/lite/kernels/internal:tensor", + "//tensorflow/lite/micro:op_resolvers", "//tensorflow/lite/micro/testing:micro_test", ], ) @@ -239,9 +218,9 @@ tflite_micro_cc_test( "depthwise_conv_test.cc", ], deps = [ - ":portable_optimized_ops_resolver", "//tensorflow/lite/c:common", "//tensorflow/lite/kernels/internal:tensor", + "//tensorflow/lite/micro:portable_optimized_op_resolver", "//tensorflow/lite/micro/testing:micro_test", ], ) @@ -252,10 +231,10 @@ tflite_micro_cc_test( "fully_connected_test.cc", ], deps = [ - ":all_ops_resolver", "//tensorflow/lite/c:common", "//tensorflow/lite/micro:micro_framework", "//tensorflow/lite/micro:micro_utils", + "//tensorflow/lite/micro:op_resolvers", "//tensorflow/lite/micro/testing:micro_test", ], ) @@ -266,8 +245,8 @@ tflite_micro_cc_test( "softmax_test.cc", ], deps = [ - ":all_ops_resolver", "//tensorflow/lite/c:common", + "//tensorflow/lite/micro:op_resolvers", "//tensorflow/lite/micro/testing:micro_test", ], ) @@ -278,8 +257,8 @@ tflite_micro_cc_test( "logistic_test.cc", ], deps = [ - ":all_ops_resolver", "//tensorflow/lite/c:common", + "//tensorflow/lite/micro:op_resolvers", "//tensorflow/lite/micro/testing:micro_test", ], ) @@ -290,8 +269,8 @@ tflite_micro_cc_test( "svdf_test.cc", ], deps = [ - ":all_ops_resolver", "//tensorflow/lite/c:common", + "//tensorflow/lite/micro:op_resolvers", "//tensorflow/lite/micro/testing:micro_test", ], ) @@ -302,9 +281,9 @@ tflite_micro_cc_test( "conv_test.cc", ], deps = [ - ":all_ops_resolver", "//tensorflow/lite/c:common", "//tensorflow/lite/micro:micro_utils", + "//tensorflow/lite/micro:op_resolvers", "//tensorflow/lite/micro/testing:micro_test", ], ) @@ -315,8 +294,8 @@ tflite_micro_cc_test( "prelu_test.cc", ], deps = [ - ":all_ops_resolver", "//tensorflow/lite/c:common", + "//tensorflow/lite/micro:op_resolvers", "//tensorflow/lite/micro/testing:micro_test", ], ) @@ -327,8 +306,8 @@ tflite_micro_cc_test( "floor_test.cc", ], deps = [ - ":all_ops_resolver", "//tensorflow/lite/c:common", + "//tensorflow/lite/micro:op_resolvers", "//tensorflow/lite/micro/testing:micro_test", ], ) @@ -339,8 +318,8 @@ tflite_micro_cc_test( "logical_test.cc", ], deps = [ - ":all_ops_resolver", "//tensorflow/lite/c:common", + "//tensorflow/lite/micro:op_resolvers", "//tensorflow/lite/micro/testing:micro_test", ], ) @@ -351,8 +330,8 @@ tflite_micro_cc_test( "neg_test.cc", ], deps = [ - ":all_ops_resolver", "//tensorflow/lite/c:common", + "//tensorflow/lite/micro:op_resolvers", "//tensorflow/lite/micro/testing:micro_test", ], ) @@ -363,8 +342,8 @@ tflite_micro_cc_test( "maximum_minimum_test.cc", ], deps = [ - ":all_ops_resolver", "//tensorflow/lite/c:common", + "//tensorflow/lite/micro:op_resolvers", "//tensorflow/lite/micro/testing:micro_test", ], ) @@ -375,8 +354,8 @@ tflite_micro_cc_test( "mul_test.cc", ], deps = [ - ":all_ops_resolver", "//tensorflow/lite/c:common", + "//tensorflow/lite/micro:op_resolvers", "//tensorflow/lite/micro/testing:micro_test", ], ) @@ -387,8 +366,8 @@ tflite_micro_cc_test( "sub_test.cc", ], deps = [ - ":all_ops_resolver", "//tensorflow/lite/c:common", + "//tensorflow/lite/micro:op_resolvers", "//tensorflow/lite/micro/testing:micro_test", ], ) @@ -399,8 +378,8 @@ tflite_micro_cc_test( "arg_min_max_test.cc", ], deps = [ - ":all_ops_resolver", "//tensorflow/lite/c:common", + "//tensorflow/lite/micro:op_resolvers", "//tensorflow/lite/micro/testing:micro_test", ], ) @@ -411,8 +390,8 @@ tflite_micro_cc_test( "comparisons_test.cc", ], deps = [ - ":all_ops_resolver", "//tensorflow/lite/c:common", + "//tensorflow/lite/micro:op_resolvers", "//tensorflow/lite/micro/testing:micro_test", ], ) @@ -423,8 +402,8 @@ tflite_micro_cc_test( "ceil_test.cc", ], deps = [ - ":all_ops_resolver", "//tensorflow/lite/c:common", + "//tensorflow/lite/micro:op_resolvers", "//tensorflow/lite/micro/testing:micro_test", ], ) @@ -435,8 +414,8 @@ tflite_micro_cc_test( "round_test.cc", ], deps = [ - ":all_ops_resolver", "//tensorflow/lite/c:common", + "//tensorflow/lite/micro:op_resolvers", "//tensorflow/lite/micro/testing:micro_test", ], ) @@ -447,8 +426,8 @@ tflite_micro_cc_test( "strided_slice_test.cc", ], deps = [ - ":all_ops_resolver", "//tensorflow/lite/c:common", + "//tensorflow/lite/micro:op_resolvers", "//tensorflow/lite/micro/testing:micro_test", ], ) @@ -459,9 +438,9 @@ tflite_micro_cc_test( "pack_test.cc", ], deps = [ - ":all_ops_resolver", "//tensorflow/lite/c:common", "//tensorflow/lite/micro:debug_log", + "//tensorflow/lite/micro:op_resolvers", "//tensorflow/lite/micro/testing:micro_test", ], ) @@ -472,9 +451,9 @@ tflite_micro_cc_test( "unpack_test.cc", ], deps = [ - ":all_ops_resolver", "//tensorflow/lite/c:common", "//tensorflow/lite/micro:debug_log", + "//tensorflow/lite/micro:op_resolvers", "//tensorflow/lite/micro/testing:micro_test", ], ) @@ -485,9 +464,9 @@ tflite_micro_cc_test( "split_test.cc", ], deps = [ - ":all_ops_resolver", "//tensorflow/lite/c:common", "//tensorflow/lite/micro:debug_log", + "//tensorflow/lite/micro:op_resolvers", "//tensorflow/lite/micro/testing:micro_test", ], ) @@ -498,8 +477,8 @@ tflite_micro_cc_test( "add_test.cc", ], deps = [ - ":all_ops_resolver", "//tensorflow/lite/c:common", + "//tensorflow/lite/micro:op_resolvers", "//tensorflow/lite/micro/testing:micro_test", ], ) @@ -532,9 +511,9 @@ tflite_micro_cc_test( "quantize_test.cc", ], deps = [ - ":all_ops_resolver", "//tensorflow/lite/c:common", "//tensorflow/lite/micro:micro_framework", + "//tensorflow/lite/micro:op_resolvers", "//tensorflow/lite/micro/testing:micro_test", ], ) @@ -545,9 +524,9 @@ tflite_micro_cc_test( "dequantize_test.cc", ], deps = [ - ":all_ops_resolver", "//tensorflow/lite/c:common", "//tensorflow/lite/micro:micro_framework", + "//tensorflow/lite/micro:op_resolvers", "//tensorflow/lite/micro/testing:micro_test", ], ) @@ -564,11 +543,11 @@ tflite_micro_cc_test( "reshape_test.cc", ], deps = [ - ":all_ops_resolver", "//tensorflow/lite/c:common", "//tensorflow/lite/kernels/internal:tensor", "//tensorflow/lite/micro:micro_framework", "//tensorflow/lite/micro:micro_utils", + "//tensorflow/lite/micro:op_resolvers", "//tensorflow/lite/micro/testing:micro_test", ], ) @@ -579,8 +558,8 @@ tflite_micro_cc_test( "activations_test.cc", ], deps = [ - ":all_ops_resolver", "//tensorflow/lite/c:common", + "//tensorflow/lite/micro:op_resolvers", "//tensorflow/lite/micro/testing:micro_test", ], ) @@ -591,8 +570,8 @@ tflite_micro_cc_test( "concatenation_test.cc", ], deps = [ - ":all_ops_resolver", "//tensorflow/lite/c:common", + "//tensorflow/lite/micro:op_resolvers", "//tensorflow/lite/micro/testing:micro_test", ], ) @@ -603,9 +582,9 @@ tflite_micro_cc_test( "pad_test.cc", ], deps = [ - ":all_ops_resolver", "//tensorflow/lite/c:common", "//tensorflow/lite/micro:micro_framework", + "//tensorflow/lite/micro:op_resolvers", "//tensorflow/lite/micro/testing:micro_test", ], ) @@ -616,8 +595,8 @@ tflite_micro_cc_test( "reduce_test.cc", ], deps = [ - ":all_ops_resolver", "//tensorflow/lite/c:common", + "//tensorflow/lite/micro:op_resolvers", "//tensorflow/lite/micro/testing:micro_test", ], ) @@ -628,9 +607,9 @@ tflite_micro_cc_test( "circular_buffer_test.cc", ], deps = [ - ":all_ops_resolver", ":micro_ops", "//tensorflow/lite/c:common", + "//tensorflow/lite/micro:op_resolvers", "//tensorflow/lite/micro/testing:micro_test", ], ) @@ -641,8 +620,8 @@ tflite_micro_cc_test( "resize_nearest_neighbor_test.cc", ], deps = [ - ":all_ops_resolver", "//tensorflow/lite/c:common", + "//tensorflow/lite/micro:op_resolvers", "//tensorflow/lite/micro/testing:micro_test", ], ) @@ -653,8 +632,8 @@ tflite_micro_cc_test( "l2norm_test.cc", ], deps = [ - ":all_ops_resolver", "//tensorflow/lite/c:common", + "//tensorflow/lite/micro:op_resolvers", "//tensorflow/lite/micro/testing:micro_test", ], ) @@ -663,9 +642,9 @@ tflite_micro_cc_test( name = "tanh_test", srcs = ["tanh_test.cc"], deps = [ - ":all_ops_resolver", "//tensorflow/lite/c:common", "//tensorflow/lite/micro:micro_framework", + "//tensorflow/lite/micro:op_resolvers", "//tensorflow/lite/micro/testing:micro_test", ], ) diff --git a/tensorflow/lite/micro/kernels/activations_test.cc b/tensorflow/lite/micro/kernels/activations_test.cc index 008be1039e1..686139e51a5 100644 --- a/tensorflow/lite/micro/kernels/activations_test.cc +++ b/tensorflow/lite/micro/kernels/activations_test.cc @@ -15,7 +15,7 @@ limitations under the License. #include "tensorflow/lite/c/builtin_op_data.h" #include "tensorflow/lite/c/common.h" -#include "tensorflow/lite/micro/kernels/all_ops_resolver.h" +#include "tensorflow/lite/micro/all_ops_resolver.h" #include "tensorflow/lite/micro/testing/micro_test.h" #include "tensorflow/lite/micro/testing/test_utils.h" @@ -41,7 +41,7 @@ void TestReluFloat(const int* input_dims_data, const float* input_data, TfLiteContext context; PopulateContext(tensors, tensors_size, micro_test::reporter, &context); - ::tflite::ops::micro::AllOpsResolver resolver; + ::tflite::AllOpsResolver resolver; const TfLiteRegistration* registration = resolver.FindOp(tflite::BuiltinOperator_RELU); TF_LITE_MICRO_EXPECT_NE(nullptr, registration); @@ -97,7 +97,7 @@ void TestRelu6Float(const int* input_dims_data, const float* input_data, TfLiteContext context; PopulateContext(tensors, tensors_size, micro_test::reporter, &context); - ::tflite::ops::micro::AllOpsResolver resolver; + ::tflite::AllOpsResolver resolver; const TfLiteRegistration* registration = resolver.FindOp(tflite::BuiltinOperator_RELU6); TF_LITE_MICRO_EXPECT_NE(nullptr, registration); @@ -158,7 +158,7 @@ void TestReluUint8(const int* input_dims_data, const float* input_data, TfLiteContext context; PopulateContext(tensors, tensors_size, micro_test::reporter, &context); - ::tflite::ops::micro::AllOpsResolver resolver; + ::tflite::AllOpsResolver resolver; const TfLiteRegistration* registration = resolver.FindOp(tflite::BuiltinOperator_RELU); TF_LITE_MICRO_EXPECT_NE(nullptr, registration); @@ -223,7 +223,7 @@ void TestRelu6Uint8(const int* input_dims_data, const float* input_data, TfLiteContext context; PopulateContext(tensors, tensors_size, micro_test::reporter, &context); - ::tflite::ops::micro::AllOpsResolver resolver; + ::tflite::AllOpsResolver resolver; const TfLiteRegistration* registration = resolver.FindOp(tflite::BuiltinOperator_RELU6); TF_LITE_MICRO_EXPECT_NE(nullptr, registration); @@ -287,7 +287,7 @@ void TestReluInt8(const int* input_dims_data, const float* input_data, TfLiteContext context; PopulateContext(tensors, tensors_size, micro_test::reporter, &context); - ::tflite::ops::micro::AllOpsResolver resolver; + ::tflite::AllOpsResolver resolver; const TfLiteRegistration* registration = resolver.FindOp(tflite::BuiltinOperator_RELU); TF_LITE_MICRO_EXPECT_NE(nullptr, registration); @@ -353,7 +353,7 @@ void TestRelu6Int8(const int* input_dims_data, const float* input_data, TfLiteContext context; PopulateContext(tensors, tensors_size, micro_test::reporter, &context); - ::tflite::ops::micro::AllOpsResolver resolver; + ::tflite::AllOpsResolver resolver; const TfLiteRegistration* registration = resolver.FindOp(tflite::BuiltinOperator_RELU6); TF_LITE_MICRO_EXPECT_NE(nullptr, registration); diff --git a/tensorflow/lite/micro/kernels/add_test.cc b/tensorflow/lite/micro/kernels/add_test.cc index 07dc25222b6..d97739a345b 100644 --- a/tensorflow/lite/micro/kernels/add_test.cc +++ b/tensorflow/lite/micro/kernels/add_test.cc @@ -17,7 +17,7 @@ limitations under the License. #include "tensorflow/lite/c/builtin_op_data.h" #include "tensorflow/lite/c/common.h" -#include "tensorflow/lite/micro/kernels/all_ops_resolver.h" +#include "tensorflow/lite/micro/all_ops_resolver.h" #include "tensorflow/lite/micro/testing/micro_test.h" #include "tensorflow/lite/micro/testing/test_utils.h" @@ -69,7 +69,7 @@ void ValidateAddGoldens(TfLiteTensor* tensors, int tensors_size, TfLiteContext context; PopulateContext(tensors, tensors_size, micro_test::reporter, &context); - ::tflite::ops::micro::AllOpsResolver resolver; + ::tflite::AllOpsResolver resolver; const TfLiteRegistration* registration = resolver.FindOp(::tflite::BuiltinOperator_ADD); diff --git a/tensorflow/lite/micro/kernels/all_ops_resolver.cc b/tensorflow/lite/micro/kernels/all_ops_resolver.cc deleted file mode 100644 index e427511c1f2..00000000000 --- a/tensorflow/lite/micro/kernels/all_ops_resolver.cc +++ /dev/null @@ -1,80 +0,0 @@ -/* 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. -==============================================================================*/ - -#include "tensorflow/lite/micro/kernels/all_ops_resolver.h" - -#include "tensorflow/lite/micro/kernels/micro_ops.h" - -namespace tflite { -namespace ops { -namespace micro { - -AllOpsResolver::AllOpsResolver() { - // Please keep this list of Builtin Operators in alphabetical order. - AddBuiltin(BuiltinOperator_ABS, Register_ABS()); - AddBuiltin(BuiltinOperator_ADD, Register_ADD()); - AddBuiltin(BuiltinOperator_ARG_MAX, Register_ARG_MAX()); - AddBuiltin(BuiltinOperator_ARG_MIN, Register_ARG_MIN()); - AddBuiltin(BuiltinOperator_AVERAGE_POOL_2D, Register_AVERAGE_POOL_2D()); - AddBuiltin(BuiltinOperator_CEIL, Register_CEIL()); - AddBuiltin(BuiltinOperator_CONCATENATION, Register_CONCATENATION()); - AddBuiltin(BuiltinOperator_CONV_2D, Register_CONV_2D()); - AddBuiltin(BuiltinOperator_COS, Register_COS()); - AddBuiltin(BuiltinOperator_DEPTHWISE_CONV_2D, Register_DEPTHWISE_CONV_2D()); - AddBuiltin(BuiltinOperator_DEQUANTIZE, Register_DEQUANTIZE()); - AddBuiltin(BuiltinOperator_EQUAL, Register_EQUAL()); - AddBuiltin(BuiltinOperator_FLOOR, Register_FLOOR()); - AddBuiltin(BuiltinOperator_FULLY_CONNECTED, Register_FULLY_CONNECTED()); - AddBuiltin(BuiltinOperator_GREATER, Register_GREATER()); - AddBuiltin(BuiltinOperator_GREATER_EQUAL, Register_GREATER_EQUAL()); - AddBuiltin(BuiltinOperator_L2_NORMALIZATION, Register_L2_NORMALIZATION()); - AddBuiltin(BuiltinOperator_LESS, Register_LESS()); - AddBuiltin(BuiltinOperator_LESS_EQUAL, Register_LESS_EQUAL()); - AddBuiltin(BuiltinOperator_LOG, Register_LOG()); - AddBuiltin(BuiltinOperator_LOGICAL_AND, Register_LOGICAL_AND()); - AddBuiltin(BuiltinOperator_LOGICAL_NOT, Register_LOGICAL_NOT()); - AddBuiltin(BuiltinOperator_LOGICAL_OR, Register_LOGICAL_OR()); - AddBuiltin(BuiltinOperator_LOGISTIC, Register_LOGISTIC()); - AddBuiltin(BuiltinOperator_MAX_POOL_2D, Register_MAX_POOL_2D()); - AddBuiltin(BuiltinOperator_MAXIMUM, Register_MAXIMUM()); - AddBuiltin(BuiltinOperator_MEAN, Register_MEAN()); - AddBuiltin(BuiltinOperator_MINIMUM, Register_MINIMUM()); - AddBuiltin(BuiltinOperator_MUL, Register_MUL()); - AddBuiltin(BuiltinOperator_NEG, Register_NEG()); - AddBuiltin(BuiltinOperator_NOT_EQUAL, Register_NOT_EQUAL()); - AddBuiltin(BuiltinOperator_PACK, Register_PACK()); - AddBuiltin(BuiltinOperator_PAD, Register_PAD()); - AddBuiltin(BuiltinOperator_PADV2, Register_PADV2()); - AddBuiltin(BuiltinOperator_PRELU, Register_PRELU()); - AddBuiltin(BuiltinOperator_QUANTIZE, Register_QUANTIZE()); - AddBuiltin(BuiltinOperator_RELU, Register_RELU()); - AddBuiltin(BuiltinOperator_RELU6, Register_RELU6()); - AddBuiltin(BuiltinOperator_RESHAPE, Register_RESHAPE()); - AddBuiltin(BuiltinOperator_RESIZE_NEAREST_NEIGHBOR, - Register_RESIZE_NEAREST_NEIGHBOR()); - AddBuiltin(BuiltinOperator_ROUND, Register_ROUND()); - AddBuiltin(BuiltinOperator_RSQRT, Register_RSQRT()); - AddBuiltin(BuiltinOperator_SIN, Register_SIN()); - AddBuiltin(BuiltinOperator_SOFTMAX, Register_SOFTMAX()); - AddBuiltin(BuiltinOperator_SPLIT, Register_SPLIT()); - AddBuiltin(BuiltinOperator_SQRT, Register_SQRT()); - AddBuiltin(BuiltinOperator_SQUARE, Register_SQUARE()); - AddBuiltin(BuiltinOperator_STRIDED_SLICE, Register_STRIDED_SLICE()); - AddBuiltin(BuiltinOperator_SUB, Register_SUB()); - AddBuiltin(BuiltinOperator_SVDF, Register_SVDF()); - AddBuiltin(BuiltinOperator_TANH, Register_TANH()); - AddBuiltin(BuiltinOperator_UNPACK, Register_UNPACK()); -} - -} // namespace micro -} // namespace ops -} // namespace tflite diff --git a/tensorflow/lite/micro/kernels/arc_mli/conv_slicing_test.cc b/tensorflow/lite/micro/kernels/arc_mli/conv_slicing_test.cc index 2c32b45bc26..25d5377009e 100644 --- a/tensorflow/lite/micro/kernels/arc_mli/conv_slicing_test.cc +++ b/tensorflow/lite/micro/kernels/arc_mli/conv_slicing_test.cc @@ -24,7 +24,7 @@ limitations under the License. #include "tensorflow/lite/c/builtin_op_data.h" #include "tensorflow/lite/c/common.h" -#include "tensorflow/lite/micro/kernels/all_ops_resolver.h" +#include "tensorflow/lite/micro/all_ops_resolver.h" #include "tensorflow/lite/micro/micro_utils.h" #include "tensorflow/lite/micro/testing/micro_test.h" #include "tensorflow/lite/micro/testing/test_utils.h" @@ -136,7 +136,7 @@ TfLiteStatus ValidateConvGoldens(TfLiteTensor* tensors, int tensors_size, TfLiteContext context; PopulateContext(tensors, tensors_size, micro_test::reporter, &context); - ::tflite::ops::micro::AllOpsResolver resolver; + ::tflite::AllOpsResolver resolver; const TfLiteRegistration* registration = resolver.FindOp(tflite::BuiltinOperator_CONV_2D); diff --git a/tensorflow/lite/micro/kernels/arc_mli/depthwise_conv_slicing_test.cc b/tensorflow/lite/micro/kernels/arc_mli/depthwise_conv_slicing_test.cc index 10f2f857c01..d9efb3ae709 100644 --- a/tensorflow/lite/micro/kernels/arc_mli/depthwise_conv_slicing_test.cc +++ b/tensorflow/lite/micro/kernels/arc_mli/depthwise_conv_slicing_test.cc @@ -25,7 +25,7 @@ limitations under the License. #include "tensorflow/lite/c/builtin_op_data.h" #include "tensorflow/lite/c/common.h" #include "tensorflow/lite/kernels/internal/tensor_ctypes.h" -#include "tensorflow/lite/micro/kernels/all_ops_resolver.h" +#include "tensorflow/lite/micro/all_ops_resolver.h" #include "tensorflow/lite/micro/testing/micro_test.h" #include "tensorflow/lite/micro/testing/test_utils.h" @@ -55,7 +55,7 @@ TfLiteStatus ValidateDepthwiseConvGoldens(const T* expected_output_data, TfLiteContext context; PopulateContext(tensors, tensors_size, micro_test::reporter, &context); - ::tflite::ops::micro::AllOpsResolver resolver; + ::tflite::AllOpsResolver resolver; const TfLiteRegistration* registration = resolver.FindOp(tflite::BuiltinOperator_DEPTHWISE_CONV_2D); TF_LITE_MICRO_EXPECT_NE(nullptr, registration); diff --git a/tensorflow/lite/micro/kernels/arc_mli/fully_connected_slicing_test.cc b/tensorflow/lite/micro/kernels/arc_mli/fully_connected_slicing_test.cc index a64e7bdff4a..d0c7143b18b 100644 --- a/tensorflow/lite/micro/kernels/arc_mli/fully_connected_slicing_test.cc +++ b/tensorflow/lite/micro/kernels/arc_mli/fully_connected_slicing_test.cc @@ -26,7 +26,7 @@ limitations under the License. #include "tensorflow/lite/c/builtin_op_data.h" #include "tensorflow/lite/c/common.h" -#include "tensorflow/lite/micro/kernels/all_ops_resolver.h" +#include "tensorflow/lite/micro/all_ops_resolver.h" #include "tensorflow/lite/micro/testing/micro_test.h" #include "tensorflow/lite/micro/testing/test_utils.h" @@ -69,7 +69,7 @@ void TestFullyConnectedQuantized( TfLiteContext context; PopulateContext(tensors, tensors_size, micro_test::reporter, &context); - ::tflite::ops::micro::AllOpsResolver resolver; + ::tflite::AllOpsResolver resolver; const TfLiteRegistration* registration = resolver.FindOp(tflite::BuiltinOperator_FULLY_CONNECTED, 4); TF_LITE_MICRO_EXPECT_NE(nullptr, registration); diff --git a/tensorflow/lite/micro/kernels/arc_mli/pooling_slicing_test.cc b/tensorflow/lite/micro/kernels/arc_mli/pooling_slicing_test.cc index e8667874120..7f21a67d9f7 100644 --- a/tensorflow/lite/micro/kernels/arc_mli/pooling_slicing_test.cc +++ b/tensorflow/lite/micro/kernels/arc_mli/pooling_slicing_test.cc @@ -25,7 +25,7 @@ limitations under the License. #include "tensorflow/lite/c/builtin_op_data.h" #include "tensorflow/lite/c/common.h" -#include "tensorflow/lite/micro/kernels/all_ops_resolver.h" +#include "tensorflow/lite/micro/all_ops_resolver.h" #include "tensorflow/lite/micro/testing/micro_test.h" #include "tensorflow/lite/micro/testing/test_utils.h" @@ -60,7 +60,7 @@ void TestAveragePoolingQuantized( TfLiteContext context; PopulateContext(tensors, tensors_size, micro_test::reporter, &context); - ::tflite::ops::micro::AllOpsResolver resolver; + ::tflite::AllOpsResolver resolver; const TfLiteRegistration* registration = resolver.FindOp(tflite::BuiltinOperator_AVERAGE_POOL_2D); TF_LITE_MICRO_EXPECT_NE(nullptr, registration); @@ -131,7 +131,7 @@ void TestMaxPoolQuantized(const int* input_dims_data, const T* input_data, TfLiteContext context; PopulateContext(tensors, tensors_size, micro_test::reporter, &context); - ::tflite::ops::micro::AllOpsResolver resolver; + ::tflite::AllOpsResolver resolver; const TfLiteRegistration* registration = resolver.FindOp(tflite::BuiltinOperator_MAX_POOL_2D); TF_LITE_MICRO_EXPECT_NE(nullptr, registration); diff --git a/tensorflow/lite/micro/kernels/arg_min_max_test.cc b/tensorflow/lite/micro/kernels/arg_min_max_test.cc index 2b4d22d0f4e..c5bbd537fc8 100644 --- a/tensorflow/lite/micro/kernels/arg_min_max_test.cc +++ b/tensorflow/lite/micro/kernels/arg_min_max_test.cc @@ -15,7 +15,7 @@ limitations under the License. #include "tensorflow/lite/c/builtin_op_data.h" #include "tensorflow/lite/c/common.h" -#include "tensorflow/lite/micro/kernels/all_ops_resolver.h" +#include "tensorflow/lite/micro/all_ops_resolver.h" #include "tensorflow/lite/micro/testing/micro_test.h" #include "tensorflow/lite/micro/testing/test_utils.h" @@ -28,7 +28,7 @@ void ValidateArgMinMaxGoldens(TfLiteTensor* tensors, int tensors_size, int output_size, bool using_min) { TfLiteContext context; PopulateContext(tensors, tensors_size, micro_test::reporter, &context); - ::tflite::ops::micro::AllOpsResolver resolver; + ::tflite::AllOpsResolver resolver; const TfLiteRegistration* registration; if (using_min) { registration = resolver.FindOp(tflite::BuiltinOperator_ARG_MIN); diff --git a/tensorflow/lite/micro/kernels/ceil_test.cc b/tensorflow/lite/micro/kernels/ceil_test.cc index fc21b0141b5..db876a37fcb 100644 --- a/tensorflow/lite/micro/kernels/ceil_test.cc +++ b/tensorflow/lite/micro/kernels/ceil_test.cc @@ -15,7 +15,7 @@ limitations under the License. #include "tensorflow/lite/c/builtin_op_data.h" #include "tensorflow/lite/c/common.h" -#include "tensorflow/lite/micro/kernels/all_ops_resolver.h" +#include "tensorflow/lite/micro/all_ops_resolver.h" #include "tensorflow/lite/micro/testing/micro_test.h" #include "tensorflow/lite/micro/testing/test_utils.h" @@ -37,7 +37,7 @@ void TestCeil(const int* input_dims_data, const float* input_data, }; TfLiteContext context; PopulateContext(tensors, tensors_size, micro_test::reporter, &context); - ::tflite::ops::micro::AllOpsResolver resolver; + ::tflite::AllOpsResolver resolver; const TfLiteRegistration* registration = resolver.FindOp(tflite::BuiltinOperator_CEIL); TF_LITE_MICRO_EXPECT_NE(nullptr, registration); diff --git a/tensorflow/lite/micro/kernels/circular_buffer_test.cc b/tensorflow/lite/micro/kernels/circular_buffer_test.cc index 1fd19bb9d19..cb123c50b19 100644 --- a/tensorflow/lite/micro/kernels/circular_buffer_test.cc +++ b/tensorflow/lite/micro/kernels/circular_buffer_test.cc @@ -15,7 +15,7 @@ limitations under the License. #include "tensorflow/lite/c/builtin_op_data.h" #include "tensorflow/lite/c/common.h" -#include "tensorflow/lite/micro/kernels/all_ops_resolver.h" +#include "tensorflow/lite/micro/all_ops_resolver.h" #include "tensorflow/lite/micro/kernels/micro_ops.h" #include "tensorflow/lite/micro/testing/micro_test.h" #include "tensorflow/lite/micro/testing/test_utils.h" diff --git a/tensorflow/lite/micro/kernels/comparisons_test.cc b/tensorflow/lite/micro/kernels/comparisons_test.cc index 731d9d778e7..198bb5c9d19 100644 --- a/tensorflow/lite/micro/kernels/comparisons_test.cc +++ b/tensorflow/lite/micro/kernels/comparisons_test.cc @@ -17,7 +17,7 @@ limitations under the License. #include "tensorflow/lite/c/builtin_op_data.h" #include "tensorflow/lite/c/common.h" -#include "tensorflow/lite/micro/kernels/all_ops_resolver.h" +#include "tensorflow/lite/micro/all_ops_resolver.h" #include "tensorflow/lite/micro/testing/micro_test.h" #include "tensorflow/lite/micro/testing/test_utils.h" @@ -36,7 +36,7 @@ void TestComparison(tflite::BuiltinOperator op, TfLiteTensor* tensors, TfLiteContext context; PopulateContext(tensors, tensors_size, micro_test::reporter, &context); - ::tflite::ops::micro::AllOpsResolver resolver; + ::tflite::AllOpsResolver resolver; const TfLiteRegistration* registration = resolver.FindOp(op); TF_LITE_MICRO_EXPECT_NE(nullptr, registration); diff --git a/tensorflow/lite/micro/kernels/concatenation_test.cc b/tensorflow/lite/micro/kernels/concatenation_test.cc index 040cd43a400..feb79804981 100644 --- a/tensorflow/lite/micro/kernels/concatenation_test.cc +++ b/tensorflow/lite/micro/kernels/concatenation_test.cc @@ -16,7 +16,7 @@ limitations under the License. #include "tensorflow/lite/c/builtin_op_data.h" #include "tensorflow/lite/c/common.h" -#include "tensorflow/lite/micro/kernels/all_ops_resolver.h" +#include "tensorflow/lite/micro/all_ops_resolver.h" #include "tensorflow/lite/micro/testing/micro_test.h" #include "tensorflow/lite/micro/testing/test_utils.h" @@ -47,7 +47,7 @@ void TestConcatenateTwoInputs(std::initializer_list<int> input1_dims_data, TfLiteContext context; PopulateContext(tensors, tensors_size, micro_test::reporter, &context); - ::tflite::ops::micro::AllOpsResolver resolver; + ::tflite::AllOpsResolver resolver; const TfLiteRegistration* registration = resolver.FindOp(tflite::BuiltinOperator_CONCATENATION); TF_LITE_MICRO_EXPECT_NE(nullptr, registration); @@ -109,7 +109,7 @@ void TestConcatenateQuantizedTwoInputs( TfLiteContext context; PopulateContext(tensors, tensors_size, micro_test::reporter, &context); - ::tflite::ops::micro::AllOpsResolver resolver; + ::tflite::AllOpsResolver resolver; const TfLiteRegistration* registration = resolver.FindOp(tflite::BuiltinOperator_CONCATENATION); TF_LITE_MICRO_EXPECT_NE(nullptr, registration); diff --git a/tensorflow/lite/micro/kernels/conv_test.cc b/tensorflow/lite/micro/kernels/conv_test.cc index 9b1add6d94a..a8e7b12ac99 100644 --- a/tensorflow/lite/micro/kernels/conv_test.cc +++ b/tensorflow/lite/micro/kernels/conv_test.cc @@ -15,7 +15,7 @@ limitations under the License. #include "tensorflow/lite/c/builtin_op_data.h" #include "tensorflow/lite/c/common.h" -#include "tensorflow/lite/micro/kernels/all_ops_resolver.h" +#include "tensorflow/lite/micro/all_ops_resolver.h" #include "tensorflow/lite/micro/micro_utils.h" #include "tensorflow/lite/micro/testing/micro_test.h" #include "tensorflow/lite/micro/testing/test_utils.h" @@ -57,7 +57,7 @@ TfLiteStatus ValidateConvGoldens(TfLiteTensor* tensors, int tensors_size, TfLiteContext context; PopulateContext(tensors, tensors_size, micro_test::reporter, &context); - ::tflite::ops::micro::AllOpsResolver resolver; + ::tflite::AllOpsResolver resolver; const TfLiteRegistration* registration = resolver.FindOp(tflite::BuiltinOperator_CONV_2D); diff --git a/tensorflow/lite/micro/kernels/depthwise_conv_test.cc b/tensorflow/lite/micro/kernels/depthwise_conv_test.cc index 07177452ed7..b696cea22b0 100644 --- a/tensorflow/lite/micro/kernels/depthwise_conv_test.cc +++ b/tensorflow/lite/micro/kernels/depthwise_conv_test.cc @@ -16,7 +16,7 @@ limitations under the License. #include "tensorflow/lite/c/builtin_op_data.h" #include "tensorflow/lite/c/common.h" #include "tensorflow/lite/kernels/internal/tensor_ctypes.h" -#include "tensorflow/lite/micro/kernels/all_ops_resolver.h" +#include "tensorflow/lite/micro/all_ops_resolver.h" #include "tensorflow/lite/micro/testing/micro_test.h" #include "tensorflow/lite/micro/testing/test_utils.h" @@ -46,7 +46,7 @@ TfLiteStatus ValidateDepthwiseConvGoldens(const T* expected_output_data, TfLiteContext context; PopulateContext(tensors, tensors_size, micro_test::reporter, &context); - ::tflite::ops::micro::AllOpsResolver resolver; + ::tflite::AllOpsResolver resolver; const TfLiteRegistration* registration = resolver.FindOp(tflite::BuiltinOperator_DEPTHWISE_CONV_2D); TF_LITE_MICRO_EXPECT_NE(nullptr, registration); diff --git a/tensorflow/lite/micro/kernels/dequantize_test.cc b/tensorflow/lite/micro/kernels/dequantize_test.cc index c90f745a778..c51c48cc23f 100644 --- a/tensorflow/lite/micro/kernels/dequantize_test.cc +++ b/tensorflow/lite/micro/kernels/dequantize_test.cc @@ -15,7 +15,7 @@ limitations under the License. #include "tensorflow/lite/c/builtin_op_data.h" #include "tensorflow/lite/c/common.h" -#include "tensorflow/lite/micro/kernels/all_ops_resolver.h" +#include "tensorflow/lite/micro/all_ops_resolver.h" #include "tensorflow/lite/micro/test_helpers.h" #include "tensorflow/lite/micro/testing/micro_test.h" #include "tensorflow/lite/micro/testing/test_utils.h" @@ -29,7 +29,7 @@ void ValidateDequantizeGoldens(TfLiteTensor* tensors, int tensors_size, const T* expected_output_data, T* output_data, int output_length, float tolerance = 1e-5) { TfLiteContext context; - ::tflite::ops::micro::AllOpsResolver resolver; + ::tflite::AllOpsResolver resolver; PopulateContext(tensors, tensors_size, micro_test::reporter, &context); const TfLiteRegistration* registration = diff --git a/tensorflow/lite/micro/kernels/elementwise_test.cc b/tensorflow/lite/micro/kernels/elementwise_test.cc index 923739b5bb4..4086b91b0a9 100644 --- a/tensorflow/lite/micro/kernels/elementwise_test.cc +++ b/tensorflow/lite/micro/kernels/elementwise_test.cc @@ -14,8 +14,8 @@ limitations under the License. ==============================================================================*/ #include "tensorflow/lite/c/common.h" +#include "tensorflow/lite/micro/all_ops_resolver.h" #include "tensorflow/lite/micro/debug_log.h" -#include "tensorflow/lite/micro/kernels/all_ops_resolver.h" #include "tensorflow/lite/micro/testing/micro_test.h" #include "tensorflow/lite/micro/testing/test_utils.h" @@ -46,7 +46,7 @@ void TestElementwiseFloat(tflite::BuiltinOperator op, TfLiteContext context; PopulateContext(tensors, tensors_size, micro_test::reporter, &context); - tflite::ops::micro::AllOpsResolver resolver; + tflite::AllOpsResolver resolver; const TfLiteRegistration* registration = resolver.FindOp(op); TF_LITE_MICRO_EXPECT_NE(nullptr, registration); @@ -111,7 +111,7 @@ void TestElementwiseBool(tflite::BuiltinOperator op, TfLiteContext context; PopulateContext(tensors, tensors_size, micro_test::reporter, &context); - tflite::ops::micro::AllOpsResolver resolver; + tflite::AllOpsResolver resolver; const TfLiteRegistration* registration = resolver.FindOp(op); TF_LITE_MICRO_EXPECT_NE(nullptr, registration); diff --git a/tensorflow/lite/micro/kernels/floor_test.cc b/tensorflow/lite/micro/kernels/floor_test.cc index eea959d54ce..e6f477bf44d 100644 --- a/tensorflow/lite/micro/kernels/floor_test.cc +++ b/tensorflow/lite/micro/kernels/floor_test.cc @@ -15,7 +15,7 @@ limitations under the License. #include "tensorflow/lite/c/builtin_op_data.h" #include "tensorflow/lite/c/common.h" -#include "tensorflow/lite/micro/kernels/all_ops_resolver.h" +#include "tensorflow/lite/micro/all_ops_resolver.h" #include "tensorflow/lite/micro/testing/micro_test.h" #include "tensorflow/lite/micro/testing/test_utils.h" @@ -38,7 +38,7 @@ void TestFloor(const int* input_dims_data, const float* input_data, }; TfLiteContext context; PopulateContext(tensors, tensors_size, micro_test::reporter, &context); - ::tflite::ops::micro::AllOpsResolver resolver; + ::tflite::AllOpsResolver resolver; const TfLiteRegistration* registration = resolver.FindOp(tflite::BuiltinOperator_FLOOR); TF_LITE_MICRO_EXPECT_NE(nullptr, registration); diff --git a/tensorflow/lite/micro/kernels/fully_connected_test.cc b/tensorflow/lite/micro/kernels/fully_connected_test.cc index b464d977385..b3066be5eb0 100644 --- a/tensorflow/lite/micro/kernels/fully_connected_test.cc +++ b/tensorflow/lite/micro/kernels/fully_connected_test.cc @@ -18,7 +18,7 @@ limitations under the License. #include "tensorflow/lite/c/builtin_op_data.h" #include "tensorflow/lite/c/common.h" -#include "tensorflow/lite/micro/kernels/all_ops_resolver.h" +#include "tensorflow/lite/micro/all_ops_resolver.h" #include "tensorflow/lite/micro/micro_utils.h" #include "tensorflow/lite/micro/test_helpers.h" #include "tensorflow/lite/micro/testing/micro_test.h" @@ -53,7 +53,7 @@ TfLiteStatus TestFullyConnectedFloat( TfLiteContext context; PopulateContext(tensors, tensors_size, micro_test::reporter, &context); - ::tflite::ops::micro::AllOpsResolver resolver; + ::tflite::AllOpsResolver resolver; const TfLiteRegistration* registration = resolver.FindOp(tflite::BuiltinOperator_FULLY_CONNECTED); TF_LITE_MICRO_EXPECT_NE(nullptr, registration); @@ -133,7 +133,7 @@ TfLiteStatus TestFullyConnectedQuantized( TfLiteContext context; PopulateContext(tensors, tensors_size, micro_test::reporter, &context); - ::tflite::ops::micro::AllOpsResolver resolver; + ::tflite::AllOpsResolver resolver; const TfLiteRegistration* registration = resolver.FindOp(tflite::BuiltinOperator_FULLY_CONNECTED); TF_LITE_MICRO_EXPECT_NE(nullptr, registration); diff --git a/tensorflow/lite/micro/kernels/l2norm_test.cc b/tensorflow/lite/micro/kernels/l2norm_test.cc index 4b034b211db..9ad3481c582 100644 --- a/tensorflow/lite/micro/kernels/l2norm_test.cc +++ b/tensorflow/lite/micro/kernels/l2norm_test.cc @@ -15,7 +15,7 @@ limitations under the License. #include "tensorflow/lite/c/builtin_op_data.h" #include "tensorflow/lite/c/common.h" -#include "tensorflow/lite/micro/kernels/all_ops_resolver.h" +#include "tensorflow/lite/micro/all_ops_resolver.h" #include "tensorflow/lite/micro/testing/micro_test.h" #include "tensorflow/lite/micro/testing/test_utils.h" @@ -104,7 +104,7 @@ void TestL2Normalization(const int* input_dims_data, TfLiteContext context; PopulateContext(tensors, tensors_size, micro_test::reporter, &context); - ::tflite::ops::micro::AllOpsResolver resolver; + ::tflite::AllOpsResolver resolver; const TfLiteRegistration* registration = resolver.FindOp(tflite::BuiltinOperator_L2_NORMALIZATION); TF_LITE_MICRO_EXPECT_NE(nullptr, registration); diff --git a/tensorflow/lite/micro/kernels/logical_test.cc b/tensorflow/lite/micro/kernels/logical_test.cc index ec5503bc8f3..262de56ee72 100644 --- a/tensorflow/lite/micro/kernels/logical_test.cc +++ b/tensorflow/lite/micro/kernels/logical_test.cc @@ -14,7 +14,7 @@ limitations under the License. ==============================================================================*/ #include "tensorflow/lite/c/builtin_op_data.h" #include "tensorflow/lite/c/common.h" -#include "tensorflow/lite/micro/kernels/all_ops_resolver.h" +#include "tensorflow/lite/micro/all_ops_resolver.h" #include "tensorflow/lite/micro/testing/micro_test.h" #include "tensorflow/lite/micro/testing/test_utils.h" @@ -47,7 +47,7 @@ void TestLogicalOp(tflite::BuiltinOperator op, TfLiteContext context; PopulateContext(tensors, tensors_size, micro_test::reporter, &context); - ::tflite::ops::micro::AllOpsResolver resolver; + ::tflite::AllOpsResolver resolver; const TfLiteRegistration* registration = resolver.FindOp(op); TF_LITE_MICRO_EXPECT_NE(nullptr, registration); diff --git a/tensorflow/lite/micro/kernels/logistic_test.cc b/tensorflow/lite/micro/kernels/logistic_test.cc index 6473858f9fb..7e6484b5154 100644 --- a/tensorflow/lite/micro/kernels/logistic_test.cc +++ b/tensorflow/lite/micro/kernels/logistic_test.cc @@ -15,7 +15,7 @@ limitations under the License. #include "tensorflow/lite/c/builtin_op_data.h" #include "tensorflow/lite/c/common.h" -#include "tensorflow/lite/micro/kernels/all_ops_resolver.h" +#include "tensorflow/lite/micro/all_ops_resolver.h" #include "tensorflow/lite/micro/testing/micro_test.h" #include "tensorflow/lite/micro/testing/test_utils.h" @@ -43,7 +43,7 @@ void TestLogisticFloat(std::initializer_list<int> input_dims_data, TfLiteContext context; PopulateContext(tensors, tensors_size, micro_test::reporter, &context); - ::tflite::ops::micro::AllOpsResolver resolver; + ::tflite::AllOpsResolver resolver; const TfLiteRegistration* registration = resolver.FindOp(tflite::BuiltinOperator_LOGISTIC); TF_LITE_MICRO_EXPECT_NE(nullptr, registration); @@ -105,7 +105,7 @@ void TestLogisticInt8(std::initializer_list<int> input_dims_data, TfLiteContext context; PopulateContext(tensors, tensors_size, micro_test::reporter, &context); - ::tflite::ops::micro::AllOpsResolver resolver; + ::tflite::AllOpsResolver resolver; const TfLiteRegistration* registration = resolver.FindOp(tflite::BuiltinOperator_LOGISTIC); TF_LITE_MICRO_EXPECT_NE(nullptr, registration); diff --git a/tensorflow/lite/micro/kernels/maximum_minimum_test.cc b/tensorflow/lite/micro/kernels/maximum_minimum_test.cc index c60ca906a5d..2c50552ad79 100644 --- a/tensorflow/lite/micro/kernels/maximum_minimum_test.cc +++ b/tensorflow/lite/micro/kernels/maximum_minimum_test.cc @@ -15,7 +15,7 @@ limitations under the License. #include "tensorflow/lite/c/builtin_op_data.h" #include "tensorflow/lite/c/common.h" -#include "tensorflow/lite/micro/kernels/all_ops_resolver.h" +#include "tensorflow/lite/micro/all_ops_resolver.h" #include "tensorflow/lite/micro/testing/micro_test.h" #include "tensorflow/lite/micro/testing/test_utils.h" @@ -48,7 +48,7 @@ void TestMaxMinFloat(tflite::BuiltinOperator op, TfLiteContext context; PopulateContext(tensors, tensors_size, micro_test::reporter, &context); - ::tflite::ops::micro::AllOpsResolver resolver; + ::tflite::AllOpsResolver resolver; const TfLiteRegistration* registration = resolver.FindOp(op); TF_LITE_MICRO_EXPECT_NE(nullptr, registration); @@ -107,7 +107,7 @@ void TestMaxMinQuantized( TfLiteContext context; PopulateContext(tensors, tensors_size, micro_test::reporter, &context); - ::tflite::ops::micro::AllOpsResolver resolver; + ::tflite::AllOpsResolver resolver; const TfLiteRegistration* registration = resolver.FindOp(op); TF_LITE_MICRO_EXPECT_NE(nullptr, registration); @@ -164,7 +164,7 @@ void TestMaxMinQuantizedInt32( TfLiteContext context; PopulateContext(tensors, tensors_size, micro_test::reporter, &context); - ::tflite::ops::micro::AllOpsResolver resolver; + ::tflite::AllOpsResolver resolver; const TfLiteRegistration* registration = resolver.FindOp(op); TF_LITE_MICRO_EXPECT_NE(nullptr, registration); diff --git a/tensorflow/lite/micro/kernels/mul_test.cc b/tensorflow/lite/micro/kernels/mul_test.cc index 446512a7c6c..d58d5eaf715 100644 --- a/tensorflow/lite/micro/kernels/mul_test.cc +++ b/tensorflow/lite/micro/kernels/mul_test.cc @@ -15,7 +15,7 @@ limitations under the License. #include "tensorflow/lite/c/builtin_op_data.h" #include "tensorflow/lite/c/common.h" -#include "tensorflow/lite/micro/kernels/all_ops_resolver.h" +#include "tensorflow/lite/micro/all_ops_resolver.h" #include "tensorflow/lite/micro/testing/micro_test.h" #include "tensorflow/lite/micro/testing/test_utils.h" @@ -35,7 +35,7 @@ void TestMulFloat(std::initializer_list<int> input1_dims_data, TfLiteIntArray* output_dims = IntArrayFromInitializer(output_dims_data); const int output_dims_count = ElementCount(*output_dims); - ::tflite::ops::micro::AllOpsResolver resolver; + ::tflite::AllOpsResolver resolver; constexpr int inputs_size = 2; constexpr int outputs_size = 1; @@ -107,7 +107,7 @@ void TestMulQuantized(std::initializer_list<int> input1_dims_data, TfLiteIntArray* output_dims = IntArrayFromInitializer(output_dims_data); const int output_dims_count = ElementCount(*output_dims); - ::tflite::ops::micro::AllOpsResolver resolver; + ::tflite::AllOpsResolver resolver; constexpr int inputs_size = 2; constexpr int outputs_size = 1; diff --git a/tensorflow/lite/micro/kernels/neg_test.cc b/tensorflow/lite/micro/kernels/neg_test.cc index 9e8f0c842ea..9608e31d73c 100644 --- a/tensorflow/lite/micro/kernels/neg_test.cc +++ b/tensorflow/lite/micro/kernels/neg_test.cc @@ -15,7 +15,7 @@ limitations under the License. #include "tensorflow/lite/c/builtin_op_data.h" #include "tensorflow/lite/c/common.h" -#include "tensorflow/lite/micro/kernels/all_ops_resolver.h" +#include "tensorflow/lite/micro/all_ops_resolver.h" #include "tensorflow/lite/micro/testing/micro_test.h" #include "tensorflow/lite/micro/testing/test_utils.h" @@ -41,7 +41,7 @@ void TestNegFloat(std::initializer_list<int> input_dims_data, TfLiteContext context; PopulateContext(tensors, tensors_size, micro_test::reporter, &context); - ::tflite::ops::micro::AllOpsResolver resolver; + ::tflite::AllOpsResolver resolver; const TfLiteRegistration* registration = resolver.FindOp(tflite::BuiltinOperator_NEG); TF_LITE_MICRO_EXPECT_NE(nullptr, registration); diff --git a/tensorflow/lite/micro/kernels/pack_test.cc b/tensorflow/lite/micro/kernels/pack_test.cc index 216cd615e4c..187fc2a0ddd 100644 --- a/tensorflow/lite/micro/kernels/pack_test.cc +++ b/tensorflow/lite/micro/kernels/pack_test.cc @@ -15,8 +15,8 @@ limitations under the License. #include "tensorflow/lite/c/builtin_op_data.h" #include "tensorflow/lite/c/common.h" +#include "tensorflow/lite/micro/all_ops_resolver.h" #include "tensorflow/lite/micro/debug_log.h" -#include "tensorflow/lite/micro/kernels/all_ops_resolver.h" #include "tensorflow/lite/micro/testing/micro_test.h" #include "tensorflow/lite/micro/testing/test_utils.h" @@ -50,7 +50,7 @@ void TestPackTwoInputsFloat(std::initializer_list<int> input1_dims_data, TfLiteContext context; PopulateContext(tensors, tensors_size, micro_test::reporter, &context); - tflite::ops::micro::AllOpsResolver resolver; + tflite::AllOpsResolver resolver; const TfLiteRegistration* registration = resolver.FindOp(tflite::BuiltinOperator_PACK); TF_LITE_MICRO_EXPECT_NE(nullptr, registration); @@ -127,7 +127,7 @@ void TestPackThreeInputsFloat(std::initializer_list<int> input1_dims_data, TfLiteContext context; PopulateContext(tensors, tensors_size, micro_test::reporter, &context); - tflite::ops::micro::AllOpsResolver resolver; + tflite::AllOpsResolver resolver; const TfLiteRegistration* registration = resolver.FindOp(tflite::BuiltinOperator_PACK); TF_LITE_MICRO_EXPECT_NE(nullptr, registration); @@ -200,7 +200,7 @@ void TestPackTwoInputsQuantized( TfLiteContext context; PopulateContext(tensors, tensors_size, micro_test::reporter, &context); - tflite::ops::micro::AllOpsResolver resolver; + tflite::AllOpsResolver resolver; const TfLiteRegistration* registration = resolver.FindOp(tflite::BuiltinOperator_PACK); TF_LITE_MICRO_EXPECT_NE(nullptr, registration); @@ -270,7 +270,7 @@ void TestPackTwoInputsQuantized32( TfLiteContext context; PopulateContext(tensors, tensors_size, micro_test::reporter, &context); - tflite::ops::micro::AllOpsResolver resolver; + tflite::AllOpsResolver resolver; const TfLiteRegistration* registration = resolver.FindOp(tflite::BuiltinOperator_PACK); TF_LITE_MICRO_EXPECT_NE(nullptr, registration); diff --git a/tensorflow/lite/micro/kernels/pad_test.cc b/tensorflow/lite/micro/kernels/pad_test.cc index eac5b980837..28b2069bc18 100644 --- a/tensorflow/lite/micro/kernels/pad_test.cc +++ b/tensorflow/lite/micro/kernels/pad_test.cc @@ -15,7 +15,7 @@ limitations under the License. #include "tensorflow/lite/c/builtin_op_data.h" #include "tensorflow/lite/c/common.h" -#include "tensorflow/lite/micro/kernels/all_ops_resolver.h" +#include "tensorflow/lite/micro/all_ops_resolver.h" #include "tensorflow/lite/micro/test_helpers.h" #include "tensorflow/lite/micro/testing/micro_test.h" #include "tensorflow/lite/micro/testing/test_utils.h" @@ -30,7 +30,7 @@ TfLiteStatus ValidatePadGoldens(TfLiteTensor* tensors, int tensors_size, int output_length) { TfLiteContext context; PopulateContext(tensors, tensors_size, micro_test::reporter, &context); - ::tflite::ops::micro::AllOpsResolver resolver; + ::tflite::AllOpsResolver resolver; const TfLiteRegistration* registration = resolver.FindOp(tflite::BuiltinOperator_PAD); TF_LITE_ENSURE(&context, registration != nullptr); @@ -67,7 +67,7 @@ TfLiteStatus ValidatePadV2Goldens(TfLiteTensor* tensors, int tensors_size, int output_length) { TfLiteContext context; PopulateContext(tensors, tensors_size, micro_test::reporter, &context); - ::tflite::ops::micro::AllOpsResolver resolver; + ::tflite::AllOpsResolver resolver; const TfLiteRegistration* registration = resolver.FindOp(tflite::BuiltinOperator_PADV2); TF_LITE_ENSURE(&context, registration != nullptr); diff --git a/tensorflow/lite/micro/kernels/pooling_test.cc b/tensorflow/lite/micro/kernels/pooling_test.cc index 1ac74fca644..e656fb802ed 100644 --- a/tensorflow/lite/micro/kernels/pooling_test.cc +++ b/tensorflow/lite/micro/kernels/pooling_test.cc @@ -17,7 +17,7 @@ limitations under the License. #include "tensorflow/lite/c/builtin_op_data.h" #include "tensorflow/lite/c/common.h" -#include "tensorflow/lite/micro/kernels/all_ops_resolver.h" +#include "tensorflow/lite/micro/all_ops_resolver.h" #include "tensorflow/lite/micro/testing/micro_test.h" #include "tensorflow/lite/micro/testing/test_utils.h" @@ -49,7 +49,7 @@ void TestAveragePoolingFloat(std::initializer_list<int> input_dims_data, TfLiteContext context; PopulateContext(tensors, tensors_size, micro_test::reporter, &context); - ::tflite::ops::micro::AllOpsResolver resolver; + ::tflite::AllOpsResolver resolver; const TfLiteRegistration* registration = resolver.FindOp(tflite::BuiltinOperator_AVERAGE_POOL_2D); TF_LITE_MICRO_EXPECT_NE(nullptr, registration); @@ -123,7 +123,7 @@ void TestAveragePoolingQuantized( TfLiteContext context; PopulateContext(tensors, tensors_size, micro_test::reporter, &context); - ::tflite::ops::micro::AllOpsResolver resolver; + ::tflite::AllOpsResolver resolver; const TfLiteRegistration* registration = resolver.FindOp(tflite::BuiltinOperator_AVERAGE_POOL_2D); TF_LITE_MICRO_EXPECT_NE(nullptr, registration); @@ -190,7 +190,7 @@ void TestMaxPoolFloat(std::initializer_list<int> input_dims_data, TfLiteContext context; PopulateContext(tensors, tensors_size, micro_test::reporter, &context); - ::tflite::ops::micro::AllOpsResolver resolver; + ::tflite::AllOpsResolver resolver; const TfLiteRegistration* registration = resolver.FindOp(tflite::BuiltinOperator_MAX_POOL_2D); TF_LITE_MICRO_EXPECT_NE(nullptr, registration); @@ -266,7 +266,7 @@ void TestMaxPoolQuantized(std::initializer_list<int> input_dims_data, TfLiteContext context; PopulateContext(tensors, tensors_size, micro_test::reporter, &context); - ::tflite::ops::micro::AllOpsResolver resolver; + ::tflite::AllOpsResolver resolver; const TfLiteRegistration* registration = resolver.FindOp(tflite::BuiltinOperator_MAX_POOL_2D); TF_LITE_MICRO_EXPECT_NE(nullptr, registration); diff --git a/tensorflow/lite/micro/kernels/prelu_test.cc b/tensorflow/lite/micro/kernels/prelu_test.cc index 1a41e75501d..c60e33313bb 100644 --- a/tensorflow/lite/micro/kernels/prelu_test.cc +++ b/tensorflow/lite/micro/kernels/prelu_test.cc @@ -15,7 +15,7 @@ limitations under the License. #include "tensorflow/lite/c/builtin_op_data.h" #include "tensorflow/lite/c/common.h" -#include "tensorflow/lite/micro/kernels/all_ops_resolver.h" +#include "tensorflow/lite/micro/all_ops_resolver.h" #include "tensorflow/lite/micro/testing/micro_test.h" #include "tensorflow/lite/micro/testing/test_utils.h" @@ -44,7 +44,7 @@ void TestPreluFloat(std::initializer_list<int> input_dims_data, }; TfLiteContext context; PopulateContext(tensors, tensors_size, micro_test::reporter, &context); - ::tflite::ops::micro::AllOpsResolver resolver; + ::tflite::AllOpsResolver resolver; const TfLiteRegistration* registration = resolver.FindOp(tflite::BuiltinOperator_PRELU); TF_LITE_MICRO_EXPECT_NE(nullptr, registration); @@ -111,7 +111,7 @@ void TestPreluQuantized(std::initializer_list<int> input_dims_data, }; TfLiteContext context; PopulateContext(tensors, tensors_size, micro_test::reporter, &context); - ::tflite::ops::micro::AllOpsResolver resolver; + ::tflite::AllOpsResolver resolver; const TfLiteRegistration* registration = resolver.FindOp(tflite::BuiltinOperator_PRELU); TF_LITE_MICRO_EXPECT_NE(nullptr, registration); diff --git a/tensorflow/lite/micro/kernels/quantize_test.cc b/tensorflow/lite/micro/kernels/quantize_test.cc index 3089357040c..33d356f9191 100644 --- a/tensorflow/lite/micro/kernels/quantize_test.cc +++ b/tensorflow/lite/micro/kernels/quantize_test.cc @@ -15,7 +15,7 @@ limitations under the License. #include "tensorflow/lite/c/builtin_op_data.h" #include "tensorflow/lite/c/common.h" -#include "tensorflow/lite/micro/kernels/all_ops_resolver.h" +#include "tensorflow/lite/micro/all_ops_resolver.h" #include "tensorflow/lite/micro/test_helpers.h" #include "tensorflow/lite/micro/testing/micro_test.h" #include "tensorflow/lite/micro/testing/test_utils.h" @@ -33,7 +33,7 @@ void ValidateQuantizeGoldens(TfLiteTensor* tensors, int tensors_size, PopulateContext(tensors, tensors_size, micro_test::reporter, &context); // Version 1 of quantize supports int8 and uint8 quantization. - ::tflite::ops::micro::AllOpsResolver resolver; + ::tflite::AllOpsResolver resolver; const TfLiteRegistration* registration = resolver.FindOp(tflite::BuiltinOperator_QUANTIZE); diff --git a/tensorflow/lite/micro/kernels/reduce_test.cc b/tensorflow/lite/micro/kernels/reduce_test.cc index 965e45adb44..a65ba8cd376 100644 --- a/tensorflow/lite/micro/kernels/reduce_test.cc +++ b/tensorflow/lite/micro/kernels/reduce_test.cc @@ -15,7 +15,7 @@ limitations under the License. #include "tensorflow/lite/c/builtin_op_data.h" #include "tensorflow/lite/c/common.h" -#include "tensorflow/lite/micro/kernels/all_ops_resolver.h" +#include "tensorflow/lite/micro/all_ops_resolver.h" #include "tensorflow/lite/micro/testing/micro_test.h" #include "tensorflow/lite/micro/testing/test_utils.h" @@ -51,7 +51,7 @@ TfLiteStatus ValidateReduceGoldens(TfLiteTensor* tensors, int tensors_size, TfLiteContext context; PopulateContext(tensors, tensors_size, micro_test::reporter, &context); - ::tflite::ops::micro::AllOpsResolver resolver; + ::tflite::AllOpsResolver resolver; const TfLiteRegistration* registration = resolver.FindOp(tflite::BuiltinOperator_MEAN); diff --git a/tensorflow/lite/micro/kernels/reshape_test.cc b/tensorflow/lite/micro/kernels/reshape_test.cc index 7e7f58f0a03..1a88997cf65 100644 --- a/tensorflow/lite/micro/kernels/reshape_test.cc +++ b/tensorflow/lite/micro/kernels/reshape_test.cc @@ -19,7 +19,7 @@ limitations under the License. #include "tensorflow/lite/c/common.h" #include "tensorflow/lite/kernels/internal/tensor_ctypes.h" -#include "tensorflow/lite/micro/kernels/all_ops_resolver.h" +#include "tensorflow/lite/micro/all_ops_resolver.h" #include "tensorflow/lite/micro/micro_utils.h" #include "tensorflow/lite/micro/test_helpers.h" #include "tensorflow/lite/micro/testing/micro_test.h" @@ -60,7 +60,7 @@ void TestReshapeImpl(TfLiteTensor* input_tensor, TfLiteTensor* shape_tensor, node.outputs = IntArrayFromInitializer({1, 2}); } - ::tflite::ops::micro::AllOpsResolver resolver; + ::tflite::AllOpsResolver resolver; const TfLiteRegistration* registration = resolver.FindOp(tflite::BuiltinOperator_RESHAPE); TF_LITE_MICRO_EXPECT_NE(nullptr, registration); diff --git a/tensorflow/lite/micro/kernels/resize_nearest_neighbor_test.cc b/tensorflow/lite/micro/kernels/resize_nearest_neighbor_test.cc index 72e7252b31b..fda4a1f5173 100644 --- a/tensorflow/lite/micro/kernels/resize_nearest_neighbor_test.cc +++ b/tensorflow/lite/micro/kernels/resize_nearest_neighbor_test.cc @@ -14,7 +14,7 @@ limitations under the License. ==============================================================================*/ #include "tensorflow/lite/c/builtin_op_data.h" -#include "tensorflow/lite/micro/kernels/all_ops_resolver.h" +#include "tensorflow/lite/micro/all_ops_resolver.h" #include "tensorflow/lite/micro/testing/micro_test.h" #include "tensorflow/lite/micro/testing/test_utils.h" @@ -69,7 +69,7 @@ void TestResizeNearestNeighbor(const int* input_dims_data, const T* input_data, TfLiteContext context; PopulateContext(tensors, tensors_size, micro_test::reporter, &context); - ::tflite::ops::micro::AllOpsResolver resolver; + ::tflite::AllOpsResolver resolver; const TfLiteRegistration* registration = resolver.FindOp(tflite::BuiltinOperator_RESIZE_NEAREST_NEIGHBOR); TF_LITE_MICRO_EXPECT_NE(nullptr, registration); diff --git a/tensorflow/lite/micro/kernels/round_test.cc b/tensorflow/lite/micro/kernels/round_test.cc index 10eb2759a4b..c1421e099ea 100644 --- a/tensorflow/lite/micro/kernels/round_test.cc +++ b/tensorflow/lite/micro/kernels/round_test.cc @@ -15,7 +15,7 @@ limitations under the License. #include "tensorflow/lite/c/builtin_op_data.h" #include "tensorflow/lite/c/common.h" -#include "tensorflow/lite/micro/kernels/all_ops_resolver.h" +#include "tensorflow/lite/micro/all_ops_resolver.h" #include "tensorflow/lite/micro/testing/micro_test.h" #include "tensorflow/lite/micro/testing/test_utils.h" @@ -37,7 +37,7 @@ void TestRound(const int* input_dims_data, const float* input_data, }; TfLiteContext context; PopulateContext(tensors, tensors_size, micro_test::reporter, &context); - ::tflite::ops::micro::AllOpsResolver resolver; + ::tflite::AllOpsResolver resolver; const TfLiteRegistration* registration = resolver.FindOp(tflite::BuiltinOperator_ROUND); TF_LITE_MICRO_EXPECT_NE(nullptr, registration); diff --git a/tensorflow/lite/micro/kernels/softmax_test.cc b/tensorflow/lite/micro/kernels/softmax_test.cc index afd97f1f015..b8d89673837 100644 --- a/tensorflow/lite/micro/kernels/softmax_test.cc +++ b/tensorflow/lite/micro/kernels/softmax_test.cc @@ -15,7 +15,7 @@ limitations under the License. #include "tensorflow/lite/c/builtin_op_data.h" #include "tensorflow/lite/c/common.h" -#include "tensorflow/lite/micro/kernels/all_ops_resolver.h" +#include "tensorflow/lite/micro/all_ops_resolver.h" #include "tensorflow/lite/micro/testing/micro_test.h" #include "tensorflow/lite/micro/testing/test_utils.h" @@ -43,7 +43,7 @@ void TestSoftmaxFloat(std::initializer_list<int> input_dims_data, TfLiteContext context; PopulateContext(tensors, tensors_size, micro_test::reporter, &context); - ::tflite::ops::micro::AllOpsResolver resolver; + ::tflite::AllOpsResolver resolver; const TfLiteRegistration* registration = resolver.FindOp(tflite::BuiltinOperator_SOFTMAX); TF_LITE_MICRO_EXPECT_NE(nullptr, registration); @@ -109,7 +109,7 @@ void TestSoftmaxQuantized(std::initializer_list<int> input_dims_data, TfLiteContext context; PopulateContext(tensors, tensors_size, micro_test::reporter, &context); - ::tflite::ops::micro::AllOpsResolver resolver; + ::tflite::AllOpsResolver resolver; const TfLiteRegistration* registration = resolver.FindOp(tflite::BuiltinOperator_SOFTMAX); TF_LITE_MICRO_EXPECT_NE(nullptr, registration); @@ -175,7 +175,7 @@ void TestSoftmaxQuantizedSigned( TfLiteContext context; PopulateContext(tensors, tensors_size, micro_test::reporter, &context); - ::tflite::ops::micro::AllOpsResolver resolver; + ::tflite::AllOpsResolver resolver; const TfLiteRegistration* registration = resolver.FindOp(tflite::BuiltinOperator_SOFTMAX); TF_LITE_MICRO_EXPECT_NE(nullptr, registration); diff --git a/tensorflow/lite/micro/kernels/split_test.cc b/tensorflow/lite/micro/kernels/split_test.cc index 807929ca4d5..fb46dfbfb49 100644 --- a/tensorflow/lite/micro/kernels/split_test.cc +++ b/tensorflow/lite/micro/kernels/split_test.cc @@ -15,8 +15,8 @@ limitations under the License. #include "tensorflow/lite/c/builtin_op_data.h" #include "tensorflow/lite/c/common.h" +#include "tensorflow/lite/micro/all_ops_resolver.h" #include "tensorflow/lite/micro/debug_log.h" -#include "tensorflow/lite/micro/kernels/all_ops_resolver.h" #include "tensorflow/lite/micro/testing/micro_test.h" #include "tensorflow/lite/micro/testing/test_utils.h" @@ -63,7 +63,7 @@ void TestSplitTwoOutputsFloat( TfLiteContext context; PopulateContext(tensors, tensors_size, micro_test::reporter, &context); - tflite::ops::micro::AllOpsResolver resolver; + tflite::AllOpsResolver resolver; const TfLiteRegistration* registration = resolver.FindOp(tflite::BuiltinOperator_SPLIT); TF_LITE_MICRO_EXPECT_NE(nullptr, registration); @@ -166,7 +166,7 @@ void TestSplitFourOutputsFloat( TfLiteContext context; PopulateContext(tensors, tensors_size, micro_test::reporter, &context); - tflite::ops::micro::AllOpsResolver resolver; + tflite::AllOpsResolver resolver; const TfLiteRegistration* registration = resolver.FindOp(tflite::BuiltinOperator_SPLIT); TF_LITE_MICRO_EXPECT_NE(nullptr, registration); @@ -264,7 +264,7 @@ void TestSplitTwoOutputsQuantized( TfLiteContext context; PopulateContext(tensors, tensors_size, micro_test::reporter, &context); - tflite::ops::micro::AllOpsResolver resolver; + tflite::AllOpsResolver resolver; const TfLiteRegistration* registration = resolver.FindOp(tflite::BuiltinOperator_SPLIT); TF_LITE_MICRO_EXPECT_NE(nullptr, registration); @@ -353,7 +353,7 @@ void TestSplitTwoOutputsQuantized32( TfLiteContext context; PopulateContext(tensors, tensors_size, micro_test::reporter, &context); - tflite::ops::micro::AllOpsResolver resolver; + tflite::AllOpsResolver resolver; const TfLiteRegistration* registration = resolver.FindOp(tflite::BuiltinOperator_SPLIT); TF_LITE_MICRO_EXPECT_NE(nullptr, registration); diff --git a/tensorflow/lite/micro/kernels/strided_slice_test.cc b/tensorflow/lite/micro/kernels/strided_slice_test.cc index a36a90b858e..308c20ec0d8 100644 --- a/tensorflow/lite/micro/kernels/strided_slice_test.cc +++ b/tensorflow/lite/micro/kernels/strided_slice_test.cc @@ -14,7 +14,7 @@ limitations under the License. ==============================================================================*/ #include "tensorflow/lite/c/builtin_op_data.h" #include "tensorflow/lite/c/common.h" -#include "tensorflow/lite/micro/kernels/all_ops_resolver.h" +#include "tensorflow/lite/micro/all_ops_resolver.h" #include "tensorflow/lite/micro/testing/micro_test.h" #include "tensorflow/lite/micro/testing/test_utils.h" @@ -86,7 +86,7 @@ void TestStrideSlide(std::initializer_list<int> input_shape, TfLiteContext context; PopulateContext(tensors, tensors_size, micro_test::reporter, &context); - ::tflite::ops::micro::AllOpsResolver resolver; + ::tflite::AllOpsResolver resolver; const TfLiteRegistration* registration = resolver.FindOp(tflite::BuiltinOperator_STRIDED_SLICE); TF_LITE_MICRO_EXPECT_NE(nullptr, registration); diff --git a/tensorflow/lite/micro/kernels/sub_test.cc b/tensorflow/lite/micro/kernels/sub_test.cc index e4875c3bd1e..fd298e55276 100644 --- a/tensorflow/lite/micro/kernels/sub_test.cc +++ b/tensorflow/lite/micro/kernels/sub_test.cc @@ -17,7 +17,7 @@ limitations under the License. #include "tensorflow/lite/c/builtin_op_data.h" #include "tensorflow/lite/c/common.h" -#include "tensorflow/lite/micro/kernels/all_ops_resolver.h" +#include "tensorflow/lite/micro/all_ops_resolver.h" #include "tensorflow/lite/micro/testing/micro_test.h" #include "tensorflow/lite/micro/testing/test_utils.h" @@ -69,7 +69,7 @@ void ValidateSubGoldens(TfLiteTensor* tensors, int tensors_size, TfLiteContext context; PopulateContext(tensors, tensors_size, micro_test::reporter, &context); - ::tflite::ops::micro::AllOpsResolver resolver; + ::tflite::AllOpsResolver resolver; const TfLiteRegistration* registration = resolver.FindOp(::tflite::BuiltinOperator_SUB); diff --git a/tensorflow/lite/micro/kernels/svdf_test.cc b/tensorflow/lite/micro/kernels/svdf_test.cc index fead3ab2fab..31c610a72c7 100644 --- a/tensorflow/lite/micro/kernels/svdf_test.cc +++ b/tensorflow/lite/micro/kernels/svdf_test.cc @@ -17,7 +17,7 @@ limitations under the License. #include "tensorflow/lite/c/builtin_op_data.h" #include "tensorflow/lite/c/common.h" -#include "tensorflow/lite/micro/kernels/all_ops_resolver.h" +#include "tensorflow/lite/micro/all_ops_resolver.h" #include "tensorflow/lite/micro/testing/micro_test.h" #include "tensorflow/lite/micro/testing/test_utils.h" @@ -173,7 +173,7 @@ void ValidateSVDFGoldens(const int batch_size, const int num_units, TfLiteContext context; PopulateContext(tensors, tensor_count, micro_test::reporter, &context); - ::tflite::ops::micro::AllOpsResolver resolver; + ::tflite::AllOpsResolver resolver; const TfLiteRegistration* registration = resolver.FindOp(tflite::BuiltinOperator_SVDF); TF_LITE_MICRO_EXPECT_NE(nullptr, registration); @@ -248,7 +248,7 @@ void ValidateIntegerSVDFGoldens(const int batch_size, const int num_units, TfLiteContext context; PopulateContext(tensors, tensor_count, micro_test::reporter, &context); - ::tflite::ops::micro::AllOpsResolver resolver; + ::tflite::AllOpsResolver resolver; const TfLiteRegistration* registration = resolver.FindOp(tflite::BuiltinOperator_SVDF); TF_LITE_MICRO_EXPECT_NE(nullptr, registration); diff --git a/tensorflow/lite/micro/kernels/tanh_test.cc b/tensorflow/lite/micro/kernels/tanh_test.cc index 517d8a9c4a8..cfdef61b271 100644 --- a/tensorflow/lite/micro/kernels/tanh_test.cc +++ b/tensorflow/lite/micro/kernels/tanh_test.cc @@ -15,7 +15,7 @@ limitations under the License. #include "tensorflow/lite/c/builtin_op_data.h" #include "tensorflow/lite/c/common.h" -#include "tensorflow/lite/micro/kernels/all_ops_resolver.h" +#include "tensorflow/lite/micro/all_ops_resolver.h" #include "tensorflow/lite/micro/testing/micro_test.h" #include "tensorflow/lite/micro/testing/test_utils.h" @@ -43,7 +43,7 @@ void TestTanhFloat(std::initializer_list<int> input_dims_data, TfLiteContext context; PopulateContext(tensors, tensors_size, micro_test::reporter, &context); - ::tflite::ops::micro::AllOpsResolver resolver; + ::tflite::AllOpsResolver resolver; const TfLiteRegistration* registration = resolver.FindOp(tflite::BuiltinOperator_TANH); TF_LITE_MICRO_EXPECT_NE(nullptr, registration); @@ -105,7 +105,7 @@ void TestTanhInt8(std::initializer_list<int> input_dims_data, TfLiteContext context; PopulateContext(tensors, tensors_size, micro_test::reporter, &context); - ::tflite::ops::micro::AllOpsResolver resolver; + ::tflite::AllOpsResolver resolver; const TfLiteRegistration* registration = resolver.FindOp(tflite::BuiltinOperator_TANH); TF_LITE_MICRO_EXPECT_NE(nullptr, registration); diff --git a/tensorflow/lite/micro/kernels/unpack_test.cc b/tensorflow/lite/micro/kernels/unpack_test.cc index 015c92c208a..fc524e90cd8 100644 --- a/tensorflow/lite/micro/kernels/unpack_test.cc +++ b/tensorflow/lite/micro/kernels/unpack_test.cc @@ -15,8 +15,8 @@ limitations under the License. #include "tensorflow/lite/c/builtin_op_data.h" #include "tensorflow/lite/c/common.h" +#include "tensorflow/lite/micro/all_ops_resolver.h" #include "tensorflow/lite/micro/debug_log.h" -#include "tensorflow/lite/micro/kernels/all_ops_resolver.h" #include "tensorflow/lite/micro/testing/micro_test.h" #include "tensorflow/lite/micro/testing/test_utils.h" @@ -65,7 +65,7 @@ void TestUnpackThreeOutputsFloat( TfLiteContext context; PopulateContext(tensors, tensors_size, micro_test::reporter, &context); - tflite::ops::micro::AllOpsResolver resolver; + tflite::AllOpsResolver resolver; const TfLiteRegistration* registration = resolver.FindOp(tflite::BuiltinOperator_UNPACK); TF_LITE_MICRO_EXPECT_NE(nullptr, registration); @@ -142,7 +142,7 @@ void TestUnpackOneOutputFloat(std::initializer_list<int> input_dims_data, TfLiteContext context; PopulateContext(tensors, tensors_size, micro_test::reporter, &context); - tflite::ops::micro::AllOpsResolver resolver; + tflite::AllOpsResolver resolver; const TfLiteRegistration* registration = resolver.FindOp(tflite::BuiltinOperator_UNPACK); TF_LITE_MICRO_EXPECT_NE(nullptr, registration); @@ -234,7 +234,7 @@ void TestUnpackThreeOutputsQuantized( TfLiteContext context; PopulateContext(tensors, tensors_size, micro_test::reporter, &context); - tflite::ops::micro::AllOpsResolver resolver; + tflite::AllOpsResolver resolver; const TfLiteRegistration* registration = resolver.FindOp(tflite::BuiltinOperator_UNPACK); TF_LITE_MICRO_EXPECT_NE(nullptr, registration); @@ -330,7 +330,7 @@ void TestUnpackThreeOutputsQuantized32( TfLiteContext context; PopulateContext(tensors, tensors_size, micro_test::reporter, &context); - tflite::ops::micro::AllOpsResolver resolver; + tflite::AllOpsResolver resolver; const TfLiteRegistration* registration = resolver.FindOp(tflite::BuiltinOperator_UNPACK); TF_LITE_MICRO_EXPECT_NE(nullptr, registration);