Split OpResolvers out of micro_framework build target.
As part of the OpResolver refactor to reduce the code size, the micro_framework target would become even more monolithic. This change: * splits out the OpResolvers to keep the build targets more modular. * moves AllOpsResolver and MicroMutableOpResolver implementation side-by-side and in the same cc_library for consistency. * put AllOpsResolver in the same namespace as MicroOpsResolver for consistency (and since the include path is being changed and dependencies need to be updated anyway). * make micro/kernels private visibility (with one exception). PiperOrigin-RevId: 314595574 Change-Id: Ie0aa716e37472b57903896d2dd5e2f606585db98
This commit is contained in:
parent
463d464069
commit
e5dfc3bc38
@ -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
|
||||
|
@ -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",
|
||||
|
90
tensorflow/lite/micro/all_ops_resolver.cc
Normal file
90
tensorflow/lite/micro/all_ops_resolver.cc
Normal file
@ -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
|
@ -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_
|
@ -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",
|
||||
|
@ -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",
|
||||
],
|
||||
)
|
||||
|
@ -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.
|
||||
|
||||
|
@ -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(
|
||||
|
@ -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",
|
||||
],
|
||||
|
@ -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",
|
||||
|
@ -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;
|
||||
|
@ -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(
|
||||
|
@ -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(),
|
||||
|
@ -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);
|
||||
|
@ -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",
|
||||
],
|
||||
|
@ -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(
|
||||
|
@ -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,
|
||||
|
@ -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",
|
||||
],
|
||||
|
@ -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(
|
||||
|
@ -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",
|
||||
],
|
||||
)
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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"
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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 =
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user