xmos-ai-tools 1.3.2.dev80__py3-none-macosx_10_15_universal2.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 (395) hide show
  1. xmos_ai_tools/__init__.py +7 -0
  2. xmos_ai_tools/io_server/__init__.py +151 -0
  3. xmos_ai_tools/runtime/__init__.py +0 -0
  4. xmos_ai_tools/runtime/buildfiles/aitoolslib.cmake +13 -0
  5. xmos_ai_tools/runtime/buildfiles/aitoolslib.make +8 -0
  6. xmos_ai_tools/runtime/include/flash_server.h +74 -0
  7. xmos_ai_tools/runtime/include/flatbuffers/allocator.h +68 -0
  8. xmos_ai_tools/runtime/include/flatbuffers/array.h +243 -0
  9. xmos_ai_tools/runtime/include/flatbuffers/base.h +474 -0
  10. xmos_ai_tools/runtime/include/flatbuffers/bfbs_generator.h +43 -0
  11. xmos_ai_tools/runtime/include/flatbuffers/buffer.h +142 -0
  12. xmos_ai_tools/runtime/include/flatbuffers/buffer_ref.h +53 -0
  13. xmos_ai_tools/runtime/include/flatbuffers/code_generators.h +235 -0
  14. xmos_ai_tools/runtime/include/flatbuffers/default_allocator.h +64 -0
  15. xmos_ai_tools/runtime/include/flatbuffers/detached_buffer.h +114 -0
  16. xmos_ai_tools/runtime/include/flatbuffers/flatbuffer_builder.h +1197 -0
  17. xmos_ai_tools/runtime/include/flatbuffers/flatbuffers.h +270 -0
  18. xmos_ai_tools/runtime/include/flatbuffers/flatc.h +111 -0
  19. xmos_ai_tools/runtime/include/flatbuffers/flexbuffers.h +1897 -0
  20. xmos_ai_tools/runtime/include/flatbuffers/grpc.h +300 -0
  21. xmos_ai_tools/runtime/include/flatbuffers/hash.h +127 -0
  22. xmos_ai_tools/runtime/include/flatbuffers/idl.h +1232 -0
  23. xmos_ai_tools/runtime/include/flatbuffers/minireflect.h +419 -0
  24. xmos_ai_tools/runtime/include/flatbuffers/pch/flatc_pch.h +39 -0
  25. xmos_ai_tools/runtime/include/flatbuffers/pch/pch.h +38 -0
  26. xmos_ai_tools/runtime/include/flatbuffers/reflection.h +502 -0
  27. xmos_ai_tools/runtime/include/flatbuffers/reflection_generated.h +1449 -0
  28. xmos_ai_tools/runtime/include/flatbuffers/registry.h +128 -0
  29. xmos_ai_tools/runtime/include/flatbuffers/stl_emulation.h +509 -0
  30. xmos_ai_tools/runtime/include/flatbuffers/string.h +64 -0
  31. xmos_ai_tools/runtime/include/flatbuffers/struct.h +53 -0
  32. xmos_ai_tools/runtime/include/flatbuffers/table.h +168 -0
  33. xmos_ai_tools/runtime/include/flatbuffers/util.h +690 -0
  34. xmos_ai_tools/runtime/include/flatbuffers/vector.h +370 -0
  35. xmos_ai_tools/runtime/include/flatbuffers/vector_downward.h +271 -0
  36. xmos_ai_tools/runtime/include/flatbuffers/verifier.h +283 -0
  37. xmos_ai_tools/runtime/include/ioserver.h +44 -0
  38. xmos_ai_tools/runtime/include/lib_nn/api/TransposeConv.h +24 -0
  39. xmos_ai_tools/runtime/include/lib_nn/api/add_int16.h +27 -0
  40. xmos_ai_tools/runtime/include/lib_nn/api/add_int16_transform.h +42 -0
  41. xmos_ai_tools/runtime/include/lib_nn/api/dequantize_int16.h +22 -0
  42. xmos_ai_tools/runtime/include/lib_nn/api/dequantize_int16_transform.h +34 -0
  43. xmos_ai_tools/runtime/include/lib_nn/api/expand_8_to_16.h +8 -0
  44. xmos_ai_tools/runtime/include/lib_nn/api/multiply_int16.h +42 -0
  45. xmos_ai_tools/runtime/include/lib_nn/api/multiply_int16_transform.h +71 -0
  46. xmos_ai_tools/runtime/include/lib_nn/api/nn_api.h +15 -0
  47. xmos_ai_tools/runtime/include/lib_nn/api/nn_bin_types.h +14 -0
  48. xmos_ai_tools/runtime/include/lib_nn/api/nn_config.h +287 -0
  49. xmos_ai_tools/runtime/include/lib_nn/api/nn_conv2d_structs.h +72 -0
  50. xmos_ai_tools/runtime/include/lib_nn/api/nn_image.h +26 -0
  51. xmos_ai_tools/runtime/include/lib_nn/api/nn_layers.h +303 -0
  52. xmos_ai_tools/runtime/include/lib_nn/api/nn_op_helper.h +132 -0
  53. xmos_ai_tools/runtime/include/lib_nn/api/nn_op_utils.h +150 -0
  54. xmos_ai_tools/runtime/include/lib_nn/api/nn_operator.h +18 -0
  55. xmos_ai_tools/runtime/include/lib_nn/api/nn_pooling.h +551 -0
  56. xmos_ai_tools/runtime/include/lib_nn/api/nn_types.h +83 -0
  57. xmos_ai_tools/runtime/include/lib_nn/api/nn_window_params.h +55 -0
  58. xmos_ai_tools/runtime/include/lib_nn/api/output_transform_fn_int16.h +54 -0
  59. xmos_ai_tools/runtime/include/lib_nn/api/output_transform_fn_int16_kernel_transform.h +37 -0
  60. xmos_ai_tools/runtime/include/lib_nn/api/output_transform_fn_int16_mappings.h +13 -0
  61. xmos_ai_tools/runtime/include/lib_nn/api/quadratic_approximation.h +82 -0
  62. xmos_ai_tools/runtime/include/lib_nn/api/quadratic_interpolation.h +23 -0
  63. xmos_ai_tools/runtime/include/lib_nn/api/quantize_int16.h +22 -0
  64. xmos_ai_tools/runtime/include/lib_nn/api/quantize_int16_transform.h +33 -0
  65. xmos_ai_tools/runtime/include/lib_nn/api/version.h +13 -0
  66. xmos_ai_tools/runtime/include/lib_nn/api/vpu_memmove_word_aligned.h +15 -0
  67. xmos_ai_tools/runtime/include/lib_nn/api/vpu_memset_256.h +55 -0
  68. xmos_ai_tools/runtime/include/lib_nn/api/vpu_sim.h +118 -0
  69. xmos_ai_tools/runtime/include/lib_nn/api/xs3_vpu.h +216 -0
  70. xmos_ai_tools/runtime/include/lib_nn/api/xs3a_registers.h +2869 -0
  71. xmos_ai_tools/runtime/include/lib_nn/src/asm/asm_constants.h +41 -0
  72. xmos_ai_tools/runtime/include/lib_nn/src/asm/window_op_plan.h +25 -0
  73. xmos_ai_tools/runtime/include/lib_tflite_micro/api/fast_flash.h +47 -0
  74. xmos_ai_tools/runtime/include/lib_tflite_micro/api/inference_engine.h +218 -0
  75. xmos_ai_tools/runtime/include/lib_tflite_micro/api/memory_parallel_transport.h +52 -0
  76. xmos_ai_tools/runtime/include/lib_tflite_micro/api/version.h +13 -0
  77. xmos_ai_tools/runtime/include/lib_tflite_micro/api/xcore_config.h +17 -0
  78. xmos_ai_tools/runtime/include/lib_tflite_micro/api/xcore_device_memory.h +62 -0
  79. xmos_ai_tools/runtime/include/lib_tflite_micro/api/xcore_shared_config.h +31 -0
  80. xmos_ai_tools/runtime/include/lib_tflite_micro/src/tflite-xcore-kernels/conv2d_float.h +155 -0
  81. xmos_ai_tools/runtime/include/lib_tflite_micro/src/tflite-xcore-kernels/xcore_common.h +19 -0
  82. xmos_ai_tools/runtime/include/lib_tflite_micro/src/tflite-xcore-kernels/xcore_custom_options.h +28 -0
  83. xmos_ai_tools/runtime/include/lib_tflite_micro/src/tflite-xcore-kernels/xcore_error_reporter.h +32 -0
  84. xmos_ai_tools/runtime/include/lib_tflite_micro/src/tflite-xcore-kernels/xcore_interpreter.h +49 -0
  85. xmos_ai_tools/runtime/include/lib_tflite_micro/src/tflite-xcore-kernels/xcore_ops.h +71 -0
  86. xmos_ai_tools/runtime/include/lib_tflite_micro/src/tflite-xcore-kernels/xcore_profiler.h +49 -0
  87. xmos_ai_tools/runtime/include/lib_tflite_micro/src/tflite-xcore-kernels/xcore_utils.h +160 -0
  88. xmos_ai_tools/runtime/include/lib_tflite_micro/src/thread_call.h +119 -0
  89. xmos_ai_tools/runtime/include/lib_xud/lib_xud/api/legacy/usb_defs.h +4 -0
  90. xmos_ai_tools/runtime/include/lib_xud/lib_xud/api/legacy/usb_device.h +4 -0
  91. xmos_ai_tools/runtime/include/lib_xud/lib_xud/api/legacy/usb_std_descriptors.h +4 -0
  92. xmos_ai_tools/runtime/include/lib_xud/lib_xud/api/legacy/usb_std_requests.h +4 -0
  93. xmos_ai_tools/runtime/include/lib_xud/lib_xud/api/xud.h +518 -0
  94. xmos_ai_tools/runtime/include/lib_xud/lib_xud/api/xud_conf_default.h +11 -0
  95. xmos_ai_tools/runtime/include/lib_xud/lib_xud/api/xud_device.h +87 -0
  96. xmos_ai_tools/runtime/include/lib_xud/lib_xud/api/xud_std_descriptors.h +191 -0
  97. xmos_ai_tools/runtime/include/lib_xud/lib_xud/api/xud_std_requests.h +120 -0
  98. xmos_ai_tools/runtime/include/lib_xud/lib_xud/src/user/XUD_USB_Defines.h +70 -0
  99. xmos_ai_tools/runtime/include/lib_xud/lib_xud/src/user/class/hid.h +23 -0
  100. xmos_ai_tools/runtime/include/lib_xud/lib_xud/src/user/class/usbaudio10.h +30 -0
  101. xmos_ai_tools/runtime/include/lib_xud/lib_xud/src/user/class/usbaudio20.h +357 -0
  102. xmos_ai_tools/runtime/include/lib_xud/lib_xud/src/user/class/usbaudiocommon.h +168 -0
  103. xmos_ai_tools/runtime/include/signal/micro/kernels/delay_flexbuffers_generated_data.h +25 -0
  104. xmos_ai_tools/runtime/include/signal/micro/kernels/energy_flexbuffers_generated_data.h +28 -0
  105. xmos_ai_tools/runtime/include/signal/micro/kernels/fft_flexbuffers_generated_data.h +37 -0
  106. xmos_ai_tools/runtime/include/signal/micro/kernels/filter_bank_flexbuffers_generated_data.h +25 -0
  107. xmos_ai_tools/runtime/include/signal/micro/kernels/filter_bank_log_flexbuffers_generated_data.h +27 -0
  108. xmos_ai_tools/runtime/include/signal/micro/kernels/filter_bank_spectral_subtraction_flexbuffers_generated_data.h +26 -0
  109. xmos_ai_tools/runtime/include/signal/micro/kernels/framer_flexbuffers_generated_data.h +25 -0
  110. xmos_ai_tools/runtime/include/signal/micro/kernels/irfft.h +31 -0
  111. xmos_ai_tools/runtime/include/signal/micro/kernels/overlap_add_flexbuffers_generated_data.h +25 -0
  112. xmos_ai_tools/runtime/include/signal/micro/kernels/pcan_flexbuffers_generated_data.h +7 -0
  113. xmos_ai_tools/runtime/include/signal/micro/kernels/rfft.h +31 -0
  114. xmos_ai_tools/runtime/include/signal/micro/kernels/stacker_flexbuffers_generated_data.h +25 -0
  115. xmos_ai_tools/runtime/include/signal/micro/kernels/window_flexbuffers_generated_data.h +25 -0
  116. xmos_ai_tools/runtime/include/signal/src/circular_buffer.h +118 -0
  117. xmos_ai_tools/runtime/include/signal/src/complex.h +29 -0
  118. xmos_ai_tools/runtime/include/signal/src/energy.h +38 -0
  119. xmos_ai_tools/runtime/include/signal/src/fft_auto_scale.h +35 -0
  120. xmos_ai_tools/runtime/include/signal/src/filter_bank.h +69 -0
  121. xmos_ai_tools/runtime/include/signal/src/filter_bank_log.h +38 -0
  122. xmos_ai_tools/runtime/include/signal/src/filter_bank_spectral_subtraction.h +73 -0
  123. xmos_ai_tools/runtime/include/signal/src/filter_bank_square_root.h +34 -0
  124. xmos_ai_tools/runtime/include/signal/src/irfft.h +84 -0
  125. xmos_ai_tools/runtime/include/signal/src/kiss_fft_wrappers/kiss_fft_common.h +49 -0
  126. xmos_ai_tools/runtime/include/signal/src/kiss_fft_wrappers/kiss_fft_float.h +31 -0
  127. xmos_ai_tools/runtime/include/signal/src/kiss_fft_wrappers/kiss_fft_int16.h +30 -0
  128. xmos_ai_tools/runtime/include/signal/src/kiss_fft_wrappers/kiss_fft_int32.h +31 -0
  129. xmos_ai_tools/runtime/include/signal/src/log.h +30 -0
  130. xmos_ai_tools/runtime/include/signal/src/max_abs.h +31 -0
  131. xmos_ai_tools/runtime/include/signal/src/msb.h +32 -0
  132. xmos_ai_tools/runtime/include/signal/src/overlap_add.h +46 -0
  133. xmos_ai_tools/runtime/include/signal/src/pcan_argc_fixed.h +41 -0
  134. xmos_ai_tools/runtime/include/signal/src/rfft.h +85 -0
  135. xmos_ai_tools/runtime/include/signal/src/square_root.h +32 -0
  136. xmos_ai_tools/runtime/include/signal/src/window.h +31 -0
  137. xmos_ai_tools/runtime/include/signal/testdata/fft_test_data.h +48 -0
  138. xmos_ai_tools/runtime/include/tensorflow/lite/array.h +156 -0
  139. xmos_ai_tools/runtime/include/tensorflow/lite/builtin_op_data.h +22 -0
  140. xmos_ai_tools/runtime/include/tensorflow/lite/builtin_ops.h +241 -0
  141. xmos_ai_tools/runtime/include/tensorflow/lite/c/builtin_op_data.h +20 -0
  142. xmos_ai_tools/runtime/include/tensorflow/lite/c/c_api_types.h +26 -0
  143. xmos_ai_tools/runtime/include/tensorflow/lite/c/common.h +30 -0
  144. xmos_ai_tools/runtime/include/tensorflow/lite/context_util.h +54 -0
  145. xmos_ai_tools/runtime/include/tensorflow/lite/core/api/error_reporter.h +72 -0
  146. xmos_ai_tools/runtime/include/tensorflow/lite/core/api/flatbuffer_conversions.h +440 -0
  147. xmos_ai_tools/runtime/include/tensorflow/lite/core/api/tensor_utils.h +28 -0
  148. xmos_ai_tools/runtime/include/tensorflow/lite/core/c/builtin_op_data.h +626 -0
  149. xmos_ai_tools/runtime/include/tensorflow/lite/core/c/c_api_types.h +178 -0
  150. xmos_ai_tools/runtime/include/tensorflow/lite/core/c/common.h +1496 -0
  151. xmos_ai_tools/runtime/include/tensorflow/lite/core/macros.h +78 -0
  152. xmos_ai_tools/runtime/include/tensorflow/lite/experimental/microfrontend/lib/bits.h +102 -0
  153. xmos_ai_tools/runtime/include/tensorflow/lite/experimental/microfrontend/lib/fft.h +50 -0
  154. xmos_ai_tools/runtime/include/tensorflow/lite/experimental/microfrontend/lib/fft_io.h +34 -0
  155. xmos_ai_tools/runtime/include/tensorflow/lite/experimental/microfrontend/lib/fft_util.h +34 -0
  156. xmos_ai_tools/runtime/include/tensorflow/lite/experimental/microfrontend/lib/filterbank.h +63 -0
  157. xmos_ai_tools/runtime/include/tensorflow/lite/experimental/microfrontend/lib/filterbank_io.h +35 -0
  158. xmos_ai_tools/runtime/include/tensorflow/lite/experimental/microfrontend/lib/filterbank_util.h +50 -0
  159. xmos_ai_tools/runtime/include/tensorflow/lite/experimental/microfrontend/lib/frontend.h +64 -0
  160. xmos_ai_tools/runtime/include/tensorflow/lite/experimental/microfrontend/lib/frontend_io.h +31 -0
  161. xmos_ai_tools/runtime/include/tensorflow/lite/experimental/microfrontend/lib/frontend_util.h +52 -0
  162. xmos_ai_tools/runtime/include/tensorflow/lite/experimental/microfrontend/lib/kiss_fft_common.h +48 -0
  163. xmos_ai_tools/runtime/include/tensorflow/lite/experimental/microfrontend/lib/kiss_fft_int16.h +33 -0
  164. xmos_ai_tools/runtime/include/tensorflow/lite/experimental/microfrontend/lib/log_lut.h +40 -0
  165. xmos_ai_tools/runtime/include/tensorflow/lite/experimental/microfrontend/lib/log_scale.h +39 -0
  166. xmos_ai_tools/runtime/include/tensorflow/lite/experimental/microfrontend/lib/log_scale_io.h +33 -0
  167. xmos_ai_tools/runtime/include/tensorflow/lite/experimental/microfrontend/lib/log_scale_util.h +45 -0
  168. xmos_ai_tools/runtime/include/tensorflow/lite/experimental/microfrontend/lib/noise_reduction.h +46 -0
  169. xmos_ai_tools/runtime/include/tensorflow/lite/experimental/microfrontend/lib/noise_reduction_io.h +36 -0
  170. xmos_ai_tools/runtime/include/tensorflow/lite/experimental/microfrontend/lib/noise_reduction_util.h +50 -0
  171. xmos_ai_tools/runtime/include/tensorflow/lite/experimental/microfrontend/lib/pcan_gain_control.h +47 -0
  172. xmos_ai_tools/runtime/include/tensorflow/lite/experimental/microfrontend/lib/pcan_gain_control_util.h +57 -0
  173. xmos_ai_tools/runtime/include/tensorflow/lite/experimental/microfrontend/lib/window.h +49 -0
  174. xmos_ai_tools/runtime/include/tensorflow/lite/experimental/microfrontend/lib/window_io.h +34 -0
  175. xmos_ai_tools/runtime/include/tensorflow/lite/experimental/microfrontend/lib/window_util.h +45 -0
  176. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/common.h +1358 -0
  177. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/compatibility.h +122 -0
  178. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/cppmath.h +40 -0
  179. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/max.h +35 -0
  180. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/min.h +35 -0
  181. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/optimized/neon_check.h +20 -0
  182. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/portable_tensor.h +141 -0
  183. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/portable_tensor_utils.h +623 -0
  184. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/quantization_util.h +292 -0
  185. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/add.h +561 -0
  186. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/add_n.h +86 -0
  187. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/arg_min_max.h +88 -0
  188. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/batch_matmul.h +275 -0
  189. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/batch_to_space_nd.h +101 -0
  190. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/binary_function.h +91 -0
  191. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/broadcast_args.h +56 -0
  192. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/broadcast_to.h +97 -0
  193. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/ceil.h +37 -0
  194. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/comparisons.h +271 -0
  195. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/concatenation.h +141 -0
  196. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/conv.h +289 -0
  197. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/cumsum.h +175 -0
  198. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/depth_to_space.h +79 -0
  199. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/depthwiseconv_float.h +100 -0
  200. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/depthwiseconv_uint8.h +319 -0
  201. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/dequantize.h +78 -0
  202. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/div.h +247 -0
  203. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/elu.h +37 -0
  204. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/exp.h +38 -0
  205. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/fill.h +38 -0
  206. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/floor.h +39 -0
  207. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/floor_div.h +35 -0
  208. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/floor_mod.h +44 -0
  209. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/fully_connected.h +323 -0
  210. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/hard_swish.h +168 -0
  211. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/integer_ops/add.h +250 -0
  212. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/integer_ops/conv.h +241 -0
  213. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/integer_ops/depthwise_conv.h +291 -0
  214. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/integer_ops/fully_connected.h +126 -0
  215. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/integer_ops/l2normalization.h +67 -0
  216. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/integer_ops/logistic.h +121 -0
  217. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/integer_ops/mean.h +18 -0
  218. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/integer_ops/mul.h +194 -0
  219. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/integer_ops/pooling.h +264 -0
  220. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/integer_ops/tanh.h +117 -0
  221. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/integer_ops/transpose_conv.h +224 -0
  222. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/l2normalization.h +90 -0
  223. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/leaky_relu.h +69 -0
  224. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/log_softmax.h +256 -0
  225. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/logistic.h +132 -0
  226. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/lstm_cell.h +422 -0
  227. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/maximum_minimum.h +64 -0
  228. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/mul.h +267 -0
  229. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/neg.h +37 -0
  230. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/pad.h +169 -0
  231. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/pooling.h +303 -0
  232. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/portable_tensor_utils.h +333 -0
  233. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/portable_tensor_utils_impl.h +244 -0
  234. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/prelu.h +111 -0
  235. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/process_broadcast_shapes.h +140 -0
  236. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/quantize.h +89 -0
  237. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/reduce.h +491 -0
  238. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/requantize.h +70 -0
  239. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/resize_bilinear.h +233 -0
  240. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/resize_nearest_neighbor.h +102 -0
  241. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/round.h +51 -0
  242. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/select.h +151 -0
  243. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/slice.h +80 -0
  244. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/softmax.h +233 -0
  245. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/space_to_batch_nd.h +109 -0
  246. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/space_to_depth.h +80 -0
  247. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/strided_slice.h +147 -0
  248. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/sub.h +465 -0
  249. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/tanh.h +129 -0
  250. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/transpose.h +203 -0
  251. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/transpose_conv.h +225 -0
  252. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/runtime_shape.h +168 -0
  253. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/strided_slice_logic.h +278 -0
  254. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/tensor_ctypes.h +42 -0
  255. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/types.h +1096 -0
  256. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/kernel_util.h +341 -0
  257. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/op_macros.h +49 -0
  258. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/padding.h +115 -0
  259. xmos_ai_tools/runtime/include/tensorflow/lite/micro/arena_allocator/ibuffer_allocator.h +100 -0
  260. xmos_ai_tools/runtime/include/tensorflow/lite/micro/arena_allocator/non_persistent_arena_buffer_allocator.h +104 -0
  261. xmos_ai_tools/runtime/include/tensorflow/lite/micro/arena_allocator/persistent_arena_buffer_allocator.h +58 -0
  262. xmos_ai_tools/runtime/include/tensorflow/lite/micro/arena_allocator/recording_single_arena_buffer_allocator.h +63 -0
  263. xmos_ai_tools/runtime/include/tensorflow/lite/micro/arena_allocator/single_arena_buffer_allocator.h +144 -0
  264. xmos_ai_tools/runtime/include/tensorflow/lite/micro/benchmarks/micro_benchmark.h +95 -0
  265. xmos_ai_tools/runtime/include/tensorflow/lite/micro/compatibility.h +32 -0
  266. xmos_ai_tools/runtime/include/tensorflow/lite/micro/cortex_m_generic/debug_log_callback.h +49 -0
  267. xmos_ai_tools/runtime/include/tensorflow/lite/micro/debug_log.h +38 -0
  268. xmos_ai_tools/runtime/include/tensorflow/lite/micro/examples/micro_speech/micro_model_settings.h +37 -0
  269. xmos_ai_tools/runtime/include/tensorflow/lite/micro/examples/network_tester/expected_output_data.h +47 -0
  270. xmos_ai_tools/runtime/include/tensorflow/lite/micro/examples/network_tester/input_data.h +108 -0
  271. xmos_ai_tools/runtime/include/tensorflow/lite/micro/examples/network_tester/network_model.h +166 -0
  272. xmos_ai_tools/runtime/include/tensorflow/lite/micro/examples/person_detection/detection_responder.h +32 -0
  273. xmos_ai_tools/runtime/include/tensorflow/lite/micro/examples/person_detection/image_provider.h +38 -0
  274. xmos_ai_tools/runtime/include/tensorflow/lite/micro/examples/person_detection/main_functions.h +37 -0
  275. xmos_ai_tools/runtime/include/tensorflow/lite/micro/examples/person_detection/model_settings.h +35 -0
  276. xmos_ai_tools/runtime/include/tensorflow/lite/micro/fake_micro_context.h +70 -0
  277. xmos_ai_tools/runtime/include/tensorflow/lite/micro/flatbuffer_utils.h +65 -0
  278. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/activation_utils.h +57 -0
  279. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/activations.h +64 -0
  280. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/add.h +78 -0
  281. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/arc_mli/mli_function_specializations.h +141 -0
  282. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/arc_mli/mli_interface.h +75 -0
  283. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/arc_mli/mli_slicers.h +56 -0
  284. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/arc_mli/mli_tf_utils.h +310 -0
  285. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/arc_mli/scratch_buf_mgr.h +145 -0
  286. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/arc_mli/scratch_buffers.h +78 -0
  287. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/ceva/ceva_common.h +24 -0
  288. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/ceva/ceva_tflm_lib.h +613 -0
  289. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/ceva/mcps_macros.h +115 -0
  290. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/ceva/types.h +1286 -0
  291. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/circular_buffer.h +45 -0
  292. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/circular_buffer_flexbuffers_generated_data.h +22 -0
  293. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/conv.h +117 -0
  294. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/conv_test.h +94 -0
  295. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/depthwise_conv.h +80 -0
  296. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/dequantize.h +38 -0
  297. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/detection_postprocess_flexbuffers_generated_data.h +25 -0
  298. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/ethosu.h +28 -0
  299. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/fully_connected.h +112 -0
  300. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/hard_swish.h +30 -0
  301. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/kernel_runner.h +86 -0
  302. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/kernel_util.h +150 -0
  303. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/leaky_relu.h +43 -0
  304. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/logical.h +35 -0
  305. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/logistic.h +42 -0
  306. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/lstm_eval.h +541 -0
  307. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/lstm_eval_test.h +817 -0
  308. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/lstm_shared.h +150 -0
  309. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/micro_ops.h +158 -0
  310. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/micro_tensor_utils.h +56 -0
  311. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/mul.h +74 -0
  312. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/pad.h +27 -0
  313. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/pooling.h +142 -0
  314. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/prelu.h +39 -0
  315. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/quantize.h +37 -0
  316. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/reduce.h +65 -0
  317. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/reshape.h +26 -0
  318. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/softmax.h +67 -0
  319. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/strided_slice.h +40 -0
  320. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/sub.h +60 -0
  321. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/svdf.h +100 -0
  322. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/testdata/conv_test_data.h +37 -0
  323. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/testdata/lstm_test_data.h +579 -0
  324. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/unidirectional_sequence_lstm.h +47 -0
  325. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/xtensa/hifimini/fixedpoint_utils.h +139 -0
  326. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/xtensa/lstm_eval.h +216 -0
  327. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/xtensa/lstm_shared.h +78 -0
  328. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/xtensa/xtensa.h +38 -0
  329. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/xtensa/xtensa_add.h +48 -0
  330. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/xtensa/xtensa_conv.h +89 -0
  331. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/xtensa/xtensa_depthwise_conv.h +74 -0
  332. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/xtensa/xtensa_fully_connected.h +78 -0
  333. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/xtensa/xtensa_pad.h +49 -0
  334. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/xtensa/xtensa_pooling.h +76 -0
  335. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/xtensa/xtensa_reduce.h +47 -0
  336. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/xtensa/xtensa_reshape.h +44 -0
  337. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/xtensa/xtensa_softmax.h +58 -0
  338. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/xtensa/xtensa_svdf.h +39 -0
  339. xmos_ai_tools/runtime/include/tensorflow/lite/micro/memory_helpers.h +64 -0
  340. xmos_ai_tools/runtime/include/tensorflow/lite/micro/memory_planner/greedy_memory_planner.h +170 -0
  341. xmos_ai_tools/runtime/include/tensorflow/lite/micro/memory_planner/linear_memory_planner.h +53 -0
  342. xmos_ai_tools/runtime/include/tensorflow/lite/micro/memory_planner/memory_plan_struct.h +73 -0
  343. xmos_ai_tools/runtime/include/tensorflow/lite/micro/memory_planner/micro_memory_planner.h +95 -0
  344. xmos_ai_tools/runtime/include/tensorflow/lite/micro/memory_planner/non_persistent_buffer_planner_shim.h +133 -0
  345. xmos_ai_tools/runtime/include/tensorflow/lite/micro/micro_allocation_info.h +138 -0
  346. xmos_ai_tools/runtime/include/tensorflow/lite/micro/micro_allocator.h +351 -0
  347. xmos_ai_tools/runtime/include/tensorflow/lite/micro/micro_arena_constants.h +28 -0
  348. xmos_ai_tools/runtime/include/tensorflow/lite/micro/micro_common.h +38 -0
  349. xmos_ai_tools/runtime/include/tensorflow/lite/micro/micro_context.h +176 -0
  350. xmos_ai_tools/runtime/include/tensorflow/lite/micro/micro_graph.h +79 -0
  351. xmos_ai_tools/runtime/include/tensorflow/lite/micro/micro_interpreter.h +189 -0
  352. xmos_ai_tools/runtime/include/tensorflow/lite/micro/micro_interpreter_context.h +125 -0
  353. xmos_ai_tools/runtime/include/tensorflow/lite/micro/micro_interpreter_graph.h +110 -0
  354. xmos_ai_tools/runtime/include/tensorflow/lite/micro/micro_log.h +42 -0
  355. xmos_ai_tools/runtime/include/tensorflow/lite/micro/micro_mutable_op_resolver.h +708 -0
  356. xmos_ai_tools/runtime/include/tensorflow/lite/micro/micro_op_resolver.h +62 -0
  357. xmos_ai_tools/runtime/include/tensorflow/lite/micro/micro_profiler.h +140 -0
  358. xmos_ai_tools/runtime/include/tensorflow/lite/micro/micro_profiler_interface.h +38 -0
  359. xmos_ai_tools/runtime/include/tensorflow/lite/micro/micro_resource_variable.h +89 -0
  360. xmos_ai_tools/runtime/include/tensorflow/lite/micro/micro_time.h +36 -0
  361. xmos_ai_tools/runtime/include/tensorflow/lite/micro/micro_utils.h +162 -0
  362. xmos_ai_tools/runtime/include/tensorflow/lite/micro/mock_micro_graph.h +60 -0
  363. xmos_ai_tools/runtime/include/tensorflow/lite/micro/python/interpreter/src/python_ops_resolver.h +21 -0
  364. xmos_ai_tools/runtime/include/tensorflow/lite/micro/python/tflite_size/src/flatbuffer_size.h +30 -0
  365. xmos_ai_tools/runtime/include/tensorflow/lite/micro/python/tflite_size/src/flatbuffer_size_wrapper.h +33 -0
  366. xmos_ai_tools/runtime/include/tensorflow/lite/micro/recording_micro_allocator.h +125 -0
  367. xmos_ai_tools/runtime/include/tensorflow/lite/micro/recording_micro_interpreter.h +69 -0
  368. xmos_ai_tools/runtime/include/tensorflow/lite/micro/system_setup.h +27 -0
  369. xmos_ai_tools/runtime/include/tensorflow/lite/micro/test_helper_custom_ops.h +49 -0
  370. xmos_ai_tools/runtime/include/tensorflow/lite/micro/test_helpers.h +334 -0
  371. xmos_ai_tools/runtime/include/tensorflow/lite/micro/testing/micro_test.h +267 -0
  372. xmos_ai_tools/runtime/include/tensorflow/lite/micro/testing/test_conv_model.h +23 -0
  373. xmos_ai_tools/runtime/include/tensorflow/lite/micro/tflite_bridge/flatbuffer_conversions_bridge.h +45 -0
  374. xmos_ai_tools/runtime/include/tensorflow/lite/micro/tflite_bridge/micro_error_reporter.h +36 -0
  375. xmos_ai_tools/runtime/include/tensorflow/lite/micro/tools/benchmarking/log_utils.h +273 -0
  376. xmos_ai_tools/runtime/include/tensorflow/lite/micro/tools/benchmarking/metrics.h +41 -0
  377. xmos_ai_tools/runtime/include/tensorflow/lite/micro/tools/benchmarking/op_resolver.h +127 -0
  378. xmos_ai_tools/runtime/include/tensorflow/lite/portable_type_to_tflitetype.h +75 -0
  379. xmos_ai_tools/runtime/include/tensorflow/lite/schema/schema_generated.h +24644 -0
  380. xmos_ai_tools/runtime/include/tensorflow/lite/schema/schema_utils.h +33 -0
  381. xmos_ai_tools/runtime/include/tile_ram_server.h +38 -0
  382. xmos_ai_tools/runtime/lib/libhost_xtflitemicro.a +0 -0
  383. xmos_ai_tools/runtime/lib/libxtflitemicro.a +0 -0
  384. xmos_ai_tools/xformer/__init__.py +60 -0
  385. xmos_ai_tools/xformer/flash.py +190 -0
  386. xmos_ai_tools/xinterpreters/__init__.py +1 -0
  387. xmos_ai_tools/xinterpreters/exceptions.py +38 -0
  388. xmos_ai_tools/xinterpreters/host_interpreter.py +652 -0
  389. xmos_ai_tools/xinterpreters/libs/macos/xtflm_python.1.0.1.dylib +0 -0
  390. xmos_ai_tools/xinterpreters/libs/macos/xtflm_python.dylib +0 -0
  391. xmos_ai_tools-1.3.2.dev80.data/data/bin/xcore-opt +0 -0
  392. xmos_ai_tools-1.3.2.dev80.dist-info/METADATA +33 -0
  393. xmos_ai_tools-1.3.2.dev80.dist-info/RECORD +395 -0
  394. xmos_ai_tools-1.3.2.dev80.dist-info/WHEEL +5 -0
  395. xmos_ai_tools-1.3.2.dev80.dist-info/top_level.txt +1 -0
