xmos-ai-tools 1.3.2.dev180__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 +73 -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 +307 -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 +153 -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 +83 -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 +53 -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/load_weights.h +64 -0
  76. xmos_ai_tools/runtime/include/lib_tflite_micro/api/memory_parallel_transport.h +52 -0
  77. xmos_ai_tools/runtime/include/lib_tflite_micro/api/version.h +13 -0
  78. xmos_ai_tools/runtime/include/lib_tflite_micro/api/xcore_config.h +17 -0
  79. xmos_ai_tools/runtime/include/lib_tflite_micro/api/xcore_device_memory.h +62 -0
  80. xmos_ai_tools/runtime/include/lib_tflite_micro/api/xcore_shared_config.h +31 -0
  81. xmos_ai_tools/runtime/include/lib_tflite_micro/src/tflite-xcore-kernels/conv2d_float.h +155 -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 +79 -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 +68 -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 +64 -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 +651 -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.dev180.data/data/bin/xcore-opt +0 -0
  392. xmos_ai_tools-1.3.2.dev180.dist-info/METADATA +33 -0
  393. xmos_ai_tools-1.3.2.dev180.dist-info/RECORD +395 -0
  394. xmos_ai_tools-1.3.2.dev180.dist-info/WHEEL +5 -0
  395. xmos_ai_tools-1.3.2.dev180.dist-info/top_level.txt +1 -0
