xmos-ai-tools 1.1.2.dev216__py3-none-macosx_11_0_arm64.whl → 1.1.2.dev236__py3-none-macosx_11_0_arm64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (147) hide show
  1. xmos_ai_tools/runtime/include/lib_nn/api/nn_layers.h +16 -0
  2. xmos_ai_tools/runtime/include/lib_nn/api/quadratic_approximation.h +80 -0
  3. xmos_ai_tools/runtime/include/lib_nn/api/quadratic_interpolation.h +23 -0
  4. xmos_ai_tools/runtime/include/lib_tflite_micro/src/tflite-xcore-kernels/xcore_ops.h +15 -15
  5. xmos_ai_tools/runtime/include/{tensorflow/lite/micro/examples/micro_speech/simple_features/model.h → signal/micro/kernels/delay_flexbuffers_generated_data.h} +7 -9
  6. xmos_ai_tools/runtime/include/signal/micro/kernels/energy_flexbuffers_generated_data.h +28 -0
  7. xmos_ai_tools/runtime/include/signal/micro/kernels/fft_flexbuffers_generated_data.h +37 -0
  8. xmos_ai_tools/runtime/include/signal/micro/kernels/filter_bank_flexbuffers_generated_data.h +25 -0
  9. xmos_ai_tools/runtime/include/signal/micro/kernels/filter_bank_log_flexbuffers_generated_data.h +27 -0
  10. xmos_ai_tools/runtime/include/signal/micro/kernels/filter_bank_spectral_subtraction_flexbuffers_generated_data.h +26 -0
  11. xmos_ai_tools/runtime/include/signal/micro/kernels/framer_flexbuffers_generated_data.h +25 -0
  12. xmos_ai_tools/runtime/include/{tensorflow/lite/micro/examples/micro_speech/simple_features/no_simple_features_data.h → signal/micro/kernels/irfft.h} +15 -7
  13. xmos_ai_tools/runtime/include/signal/micro/kernels/overlap_add_flexbuffers_generated_data.h +25 -0
  14. xmos_ai_tools/runtime/include/signal/micro/kernels/pcan_flexbuffers_generated_data.h +7 -0
  15. xmos_ai_tools/runtime/include/signal/micro/kernels/rfft.h +31 -0
  16. xmos_ai_tools/runtime/include/signal/micro/kernels/stacker_flexbuffers_generated_data.h +25 -0
  17. xmos_ai_tools/runtime/include/signal/micro/kernels/window_flexbuffers_generated_data.h +25 -0
  18. xmos_ai_tools/runtime/include/signal/src/circular_buffer.h +118 -0
  19. xmos_ai_tools/runtime/include/signal/src/complex.h +29 -0
  20. xmos_ai_tools/runtime/include/signal/src/energy.h +38 -0
  21. xmos_ai_tools/runtime/include/signal/src/fft_auto_scale.h +35 -0
  22. xmos_ai_tools/runtime/include/signal/src/filter_bank.h +69 -0
  23. xmos_ai_tools/runtime/include/signal/src/filter_bank_log.h +38 -0
  24. xmos_ai_tools/runtime/include/signal/src/filter_bank_spectral_subtraction.h +73 -0
  25. xmos_ai_tools/runtime/include/{tensorflow/lite/micro/examples/micro_speech/main_functions.h → signal/src/filter_bank_square_root.h} +14 -17
  26. xmos_ai_tools/runtime/include/signal/src/irfft.h +84 -0
  27. xmos_ai_tools/runtime/include/signal/src/kiss_fft_wrappers/kiss_fft_common.h +49 -0
  28. xmos_ai_tools/runtime/include/signal/src/kiss_fft_wrappers/kiss_fft_float.h +31 -0
  29. xmos_ai_tools/runtime/include/signal/src/kiss_fft_wrappers/kiss_fft_int16.h +30 -0
  30. xmos_ai_tools/runtime/include/signal/src/kiss_fft_wrappers/kiss_fft_int32.h +31 -0
  31. xmos_ai_tools/runtime/include/{tensorflow/lite/micro/examples/micro_speech/micro_features/no_micro_features_data.h → signal/src/log.h} +13 -6
  32. xmos_ai_tools/runtime/include/{tensorflow/lite/micro/python/interpreter/src/python_utils.h → signal/src/max_abs.h} +11 -11
  33. xmos_ai_tools/runtime/include/{tensorflow/lite/micro/examples/micro_speech/micro_features/yes_micro_features_data.h → signal/src/msb.h} +15 -6
  34. xmos_ai_tools/runtime/include/signal/src/overlap_add.h +46 -0
  35. xmos_ai_tools/runtime/include/signal/src/pcan_argc_fixed.h +41 -0
  36. xmos_ai_tools/runtime/include/signal/src/rfft.h +85 -0
  37. xmos_ai_tools/runtime/include/signal/src/square_root.h +32 -0
  38. xmos_ai_tools/runtime/include/{tensorflow/lite/micro/python/interpreter/src/numpy_utils.h → signal/src/window.h} +13 -15
  39. xmos_ai_tools/runtime/include/signal/testdata/fft_test_data.h +48 -0
  40. xmos_ai_tools/runtime/include/tensorflow/lite/array.h +156 -0
  41. xmos_ai_tools/runtime/include/tensorflow/lite/builtin_ops.h +44 -0
  42. xmos_ai_tools/runtime/include/tensorflow/lite/c/c_api_types.h +6 -0
  43. xmos_ai_tools/runtime/include/tensorflow/lite/c/common.h +8 -25
  44. xmos_ai_tools/runtime/include/tensorflow/lite/core/api/error_reporter.h +3 -3
  45. xmos_ai_tools/runtime/include/tensorflow/lite/core/api/flatbuffer_conversions.h +15 -0
  46. xmos_ai_tools/runtime/include/tensorflow/lite/core/c/builtin_op_data.h +92 -3
  47. xmos_ai_tools/runtime/include/tensorflow/lite/core/c/c_api_types.h +61 -51
  48. xmos_ai_tools/runtime/include/tensorflow/lite/core/c/common.h +302 -1
  49. xmos_ai_tools/runtime/include/tensorflow/lite/core/macros.h +78 -0
  50. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/common.h +129 -43
  51. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/cppmath.h +2 -2
  52. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/portable_tensor.h +23 -4
  53. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/add.h +210 -151
  54. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/comparisons.h +9 -18
  55. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/conv.h +2 -0
  56. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/integer_ops/add.h +103 -72
  57. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/integer_ops/conv.h +2 -0
  58. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/integer_ops/mean.h +2 -63
  59. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/integer_ops/mul.h +87 -26
  60. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/mul.h +129 -80
  61. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/reduce.h +42 -93
  62. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/resize_bilinear.h +5 -0
  63. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/sub.h +249 -263
  64. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/runtime_shape.h +11 -1
  65. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/strided_slice_logic.h +5 -1
  66. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/tensor_ctypes.h +5 -10
  67. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/types.h +4 -2
  68. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/kernel_util.h +25 -14
  69. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/op_macros.h +14 -3
  70. xmos_ai_tools/runtime/include/tensorflow/lite/micro/debug_log.h +10 -3
  71. xmos_ai_tools/runtime/include/tensorflow/lite/micro/examples/micro_speech/micro_model_settings.h +37 -0
  72. xmos_ai_tools/runtime/include/tensorflow/lite/micro/fake_micro_context.h +7 -0
  73. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/add.h +6 -5
  74. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/circular_buffer.h +0 -3
  75. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/conv.h +19 -20
  76. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/conv_test.h +8 -31
  77. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/depthwise_conv.h +8 -8
  78. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/ethosu.h +1 -1
  79. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/fully_connected.h +9 -9
  80. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/kernel_runner.h +14 -9
  81. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/kernel_util.h +9 -4
  82. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/micro_ops.h +119 -100
  83. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/mul.h +4 -4
  84. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/pooling.h +8 -8
  85. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/reduce.h +4 -4
  86. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/reshape.h +26 -0
  87. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/softmax.h +12 -16
  88. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/strided_slice.h +40 -0
  89. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/svdf.h +8 -7
  90. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/unidirectional_sequence_lstm.h +5 -5
  91. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/xtensa/xtensa.h +2 -2
  92. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/xtensa/xtensa_conv.h +26 -21
  93. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/xtensa/xtensa_depthwise_conv.h +4 -4
  94. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/xtensa/xtensa_reshape.h +2 -4
  95. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/xtensa/xtensa_softmax.h +2 -2
  96. xmos_ai_tools/runtime/include/tensorflow/lite/micro/memory_planner/greedy_memory_planner.h +5 -0
  97. xmos_ai_tools/runtime/include/tensorflow/lite/micro/memory_planner/linear_memory_planner.h +4 -0
  98. xmos_ai_tools/runtime/include/tensorflow/lite/micro/memory_planner/micro_memory_planner.h +4 -0
  99. xmos_ai_tools/runtime/include/tensorflow/lite/micro/memory_planner/non_persistent_buffer_planner_shim.h +4 -0
  100. xmos_ai_tools/runtime/include/tensorflow/lite/micro/micro_allocator.h +23 -8
  101. xmos_ai_tools/runtime/include/tensorflow/lite/micro/micro_common.h +38 -0
  102. xmos_ai_tools/runtime/include/tensorflow/lite/micro/micro_context.h +23 -65
  103. xmos_ai_tools/runtime/include/tensorflow/lite/micro/micro_graph.h +15 -57
  104. xmos_ai_tools/runtime/include/tensorflow/lite/micro/micro_interpreter.h +16 -5
  105. xmos_ai_tools/runtime/include/tensorflow/lite/micro/micro_interpreter_context.h +125 -0
  106. xmos_ai_tools/runtime/include/tensorflow/lite/micro/micro_interpreter_graph.h +110 -0
  107. xmos_ai_tools/runtime/include/tensorflow/lite/micro/micro_log.h +6 -8
  108. xmos_ai_tools/runtime/include/tensorflow/lite/micro/micro_mutable_op_resolver.h +114 -32
  109. xmos_ai_tools/runtime/include/tensorflow/lite/micro/micro_op_resolver.h +6 -5
  110. xmos_ai_tools/runtime/include/tensorflow/lite/micro/micro_profiler.h +1 -1
  111. xmos_ai_tools/runtime/include/tensorflow/lite/micro/mock_micro_graph.h +1 -1
  112. xmos_ai_tools/runtime/include/tensorflow/lite/micro/python/interpreter/src/python_ops_resolver.h +21 -0
  113. xmos_ai_tools/runtime/include/tensorflow/lite/micro/test_helper_custom_ops.h +3 -4
  114. xmos_ai_tools/runtime/include/tensorflow/lite/micro/test_helpers.h +28 -12
  115. xmos_ai_tools/runtime/include/tensorflow/lite/micro/testing/micro_test.h +1 -0
  116. xmos_ai_tools/runtime/include/tensorflow/lite/micro/tools/benchmarking/log_utils.h +273 -0
  117. xmos_ai_tools/runtime/include/tensorflow/lite/micro/tools/benchmarking/metrics.h +41 -0
  118. xmos_ai_tools/runtime/include/tensorflow/lite/micro/tools/benchmarking/op_resolver.h +127 -0
  119. xmos_ai_tools/runtime/include/tensorflow/lite/schema/schema_generated.h +9139 -5010
  120. xmos_ai_tools/runtime/lib/libhost_xtflitemicro.a +0 -0
  121. xmos_ai_tools/runtime/lib/libxtflitemicro.a +0 -0
  122. xmos_ai_tools/xinterpreters/libs/macos/xtflm_python.1.0.1.dylib +0 -0
  123. xmos_ai_tools/xinterpreters/libs/macos/xtflm_python.dylib +0 -0
  124. {xmos_ai_tools-1.1.2.dev216.data → xmos_ai_tools-1.1.2.dev236.data}/data/bin/xcore-opt +0 -0
  125. {xmos_ai_tools-1.1.2.dev216.dist-info → xmos_ai_tools-1.1.2.dev236.dist-info}/METADATA +3 -4
  126. {xmos_ai_tools-1.1.2.dev216.dist-info → xmos_ai_tools-1.1.2.dev236.dist-info}/RECORD +128 -105
  127. {xmos_ai_tools-1.1.2.dev216.dist-info → xmos_ai_tools-1.1.2.dev236.dist-info}/WHEEL +1 -1
  128. xmos_ai_tools/runtime/include/tensorflow/lite/core/api/op_resolver.h +0 -129
  129. xmos_ai_tools/runtime/include/tensorflow/lite/micro/all_ops_resolver.h +0 -38
  130. xmos_ai_tools/runtime/include/tensorflow/lite/micro/examples/micro_speech/audio_provider.h +0 -44
  131. xmos_ai_tools/runtime/include/tensorflow/lite/micro/examples/micro_speech/command_responder.h +0 -30
  132. xmos_ai_tools/runtime/include/tensorflow/lite/micro/examples/micro_speech/feature_provider.h +0 -50
  133. xmos_ai_tools/runtime/include/tensorflow/lite/micro/examples/micro_speech/micro_features/micro_features_generator.h +0 -30
  134. xmos_ai_tools/runtime/include/tensorflow/lite/micro/examples/micro_speech/micro_features/micro_model_settings.h +0 -43
  135. xmos_ai_tools/runtime/include/tensorflow/lite/micro/examples/micro_speech/micro_features/no_feature_data_slice.h +0 -29
  136. xmos_ai_tools/runtime/include/tensorflow/lite/micro/examples/micro_speech/micro_features/yes_feature_data_slice.h +0 -29
  137. xmos_ai_tools/runtime/include/tensorflow/lite/micro/examples/micro_speech/recognize_commands.h +0 -151
  138. xmos_ai_tools/runtime/include/tensorflow/lite/micro/examples/micro_speech/simple_features/no_power_spectrum_data.h +0 -29
  139. xmos_ai_tools/runtime/include/tensorflow/lite/micro/examples/micro_speech/simple_features/simple_features_generator.h +0 -29
  140. xmos_ai_tools/runtime/include/tensorflow/lite/micro/examples/micro_speech/simple_features/simple_model_settings.h +0 -43
  141. xmos_ai_tools/runtime/include/tensorflow/lite/micro/examples/micro_speech/simple_features/yes_power_spectrum_data.h +0 -29
  142. xmos_ai_tools/runtime/include/tensorflow/lite/micro/examples/micro_speech/simple_features/yes_simple_features_data.h +0 -23
  143. xmos_ai_tools/runtime/include/tensorflow/lite/micro/micro_string.h +0 -33
  144. xmos_ai_tools/runtime/include/tensorflow/lite/micro/python/interpreter/src/interpreter_wrapper.h +0 -51
  145. xmos_ai_tools/runtime/include/tensorflow/lite/micro/python/interpreter/src/pybind11_lib.h +0 -64
  146. xmos_ai_tools/runtime/include/tensorflow/lite/micro/python/interpreter/src/shared_library.h +0 -40
  147. {xmos_ai_tools-1.1.2.dev216.dist-info → xmos_ai_tools-1.1.2.dev236.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,21 @@
1
+ /* Copyright 2023 The TensorFlow Authors. All Rights Reserved.
2
+
3
+ Licensed under the Apache License, Version 2.0 (the "License");
4
+ you may not use this file except in compliance with the License.
5
+ You may obtain a copy of the License at
6
+
7
+ http://www.apache.org/licenses/LICENSE-2.0
8
+
9
+ Unless required by applicable law or agreed to in writing, software
10
+ distributed under the License is distributed on an "AS IS" BASIS,
11
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ See the License for the specific language governing permissions and
13
+ limitations under the License.
14
+ ==============================================================================*/
15
+ #ifndef TENSORFLOW_LITE_MICRO_PYTHON_INTERPRETER_SRC_PYTHON_OPS_RESOLVER_H_
16
+ #define TENSORFLOW_LITE_MICRO_PYTHON_INTERPRETER_SRC_PYTHON_OPS_RESOLVER_H_
17
+
18
+ // TODO(b/286456378): remove once this shim is no longer needed.
19
+ #include "python/tflite_micro/python_ops_resolver.h"
20
+
21
+ #endif // TENSORFLOW_LITE_MICRO_PYTHON_INTERPRETER_SRC_PYTHON_OPS_RESOLVER_H_
@@ -20,10 +20,9 @@ limitations under the License.
20
20
  #include <limits>
21
21
 
22
22
  #include "flatbuffers/flatbuffers.h" // from @flatbuffers
23
- #include "tensorflow/lite/c/common.h"
24
23
  #include "tensorflow/lite/kernels/internal/compatibility.h"
25
24
  #include "tensorflow/lite/kernels/internal/tensor_ctypes.h"
26
- #include "tensorflow/lite/micro/all_ops_resolver.h"
25
+ #include "tensorflow/lite/micro/micro_common.h"
27
26
  #include "tensorflow/lite/micro/micro_utils.h"
28
27
  #include "tensorflow/lite/portable_type_to_tflitetype.h"
29
28
  #include "tensorflow/lite/schema/schema_generated.h"
@@ -33,8 +32,8 @@ namespace testing {
33
32
 
34
33
  class PackerOp {
35
34
  public:
36
- static const TfLiteRegistration_V1* getRegistration();
37
- static TfLiteRegistration_V1* GetMutableRegistration();
35
+ static const TFLMRegistration* getRegistration();
36
+ static TFLMRegistration* GetMutableRegistration();
38
37
  static void* Init(TfLiteContext* context, const char* buffer, size_t length);
39
38
  static void Free(TfLiteContext* context, void* buffer);
40
39
  static TfLiteStatus Prepare(TfLiteContext* context, TfLiteNode* node);
@@ -16,14 +16,16 @@ limitations under the License.
16
16
  #ifndef TENSORFLOW_LITE_MICRO_TEST_HELPERS_H_
17
17
  #define TENSORFLOW_LITE_MICRO_TEST_HELPERS_H_
18
18
 
19
+ #include <algorithm>
19
20
  #include <cstdint>
20
21
  #include <limits>
22
+ #include <type_traits>
21
23
 
22
24
  #include "flatbuffers/flatbuffers.h" // from @flatbuffers
23
25
  #include "tensorflow/lite/c/common.h"
24
26
  #include "tensorflow/lite/kernels/internal/compatibility.h"
25
27
  #include "tensorflow/lite/kernels/internal/tensor_ctypes.h"
26
- #include "tensorflow/lite/micro/all_ops_resolver.h"
28
+ #include "tensorflow/lite/micro/micro_mutable_op_resolver.h"
27
29
  #include "tensorflow/lite/micro/micro_utils.h"
28
30
  #include "tensorflow/lite/portable_type_to_tflitetype.h"
29
31
  #include "tensorflow/lite/schema/schema_generated.h"
@@ -32,6 +34,7 @@ namespace tflite {
32
34
  namespace testing {
33
35
 
34
36
  constexpr int kOfflinePlannerHeaderSize = 3;
37
+ using TestingOpResolver = tflite::MicroMutableOpResolver<10>;
35
38
 
36
39
  struct NodeConnection_ {
37
40
  std::initializer_list<int32_t> input;
@@ -55,8 +58,8 @@ class SimpleStatefulOp {
55
58
  };
56
59
 
57
60
  public:
58
- static const TfLiteRegistration_V1* getRegistration();
59
- static TfLiteRegistration_V1* GetMutableRegistration();
61
+ static const TFLMRegistration* getRegistration();
62
+ static TFLMRegistration* GetMutableRegistration();
60
63
  static void* Init(TfLiteContext* context, const char* buffer, size_t length);
61
64
  static TfLiteStatus Prepare(TfLiteContext* context, TfLiteNode* node);
62
65
  static TfLiteStatus Invoke(TfLiteContext* context, TfLiteNode* node);
@@ -64,8 +67,8 @@ class SimpleStatefulOp {
64
67
 
65
68
  class MockCustom {
66
69
  public:
67
- static const TfLiteRegistration_V1* getRegistration();
68
- static TfLiteRegistration_V1* GetMutableRegistration();
70
+ static const TFLMRegistration* getRegistration();
71
+ static TFLMRegistration* GetMutableRegistration();
69
72
  static void* Init(TfLiteContext* context, const char* buffer, size_t length);
70
73
  static void Free(TfLiteContext* context, void* buffer);
71
74
  static TfLiteStatus Prepare(TfLiteContext* context, TfLiteNode* node);
@@ -78,8 +81,8 @@ class MockCustom {
78
81
  // the sum of the inputs.
79
82
  class MultipleInputs {
80
83
  public:
81
- static const TfLiteRegistration_V1* getRegistration();
82
- static TfLiteRegistration_V1* GetMutableRegistration();
84
+ static const TFLMRegistration* getRegistration();
85
+ static TFLMRegistration* GetMutableRegistration();
83
86
  static void* Init(TfLiteContext* context, const char* buffer, size_t length);
84
87
  static void Free(TfLiteContext* context, void* buffer);
85
88
  static TfLiteStatus Prepare(TfLiteContext* context, TfLiteNode* node);
@@ -91,8 +94,8 @@ class MultipleInputs {
91
94
  // A simple no-op operator.
92
95
  class NoOp {
93
96
  public:
94
- static const TfLiteRegistration_V1* getRegistration();
95
- static TfLiteRegistration_V1* GetMutableRegistration();
97
+ static const TFLMRegistration* getRegistration();
98
+ static TFLMRegistration* GetMutableRegistration();
96
99
  static void* Init(TfLiteContext* context, const char* buffer, size_t length);
97
100
  static void Free(TfLiteContext* context, void* buffer);
98
101
  static TfLiteStatus Prepare(TfLiteContext* context, TfLiteNode* node);
@@ -102,7 +105,7 @@ class NoOp {
102
105
  };
103
106
 
104
107
  // Returns an Op Resolver that can be used in the testing code.
105
- AllOpsResolver GetOpResolver();
108
+ TfLiteStatus GetTestingOpResolver(TestingOpResolver& op_resolver);
106
109
 
107
110
  // Returns a simple example flatbuffer TensorFlow Lite model. Contains 1 input,
108
111
  // 1 layer of weights, 1 output Tensor, and 1 operator.
@@ -192,7 +195,7 @@ void PopulateContext(TfLiteTensor* tensors, int tensors_size,
192
195
 
193
196
  // Create a TfLiteIntArray from an array of ints. The first element in the
194
197
  // supplied array must be the size of the array expressed as an int.
195
- TfLiteIntArray* IntArrayFromInts(int* int_array);
198
+ TfLiteIntArray* IntArrayFromInts(const int* int_array);
196
199
 
197
200
  // Create a TfLiteFloatArray from an array of floats. The first element in the
198
201
  // supplied array must be the size of the array expressed as a float.
@@ -297,7 +300,7 @@ TfLiteTensor CreateSymmetricPerChannelQuantizedTensor(
297
300
  // Returns the number of tensors in the default subgraph for a tflite::Model.
298
301
  size_t GetModelTensorCount(const Model* model);
299
302
 
300
- // Derives the quantization scaling factor from a min and max range.
303
+ // Derives the asymmetric quantization scaling factor from a min and max range.
301
304
  template <typename T>
302
305
  inline float ScaleFromMinMax(const float min, const float max) {
303
306
  return (max - min) /
@@ -305,6 +308,19 @@ inline float ScaleFromMinMax(const float min, const float max) {
305
308
  std::numeric_limits<T>::min());
306
309
  }
307
310
 
311
+ // Derives the symmetric quantization scaling factor from a min and max range.
312
+ template <typename T>
313
+ inline float SymmetricScaleFromMinMax(const float min, const float max) {
314
+ const int32_t kScale =
315
+ std::numeric_limits<typename std::make_signed<T>::type>::max();
316
+ const float range = std::max(std::abs(min), std::abs(max));
317
+ if (range == 0) {
318
+ return 1.0f;
319
+ } else {
320
+ return range / kScale;
321
+ }
322
+ }
323
+
308
324
  // Derives the quantization zero point from a min and max range.
309
325
  template <typename T>
310
326
  inline int ZeroPointFromMinMax(const float min, const float max) {
@@ -259,6 +259,7 @@ inline void InitializeTest() { InitializeTarget(); }
259
259
  MicroPrintf("FAIL: %s did not match %s", string1, string2, __FILE__, \
260
260
  __LINE__); \
261
261
  micro_test::did_test_fail = true; \
262
+ break; \
262
263
  } \
263
264
  } \
264
265
  } while (false)
@@ -0,0 +1,273 @@
1
+ /* Copyright 2023 The TensorFlow Authors. All Rights Reserved.
2
+
3
+ Licensed under the Apache License, Version 2.0 (the "License");
4
+ you may not use this file except in compliance with the License.
5
+ You may obtain a copy of the License at
6
+
7
+ http://www.apache.org/licenses/LICENSE-2.0
8
+
9
+ Unless required by applicable law or agreed to in writing, software
10
+ distributed under the License is distributed on an "AS IS" BASIS,
11
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ See the License for the specific language governing permissions and
13
+ limitations under the License.
14
+ ==============================================================================*/
15
+
16
+ #ifndef TFLM_BENCHMARK_INTERNAL_LOG_UTILS_H_
17
+ #define TFLM_BENCHMARK_INTERNAL_LOG_UTILS_H_
18
+
19
+ #include <algorithm>
20
+ #include <cstdarg>
21
+ #include <cstdint>
22
+ #include <cstring>
23
+
24
+ #include "tensorflow/lite/micro/micro_log.h"
25
+
26
+ namespace tflite {
27
+
28
+ // The maxmimum length of a string.
29
+ static constexpr int kMaxStringLength = 32;
30
+
31
+ // The maximum length of a table row, applies to the header as well.
32
+ static constexpr int kMaxRowLength = 100;
33
+
34
+ // The default padding between columns in a table.
35
+ static constexpr int kDefaultColumnPadding = 4;
36
+
37
+ // Defines how formatted data is printed to stdout.
38
+ enum class PrettyPrintType {
39
+ // Prints as a CSV file.
40
+ kCsv,
41
+ // Prints as a formatted table.
42
+ kTable,
43
+ };
44
+
45
+ // Returns the length of the longest string in an array.
46
+ // Args:
47
+ // - strings: An array of strings.
48
+ // - count: The number of strings in the array.
49
+ int GetLongestStringLength(const char strings[][kMaxStringLength], int count);
50
+
51
+ // Adds padding between two columns in a table.
52
+ // ex) "hello" is being inserted into a column. The largest value in that column
53
+ // is 10, and there's a global padding of 4 spaces. Therefore, 9 spaces (10
54
+ // - 5 + 4) are added as padding.
55
+ // Args:
56
+ // - string: The input padding string.
57
+ // - size: The size of the string that's being inserted into a column.
58
+ // - max_size: The size of the largest string in the column.
59
+ // - padding: The amount of padding to add to each column regardless of its
60
+ // size.
61
+ void FillColumnPadding(char* string, int size, int max_size,
62
+ int padding = kDefaultColumnPadding);
63
+
64
+ // Fills a string with a specified value.
65
+ // Args:
66
+ // - string: The input string. This is filled in with the specified value.
67
+ // - size: The size of the string after being filled in. This must be less than
68
+ // the allocated space for the string.
69
+ // - buffer_size: The size of the string's buffer.
70
+ // - value: The value to insert into the string. Defaults to a space.
71
+ void FillString(char* string, int size, int buffer_size, char value = ' ');
72
+
73
+ // Concatenates the input string onto the first.
74
+ // Args:
75
+ // - output: The destination string for where to append input.
76
+ // - input: The input string to concatenate.
77
+ // - size: The number of characters to concatenate from the first string. If
78
+ // negative, the whole input string will be concatenated.
79
+ void MicroStrcat(char* output, const char* input, int size = -1);
80
+
81
+ // Copies the input string into the output.
82
+ void MicroStrcpy(char* output, const char* input);
83
+
84
+ // Formats a division operation to have a specified number of decimal places.
85
+ // Args:
86
+ // - output: The output string to be formatted.
87
+ // - numerator: The numerator in the division operation.
88
+ // - denominator: The denominator in the division operation.
89
+ // - decimal places: The number of decimal places to print to.
90
+ void FormatIntegerDivide(char* output, int64_t numerator, int64_t denominator,
91
+ int decimal_places);
92
+
93
+ // Formats a division operation as a percentage.
94
+ // Args:
95
+ // - output: The output string to be formatted.
96
+ // - numerator: The numerator in the division operation.
97
+ // - denominator: The denominator in the division operation.
98
+ // - decimal places: The number of decimal places to print to.
99
+ void FormatAsPercentage(char* output, int64_t numerator, int64_t denominator,
100
+ int decimal_places);
101
+
102
+ void PrettyPrintTableHeader(PrettyPrintType type, const char* table_name);
103
+
104
+ // Formats a number as a string.
105
+ // Args:
106
+ // - output: The location of where to write the formatted number.
107
+ // - value: The value to write to a string.
108
+ template <typename T>
109
+ void FormatNumber(char* output, T value);
110
+
111
+ // Pretty prints a table to stdout.
112
+ // Note: kMaxRows and kColumns should describe the allocated size of the table,
113
+ // not the amount of data that is populated. It is required that all
114
+ // columns are filled out, but not all rows.
115
+ //
116
+ // ex) PrintTable<3, 25>(headers, data, 4);
117
+ // This will print a table with 3 columns and 4 rows. In this example, it
118
+ // is required that data is defined as char[3][25][kMaxStringLength] to
119
+ // properly print.
120
+ //
121
+ // op cycles cpu %
122
+ // -------------------------
123
+ // foo | 1000 | 10
124
+ // bar | 2500 | 25
125
+ // baz | 1000 | 10
126
+ // lorem | 2000 | 20
127
+ //
128
+ // Args:
129
+ // - headers: A 1D array of strings containing the headers of the table. This
130
+ // must be equal in size to kColumns.
131
+ // - data: A 2D array of string data organized in [columns, rows]. As stated
132
+ // above, it is required that all columns are populated, but not all rows.
133
+ // - rows: The number of populated rows in `data`.
134
+ template <int kMaxRows, int kColumns>
135
+ void PrintTable(const char headers[kColumns][kMaxStringLength],
136
+ const char data[kColumns][kMaxRows][kMaxStringLength],
137
+ const int rows) {
138
+ // Get the maximum width for each column in the table.
139
+ int max_column_width[kColumns];
140
+ for (int i = 0; i < kColumns; ++i) {
141
+ max_column_width[i] = std::max(GetLongestStringLength(data[i], rows),
142
+ static_cast<int>(strlen(headers[i])));
143
+ }
144
+
145
+ // Add padding between each item in the header so it can be printed on one
146
+ // line.
147
+ char header_spaces[kColumns][kMaxStringLength];
148
+ for (int i = 0; i < kColumns; ++i) {
149
+ FillColumnPadding(header_spaces[i], strlen(headers[i]), max_column_width[i],
150
+ kDefaultColumnPadding + 2);
151
+ }
152
+
153
+ // Print the header.
154
+ char header[kMaxRowLength];
155
+ memset(header, 0, kMaxRowLength);
156
+ for (int i = 0; i < kColumns; ++i) {
157
+ MicroStrcat(header, headers[i]);
158
+ MicroStrcat(header, header_spaces[i]);
159
+ }
160
+ MicroPrintf("%s", header);
161
+
162
+ // Print a separator to separate the header from the data.
163
+ char separator[kMaxRowLength];
164
+ FillString(separator, strlen(header) - 1, kMaxRowLength, '-');
165
+ MicroPrintf("%s", separator);
166
+
167
+ for (int i = 0; i < rows; ++i) {
168
+ char spaces[kColumns][kMaxStringLength];
169
+ for (int j = 0; j < kColumns; ++j) {
170
+ FillColumnPadding(spaces[j], strlen(data[j][i]), max_column_width[j]);
171
+ }
172
+
173
+ char row[kMaxRowLength];
174
+ memset(row, 0, kMaxRowLength);
175
+
176
+ // Concatenate each column in a row with the format "[data][padding]| "
177
+ for (int j = 0; j < kColumns; ++j) {
178
+ MicroStrcat(row, data[j][i]);
179
+ MicroStrcat(row, spaces[j]);
180
+ MicroStrcat(row, "| ");
181
+ }
182
+
183
+ MicroPrintf("%s", row);
184
+ }
185
+
186
+ MicroPrintf(separator);
187
+ MicroPrintf("");
188
+ }
189
+
190
+ // Pretty prints a csv to stdout.
191
+ // Note: kMaxRows and kColumns should describe the allocated size of the table,
192
+ // not the amount of data that is populated. It is required that all
193
+ // columns are filled out, but not all rows.
194
+ //
195
+ // ex)
196
+ // op,cycles,%cpu
197
+ // foo,1000,10
198
+ // bar,2500,25
199
+ // baz,1000,10
200
+ //
201
+ // Args:
202
+ // - headers: A 1D array of strings containing the headers of the table. This
203
+ // must be equal in size to kColumns.
204
+ // - data: A 2D array of string data organized in [columns, rows]. As stated
205
+ // above, it is required that all columns are populated, but not all rows.
206
+ // - rows: The number of populated rows in `data`.
207
+ template <int kMaxRows, int kColumns>
208
+ void PrintCsv(const char headers[kColumns][kMaxStringLength],
209
+ const char data[kColumns][kMaxRows][kMaxStringLength],
210
+ const int rows) {
211
+ char header[kMaxRowLength];
212
+ memset(header, 0, kMaxRowLength);
213
+ for (int i = 0; i < kColumns; ++i) {
214
+ MicroStrcat(header, headers[i]);
215
+ if (i < kColumns - 1) {
216
+ MicroStrcat(header, ",");
217
+ }
218
+ }
219
+
220
+ MicroPrintf("%s", header);
221
+
222
+ char row[kMaxRowLength];
223
+ for (int i = 0; i < rows; ++i) {
224
+ memset(row, 0, kMaxRowLength);
225
+ for (int j = 0; j < kColumns; ++j) {
226
+ MicroStrcat(row, data[j][i]);
227
+ if (j < kColumns - 1) {
228
+ MicroStrcat(row, ",");
229
+ }
230
+ }
231
+
232
+ MicroPrintf("%s", row);
233
+ }
234
+
235
+ MicroPrintf(""); // Serves as a new line.
236
+ }
237
+
238
+ // Prints a 2D array of strings in a formatted manner along with a table name
239
+ // that includes the table type.
240
+ //
241
+ // Note: kMaxRows and kColumns should describe the allocated size of the table,
242
+ // not the amount of data that is populated. It is required that all
243
+ // columns are filled out, but not all rows.
244
+ //
245
+ // ex) PrettyPrint::kCsv will print a csv with a [[ CSV ]]: table_name header.
246
+ //
247
+ // Args:
248
+ // - headers: A 1D array of strings containing the headers of the table. This
249
+ // must be equal in size to kColumns.
250
+ // - data: A 2D array of string data organized in [columns, rows]. As stated
251
+ // above, it is required that all columns are populated, but not all rows.
252
+ // - rows: The number of populated rows in `data`.
253
+ // - type: The format type that should be used to pretty print.
254
+ // - table_name: The name of the table to be printed alongside the format type.
255
+ template <int kMaxRows, int kColumns>
256
+ void PrintFormattedData(const char headers[kColumns][kMaxStringLength],
257
+ const char data[kColumns][kMaxRows][kMaxStringLength],
258
+ const int rows, const PrettyPrintType type,
259
+ const char* table_name) {
260
+ PrettyPrintTableHeader(type, table_name);
261
+ switch (type) {
262
+ case PrettyPrintType::kCsv:
263
+ PrintCsv<kMaxRows, kColumns>(headers, data, rows);
264
+ break;
265
+ case PrettyPrintType::kTable:
266
+ PrintTable<kMaxRows, kColumns>(headers, data, rows);
267
+ break;
268
+ }
269
+ }
270
+
271
+ } // namespace tflite
272
+
273
+ #endif // TFLM_BENCHMARK_INTERNAL_LOG_UTILS_H_
@@ -0,0 +1,41 @@
1
+ /* Copyright 2023 The TensorFlow Authors. All Rights Reserved.
2
+
3
+ Licensed under the Apache License, Version 2.0 (the "License");
4
+ you may not use this file except in compliance with the License.
5
+ You may obtain a copy of the License at
6
+
7
+ http://www.apache.org/licenses/LICENSE-2.0
8
+
9
+ Unless required by applicable law or agreed to in writing, software
10
+ distributed under the License is distributed on an "AS IS" BASIS,
11
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ See the License for the specific language governing permissions and
13
+ limitations under the License.
14
+ ==============================================================================*/
15
+
16
+ #ifndef TFLM_BENCHMARK_INTERNAL_METRICS_H_
17
+ #define TFLM_BENCHMARK_INTERNAL_METRICS_H_
18
+
19
+ #include <stdio.h>
20
+
21
+ #include <cmath>
22
+ #include <cstdint>
23
+
24
+ #include "tensorflow/lite/micro/micro_profiler.h"
25
+ #include "tensorflow/lite/micro/recording_micro_allocator.h"
26
+ #include "tensorflow/lite/micro/tools/benchmarking/log_utils.h"
27
+
28
+ namespace tflite {
29
+
30
+ // Logs the allocation events. Prints out two tables, one for the arena
31
+ // allocations, and one for each type of TFLM allocation type.
32
+ // Args:
33
+ // - allocator: The recording micro allocator used during the invocation
34
+ // process.
35
+ // - type: Which print format should be used to output the allocation data to
36
+ // stdout.
37
+ void LogAllocatorEvents(const tflite::RecordingMicroAllocator& allocator,
38
+ PrettyPrintType type);
39
+ } // namespace tflite
40
+
41
+ #endif // TFLM_BENCHMARK_INTERNAL_METRICS_H_
@@ -0,0 +1,127 @@
1
+ /* Copyright 2023 The TensorFlow Authors. All Rights Reserved.
2
+
3
+ Licensed under the Apache License, Version 2.0 (the "License");
4
+ you may not use this file except in compliance with the License.
5
+ You may obtain a copy of the License at
6
+
7
+ http://www.apache.org/licenses/LICENSE-2.0
8
+
9
+ Unless required by applicable law or agreed to in writing, software
10
+ distributed under the License is distributed on an "AS IS" BASIS,
11
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ See the License for the specific language governing permissions and
13
+ limitations under the License.
14
+ ==============================================================================*/
15
+
16
+ #ifndef TFLM_BENCHMARK_OP_RESOLVER_H_
17
+ #define TFLM_BENCHMARK_OP_RESOLVER_H_
18
+
19
+ #include <memory>
20
+
21
+ #include "tensorflow/lite/micro/micro_mutable_op_resolver.h"
22
+ #include "tensorflow/lite/micro/micro_op_resolver.h"
23
+
24
+ namespace tflite {
25
+
26
+ inline TfLiteStatus CreateOpResolver(
27
+ tflite::MicroMutableOpResolver<96>& op_resolver) {
28
+ TF_LITE_ENSURE_STATUS(op_resolver.AddFullyConnected());
29
+ TF_LITE_ENSURE_STATUS(op_resolver.AddAdd());
30
+ TF_LITE_ENSURE_STATUS(op_resolver.AddAbs());
31
+ TF_LITE_ENSURE_STATUS(op_resolver.AddAddN());
32
+ TF_LITE_ENSURE_STATUS(op_resolver.AddArgMax());
33
+ TF_LITE_ENSURE_STATUS(op_resolver.AddArgMin());
34
+ TF_LITE_ENSURE_STATUS(op_resolver.AddAssignVariable());
35
+ TF_LITE_ENSURE_STATUS(op_resolver.AddBatchToSpaceNd());
36
+ TF_LITE_ENSURE_STATUS(op_resolver.AddBroadcastArgs());
37
+ TF_LITE_ENSURE_STATUS(op_resolver.AddBroadcastTo());
38
+ TF_LITE_ENSURE_STATUS(op_resolver.AddCallOnce());
39
+ TF_LITE_ENSURE_STATUS(op_resolver.AddCast());
40
+ TF_LITE_ENSURE_STATUS(op_resolver.AddCeil());
41
+ TF_LITE_ENSURE_STATUS(op_resolver.AddCircularBuffer());
42
+ TF_LITE_ENSURE_STATUS(op_resolver.AddConcatenation());
43
+ TF_LITE_ENSURE_STATUS(op_resolver.AddCos());
44
+ TF_LITE_ENSURE_STATUS(op_resolver.AddCumSum());
45
+ TF_LITE_ENSURE_STATUS(op_resolver.AddDepthToSpace());
46
+ TF_LITE_ENSURE_STATUS(op_resolver.AddDequantize());
47
+ TF_LITE_ENSURE_STATUS(op_resolver.AddDiv());
48
+ TF_LITE_ENSURE_STATUS(op_resolver.AddElu());
49
+ TF_LITE_ENSURE_STATUS(op_resolver.AddEqual());
50
+ TF_LITE_ENSURE_STATUS(op_resolver.AddEthosU());
51
+ TF_LITE_ENSURE_STATUS(op_resolver.AddExp());
52
+ TF_LITE_ENSURE_STATUS(op_resolver.AddExpandDims());
53
+ TF_LITE_ENSURE_STATUS(op_resolver.AddFill());
54
+ TF_LITE_ENSURE_STATUS(op_resolver.AddFloor());
55
+ TF_LITE_ENSURE_STATUS(op_resolver.AddFloorDiv());
56
+ TF_LITE_ENSURE_STATUS(op_resolver.AddFloorMod());
57
+ TF_LITE_ENSURE_STATUS(op_resolver.AddGather());
58
+ TF_LITE_ENSURE_STATUS(op_resolver.AddGatherNd());
59
+ TF_LITE_ENSURE_STATUS(op_resolver.AddGreater());
60
+ TF_LITE_ENSURE_STATUS(op_resolver.AddGreaterEqual());
61
+ TF_LITE_ENSURE_STATUS(op_resolver.AddHardSwish());
62
+ TF_LITE_ENSURE_STATUS(op_resolver.AddIf());
63
+ TF_LITE_ENSURE_STATUS(op_resolver.AddL2Normalization());
64
+ TF_LITE_ENSURE_STATUS(op_resolver.AddL2Pool2D());
65
+ TF_LITE_ENSURE_STATUS(op_resolver.AddLeakyRelu());
66
+ TF_LITE_ENSURE_STATUS(op_resolver.AddLess());
67
+ TF_LITE_ENSURE_STATUS(op_resolver.AddLessEqual());
68
+ TF_LITE_ENSURE_STATUS(op_resolver.AddLog());
69
+ TF_LITE_ENSURE_STATUS(op_resolver.AddLogicalAnd());
70
+ TF_LITE_ENSURE_STATUS(op_resolver.AddLogicalNot());
71
+ TF_LITE_ENSURE_STATUS(op_resolver.AddLogicalOr());
72
+ TF_LITE_ENSURE_STATUS(op_resolver.AddLogistic());
73
+ TF_LITE_ENSURE_STATUS(op_resolver.AddLogSoftmax());
74
+ TF_LITE_ENSURE_STATUS(op_resolver.AddMaximum());
75
+ TF_LITE_ENSURE_STATUS(op_resolver.AddMirrorPad());
76
+ TF_LITE_ENSURE_STATUS(op_resolver.AddMean());
77
+ TF_LITE_ENSURE_STATUS(op_resolver.AddMinimum());
78
+ TF_LITE_ENSURE_STATUS(op_resolver.AddNeg());
79
+ TF_LITE_ENSURE_STATUS(op_resolver.AddNotEqual());
80
+ TF_LITE_ENSURE_STATUS(op_resolver.AddPack());
81
+ TF_LITE_ENSURE_STATUS(op_resolver.AddPadV2());
82
+ TF_LITE_ENSURE_STATUS(op_resolver.AddPrelu());
83
+ TF_LITE_ENSURE_STATUS(op_resolver.AddQuantize());
84
+ TF_LITE_ENSURE_STATUS(op_resolver.AddReadVariable());
85
+ TF_LITE_ENSURE_STATUS(op_resolver.AddReduceMax());
86
+ TF_LITE_ENSURE_STATUS(op_resolver.AddRelu());
87
+ TF_LITE_ENSURE_STATUS(op_resolver.AddRelu6());
88
+ TF_LITE_ENSURE_STATUS(op_resolver.AddReshape());
89
+ TF_LITE_ENSURE_STATUS(op_resolver.AddResizeBilinear());
90
+ TF_LITE_ENSURE_STATUS(op_resolver.AddResizeNearestNeighbor());
91
+ TF_LITE_ENSURE_STATUS(op_resolver.AddRound());
92
+ TF_LITE_ENSURE_STATUS(op_resolver.AddRsqrt());
93
+ TF_LITE_ENSURE_STATUS(op_resolver.AddSelectV2());
94
+ TF_LITE_ENSURE_STATUS(op_resolver.AddShape());
95
+ TF_LITE_ENSURE_STATUS(op_resolver.AddSin());
96
+ TF_LITE_ENSURE_STATUS(op_resolver.AddSlice());
97
+ TF_LITE_ENSURE_STATUS(op_resolver.AddSoftmax());
98
+ TF_LITE_ENSURE_STATUS(op_resolver.AddSpaceToBatchNd());
99
+ TF_LITE_ENSURE_STATUS(op_resolver.AddSpaceToDepth());
100
+ TF_LITE_ENSURE_STATUS(op_resolver.AddSplit());
101
+ TF_LITE_ENSURE_STATUS(op_resolver.AddSplitV());
102
+ TF_LITE_ENSURE_STATUS(op_resolver.AddSqueeze());
103
+ TF_LITE_ENSURE_STATUS(op_resolver.AddSqrt());
104
+ TF_LITE_ENSURE_STATUS(op_resolver.AddSquare());
105
+ TF_LITE_ENSURE_STATUS(op_resolver.AddSquaredDifference());
106
+ TF_LITE_ENSURE_STATUS(op_resolver.AddStridedSlice());
107
+ TF_LITE_ENSURE_STATUS(op_resolver.AddSub());
108
+ TF_LITE_ENSURE_STATUS(op_resolver.AddSum());
109
+ TF_LITE_ENSURE_STATUS(op_resolver.AddSvdf());
110
+ TF_LITE_ENSURE_STATUS(op_resolver.AddTanh());
111
+ TF_LITE_ENSURE_STATUS(op_resolver.AddTransposeConv());
112
+ TF_LITE_ENSURE_STATUS(op_resolver.AddTranspose());
113
+ TF_LITE_ENSURE_STATUS(op_resolver.AddUnpack());
114
+ TF_LITE_ENSURE_STATUS(op_resolver.AddUnidirectionalSequenceLSTM());
115
+ TF_LITE_ENSURE_STATUS(op_resolver.AddVarHandle());
116
+ TF_LITE_ENSURE_STATUS(op_resolver.AddWhile());
117
+ TF_LITE_ENSURE_STATUS(op_resolver.AddZerosLike());
118
+ TF_LITE_ENSURE_STATUS(op_resolver.AddDepthwiseConv2D());
119
+ TF_LITE_ENSURE_STATUS(op_resolver.AddConv2D());
120
+ TF_LITE_ENSURE_STATUS(op_resolver.AddAveragePool2D());
121
+ TF_LITE_ENSURE_STATUS(op_resolver.AddPad());
122
+ TF_LITE_ENSURE_STATUS(op_resolver.AddMaxPool2D());
123
+ TF_LITE_ENSURE_STATUS(op_resolver.AddMul());
124
+ return kTfLiteOk;
125
+ }
126
+ } // namespace tflite
127
+ #endif // TFLM_BENCHMARK_OP_RESOLVER_H_