@@ -0,0 +1,233 @@
1
+ /* Copyright 2017 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_KERNELS_INTERNAL_REFERENCE_SOFTMAX_H_
16
+ #define TENSORFLOW_LITE_KERNELS_INTERNAL_REFERENCE_SOFTMAX_H_
17
+
18
+ #include <algorithm>
19
+ #include <limits>
20
+
21
+ #include "fixedpoint/fixedpoint.h"
22
+ #include "tensorflow/lite/kernels/internal/common.h"
23
+ #include "tensorflow/lite/kernels/internal/cppmath.h"
24
+ #include "tensorflow/lite/kernels/internal/quantization_util.h"
25
+ #include "tensorflow/lite/kernels/internal/types.h"
26
+ #include "tensorflow/lite/kernels/op_macros.h"
27
+
28
+ namespace tflite_micro {
29
+ namespace reference_ops {
30
+
31
+ inline void Softmax(const SoftmaxParams& params,
32
+ const RuntimeShape& input_shape, const float* input_data,
33
+ const RuntimeShape& output_shape, float* output_data) {
34
+ const int trailing_dim = input_shape.DimensionsCount() - 1;
35
+ const int outer_size =
36
+ MatchingFlatSizeSkipDim(input_shape, trailing_dim, output_shape);
37
+ const int depth =
38
+ MatchingDim(input_shape, trailing_dim, output_shape, trailing_dim);
39
+
40
+ for (int i = 0; i < outer_size; ++i) {
41
+ // Find max element value which we'll use to ensure numerical stability
42
+ // taking advantage of the following equality:
43
+ // exp(x[i])/sum(exp(x[i])) == exp(x[i]+C)/sum(exp(x[i]+C))
44
+ float max = std::numeric_limits<float>::lowest();
45
+ for (int c = 0; c < depth; ++c) {
46
+ max = std::max(max, input_data[i * depth + c]);
47
+ }
48
+
49
+ // Compute sum.
50
+ float sum = 0.f;
51
+ for (int c = 0; c < depth; ++c) {
52
+ const float exp_c = std::exp((input_data[i * depth + c] - max) *
53
+ static_cast<float>(params.beta));
54
+ output_data[i * depth + c] = exp_c;
55
+ sum += exp_c;
56
+ }
57
+
58
+ // Compute result.
59
+ for (int c = 0; c < depth; ++c) {
60
+ output_data[i * depth + c] = output_data[i * depth + c] / sum;
61
+ }
62
+ }
63
+ }
64
+
65
+ // Quantized softmax with int8_t/uint8_t input and int8_t/uint8_t/int16_t
66
+ // output.
67
+ template <typename InputT, typename OutputT>
68
+ inline void Softmax(const SoftmaxParams& params,
69
+ const RuntimeShape& input_shape, const InputT* input_data,
70
+ const RuntimeShape& output_shape, OutputT* output_data) {
71
+ const int32_t input_beta_multiplier = params.input_multiplier;
72
+ const int32_t input_beta_left_shift = params.input_left_shift;
73
+ const int diff_min = params.diff_min;
74
+ // The representation chosen for the input to the exp() function is Q5.26.
75
+ // We need to leave extra space since values that we skip might be as large as
76
+ // -32 before multiplying by input_beta_multiplier, and therefore as large as
77
+ // -16 afterwards. Note that exp(-8) is definitely not insignificant to
78
+ // accumulation, but exp(-16) definitely is.
79
+ static const int kScaledDiffIntegerBits = 5;
80
+ static const int kAccumulationIntegerBits = 12;
81
+ using FixedPointScaledDiff =
82
+ gemmlowp::FixedPoint<int32_t, kScaledDiffIntegerBits>;
83
+ using FixedPointAccum =
84
+ gemmlowp::FixedPoint<int32_t, kAccumulationIntegerBits>;
85
+ using FixedPoint0 = gemmlowp::FixedPoint<int32_t, 0>;
86
+
87
+ const int trailing_dim = input_shape.DimensionsCount() - 1;
88
+ const int outer_size =
89
+ MatchingFlatSizeSkipDim(input_shape, trailing_dim, output_shape);
90
+ const int depth =
91
+ MatchingDim(input_shape, trailing_dim, output_shape, trailing_dim);
92
+
93
+ for (int i = 0; i < outer_size; ++i) {
94
+ InputT max_in_row = std::numeric_limits<InputT>::min();
95
+ for (int c = 0; c < depth; ++c) {
96
+ max_in_row = std::max(max_in_row, input_data[i * depth + c]);
97
+ }
98
+
99
+ FixedPointAccum sum_of_exps = FixedPointAccum::Zero();
100
+ for (int c = 0; c < depth; ++c) {
101
+ int32_t input_diff =
102
+ static_cast<int32_t>(input_data[i * depth + c]) - max_in_row;
103
+ if (input_diff >= diff_min) {
104
+ const int32_t input_diff_rescaled =
105
+ MultiplyByQuantizedMultiplierGreaterThanOne(
106
+ input_diff, input_beta_multiplier, input_beta_left_shift);
107
+ const FixedPointScaledDiff scaled_diff_f8 =
108
+ FixedPointScaledDiff::FromRaw(input_diff_rescaled);
109
+ sum_of_exps = sum_of_exps + gemmlowp::Rescale<kAccumulationIntegerBits>(
110
+ exp_on_negative_values(scaled_diff_f8));
111
+ }
112
+ }
113
+
114
+ int num_bits_over_unit;
115
+ FixedPoint0 shifted_scale = FixedPoint0::FromRaw(GetReciprocal(
116
+ sum_of_exps.raw(), kAccumulationIntegerBits, &num_bits_over_unit));
117
+
118
+ for (int c = 0; c < depth; ++c) {
119
+ int32_t input_diff =
120
+ static_cast<int32_t>(input_data[i * depth + c]) - max_in_row;
121
+ if (input_diff >= diff_min) {
122
+ const int32_t input_diff_rescaled =
123
+ MultiplyByQuantizedMultiplierGreaterThanOne(
124
+ input_diff, input_beta_multiplier, input_beta_left_shift);
125
+ const FixedPointScaledDiff scaled_diff_f8 =
126
+ FixedPointScaledDiff::FromRaw(input_diff_rescaled);
127
+
128
+ FixedPoint0 exp_in_0 = exp_on_negative_values(scaled_diff_f8);
129
+ int32_t unsat_output = gemmlowp::RoundingDivideByPOT(
130
+ (shifted_scale * exp_in_0).raw(),
131
+ num_bits_over_unit + 31 - (sizeof(OutputT) * 8));
132
+
133
+ const int32_t shifted_output =
134
+ unsat_output +
135
+ static_cast<int32_t>(std::numeric_limits<OutputT>::min());
136
+
137
+ output_data[i * depth + c] = static_cast<OutputT>(std::max(
138
+ std::min(shifted_output,
139
+ static_cast<int32_t>(std::numeric_limits<OutputT>::max())),
140
+ static_cast<int32_t>(std::numeric_limits<OutputT>::min())));
141
+ } else {
142
+ output_data[i * depth + c] = std::numeric_limits<OutputT>::min();
143
+ }
144
+ }
145
+ }
146
+ }
147
+
148
+ // Computes exp(input - max_input)
149
+ inline int16_t SoftMaxCalculateExp(const SoftmaxParams& params,
150
+ const int16_t* input_data, const int depth,
151
+ int16_t max_in_row, int i, int c) {
152
+ int32_t input_diff = input_data[i * depth + c] - max_in_row;
153
+ // scale the input_diff such that [-65535, 0] correspond to [-10.0, 0.0]
154
+ // exp lut generated with range [-10, 0], as exp(-10) is negligible.
155
+ int32_t scaled_diff = MultiplyByQuantizedMultiplier(
156
+ input_diff, params.input_multiplier, params.input_left_shift);
157
+ // recenter to [-32768, 32767]
158
+ int32_t sym_scaled_diff = scaled_diff + 32767;
159
+ int16_t sat_sym_scaled_diff =
160
+ std::min(std::max(sym_scaled_diff, static_cast<int32_t>(-32768)),
161
+ static_cast<int32_t>(32767));
162
+ // apply the exp() LUT activation function
163
+ return LUTLookup(sat_sym_scaled_diff, params.exp_lut);
164
+ }
165
+ // Quantized softmax with int16_t input and int16_t output.
166
+ inline void SoftmaxInt16(const SoftmaxParams& params,
167
+ const RuntimeShape& input_shape,
168
+ const int16_t* input_data,
169
+ const RuntimeShape& output_shape,
170
+ int16_t* output_data) {
171
+ const int trailing_dim = input_shape.DimensionsCount() - 1;
172
+ const int outer_size =
173
+ MatchingFlatSizeSkipDim(input_shape, trailing_dim, output_shape);
174
+ const int depth =
175
+ MatchingDim(input_shape, trailing_dim, output_shape, trailing_dim);
176
+
177
+ for (int i = 0; i < outer_size; ++i) {
178
+ // Find the largest element
179
+ int16_t max_in_row = std::numeric_limits<int16_t>::min();
180
+ for (int c = 0; c < depth; ++c) {
181
+ max_in_row = std::max(max_in_row, input_data[i * depth + c]);
182
+ }
183
+
184
+ // This loops computes the exp values and their sum. We will need the exp
185
+ // values later on in the function so we cache them in the output_data
186
+ // buffer. This is an optimization done to avoid calculating the exp values
187
+ // twice making use of the output_data buffer as scratch memory.
188
+ int32_t sum_of_exps = 0; // Q16.15 fixed point format.
189
+ int16_t* exp_results_Q015 = output_data + i * depth;
190
+ for (int c = 0; c < depth; ++c) {
191
+ exp_results_Q015[c] =
192
+ SoftMaxCalculateExp(params, input_data, depth, max_in_row, i, c);
193
+ sum_of_exps += exp_results_Q015[c];
194
+ }
195
+
196
+ // Compute the reciprocal 1/sum_of_exps
197
+ uint8_t headroom_plus_one =
198
+ CountLeadingZeros(static_cast<uint32_t>(sum_of_exps));
199
+ int32_t shifted_sum =
200
+ ((static_cast<int64_t>(sum_of_exps) << (headroom_plus_one - 1)) +
201
+ (1 << 13)) >>
202
+ 14;
203
+ // since the LUT computes 1/(1 + x) we need to first compute x = (sum - 1).
204
+ // also, the LUT expects a symmetrical input, so we must also recenter x
205
+ // from [0, 65535] to [-32768, 32767].
206
+ int32_t sym_shifted_sum = shifted_sum + (-((1 << 15) + (1 << 16)));
207
+ int16_t sat_sym_shifted_sum = static_cast<int16_t>(
208
+ std::min(std::max(sym_shifted_sum, static_cast<int32_t>(-32768)),
209
+ static_cast<int32_t>(32767)));
210
+ // apply 1/(1 + x) LUT activation function
211
+ int16_t reciprocal_scale_Q015 =
212
+ LUTLookup(sat_sym_shifted_sum, params.one_over_one_plus_x_lut);
213
+
214
+ // Rescale the exp_result with reciprocal
215
+ // range of output is [0, 32767] correspond to [0.0, 1.0]
216
+ for (int c = 0; c < depth; ++c) {
217
+ uint8_t right_shift = 31 - headroom_plus_one;
218
+ int64_t round = 1 << (right_shift - 1);
219
+ int32_t result = (static_cast<int64_t>(exp_results_Q015[c]) *
220
+ static_cast<int64_t>(reciprocal_scale_Q015) +
221
+ round) >>
222
+ right_shift;
223
+ output_data[i * depth + c] = static_cast<int16_t>(
224
+ std::min(std::max(result, static_cast<int32_t>(0)),
225
+ static_cast<int32_t>(32767)));
226
+ }
227
+ }
228
+ }
229
+
230
+ } // namespace reference_ops
231
+ } // namespace tflite_micro
232
+
233
+ #endif // TENSORFLOW_LITE_KERNELS_INTERNAL_REFERENCE_SOFTMAX_H_
@@ -0,0 +1,109 @@
1
+ /* Copyright 2020 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_KERNELS_INTERNAL_REFERENCE_SPACE_TO_BATCH_ND_H_
16
+ #define TENSORFLOW_LITE_KERNELS_INTERNAL_REFERENCE_SPACE_TO_BATCH_ND_H_
17
+
18
+ #include <cmath>
19
+
20
+ #include "ruy/profiler/instrumentation.h" // from @ruy
21
+ #include "tensorflow/lite/kernels/internal/common.h"
22
+ #include "tensorflow/lite/kernels/internal/types.h"
23
+
24
+ namespace tflite_micro {
25
+ namespace reference_ops {
26
+
27
+ // TODO(b/135760455): Move this method anonymous namespace in a cc file.
28
+ inline RuntimeShape ExtendShapeSpaceToBatch(const RuntimeShape& shape) {
29
+ if (shape.DimensionsCount() == 4) {
30
+ return shape;
31
+ }
32
+ RuntimeShape new_shape(4, 1);
33
+ new_shape.SetDim(0, shape.Dims(0));
34
+ new_shape.SetDim(1, shape.Dims(1));
35
+ new_shape.SetDim(3, shape.Dims(2));
36
+ return new_shape;
37
+ }
38
+
39
+ template <typename T>
40
+ inline void SpaceToBatchND(const SpaceToBatchParams& params,
41
+ const RuntimeShape& unextended_input1_shape,
42
+ const T* input1_data,
43
+ const RuntimeShape& unextended_input2_shape,
44
+ const int32_t* block_shape_data,
45
+ const RuntimeShape& unextended_input3_shape,
46
+ const int32_t* paddings_data,
47
+ const RuntimeShape& unextended_output_shape,
48
+ T* output_data) {
49
+ ruy::profiler::ScopeLabel label("SpaceToBatchND");
50
+ TFLITE_DCHECK_GE(unextended_input1_shape.DimensionsCount(), 3);
51
+ TFLITE_DCHECK_LE(unextended_input1_shape.DimensionsCount(), 4);
52
+ TFLITE_DCHECK_EQ(unextended_input1_shape.DimensionsCount(),
53
+ unextended_output_shape.DimensionsCount());
54
+
55
+ // Extends the input/output shape from 3D to 4D if needed, NHC -> NH1C.
56
+ const RuntimeShape input1_shape =
57
+ ExtendShapeSpaceToBatch(unextended_input1_shape);
58
+ const RuntimeShape output_shape =
59
+ ExtendShapeSpaceToBatch(unextended_output_shape);
60
+
61
+ const int depth = input1_shape.Dims(3);
62
+ const int input_width = input1_shape.Dims(2);
63
+ const int input_height = input1_shape.Dims(1);
64
+ const int input_batch_size = input1_shape.Dims(0);
65
+
66
+ const int output_width = output_shape.Dims(2);
67
+ const int output_height = output_shape.Dims(1);
68
+ const int output_batch_size = output_shape.Dims(0);
69
+
70
+ const int block_shape_height = block_shape_data[0];
71
+ const int block_shape_width =
72
+ unextended_input1_shape.DimensionsCount() == 4 ? block_shape_data[1] : 1;
73
+ const int padding_top = paddings_data[0];
74
+ const int padding_left =
75
+ unextended_input1_shape.DimensionsCount() == 4 ? paddings_data[2] : 0;
76
+
77
+ // For uint8 quantized, the correct padding "zero value" is the output offset.
78
+ const int32_t pad_value = params.output_offset;
79
+ for (int out_b = 0; out_b < output_batch_size; ++out_b) {
80
+ int input_batch = out_b % input_batch_size;
81
+ int shift_w = (out_b / input_batch_size) % block_shape_width;
82
+ int shift_h = (out_b / input_batch_size) / block_shape_width;
83
+ for (int out_h = 0; out_h < output_height; ++out_h) {
84
+ for (int out_w = 0; out_w < output_width; ++out_w) {
85
+ T* out = output_data + Offset(output_shape, out_b, out_h, out_w, 0);
86
+ if (out_h * block_shape_height + shift_h < padding_top ||
87
+ out_h * block_shape_height + shift_h >=
88
+ padding_top + input_height ||
89
+ out_w * block_shape_width + shift_w < padding_left ||
90
+ out_w * block_shape_width + shift_w >= padding_left + input_width) {
91
+ // This may not execute correctly when pad_value != 0 and T != uint8.
92
+ memset(out, pad_value, depth * sizeof(T));
93
+ } else {
94
+ const T* in =
95
+ input1_data +
96
+ Offset(input1_shape, input_batch,
97
+ (out_h * block_shape_height + shift_h) - padding_top,
98
+ (out_w * block_shape_width + shift_w) - padding_left, 0);
99
+ memcpy(out, in, depth * sizeof(T));
100
+ }
101
+ }
102
+ }
103
+ }
104
+ }
105
+
106
+ } // namespace reference_ops
107
+ } // namespace tflite_micro
108
+
109
+ #endif // TENSORFLOW_LITE_KERNELS_INTERNAL_REFERENCE_SPACE_TO_BATCH_ND_H_
@@ -0,0 +1,80 @@
1
+ /* Copyright 2020 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_KERNELS_INTERNAL_REFERENCE_SPACE_TO_DEPTH_H_
16
+ #define TENSORFLOW_LITE_KERNELS_INTERNAL_REFERENCE_SPACE_TO_DEPTH_H_
17
+
18
+ #include <cstdint>
19
+
20
+ #include "tensorflow/lite/kernels/internal/types.h"
21
+
22
+ namespace tflite_micro {
23
+ namespace reference_ops {
24
+
25
+ template <typename T>
26
+ inline void SpaceToDepth(const tflite_micro::SpaceToDepthParams& op_params,
27
+ const RuntimeShape& unextended_input_shape,
28
+ const T* input_data,
29
+ const RuntimeShape& unextended_output_shape,
30
+ T* output_data) {
31
+ TFLITE_DCHECK_LE(unextended_input_shape.DimensionsCount(), 4);
32
+ TFLITE_DCHECK_LE(unextended_output_shape.DimensionsCount(), 4);
33
+ const RuntimeShape input_shape =
34
+ RuntimeShape::ExtendedShape(4, unextended_input_shape);
35
+ const RuntimeShape output_shape =
36
+ RuntimeShape::ExtendedShape(4, unextended_output_shape);
37
+
38
+ const int input_depth = input_shape.Dims(3);
39
+ const int input_width = input_shape.Dims(2);
40
+ const int input_height = input_shape.Dims(1);
41
+ const int input_batch = input_shape.Dims(0);
42
+
43
+ const int output_depth = output_shape.Dims(3);
44
+ const int output_width = output_shape.Dims(2);
45
+ const int output_height = output_shape.Dims(1);
46
+ const int output_batch = output_shape.Dims(0);
47
+
48
+ const int32_t block_size = op_params.block_size;
49
+
50
+ TFLITE_DCHECK_EQ(input_width, output_width * block_size);
51
+ TFLITE_DCHECK_EQ(input_height, output_height * block_size);
52
+ TFLITE_DCHECK_EQ(input_depth * block_size * block_size, output_depth);
53
+ TFLITE_DCHECK_EQ(input_batch, output_batch);
54
+
55
+ for (int in_b = 0; in_b < input_batch; ++in_b) {
56
+ for (int in_h = 0; in_h < input_height; ++in_h) {
57
+ for (int in_w = 0; in_w < input_width; ++in_w) {
58
+ for (int in_d = 0; in_d < input_depth; ++in_d) {
59
+ const int out_d =
60
+ in_d + ((in_h % block_size) * block_size + in_w % block_size) *
61
+ input_depth;
62
+ const int out_w = in_w / block_size;
63
+ const int out_h = in_h / block_size;
64
+ const int out_b = in_b;
65
+
66
+ const int input_index = Offset(input_shape, in_b, in_h, in_w, in_d);
67
+ const int output_index =
68
+ Offset(output_shape, out_b, out_h, out_w, out_d);
69
+
70
+ output_data[output_index] = input_data[input_index];
71
+ }
72
+ }
73
+ }
74
+ }
75
+ }
76
+
77
+ } // namespace reference_ops
78
+ } // namespace tflite_micro
79
+
80
+ #endif // TENSORFLOW_LITE_KERNELS_INTERNAL_REFERENCE_SPACE_TO_DEPTH_H_
@@ -0,0 +1,147 @@
1
+ /* Copyright 2017 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_KERNELS_INTERNAL_REFERENCE_STRIDED_SLICE_H_
16
+ #define TENSORFLOW_LITE_KERNELS_INTERNAL_REFERENCE_STRIDED_SLICE_H_
17
+
18
+ #include "ruy/profiler/instrumentation.h" // from @ruy
19
+ #include "tensorflow/lite/kernels/internal/common.h"
20
+ #include "tensorflow/lite/kernels/internal/compatibility.h"
21
+ #include "tensorflow/lite/kernels/internal/portable_tensor.h"
22
+ #include "tensorflow/lite/kernels/internal/strided_slice_logic.h"
23
+ #include "tensorflow/lite/kernels/internal/types.h"
24
+
25
+ namespace tflite_micro {
26
+
27
+ namespace reference_ops {
28
+
29
+ template <typename T>
30
+ inline void StridedSlice(const tflite_micro::StridedSliceParams& op_params,
31
+ const RuntimeShape& unextended_input_shape,
32
+ const RuntimeShape& unextended_output_shape,
33
+ SequentialTensorWriter<T>* writer) {
34
+ ruy::profiler::ScopeLabel label("StridedSlice");
35
+
36
+ // Note that the output_shape is not used herein.
37
+ tflite_micro::StridedSliceParams params_copy = op_params;
38
+
39
+ TFLITE_DCHECK_LE(unextended_input_shape.DimensionsCount(), 5);
40
+ TFLITE_DCHECK_LE(unextended_output_shape.DimensionsCount(), 5);
41
+ const RuntimeShape input_shape =
42
+ RuntimeShape::ExtendedShape(5, unextended_input_shape);
43
+ const RuntimeShape output_shape =
44
+ RuntimeShape::ExtendedShape(5, unextended_output_shape);
45
+
46
+ // Reverse and pad to 5 dimensions because that is what the runtime code
47
+ // requires (ie. all shapes must be 5D and are given backwards).
48
+ strided_slice::StridedSlicePadIndices(&params_copy, 5);
49
+
50
+ const int start_0 =
51
+ strided_slice::StridedSliceStartForAxis(params_copy, input_shape, 0);
52
+ const int stop_0 = strided_slice::StridedSliceEndForAxis(
53
+ params_copy, input_shape, 0, start_0);
54
+ const int start_1 =
55
+ strided_slice::StridedSliceStartForAxis(params_copy, input_shape, 1);
56
+ const int stop_1 = strided_slice::StridedSliceEndForAxis(
57
+ params_copy, input_shape, 1, start_1);
58
+ const int start_2 =
59
+ strided_slice::StridedSliceStartForAxis(params_copy, input_shape, 2);
60
+ const int stop_2 = strided_slice::StridedSliceEndForAxis(
61
+ params_copy, input_shape, 2, start_2);
62
+ const int start_3 =
63
+ strided_slice::StridedSliceStartForAxis(params_copy, input_shape, 3);
64
+ const int stop_3 = strided_slice::StridedSliceEndForAxis(
65
+ params_copy, input_shape, 3, start_3);
66
+ const int start_4 =
67
+ strided_slice::StridedSliceStartForAxis(params_copy, input_shape, 4);
68
+ const int stop_4 = strided_slice::StridedSliceEndForAxis(
69
+ params_copy, input_shape, 4, start_4);
70
+
71
+ auto lc = [&](int end, int stride, int index) {
72
+ if (stride < 0) {
73
+ return index > end;
74
+ } else {
75
+ return index < end;
76
+ }
77
+ };
78
+ // With a static_cast it is not possible to initialize
79
+ // a variable of type 'const int *'
80
+ // with an rvalue of type 'const int32_t *' (aka 'const long *').
81
+ // reinterpret_cast is required to handle this casting.
82
+ const int* shape = reinterpret_cast<const int*>(input_shape.DimsData());
83
+ const int* stride = reinterpret_cast<const int*>(params_copy.strides);
84
+ const bool inner_stride_is_1 = params_copy.strides[4] == 1;
85
+
86
+ for (int offset_0 = start_0; lc(stop_0, stride[0], offset_0);
87
+ offset_0 += stride[0]) {
88
+ for (int offset_1 = start_1; lc(stop_1, stride[1], offset_1);
89
+ offset_1 += stride[1]) {
90
+ for (int offset_2 = start_2; lc(stop_2, stride[2], offset_2);
91
+ offset_2 += stride[2]) {
92
+ for (int offset_3 = start_3; lc(stop_3, stride[3], offset_3);
93
+ offset_3 += stride[3]) {
94
+ // When the stride is 1, the inner loop is equivalent to the
95
+ // optimized slice inner loop. Otherwise, it is identical to the
96
+ // strided_slice reference implementation inner loop.
97
+ if (inner_stride_is_1) {
98
+ const int len = stop_4 - start_4;
99
+ int index = start_4 + offset_3 * shape[4] +
100
+ offset_2 * shape[3] * shape[4] +
101
+ offset_1 * shape[2] * shape[3] * shape[4] +
102
+ offset_0 * shape[1] * shape[2] * shape[3] * shape[4];
103
+ if (len > 0) {
104
+ writer->WriteN(index, len);
105
+ }
106
+ } else {
107
+ for (int offset_4 = start_4; lc(stop_4, stride[4], offset_4);
108
+ offset_4 += stride[4]) {
109
+ int index = offset_4 + offset_3 * shape[4] +
110
+ offset_2 * shape[3] * shape[4] +
111
+ offset_1 * shape[2] * shape[3] * shape[4] +
112
+ offset_0 * shape[1] * shape[2] * shape[3] * shape[4];
113
+ writer->Write(index);
114
+ }
115
+ }
116
+ }
117
+ }
118
+ }
119
+ }
120
+ }
121
+
122
+ template <typename T>
123
+ inline void StridedSlice(const tflite_micro::StridedSliceParams& op_params,
124
+ const RuntimeShape& unextended_input_shape,
125
+ const T* input_data,
126
+ const RuntimeShape& unextended_output_shape,
127
+ T* output_data) {
128
+ SequentialTensorWriter<T> writer(input_data, output_data);
129
+ StridedSlice<T>(op_params, unextended_input_shape, unextended_output_shape,
130
+ &writer);
131
+ }
132
+
133
+ template <typename T>
134
+ inline void StridedSlice(const tflite_micro::StridedSliceParams& op_params,
135
+ const RuntimeShape& unextended_input_shape,
136
+ const TfLiteTensor* input,
137
+ const RuntimeShape& unextended_output_shape,
138
+ TfLiteTensor* output) {
139
+ SequentialTensorWriter<T> writer(input, output);
140
+ StridedSlice<T>(op_params, unextended_input_shape, unextended_output_shape,
141
+ &writer);
142
+ }
143
+
144
+ } // namespace reference_ops
145
+ } // namespace tflite_micro
146
+
147
+ #endif // TENSORFLOW_LITE_KERNELS_INTERNAL_REFERENCE_STRIDED_SLICE_H_