@@ -0,0 +1,651 @@
1
+ # Copyright 2022 XMOS LIMITED. This Software is subject to the terms of the
2
+ # XMOS Public License: Version 1
3
+ import sys
4
+ import ctypes
5
+ from typing import Optional, Dict, Any, List
6
+ from tflite.Model import Model
7
+ from tflite.TensorType import TensorType
8
+ from tflite import opcode2name
9
+ from enum import Enum
10
+
11
+ import numpy as np
12
+ from pathlib import Path
13
+
14
+ from numpy import ndarray
15
+
16
+ # DLL path for different platforms
17
+ __PARENT_DIR = Path(__file__).parent.absolute()
18
+ if sys.platform.startswith("linux"):
19
+ lib_path = str(Path.joinpath(__PARENT_DIR, "libs", "linux", "xtflm_python.so"))
20
+ elif sys.platform == "darwin":
21
+ lib_path = str(Path.joinpath(__PARENT_DIR, "libs", "macos", "xtflm_python.dylib"))
22
+ else:
23
+ lib_path = str(Path.joinpath(__PARENT_DIR, "libs", "windows", "xtflm_python.dll"))
24
+
25
+ lib = ctypes.cdll.LoadLibrary(lib_path)
26
+
27
+ from xmos_ai_tools.xinterpreters.exceptions import (
28
+ InterpreterError,
29
+ AllocateTensorsError,
30
+ InvokeError,
31
+ SetTensorError,
32
+ GetTensorError,
33
+ ModelSizeError,
34
+ ArenaSizeError,
35
+ DeviceTimeoutError,
36
+ )
37
+
38
+ MAX_TENSOR_ARENA_SIZE = 10000000
39
+
40
+
41
+ class XTFLMInterpreterStatus(Enum):
42
+ OK = 0
43
+ ERROR = 1
44
+
45
+
46
+ class TFLMHostInterpreter:
47
+ """! The xcore interpreters host class.
48
+ The interpreter to be used on a host.
49
+ """
50
+
51
+ def __init__(self, max_tensor_arena_size: int = MAX_TENSOR_ARENA_SIZE) -> None:
52
+ """! Host interpreter initializer.
53
+ Sets up functions from the cdll, and calls to cdll function to create a new interpreter.
54
+ """
55
+ self._error_msg = ctypes.create_string_buffer(4096)
56
+
57
+ lib.new_interpreter.restype = ctypes.c_void_p
58
+ lib.new_interpreter.argtypes = [
59
+ ctypes.c_size_t,
60
+ ]
61
+
62
+ lib.print_memory_plan.restype = None
63
+ lib.print_memory_plan.argtypes = [ctypes.c_void_p]
64
+
65
+ lib.delete_interpreter.restype = None
66
+ lib.delete_interpreter.argtypes = [ctypes.c_void_p]
67
+
68
+ lib.initialize.restype = ctypes.c_int
69
+ lib.initialize.argtypes = [
70
+ ctypes.c_void_p,
71
+ ctypes.c_char_p,
72
+ ctypes.c_size_t,
73
+ ctypes.c_char_p,
74
+ ]
75
+
76
+ lib.set_input_tensor.restype = ctypes.c_int
77
+ lib.set_input_tensor.argtypes = [
78
+ ctypes.c_void_p,
79
+ ctypes.c_size_t,
80
+ ctypes.c_void_p,
81
+ ctypes.c_int,
82
+ ]
83
+
84
+ lib.get_output_tensor.restype = ctypes.c_int
85
+ lib.get_output_tensor.argtypes = [
86
+ ctypes.c_void_p,
87
+ ctypes.c_size_t,
88
+ ctypes.c_void_p,
89
+ ctypes.c_int,
90
+ ]
91
+
92
+ lib.get_input_tensor.restype = ctypes.c_int
93
+ lib.get_input_tensor.argtypes = [
94
+ ctypes.c_void_p,
95
+ ctypes.c_size_t,
96
+ ctypes.c_void_p,
97
+ ctypes.c_int,
98
+ ]
99
+
100
+ lib.reset.restype = ctypes.c_int
101
+ lib.reset.argtypes = [ctypes.c_void_p]
102
+
103
+ lib.invoke.restype = ctypes.c_int
104
+ lib.invoke.argtypes = [ctypes.c_void_p]
105
+
106
+ lib.get_error.restype = ctypes.c_size_t
107
+ lib.get_error.argtypes = [ctypes.c_void_p, ctypes.c_char_p]
108
+
109
+ lib.arena_used_bytes.restype = ctypes.c_size_t
110
+ lib.arena_used_bytes.argtypes = [
111
+ ctypes.c_void_p,
112
+ ]
113
+
114
+ self._max_tensor_arena_size = max_tensor_arena_size
115
+ self.models: List[TFLMHostInterpreter.modelData] = []
116
+
117
+ def __enter__(self) -> "TFLMHostInterpreter":
118
+ return self
119
+
120
+ def __exit__(self, exc_type, exc_value, exc_traceback) -> None:
121
+ """! Exit calls close function to delete interpreter"""
122
+ self.close()
123
+
124
+ def initialise_interpreter(self, model_index: int = 0) -> None:
125
+ """! Interpreter initialiser, initialised interpreter with model and parameters (optional)
126
+ @param model_index The model to target, for interpreters that support multiple models
127
+ running concurrently. Defaults to 0 for use with a single model.
128
+ """
129
+ max_model_size = 50000000
130
+ self.obj = lib.new_interpreter(max_model_size)
131
+ currentModel = None
132
+
133
+ for model in self.models:
134
+ if model.tile == model_index:
135
+ currentModel = model
136
+
137
+ if currentModel is None:
138
+ print(f"No model at index {model_index} found.", sys.stderr)
139
+ raise IndexError
140
+
141
+ assert currentModel.model_content is not None
142
+
143
+ status = lib.initialize(
144
+ self.obj,
145
+ currentModel.model_content,
146
+ len(currentModel.model_content),
147
+ currentModel.params_content,
148
+ )
149
+ if XTFLMInterpreterStatus(status) is XTFLMInterpreterStatus.ERROR:
150
+ raise RuntimeError("Unable to initialize interpreter")
151
+
152
+ def set_tensor(self, tensor_index: int, value: ndarray, model_index=0) -> None:
153
+ """! Write the input tensor of a model.
154
+ @param value The blob of data to set the tensor to.
155
+ @param tensor_index The index of input tensor to target. Defaults to 0.
156
+ @param model_index The model to target, for interpreters that support multiple models
157
+ running concurrently. Defaults to 0 for use with a single model.
158
+ """
159
+ val = value.tobytes()
160
+
161
+ length = len(val)
162
+ length2 = self.get_input_tensor_size(tensor_index)
163
+ if length != length2:
164
+ print(
165
+ "ERROR: mismatching size in set_input_tensor %d vs %d"
166
+ % (length, length2)
167
+ )
168
+
169
+ self._check_status(lib.set_input_tensor(self.obj, tensor_index, val, length))
170
+
171
+ def get_tensor(
172
+ self, tensor_index: int = 0, model_index: int = 0, tensor: ndarray = None
173
+ ) -> ndarray:
174
+ """! Read data from the output tensor of a model.
175
+ @param tensor_index The index of output tensor to target.
176
+ @param model_index The model to target, for interpreters that support multiple models
177
+ running concurrently. Defaults to 0 for use with a single model.
178
+ @param tensor Tensor of correct shape to write into (optional).
179
+ @return The data that was stored in the output tensor.
180
+ """
181
+
182
+ count: Optional[int]
183
+ tensor_details: Optional[Dict[str, Any]]
184
+ count, tensor_details = next(
185
+ filter(
186
+ lambda x: x[1]["index"] == tensor_index,
187
+ enumerate(self.get_output_details()),
188
+ ),
189
+ (None, None),
190
+ )
191
+
192
+ if count is None or tensor_details is None:
193
+ print(f"No tensor at index {tensor_index} found.", sys.stderr)
194
+ raise IndexError
195
+
196
+ length = self.get_tensor_size(tensor_index)
197
+ if tensor is None:
198
+ tensor = np.zeros(tensor_details["shape"], dtype=tensor_details["dtype"])
199
+ else:
200
+ length = len(tensor.tobytes())
201
+ if length != length:
202
+ print(
203
+ "ERROR: mismatching size in get_output_tensor %d vs %d"
204
+ % (length, length)
205
+ )
206
+
207
+ data_ptr = tensor.ctypes.data_as(ctypes.c_void_p)
208
+ self._check_status(lib.get_output_tensor(self.obj, count, data_ptr, length))
209
+ return tensor
210
+
211
+ def get_input_tensor(self, input_index: int = 0, model_index: int = 0) -> ndarray:
212
+ """! Read the data in the input tensor of a model.
213
+ @param input_index The index of input tensor to target.
214
+ @param model_index The engine to target, for interpreters that support multiple models
215
+ running concurrently. Defaults to 0 for use with a single model.
216
+ @return The data that was stored in the output tensor.
217
+ """
218
+ tensor_details = self.get_input_details(model_index)[input_index]
219
+ tensor = np.zeros(tensor_details["shape"], dtype=tensor_details["dtype"])
220
+ data_ptr = tensor.ctypes.data_as(ctypes.c_void_p)
221
+
222
+ l = len(tensor.tobytes())
223
+ self._check_status(lib.get_input_tensor(self.obj, input_index, data_ptr, l))
224
+ return tensor
225
+
226
+ def reset(self, model_index: int = 0) -> None:
227
+ """! Resets the model."""
228
+ self._check_status(lib.reset(self.obj))
229
+
230
+ def invoke(self, model_index: int = 0) -> None:
231
+ """! Invoke the model and starting inference of the current
232
+ state of the tensors.
233
+ """
234
+ INVOKE_CALLBACK_FUNC = ctypes.CFUNCTYPE(ctypes.c_void_p, ctypes.c_int)
235
+
236
+ self._check_status(lib.invoke(self.obj))
237
+
238
+ def close(self, model_index: int = 0) -> None:
239
+ """! Delete the interpreter.
240
+ @params model_index Defines which interpreter to target in systems with multiple.
241
+ """
242
+ if self.obj:
243
+ lib.delete_interpreter(self.obj)
244
+ self.obj = None
245
+
246
+ def tensor_arena_size(self) -> int:
247
+ """! Read the size of the tensor arena required.
248
+ @return size of the tensor arena as an integer.
249
+ """
250
+ return lib.arena_used_bytes(self.obj)
251
+
252
+ def _check_status(self, status) -> None:
253
+ """! Read a status code and raise an exception.
254
+ @param status Status code.
255
+ """
256
+ if XTFLMInterpreterStatus(status) is XTFLMInterpreterStatus.ERROR:
257
+ lib.get_error(self.obj, self._error_msg)
258
+ raise RuntimeError(self._error_msg.value.decode("utf-8"))
259
+
260
+ def print_memory_plan(self) -> None:
261
+ """! Print a plan of memory allocation"""
262
+ lib.print_memory_plan(self.obj)
263
+
264
+ def allocate_tensors(self):
265
+ """! Dummy function to match tf.lite.Interpreter() API"""
266
+ return
267
+
268
+ def get_input_tensor_size(self, input_index: int = 0, model_index: int = 0) -> int:
269
+ """! Read the size of the input tensor from the model.
270
+ @param input_index The index of input tensor to target.
271
+ @param model_index The model to target, for interpreters that support multiple models
272
+ running concurrently. Defaults to 0 for use with a single model.
273
+ @return The size of the input tensor as an integer.
274
+ """
275
+
276
+ # Select correct model from model list
277
+ model = self.get_model(model_index)
278
+ modelBuf = Model.GetRootAsModel(model.model_content, 0)
279
+
280
+ # Get index of specific input tensor
281
+ tensorIndex = modelBuf.Subgraphs(0).Inputs(input_index)
282
+
283
+ tensorType = modelBuf.Subgraphs(0).Tensors(tensorIndex).Type()
284
+
285
+ tensorSize: int
286
+ if tensorType == TensorType.INT8:
287
+ tensorSize = 1 # int8 is 1 byte
288
+ elif tensorType == TensorType.INT16:
289
+ tensorSize = 2 # int16 is 2 bytes
290
+ elif tensorType == TensorType.INT32:
291
+ tensorSize = 4 # int32 is 4 bytes
292
+ elif tensorType == TensorType.FLOAT32:
293
+ tensorSize = 4 # float32 is 4 bytes
294
+ else:
295
+ print(tensorType)
296
+ self._check_status(XTFLMInterpreterStatus.ERROR)
297
+ tensorSize = 0
298
+
299
+ # Calculate tensor size by multiplying shape elements
300
+ for i in range(0, modelBuf.Subgraphs(0).Tensors(tensorIndex).ShapeLength()):
301
+ tensorSize = tensorSize * modelBuf.Subgraphs(0).Tensors(tensorIndex).Shape(
302
+ i
303
+ )
304
+ return tensorSize
305
+
306
+ def get_output_tensor_size(
307
+ self, output_index: int = 0, model_index: int = 0
308
+ ) -> int:
309
+ """! Read the size of the output tensor from the model.
310
+ @param output_index The index of output tensor to target.
311
+ @param model_index The model to target, for interpreters that support multiple models
312
+ running concurrently. Defaults to 0 for use with a single model.
313
+ @return The size of the output tensor as an integer.
314
+ """
315
+
316
+ # Select correct model from model list
317
+ modelBuf = None
318
+ model = self.get_model(model_index)
319
+ modelBuf = Model.GetRootAsModel(model.model_content, 0)
320
+
321
+ # Get index of specific output tensor
322
+ tensorIndex = modelBuf.Subgraphs(0).Outputs(output_index)
323
+
324
+ tensorType = modelBuf.Subgraphs(0).Tensors(tensorIndex).Type()
325
+
326
+ tensorSize: int
327
+ if tensorType == TensorType.INT8:
328
+ tensorSize = 1 # int8 is 1 byte
329
+ elif tensorType == TensorType.INT16:
330
+ tensorSize = 2 # int16 is 2 bytes
331
+ elif tensorType == TensorType.INT32:
332
+ tensorSize = 4 # int32 is 4 bytes
333
+ elif tensorType == TensorType.FLOAT32:
334
+ tensorSize = 4 # float32 is 4 bytes
335
+ else:
336
+ print(tensorType)
337
+ self._check_status(XTFLMInterpreterStatus.ERROR)
338
+ tensorSize = 0
339
+
340
+ # Calculate tensor size by multiplying shape elements
341
+ for i in range(0, modelBuf.Subgraphs(0).Tensors(tensorIndex).ShapeLength()):
342
+ tensorSize = tensorSize * modelBuf.Subgraphs(0).Tensors(tensorIndex).Shape(
343
+ i
344
+ )
345
+ return tensorSize
346
+
347
+ def get_tensor_size(self, tensor_index: int = 0, model_index: int = 0) -> int:
348
+ """! Read the size of the input tensor from the model.
349
+ @param tensor_index The index of input tensor to target.
350
+ @param model_index The model to target, for interpreters that support multiple models
351
+ running concurrently. Defaults to 0 for use with a single model.
352
+ @return The size of the input tensor as an integer.
353
+ """
354
+
355
+ # Select correct model from model list
356
+ modelBuf = None
357
+ model = self.get_model(model_index)
358
+ modelBuf = Model.GetRootAsModel(model.model_content, 0)
359
+
360
+ tensorType = modelBuf.Subgraphs(0).Tensors(tensor_index).Type()
361
+ if tensorType == TensorType.INT8:
362
+ tensorSize = 1 # int8 is 1 byte
363
+ elif tensorType == TensorType.INT16:
364
+ tensorSize = 2 # int16 is 2 bytes
365
+ elif tensorType == TensorType.INT32:
366
+ tensorSize = 4 # int32 is 4 bytes
367
+ elif tensorType == TensorType.FLOAT32:
368
+ tensorSize = 4 # float32 is 4 bytes
369
+ else:
370
+ print(tensorType)
371
+ self._check_status(XTFLMInterpreterStatus.ERROR)
372
+
373
+ # Calculate tensor size by multiplying shape elements
374
+ for i in range(0, modelBuf.Subgraphs(0).Tensors(tensor_index).ShapeLength()):
375
+ tensorSize = tensorSize * modelBuf.Subgraphs(0).Tensors(tensor_index).Shape(
376
+ i
377
+ )
378
+ return tensorSize
379
+
380
+ def get_input_details(self, model_index: int = 0) -> List[Dict[str, Any]]:
381
+ """! Reads the input tensor details from the model.
382
+ @param model_index The model to target, for interpreters that support multiple models
383
+ running concurrently. Defaults to 0 for use with a single model.
384
+ @return Tensor details, including the index, name, shape, data type, and quantization
385
+ parameters.
386
+ """
387
+
388
+ # Select correct model from model list
389
+ modelBuf = None
390
+ model = self.get_model(model_index)
391
+ modelBuf = Model.GetRootAsModel(model.model_content, 0)
392
+
393
+ inputsList = []
394
+ for input_ in range(0, modelBuf.Subgraphs(0).InputsLength()):
395
+ tensorIndex = modelBuf.Subgraphs(0).Inputs(input_)
396
+
397
+ # Generate dictioary of tensor details
398
+ dtype: Union[Type[Any]]
399
+ if modelBuf.Subgraphs(0).Tensors(tensorIndex).Type() == TensorType.INT8:
400
+ dtype = np.int8
401
+ elif modelBuf.Subgraphs(0).Tensors(tensorIndex).Type() == TensorType.INT16:
402
+ dtype = np.int16
403
+ elif modelBuf.Subgraphs(0).Tensors(tensorIndex).Type() == TensorType.INT32:
404
+ dtype = np.int32
405
+ elif (
406
+ modelBuf.Subgraphs(0).Tensors(tensorIndex).Type() == TensorType.FLOAT32
407
+ ):
408
+ dtype = np.float32
409
+ else:
410
+ raise TypeError
411
+
412
+ details = {
413
+ "name": str(modelBuf.Subgraphs(0).Tensors(tensorIndex).Name())[
414
+ 1:
415
+ ].strip("'"),
416
+ "index": tensorIndex,
417
+ "shape": modelBuf.Subgraphs(0).Tensors(tensorIndex).ShapeAsNumpy(),
418
+ "shape_signature": modelBuf.Subgraphs(0)
419
+ .Tensors(tensorIndex)
420
+ .ShapeSignatureAsNumpy(),
421
+ "dtype": dtype,
422
+ "quantization": (
423
+ modelBuf.Subgraphs(0).Tensors(tensorIndex).Quantization().Scale(0),
424
+ modelBuf.Subgraphs(0)
425
+ .Tensors(tensorIndex)
426
+ .Quantization()
427
+ .ZeroPoint(0),
428
+ ),
429
+ "quantization_parameters": {
430
+ "scales": modelBuf.Subgraphs(0)
431
+ .Tensors(tensorIndex)
432
+ .Quantization()
433
+ .ScaleAsNumpy(),
434
+ "zero_points": modelBuf.Subgraphs(0)
435
+ .Tensors(tensorIndex)
436
+ .Quantization()
437
+ .ZeroPointAsNumpy(),
438
+ "quantized_dimension": modelBuf.Subgraphs(0)
439
+ .Tensors(tensorIndex)
440
+ .Quantization()
441
+ .QuantizedDimension(),
442
+ },
443
+ "sparsity_parameters": {
444
+ modelBuf.Subgraphs(0).Tensors(tensorIndex).Sparsity()
445
+ },
446
+ }
447
+ inputsList.append(details)
448
+
449
+ return inputsList
450
+
451
+ def get_output_details(self, model_index: int = 0) -> List[Dict[str, Any]]:
452
+ """! Reads the output tensor details from the model.
453
+ @param output_index The index of output tensor to target.
454
+ @param model_index The model to target, for interpreters that support multiple models
455
+ running concurrently. Defaults to 0 for use with a single model.
456
+ @return Tensor details, including the index, name, shape, data type, and quantization
457
+ parameters.
458
+ """
459
+
460
+ # Select correct model from models list
461
+ model = self.get_model(model_index)
462
+ modelBuf = Model.GetRootAsModel(model.model_content, 0)
463
+
464
+ outputsList = []
465
+ for output_ in range(0, modelBuf.Subgraphs(0).OutputsLength()):
466
+ # Output tensor is last tensor
467
+ tensorIndex = modelBuf.Subgraphs(0).Outputs(output_)
468
+
469
+ dtype: Union[Type[Any]]
470
+ # Generate dictionary of tensor details
471
+ if modelBuf.Subgraphs(0).Tensors(tensorIndex).Type() == TensorType.INT8:
472
+ dtype = np.int8
473
+ elif modelBuf.Subgraphs(0).Tensors(tensorIndex).Type() == TensorType.INT16:
474
+ dtype = np.int16
475
+ elif modelBuf.Subgraphs(0).Tensors(tensorIndex).Type() == TensorType.INT32:
476
+ dtype = np.int32
477
+ elif (
478
+ modelBuf.Subgraphs(0).Tensors(tensorIndex).Type() == TensorType.FLOAT32
479
+ ):
480
+ dtype = np.float32
481
+
482
+ details = {
483
+ "name": str(modelBuf.Subgraphs(0).Tensors(tensorIndex).Name())[
484
+ 1:
485
+ ].strip("'"),
486
+ "index": tensorIndex,
487
+ "shape": modelBuf.Subgraphs(0).Tensors(tensorIndex).ShapeAsNumpy(),
488
+ "shape_signature": modelBuf.Subgraphs(0)
489
+ .Tensors(tensorIndex)
490
+ .ShapeSignatureAsNumpy(),
491
+ "dtype": dtype,
492
+ "quantization": (
493
+ modelBuf.Subgraphs(0).Tensors(tensorIndex).Quantization().Scale(0),
494
+ modelBuf.Subgraphs(0)
495
+ .Tensors(tensorIndex)
496
+ .Quantization()
497
+ .ZeroPoint(0),
498
+ ),
499
+ "quantization_parameters": {
500
+ "scales": modelBuf.Subgraphs(0)
501
+ .Tensors(tensorIndex)
502
+ .Quantization()
503
+ .ScaleAsNumpy(),
504
+ "zero_points": modelBuf.Subgraphs(0)
505
+ .Tensors(tensorIndex)
506
+ .Quantization()
507
+ .ZeroPointAsNumpy(),
508
+ "quantized_dimension": modelBuf.Subgraphs(0)
509
+ .Tensors(tensorIndex)
510
+ .Quantization()
511
+ .QuantizedDimension(),
512
+ },
513
+ "sparsity_parameters": {
514
+ modelBuf.Subgraphs(0).Tensors(tensorIndex).Sparsity()
515
+ },
516
+ }
517
+ outputsList.append(details)
518
+
519
+ return outputsList
520
+
521
+ def set_model(
522
+ self,
523
+ model_path: Optional[str] = None,
524
+ model_content: Optional[bytes] = None,
525
+ params_path: Optional[str] = None,
526
+ params_content: Optional[bytes] = None,
527
+ model_index: int = 0,
528
+ secondary_memory: bool = False,
529
+ flash: bool = False,
530
+ ) -> None:
531
+ """! Adds a model to the interpreter's list of models.
532
+ @param model_path The path to the model file (.tflite), alternative to model_content.
533
+ @param model_content The byte array representing a model, alternative to model_path.
534
+ @param params_path The path to the params file for the model,
535
+ alternative to params_content (optional).
536
+ @param params_content The byte array representing the model parameters,
537
+ alternative to params_path (optional).
538
+ @param model_index The model to target, for interpreters that support multiple models
539
+ running concurrently. Defaults to 0 for use with a single model.
540
+ """
541
+
542
+ # Check model_path or model_content is valid
543
+ if not model_path and not model_content:
544
+ raise ValueError("model_path or model_content must be provided")
545
+ tile_found = False
546
+ # Find correct model and replace
547
+ for model in self.models:
548
+ if model.tile == model_index:
549
+ model = self.modelData(
550
+ model_path,
551
+ model_content,
552
+ params_path,
553
+ params_content,
554
+ model_index,
555
+ secondary_memory,
556
+ flash,
557
+ )
558
+ tile_found = True
559
+ break
560
+ # If model wasn't previously set, add it to list
561
+ if not tile_found:
562
+ self.models.append(
563
+ self.modelData(
564
+ model_path,
565
+ model_content,
566
+ params_path,
567
+ params_content,
568
+ model_index,
569
+ secondary_memory,
570
+ flash,
571
+ )
572
+ )
573
+ self.initialise_interpreter(model_index)
574
+
575
+ def get_model(self, model_index: int = 0):
576
+ for model in self.models:
577
+ if model.tile == model_index:
578
+ return model
579
+
580
+ class modelData:
581
+ """! The model data class
582
+ A class that holds a model and data associated with a single model.
583
+ """
584
+
585
+ def __init__(
586
+ self,
587
+ model_path: Optional[str],
588
+ model_content: Optional[bytes],
589
+ params_path: Optional[str],
590
+ params_content: Optional[bytes],
591
+ model_index: int,
592
+ secondary_memory: bool,
593
+ flash: bool,
594
+ ):
595
+ """! Model data initializer.
596
+ Sets up variables, generates a list of operators used in the model,
597
+ and reads model and params paths into byte arrays (content).
598
+ @param model_path Path to the model file (.tflite).
599
+ @param model_content Model model_content (byte array).
600
+ @param params_path Path to model parameters file.
601
+ @param params_content Model parameters content (byte array)
602
+ @param model_index The model to target, for interpreters that support multiple models
603
+ running concurrently. Defaults to 0 for use with a single model.
604
+ """
605
+ self.model_path: Optional[str] = model_path
606
+ self.model_content: Optional[bytes] = model_content
607
+ self.params_path: Optional[str] = params_path
608
+ self.params_content: Optional[bytes] = params_content
609
+ self.tile: int = model_index
610
+ self.secondary_memory = secondary_memory
611
+ self.flash = flash
612
+ self.opList: List[str] = []
613
+ self.pathToContent()
614
+ self.modelToOpList()
615
+
616
+ def modelToOpList(self) -> None:
617
+ """! Generates operator list from model."""
618
+
619
+ # Load model
620
+ buffer = self.model_content
621
+ model = Model.GetRootAsModel(buffer, 0)
622
+ self.opList = []
623
+
624
+ # Iterate through operators in model and add operators to opList
625
+ for y in range(0, model.Subgraphs(0).OperatorsLength()):
626
+ opcode = model.OperatorCodes(
627
+ model.Subgraphs(0).Operators(y).OpcodeIndex()
628
+ )
629
+ # If custom opcode parse string
630
+ if opcode.BuiltinCode() == 32:
631
+ self.opList.append(str(opcode.CustomCode()).strip("b'"))
632
+ # If built in op code, decode
633
+ else:
634
+ self.opList.append(opcode2name(opcode.BuiltinCode()))
635
+
636
+ def pathToContent(self) -> None:
637
+ """! Reads model and params paths to content (byte arrays)"""
638
+
639
+ # Check if path exists but not content
640
+ if self.model_content is None and self.model_path is not None:
641
+ with open(self.model_path, "rb") as input_fd:
642
+ self.model_content = input_fd.read()
643
+
644
+ # Check if params_path exists but not params_content
645
+ if self.params_content is None and self.params_path is not None:
646
+ with open(self.params_path, "rb") as input_fd2:
647
+ self.params_content = input_fd2.read()
648
+
649
+ # If params_content is None, set to empty byte array
650
+ if self.params_content is None:
651
+ self.params_content = bytes([])
@@ -0,0 +1,33 @@
1
+ Metadata-Version: 2.1
2
+ Name: xmos_ai_tools
3
+ Version: 1.3.2.dev180
4
+ Summary: XMOS AI Tools
5
+ Home-page: https://github.com/xmos/ai_tools
6
+ Author: XMOS
7
+ Author-email: support@xmos.com
8
+ License: LICENSE.txt
9
+ Keywords: tensorflow binarized neural networks
10
+ Classifier: License :: Other/Proprietary License
11
+ Classifier: Development Status :: 4 - Beta
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: Intended Audience :: Education
14
+ Classifier: Intended Audience :: Science/Research
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3 :: Only
17
+ Classifier: Programming Language :: Python :: 3.9
18
+ Classifier: Programming Language :: Python :: 3.10
19
+ Classifier: Topic :: Scientific/Engineering
20
+ Classifier: Topic :: Scientific/Engineering :: Mathematics
21
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
22
+ Classifier: Topic :: Software Development
23
+ Classifier: Topic :: Software Development :: Libraries
24
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
25
+ Requires-Python: >=3.9
26
+ Description-Content-Type: text/markdown
27
+ Requires-Dist: numpy<2.0
28
+ Requires-Dist: tflite>=2.4.0
29
+
30
+ Documentation
31
+ -------------
32
+
33
+ Click [here](https://github.com/xmos/ai_tools/blob/7d0536c84f7f2e689cb6a11fd2f5e62b3e4dfeee/README.md) for documentation on using xmos-ai-tools to deploy AI models on xcore.