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
@@ -28,21 +28,26 @@ limitations under the License.
28
28
  namespace tflite {
29
29
  namespace micro {
30
30
 
31
- TfLiteRegistration_V1 RegisterOp(
31
+ TFLMRegistration RegisterOp(
32
32
  void* (*init)(TfLiteContext* context, const char* buffer, size_t length),
33
33
  TfLiteStatus (*prepare)(TfLiteContext* context, TfLiteNode* node),
34
34
  TfLiteStatus (*invoke)(TfLiteContext* context, TfLiteNode* node),
35
- void (*free)(TfLiteContext* context, void* buffer) = nullptr);
35
+ void (*free)(TfLiteContext* context, void* buffer) = nullptr,
36
+ void (*reset)(TfLiteContext* context, void* buffer) = nullptr);
37
+
38
+ TFLMInferenceRegistration RegisterOp(
39
+ TfLiteStatus (*invoke)(TfLiteContext* context, TfLiteNode* node),
40
+ void (*reset)(TfLiteContext* context, void* buffer) = nullptr);
36
41
 
37
42
  // Prints out n bytes in a int8_t buffer as hex
38
43
  void PrintNBytes(const int8_t* tensor_data, int n_bytes,
39
44
  const char* prefix = nullptr);
40
45
 
41
- // Prints out the the n bytes in a TfLiteEvalTensor as hex
46
+ // Prints out the n bytes in a TfLiteEvalTensor as hex
42
47
  void PrintNBytes(const TfLiteEvalTensor* tensor, int n_bytes,
43
48
  const char* prefix = nullptr);
44
49
 
45
- // Prints out the the n bytes in a TfLiteTensor as hex
50
+ // Prints out n bytes in a TfLiteTensor as hex
46
51
  void PrintNBytes(const TfLiteTensor* tensor, int n_bytes,
47
52
  const char* prefix = nullptr);
48
53
 
@@ -15,6 +15,8 @@ limitations under the License.
15
15
  #ifndef TENSORFLOW_LITE_MICRO_KERNELS_MICRO_OPS_H_
16
16
  #define TENSORFLOW_LITE_MICRO_KERNELS_MICRO_OPS_H_
17
17
 
18
+ #include "signal/micro/kernels/irfft.h"
19
+ #include "signal/micro/kernels/rfft.h"
18
20
  #include "tensorflow/lite/c/common.h"
19
21
 
20
22
  // Forward declaration of all micro op kernel registration methods. These
@@ -31,109 +33,126 @@ namespace tflite {
31
33
  // (https://abseil.io/tips/130). Any new ops (or cleanup of existing ops should
32
34
  // have their Register function declarations in the tflite namespace.
33
35
 
34
- TfLiteRegistration_V1 Register_ABS();
35
- TfLiteRegistration_V1 Register_ADD();
36
- TfLiteRegistration_V1 Register_ADD_N();
37
- TfLiteRegistration_V1 Register_ARG_MAX();
38
- TfLiteRegistration_V1 Register_ARG_MIN();
39
- TfLiteRegistration_V1 Register_ASSIGN_VARIABLE();
40
- TfLiteRegistration_V1 Register_AVERAGE_POOL_2D();
41
- TfLiteRegistration_V1 Register_BATCH_TO_SPACE_ND();
42
- TfLiteRegistration_V1 Register_BROADCAST_ARGS();
43
- TfLiteRegistration_V1 Register_BROADCAST_TO();
44
- TfLiteRegistration_V1 Register_CALL_ONCE();
45
- TfLiteRegistration_V1 Register_CAST();
46
- TfLiteRegistration_V1 Register_CEIL();
36
+ TFLMRegistration Register_ABS();
37
+ TFLMRegistration Register_ADD();
38
+ TFLMRegistration Register_ADD_N();
39
+ TFLMRegistration Register_ARG_MAX();
40
+ TFLMRegistration Register_ARG_MIN();
41
+ TFLMRegistration Register_ASSIGN_VARIABLE();
42
+ TFLMRegistration Register_AVERAGE_POOL_2D();
43
+ TFLMRegistration Register_BATCH_MATMUL();
44
+ TFLMRegistration Register_BATCH_TO_SPACE_ND();
45
+ TFLMRegistration Register_BROADCAST_ARGS();
46
+ TFLMRegistration Register_BROADCAST_TO();
47
+ TFLMRegistration Register_CALL_ONCE();
48
+ TFLMRegistration Register_CAST();
49
+ TFLMRegistration Register_CEIL();
47
50
  // TODO(b/160234179): Change custom OPs to also return by value.
48
- TfLiteRegistration_V1* Register_CIRCULAR_BUFFER();
49
- TfLiteRegistration_V1 Register_CONCATENATION();
50
- TfLiteRegistration_V1 Register_CONV_2D();
51
- TfLiteRegistration_V1 Register_COS();
52
- TfLiteRegistration_V1 Register_CUMSUM();
53
- TfLiteRegistration_V1 Register_DEPTH_TO_SPACE();
54
- TfLiteRegistration_V1 Register_DEPTHWISE_CONV_2D();
55
- TfLiteRegistration_V1 Register_DEQUANTIZE();
56
- TfLiteRegistration_V1 Register_DIV();
57
- TfLiteRegistration_V1 Register_ELU();
58
- TfLiteRegistration_V1 Register_EQUAL();
59
- TfLiteRegistration_V1* Register_ETHOSU();
60
- TfLiteRegistration_V1 Register_EXP();
61
- TfLiteRegistration_V1 Register_EXPAND_DIMS();
62
- TfLiteRegistration_V1 Register_FILL();
63
- TfLiteRegistration_V1 Register_FLOOR();
64
- TfLiteRegistration_V1 Register_FLOOR_DIV();
65
- TfLiteRegistration_V1 Register_FLOOR_MOD();
66
- TfLiteRegistration_V1 Register_FULLY_CONNECTED();
67
- TfLiteRegistration_V1 Register_GATHER();
68
- TfLiteRegistration_V1 Register_GATHER_ND();
69
- TfLiteRegistration_V1 Register_GREATER();
70
- TfLiteRegistration_V1 Register_GREATER_EQUAL();
71
- TfLiteRegistration_V1 Register_HARD_SWISH();
72
- TfLiteRegistration_V1 Register_IF();
73
- TfLiteRegistration_V1 Register_L2_NORMALIZATION();
74
- TfLiteRegistration_V1 Register_L2_POOL_2D();
75
- TfLiteRegistration_V1 Register_LEAKY_RELU();
76
- TfLiteRegistration_V1 Register_LESS();
77
- TfLiteRegistration_V1 Register_LESS_EQUAL();
78
- TfLiteRegistration_V1 Register_LOG();
79
- TfLiteRegistration_V1 Register_LOG_SOFTMAX();
80
- TfLiteRegistration_V1 Register_LOGICAL_AND();
81
- TfLiteRegistration_V1 Register_LOGICAL_NOT();
82
- TfLiteRegistration_V1 Register_LOGICAL_OR();
83
- TfLiteRegistration_V1 Register_LOGISTIC();
84
- TfLiteRegistration_V1 Register_MAX_POOL_2D();
85
- TfLiteRegistration_V1 Register_MAXIMUM();
86
- TfLiteRegistration_V1 Register_MEAN();
87
- TfLiteRegistration_V1 Register_MINIMUM();
88
- TfLiteRegistration_V1 Register_MIRROR_PAD();
89
- TfLiteRegistration_V1 Register_MUL();
90
- TfLiteRegistration_V1 Register_NEG();
91
- TfLiteRegistration_V1 Register_NOT_EQUAL();
92
- TfLiteRegistration_V1 Register_PACK();
93
- TfLiteRegistration_V1 Register_PAD();
94
- TfLiteRegistration_V1 Register_PADV2();
95
- TfLiteRegistration_V1 Register_PRELU();
96
- TfLiteRegistration_V1 Register_QUANTIZE();
97
- TfLiteRegistration_V1 Register_READ_VARIABLE();
98
- TfLiteRegistration_V1 Register_REDUCE_MAX();
99
- TfLiteRegistration_V1 Register_RELU();
100
- TfLiteRegistration_V1 Register_RELU6();
101
- TfLiteRegistration_V1 Register_RESIZE_BILINEAR();
102
- TfLiteRegistration_V1 Register_RESIZE_NEAREST_NEIGHBOR();
103
- TfLiteRegistration_V1 Register_RSQRT();
104
- TfLiteRegistration_V1 Register_SELECT_V2();
105
- TfLiteRegistration_V1 Register_SHAPE();
106
- TfLiteRegistration_V1 Register_SIN();
107
- TfLiteRegistration_V1 Register_SLICE();
108
- TfLiteRegistration_V1 Register_SOFTMAX();
109
- TfLiteRegistration_V1 Register_SPACE_TO_BATCH_ND();
110
- TfLiteRegistration_V1 Register_SPACE_TO_DEPTH();
111
- TfLiteRegistration_V1 Register_SPLIT();
112
- TfLiteRegistration_V1 Register_SPLIT_V();
113
- TfLiteRegistration_V1 Register_SQRT();
114
- TfLiteRegistration_V1 Register_SQUARE();
115
- TfLiteRegistration_V1 Register_SQUARED_DIFFERENCE();
116
- TfLiteRegistration_V1 Register_SQUEEZE();
117
- TfLiteRegistration_V1 Register_STRIDED_SLICE();
118
- TfLiteRegistration_V1 Register_SUB();
119
- TfLiteRegistration_V1 Register_SUM();
120
- TfLiteRegistration_V1 Register_SVDF();
121
- TfLiteRegistration_V1 Register_TANH();
122
- TfLiteRegistration_V1 Register_TRANSPOSE();
123
- TfLiteRegistration_V1 Register_TRANSPOSE_CONV();
51
+ TFLMRegistration* Register_CIRCULAR_BUFFER();
52
+ TFLMRegistration Register_CONCATENATION();
53
+ TFLMRegistration Register_CONV_2D();
54
+ TFLMRegistration Register_COS();
55
+ TFLMRegistration Register_CUMSUM();
56
+ TFLMRegistration Register_DEPTH_TO_SPACE();
57
+ TFLMRegistration Register_DEPTHWISE_CONV_2D();
58
+ TFLMRegistration Register_DEQUANTIZE();
59
+ TFLMRegistration Register_DIV();
60
+ TFLMRegistration Register_ELU();
61
+ TFLMRegistration Register_EMBEDDING_LOOKUP();
62
+ TFLMRegistration Register_EQUAL();
63
+ TFLMRegistration* Register_ETHOSU();
64
+ TFLMRegistration Register_EXP();
65
+ TFLMRegistration Register_EXPAND_DIMS();
66
+ TFLMRegistration Register_FILL();
67
+ TFLMRegistration Register_FLOOR();
68
+ TFLMRegistration Register_FLOOR_DIV();
69
+ TFLMRegistration Register_FLOOR_MOD();
70
+ TFLMRegistration Register_FULLY_CONNECTED();
71
+ TFLMRegistration Register_GATHER();
72
+ TFLMRegistration Register_GATHER_ND();
73
+ TFLMRegistration Register_GREATER();
74
+ TFLMRegistration Register_GREATER_EQUAL();
75
+ TFLMRegistration Register_HARD_SWISH();
76
+ TFLMRegistration Register_IF();
77
+ TFLMRegistration Register_L2_NORMALIZATION();
78
+ TFLMRegistration Register_L2_POOL_2D();
79
+ TFLMRegistration Register_LEAKY_RELU();
80
+ TFLMRegistration Register_LESS();
81
+ TFLMRegistration Register_LESS_EQUAL();
82
+ TFLMRegistration Register_LOG();
83
+ TFLMRegistration Register_LOG_SOFTMAX();
84
+ TFLMRegistration Register_LOGICAL_AND();
85
+ TFLMRegistration Register_LOGICAL_NOT();
86
+ TFLMRegistration Register_LOGICAL_OR();
87
+ TFLMRegistration Register_LOGISTIC();
88
+ TFLMRegistration Register_MAX_POOL_2D();
89
+ TFLMRegistration Register_MAXIMUM();
90
+ TFLMRegistration Register_MEAN();
91
+ TFLMRegistration Register_MINIMUM();
92
+ TFLMRegistration Register_MIRROR_PAD();
93
+ TFLMRegistration Register_MUL();
94
+ TFLMRegistration Register_NEG();
95
+ TFLMRegistration Register_NOT_EQUAL();
96
+ TFLMRegistration Register_PACK();
97
+ TFLMRegistration Register_PAD();
98
+ TFLMRegistration Register_PADV2();
99
+ TFLMRegistration Register_PRELU();
100
+ TFLMRegistration Register_QUANTIZE();
101
+ TFLMRegistration Register_READ_VARIABLE();
102
+ TFLMRegistration Register_REDUCE_MAX();
103
+ TFLMRegistration Register_RELU();
104
+ TFLMRegistration Register_RELU6();
105
+ TFLMRegistration Register_RESHAPE();
106
+ TFLMRegistration Register_RESIZE_BILINEAR();
107
+ TFLMRegistration Register_RESIZE_NEAREST_NEIGHBOR();
108
+ TFLMRegistration Register_ROUND();
109
+ TFLMRegistration Register_RSQRT();
110
+ TFLMRegistration Register_SELECT_V2();
111
+ TFLMRegistration Register_SHAPE();
112
+ TFLMRegistration Register_SIN();
113
+ TFLMRegistration Register_SLICE();
114
+ TFLMRegistration Register_SOFTMAX();
115
+ TFLMRegistration Register_SPACE_TO_BATCH_ND();
116
+ TFLMRegistration Register_SPACE_TO_DEPTH();
117
+ TFLMRegistration Register_SPLIT();
118
+ TFLMRegistration Register_SPLIT_V();
119
+ TFLMRegistration Register_SQRT();
120
+ TFLMRegistration Register_SQUARE();
121
+ TFLMRegistration Register_SQUARED_DIFFERENCE();
122
+ TFLMRegistration Register_SQUEEZE();
123
+ TFLMRegistration Register_STRIDED_SLICE();
124
+ TFLMRegistration Register_SUB();
125
+ TFLMRegistration Register_SUM();
126
+ TFLMRegistration Register_SVDF();
127
+ TFLMRegistration Register_TANH();
128
+ TFLMRegistration Register_TRANSPOSE();
129
+ TFLMRegistration Register_TRANSPOSE_CONV();
124
130
  // TODO(b/230666079): resolve conflict with xtensa implementation
125
- TfLiteRegistration_V1 Register_UNIDIRECTIONAL_SEQUENCE_LSTM();
126
- TfLiteRegistration_V1 Register_UNPACK();
127
- TfLiteRegistration_V1 Register_VAR_HANDLE();
128
- TfLiteRegistration_V1 Register_WHILE();
129
- TfLiteRegistration_V1 Register_ZEROS_LIKE();
131
+ TFLMRegistration Register_UNIDIRECTIONAL_SEQUENCE_LSTM();
132
+ TFLMRegistration Register_UNPACK();
133
+ TFLMRegistration Register_VAR_HANDLE();
134
+ TFLMRegistration Register_WHILE();
135
+ TFLMRegistration Register_ZEROS_LIKE();
136
+
137
+ // TODO(b/295174388): Add the rest of inference only registration functions.
138
+ TFLMInferenceRegistration RegisterInference_FULLY_CONNECTED();
139
+
140
+ // TODO(b/160234179): Change custom OPs to also return by value.
141
+ namespace tflm_signal {
142
+ TFLMRegistration* Register_DELAY();
143
+ TFLMRegistration* Register_FFT_AUTO_SCALE();
144
+ TFLMRegistration* Register_FILTER_BANK();
145
+ TFLMRegistration* Register_FILTER_BANK_LOG();
146
+ TFLMRegistration* Register_FILTER_BANK_SPECTRAL_SUBTRACTION();
147
+ TFLMRegistration* Register_FILTER_BANK_SQUARE_ROOT();
148
+ TFLMRegistration* Register_ENERGY();
149
+ TFLMRegistration* Register_FRAMER();
150
+ TFLMRegistration* Register_OVERLAP_ADD();
151
+ TFLMRegistration* Register_PCAN();
152
+ TFLMRegistration* Register_STACKER();
153
+ TFLMRegistration* Register_WINDOW();
154
+ } // namespace tflm_signal
130
155
 
131
- namespace ops {
132
- namespace micro {
133
- TfLiteRegistration_V1 Register_RESHAPE();
134
- TfLiteRegistration_V1 Register_ROUND();
135
- } // namespace micro
136
- } // namespace ops
137
156
  } // namespace tflite
138
157
 
139
158
  #endif // TENSORFLOW_LITE_MICRO_KERNELS_MICRO_OPS_H_
@@ -19,7 +19,7 @@ limitations under the License.
19
19
  #include <cstdint>
20
20
 
21
21
  #include "tensorflow/lite/c/builtin_op_data.h"
22
- #include "tensorflow/lite/c/common.h"
22
+ #include "tensorflow/lite/micro/micro_common.h"
23
23
 
24
24
  namespace tflite {
25
25
 
@@ -61,13 +61,13 @@ void EvalMulFloatReference(TfLiteContext* context, TfLiteNode* node,
61
61
  TfLiteEvalTensor* output);
62
62
 
63
63
  // Generic must define registration function.
64
- TfLiteRegistration_V1 Register_MUL();
64
+ TFLMRegistration Register_MUL();
65
65
 
66
66
  #if defined(CMSIS_NN)
67
- TfLiteRegistration_V1 Register_MUL_INT8();
67
+ TFLMRegistration Register_MUL_INT8();
68
68
  #else
69
69
  // Fallback registration
70
- inline TfLiteRegistration_V1 Register_MUL_INT8() { return Register_MUL(); }
70
+ inline TFLMRegistration Register_MUL_INT8() { return Register_MUL(); }
71
71
  #endif
72
72
  } // namespace tflite
73
73
 
@@ -113,27 +113,27 @@ void MaxPoolingEvalQuantized(TfLiteContext* context, TfLiteNode* node,
113
113
  }
114
114
 
115
115
  #if defined(CMSIS_NN) || defined(XTENSA)
116
- TfLiteRegistration_V1 Register_AVERAGE_POOL_2D_INT8();
116
+ TFLMRegistration Register_AVERAGE_POOL_2D_INT8();
117
117
 
118
- TfLiteRegistration_V1 Register_MAX_POOL_2D_INT8();
118
+ TFLMRegistration Register_MAX_POOL_2D_INT8();
119
119
 
120
- TfLiteRegistration_V1 Register_AVERAGE_POOL_2D_INT16();
120
+ TFLMRegistration Register_AVERAGE_POOL_2D_INT16();
121
121
 
122
- TfLiteRegistration_V1 Register_MAX_POOL_2D_INT16();
122
+ TFLMRegistration Register_MAX_POOL_2D_INT16();
123
123
  #else
124
- inline TfLiteRegistration_V1 Register_AVERAGE_POOL_2D_INT8() {
124
+ inline TFLMRegistration Register_AVERAGE_POOL_2D_INT8() {
125
125
  return tflite::Register_AVERAGE_POOL_2D();
126
126
  }
127
127
 
128
- inline TfLiteRegistration_V1 Register_MAX_POOL_2D_INT8() {
128
+ inline TFLMRegistration Register_MAX_POOL_2D_INT8() {
129
129
  return tflite::Register_MAX_POOL_2D();
130
130
  }
131
131
 
132
- inline TfLiteRegistration_V1 Register_AVERAGE_POOL_2D_INT16() {
132
+ inline TFLMRegistration Register_AVERAGE_POOL_2D_INT16() {
133
133
  return tflite::Register_AVERAGE_POOL_2D();
134
134
  }
135
135
 
136
- inline TfLiteRegistration_V1 Register_MAX_POOL_2D_INT16() {
136
+ inline TFLMRegistration Register_MAX_POOL_2D_INT16() {
137
137
  return tflite::Register_MAX_POOL_2D();
138
138
  }
139
139
  #endif
@@ -19,8 +19,8 @@ limitations under the License.
19
19
  #include <cstdint>
20
20
 
21
21
  #include "tensorflow/lite/c/builtin_op_data.h"
22
- #include "tensorflow/lite/c/common.h"
23
22
  #include "tensorflow/lite/kernels/internal/types.h"
23
+ #include "tensorflow/lite/micro/micro_common.h"
24
24
 
25
25
  namespace tflite {
26
26
 
@@ -56,9 +56,9 @@ TfLiteStatus EvalSumHelper(TfLiteContext* context, TfLiteNode* node,
56
56
  void ReduceResolveAxis(const int* axis_data, int axis_count,
57
57
  MeanParams* op_params);
58
58
 
59
- TfLiteRegistration_V1 Register_MEAN();
60
- TfLiteRegistration_V1 Register_REDUCE_MAX();
61
- TfLiteRegistration_V1 Register_SUM();
59
+ TFLMRegistration Register_MEAN();
60
+ TFLMRegistration Register_REDUCE_MAX();
61
+ TFLMRegistration Register_SUM();
62
62
 
63
63
  } // namespace tflite
64
64
 
@@ -0,0 +1,26 @@
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
+ #include "tensorflow/lite/c/builtin_op_data.h"
17
+ #include "tensorflow/lite/c/common.h"
18
+
19
+ namespace tflite {
20
+
21
+ constexpr int kReshapeInputTensor = 0;
22
+ constexpr int kReshapeOutputTensor = 0;
23
+
24
+ TfLiteStatus PrepareReshapeReference(TfLiteContext* context, TfLiteNode* node);
25
+
26
+ } // namespace tflite
@@ -16,8 +16,8 @@ limitations under the License.
16
16
  #define TENSORFLOW_LITE_MICRO_KERNELS_SOFTMAX_H_
17
17
 
18
18
  #include "tensorflow/lite/c/builtin_op_data.h"
19
- #include "tensorflow/lite/c/common.h"
20
19
  #include "tensorflow/lite/kernels/internal/types.h"
20
+ #include "tensorflow/lite/micro/micro_common.h"
21
21
 
22
22
  namespace tflite {
23
23
 
@@ -32,38 +32,34 @@ TfLiteStatus CalculateSoftmaxParams(TfLiteContext* context,
32
32
 
33
33
  TfLiteStatus SoftmaxPrepare(TfLiteContext* context, TfLiteNode* node);
34
34
 
35
- // This is the most generic TfLiteRegistration_V1. The actual supported types
35
+ // This is the most generic TFLMRegistration. The actual supported types
36
36
  // may still be target dependent. The only requirement is that every
37
37
  // implementation (reference or optimized) must define this function.
38
- TfLiteRegistration_V1 Register_SOFTMAX();
38
+ TFLMRegistration Register_SOFTMAX();
39
39
 
40
40
  #if defined(XTENSA) || defined(CMSIS_NN)
41
- // Returns a TfLiteRegistration_V1 struct for kernel variant that only supports
41
+ // Returns a TFLMRegistration struct for kernel variant that only supports
42
42
  // int8 input and int16 output.
43
- TfLiteRegistration_V1 Register_SOFTMAX_INT8_INT16();
43
+ TFLMRegistration Register_SOFTMAX_INT8_INT16();
44
44
  #else
45
- inline TfLiteRegistration_V1 Register_SOFTMAX_INT8_INT16() {
45
+ inline TFLMRegistration Register_SOFTMAX_INT8_INT16() {
46
46
  return Register_SOFTMAX();
47
47
  }
48
48
  #endif
49
49
 
50
50
  #if defined(CMSIS_NN)
51
- // Returns a TfLiteRegistration_V1 struct for kernel variant that only supports
51
+ // Returns a TFLMRegistration struct for kernel variant that only supports
52
52
  // int8 input/output and uses the latency optimized implementations.
53
- TfLiteRegistration_V1 Register_SOFTMAX_INT8();
53
+ TFLMRegistration Register_SOFTMAX_INT8();
54
54
 
55
- // Returns a TfLiteRegistration_V1 struct for kernel variant that only supports
55
+ // Returns a TFLMRegistration struct for kernel variant that only supports
56
56
  // int16 input/output and uses the latency optimized implementations.
57
- TfLiteRegistration_V1 Register_SOFTMAX_INT16();
57
+ TFLMRegistration Register_SOFTMAX_INT16();
58
58
 
59
59
  #else
60
- inline TfLiteRegistration_V1 Register_SOFTMAX_INT8() {
61
- return Register_SOFTMAX();
62
- }
60
+ inline TFLMRegistration Register_SOFTMAX_INT8() { return Register_SOFTMAX(); }
63
61
 
64
- inline TfLiteRegistration_V1 Register_SOFTMAX_INT16() {
65
- return Register_SOFTMAX();
66
- }
62
+ inline TFLMRegistration Register_SOFTMAX_INT16() { return Register_SOFTMAX(); }
67
63
  #endif
68
64
 
69
65
  } // namespace tflite
@@ -0,0 +1,40 @@
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 TENSORFLOW_LITE_MICRO_KERNELS_STRIDED_SLICE_H_
17
+ #define TENSORFLOW_LITE_MICRO_KERNELS_STRIDED_SLICE_H_
18
+
19
+ #include <cstdint>
20
+
21
+ #include "tensorflow/lite/c/builtin_op_data.h"
22
+ #include "tensorflow/lite/c/common.h"
23
+ #include "tensorflow/lite/micro/micro_common.h"
24
+
25
+ namespace tflite {
26
+
27
+ constexpr int kStridedSliceInputTensor = 0;
28
+ constexpr int kStridedSliceBeginTensor = 1;
29
+ constexpr int kStridedSliceEndTensor = 2;
30
+ constexpr int kStridedSliceStridesTensor = 3;
31
+ constexpr int kStridedSliceOutputTensor = 0;
32
+
33
+ void* StridedSliceInit(TfLiteContext* context, const char* buffer,
34
+ size_t length);
35
+
36
+ TfLiteStatus StridedSlicePrepare(TfLiteContext* context, TfLiteNode* node);
37
+
38
+ } // namespace tflite
39
+
40
+ #endif // TENSORFLOW_LITE_MICRO_KERNELS_STRIDED_SLICE_H_
@@ -1,4 +1,4 @@
1
- /* Copyright 2022 The TensorFlow Authors. All Rights Reserved.
1
+ /* Copyright 2023 The TensorFlow Authors. All Rights Reserved.
2
2
 
3
3
  Licensed under the Apache License, Version 2.0 (the "License");
4
4
  you may not use this file except in compliance with the License.
@@ -16,7 +16,7 @@ limitations under the License.
16
16
  #define TENSORFLOW_LITE_MICRO_KERNELS_SVDF_H_
17
17
 
18
18
  #include "tensorflow/lite/c/builtin_op_data.h"
19
- #include "tensorflow/lite/c/common.h"
19
+ #include "tensorflow/lite/micro/micro_common.h"
20
20
 
21
21
  namespace tflite {
22
22
 
@@ -77,13 +77,14 @@ void EvalFloatSvdfReference(
77
77
 
78
78
  TfLiteStatus PrepareSvdf(TfLiteContext* context, TfLiteNode* node);
79
79
 
80
- // This is the most generic TfLiteRegistration_V1. The actual supported types
80
+ // This is the most generic TFLMRegistration. The actual supported types
81
81
  // may still be target dependent. The only requirement is that every
82
82
  // implementation (reference or optimized) must define this function.
83
- TfLiteRegistration_V1 Register_SVDF();
83
+ TFLMRegistration Register_SVDF();
84
84
 
85
- #if defined(HEXAGON) || defined(CMSIS_NN)
86
- TfLiteRegistration_V1 Register_SVDF_INT8();
85
+ #if defined(HEXAGON) || defined(CMSIS_NN) || defined(XTENSA)
86
+
87
+ TFLMRegistration Register_SVDF_INT8();
87
88
 
88
89
  #else
89
90
  // Note that while this block gets used for both reference and optimized kernels
@@ -91,7 +92,7 @@ TfLiteRegistration_V1 Register_SVDF_INT8();
91
92
  // define fallback implementation that allow reference kernels to still be used
92
93
  // from applications that call a more specific kernel variant.
93
94
 
94
- inline TfLiteRegistration_V1 Register_SVDF_INT8() { return Register_SVDF(); }
95
+ inline TFLMRegistration Register_SVDF_INT8() { return Register_SVDF(); }
95
96
 
96
97
  #endif
97
98
  } // namespace tflite
@@ -24,20 +24,20 @@ limitations under the License.
24
24
 
25
25
  namespace tflite {
26
26
 
27
- // This is the most generic TfLiteRegistration_V1. The actual supported types
27
+ // This is the most generic TFLMRegistration. The actual supported types
28
28
  // may still be target dependent. The only requirement is that every
29
29
  // implementation (reference or optimized) must define this function.
30
30
  // TODO(b/230666079): resolve conflict with xtensa implementation
31
- TfLiteRegistration_V1 Register_UNIDIRECTIONAL_SEQUENCE_LSTM();
31
+ TFLMRegistration Register_UNIDIRECTIONAL_SEQUENCE_LSTM();
32
32
 
33
33
  #if defined(CMSIS_NN)
34
- // Returns a TfLiteRegistration_V1 struct for kernel variant that only supports
34
+ // Returns a TFLMRegistration struct for kernel variant that only supports
35
35
  // int8 activations and int8 weights and uses the latency optimized
36
36
  // implementations.
37
- TfLiteRegistration_V1 Register_UNIDIRECTIONAL_SEQUENCE_LSTM_INT8();
37
+ TFLMRegistration Register_UNIDIRECTIONAL_SEQUENCE_LSTM_INT8();
38
38
 
39
39
  #else
40
- inline TfLiteRegistration_V1 Register_UNIDIRECTIONAL_SEQUENCE_LSTM_INT8() {
40
+ inline TFLMRegistration Register_UNIDIRECTIONAL_SEQUENCE_LSTM_INT8() {
41
41
  return Register_UNIDIRECTIONAL_SEQUENCE_LSTM();
42
42
  }
43
43
  #endif
@@ -22,13 +22,13 @@ limitations under the License.
22
22
  #include "tensorflow/lite/micro/kernels/xtensa/hifimini/fixedpoint_utils.h"
23
23
  #endif // defined(HIFMINI)
24
24
 
25
- #if defined(HIFI4) || defined(HIFI5)
25
+ #if defined(HIFI3) || defined(HIFI4) || defined(HIFI5)
26
26
  #include "include/nnlib/xa_nnlib_api.h"
27
27
  #include "include/nnlib/xa_nnlib_standards.h"
28
28
 
29
29
  #define ALIGNED_SIZE(x, bytes) (((x) + (bytes - 1)) & (~(bytes - 1)))
30
30
  #define ALIGN_PTR(x, bytes) ((((unsigned)(x)) + (bytes - 1)) & (~(bytes - 1)))
31
- #endif // defined(HIFI4) || defined(HIFI5)
31
+ #endif // defined(HIFI3) || defined(HIFI4) || defined(HIFI5)
32
32
 
33
33
  #if defined(VISION_P6)
34
34
  #include "utils.h"
@@ -25,9 +25,9 @@ namespace tflite {
25
25
  struct XtensaConvOpData {
26
26
  OpDataConv reference_op_data;
27
27
 
28
- #if defined(HIFI4) || defined(HIFI5)
28
+ #if defined(HIFI3) || defined(HIFI4) || defined(HIFI5)
29
29
  int scratch_tensor_index;
30
- #endif // defined(HIFI4) || defined(HIFI5)
30
+ #endif // defined(HIFI3) || defined(HIFI4) || defined(HIFI5)
31
31
 
32
32
  #if defined(VISION_P6)
33
33
  int8_t* reorder_coefficient_bias; // buffers used to keep reordered coeff and
@@ -36,30 +36,32 @@ struct XtensaConvOpData {
36
36
  int8_t* per_channel_output_shift_int8;
37
37
  uint8_t* p_context; // persistent lib context for this instance saved here
38
38
  uint32_t context_size;
39
+ bool is_per_channel_quantized;
39
40
  #endif // VISION_P6
40
41
  };
41
42
 
42
- #if defined(HIFI4) || defined(HIFI5)
43
+ #if defined(HIFI3) || defined(HIFI4) || defined(HIFI5)
43
44
  TfLiteStatus ConvPrepareHifi(TfLiteContext* context, TfLiteNode* node);
44
45
 
45
- TfLiteStatus ConvEvalHifi(TfLiteContext* context, TfLiteNode* node,
46
- const TfLiteConvParams& params,
47
- const XtensaConvOpData& data,
48
- const TfLiteEvalTensor* input,
49
- const TfLiteEvalTensor* filter,
50
- const TfLiteEvalTensor* bias,
51
- TfLiteEvalTensor* output);
52
- #endif // defined(HIFI4) || defined(HIFI5)
53
-
54
- #if defined(HIFI4)
55
- TfLiteStatus ConvEvalHifi16(TfLiteContext* context, TfLiteNode* node,
56
- const TfLiteConvParams& params,
57
- const XtensaConvOpData& data,
58
- const TfLiteEvalTensor* input,
59
- const TfLiteEvalTensor* filter,
60
- const TfLiteEvalTensor* bias,
61
- TfLiteEvalTensor* output);
62
- #endif // defined(HIFI4)
46
+ TfLiteStatus ConvEvalHifiInt8(TfLiteContext* context, TfLiteNode* node,
47
+ const TfLiteConvParams& params,
48
+ const XtensaConvOpData& data,
49
+ const TfLiteEvalTensor* input,
50
+ const TfLiteEvalTensor* filter,
51
+ const TfLiteEvalTensor* bias,
52
+ TfLiteEvalTensor* output);
53
+
54
+ #if defined(HIFI3) || defined(HIFI4)
55
+ TfLiteStatus ConvEvalHifiInt16(TfLiteContext* context, TfLiteNode* node,
56
+ const TfLiteConvParams& params,
57
+ const XtensaConvOpData& data,
58
+ const TfLiteEvalTensor* input,
59
+ const TfLiteEvalTensor* filter,
60
+ const TfLiteEvalTensor* bias,
61
+ TfLiteEvalTensor* output);
62
+ #endif // defined(HIFI3) || defined(HIFI4)
63
+
64
+ #endif // defined(HIFI3) || defined(HIFI4) || defined(HIFI5)
63
65
 
64
66
  #if defined(VISION_P6)
65
67
 
@@ -79,6 +81,9 @@ TfLiteStatus ConvReferenceEvalInt8(TfLiteContext* context, TfLiteNode* node);
79
81
 
80
82
  TfLiteStatus ConvReferenceEvalInt16(TfLiteContext* context, TfLiteNode* node);
81
83
 
84
+ void* ConvInitXtensa(TfLiteContext* context, const char* buffer, size_t length);
85
+ TfLiteStatus ConvPrepareXtensa(TfLiteContext* context, TfLiteNode* node);
86
+
82
87
  } // namespace tflite
83
88
 
84
89
  #endif // TENSORFLOW_LITE_MICRO_KERNELS_XTENSA_XTENSA_CONV_H_