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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (147) hide show
  1. xmos_ai_tools/runtime/include/lib_nn/api/nn_layers.h +16 -0
  2. xmos_ai_tools/runtime/include/lib_nn/api/quadratic_approximation.h +80 -0
  3. xmos_ai_tools/runtime/include/lib_nn/api/quadratic_interpolation.h +23 -0
  4. xmos_ai_tools/runtime/include/lib_tflite_micro/src/tflite-xcore-kernels/xcore_ops.h +15 -15
  5. xmos_ai_tools/runtime/include/{tensorflow/lite/micro/examples/micro_speech/simple_features/model.h → signal/micro/kernels/delay_flexbuffers_generated_data.h} +7 -9
  6. xmos_ai_tools/runtime/include/signal/micro/kernels/energy_flexbuffers_generated_data.h +28 -0
  7. xmos_ai_tools/runtime/include/signal/micro/kernels/fft_flexbuffers_generated_data.h +37 -0
  8. xmos_ai_tools/runtime/include/signal/micro/kernels/filter_bank_flexbuffers_generated_data.h +25 -0
  9. xmos_ai_tools/runtime/include/signal/micro/kernels/filter_bank_log_flexbuffers_generated_data.h +27 -0
  10. xmos_ai_tools/runtime/include/signal/micro/kernels/filter_bank_spectral_subtraction_flexbuffers_generated_data.h +26 -0
  11. xmos_ai_tools/runtime/include/signal/micro/kernels/framer_flexbuffers_generated_data.h +25 -0
  12. xmos_ai_tools/runtime/include/{tensorflow/lite/micro/examples/micro_speech/simple_features/no_simple_features_data.h → signal/micro/kernels/irfft.h} +15 -7
  13. xmos_ai_tools/runtime/include/signal/micro/kernels/overlap_add_flexbuffers_generated_data.h +25 -0
  14. xmos_ai_tools/runtime/include/signal/micro/kernels/pcan_flexbuffers_generated_data.h +7 -0
  15. xmos_ai_tools/runtime/include/signal/micro/kernels/rfft.h +31 -0
  16. xmos_ai_tools/runtime/include/signal/micro/kernels/stacker_flexbuffers_generated_data.h +25 -0
  17. xmos_ai_tools/runtime/include/signal/micro/kernels/window_flexbuffers_generated_data.h +25 -0
  18. xmos_ai_tools/runtime/include/signal/src/circular_buffer.h +118 -0
  19. xmos_ai_tools/runtime/include/signal/src/complex.h +29 -0
  20. xmos_ai_tools/runtime/include/signal/src/energy.h +38 -0
  21. xmos_ai_tools/runtime/include/signal/src/fft_auto_scale.h +35 -0
  22. xmos_ai_tools/runtime/include/signal/src/filter_bank.h +69 -0
  23. xmos_ai_tools/runtime/include/signal/src/filter_bank_log.h +38 -0
  24. xmos_ai_tools/runtime/include/signal/src/filter_bank_spectral_subtraction.h +73 -0
  25. xmos_ai_tools/runtime/include/{tensorflow/lite/micro/examples/micro_speech/main_functions.h → signal/src/filter_bank_square_root.h} +14 -17
  26. xmos_ai_tools/runtime/include/signal/src/irfft.h +84 -0
  27. xmos_ai_tools/runtime/include/signal/src/kiss_fft_wrappers/kiss_fft_common.h +49 -0
  28. xmos_ai_tools/runtime/include/signal/src/kiss_fft_wrappers/kiss_fft_float.h +31 -0
  29. xmos_ai_tools/runtime/include/signal/src/kiss_fft_wrappers/kiss_fft_int16.h +30 -0
  30. xmos_ai_tools/runtime/include/signal/src/kiss_fft_wrappers/kiss_fft_int32.h +31 -0
  31. xmos_ai_tools/runtime/include/{tensorflow/lite/micro/examples/micro_speech/micro_features/no_micro_features_data.h → signal/src/log.h} +13 -6
  32. xmos_ai_tools/runtime/include/{tensorflow/lite/micro/python/interpreter/src/python_utils.h → signal/src/max_abs.h} +11 -11
  33. xmos_ai_tools/runtime/include/{tensorflow/lite/micro/examples/micro_speech/micro_features/yes_micro_features_data.h → signal/src/msb.h} +15 -6
  34. xmos_ai_tools/runtime/include/signal/src/overlap_add.h +46 -0
  35. xmos_ai_tools/runtime/include/signal/src/pcan_argc_fixed.h +41 -0
  36. xmos_ai_tools/runtime/include/signal/src/rfft.h +85 -0
  37. xmos_ai_tools/runtime/include/signal/src/square_root.h +32 -0
  38. xmos_ai_tools/runtime/include/{tensorflow/lite/micro/python/interpreter/src/numpy_utils.h → signal/src/window.h} +13 -15
  39. xmos_ai_tools/runtime/include/signal/testdata/fft_test_data.h +48 -0
  40. xmos_ai_tools/runtime/include/tensorflow/lite/array.h +156 -0
  41. xmos_ai_tools/runtime/include/tensorflow/lite/builtin_ops.h +44 -0
  42. xmos_ai_tools/runtime/include/tensorflow/lite/c/c_api_types.h +6 -0
  43. xmos_ai_tools/runtime/include/tensorflow/lite/c/common.h +8 -25
  44. xmos_ai_tools/runtime/include/tensorflow/lite/core/api/error_reporter.h +3 -3
  45. xmos_ai_tools/runtime/include/tensorflow/lite/core/api/flatbuffer_conversions.h +15 -0
  46. xmos_ai_tools/runtime/include/tensorflow/lite/core/c/builtin_op_data.h +92 -3
  47. xmos_ai_tools/runtime/include/tensorflow/lite/core/c/c_api_types.h +61 -51
  48. xmos_ai_tools/runtime/include/tensorflow/lite/core/c/common.h +302 -1
  49. xmos_ai_tools/runtime/include/tensorflow/lite/core/macros.h +78 -0
  50. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/common.h +129 -43
  51. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/cppmath.h +2 -2
  52. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/portable_tensor.h +23 -4
  53. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/add.h +210 -151
  54. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/comparisons.h +9 -18
  55. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/conv.h +2 -0
  56. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/integer_ops/add.h +103 -72
  57. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/integer_ops/conv.h +2 -0
  58. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/integer_ops/mean.h +2 -63
  59. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/integer_ops/mul.h +87 -26
  60. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/mul.h +129 -80
  61. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/reduce.h +42 -93
  62. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/resize_bilinear.h +5 -0
  63. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/sub.h +249 -263
  64. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/runtime_shape.h +11 -1
  65. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/strided_slice_logic.h +5 -1
  66. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/tensor_ctypes.h +5 -10
  67. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/types.h +4 -2
  68. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/kernel_util.h +25 -14
  69. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/op_macros.h +14 -3
  70. xmos_ai_tools/runtime/include/tensorflow/lite/micro/debug_log.h +10 -3
  71. xmos_ai_tools/runtime/include/tensorflow/lite/micro/examples/micro_speech/micro_model_settings.h +37 -0
  72. xmos_ai_tools/runtime/include/tensorflow/lite/micro/fake_micro_context.h +7 -0
  73. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/add.h +6 -5
  74. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/circular_buffer.h +0 -3
  75. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/conv.h +19 -20
  76. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/conv_test.h +8 -31
  77. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/depthwise_conv.h +8 -8
  78. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/ethosu.h +1 -1
  79. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/fully_connected.h +9 -9
  80. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/kernel_runner.h +14 -9
  81. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/kernel_util.h +9 -4
  82. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/micro_ops.h +119 -100
  83. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/mul.h +4 -4
  84. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/pooling.h +8 -8
  85. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/reduce.h +4 -4
  86. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/reshape.h +26 -0
  87. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/softmax.h +12 -16
  88. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/strided_slice.h +40 -0
  89. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/svdf.h +8 -7
  90. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/unidirectional_sequence_lstm.h +5 -5
  91. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/xtensa/xtensa.h +2 -2
  92. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/xtensa/xtensa_conv.h +26 -21
  93. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/xtensa/xtensa_depthwise_conv.h +4 -4
  94. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/xtensa/xtensa_reshape.h +2 -4
  95. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/xtensa/xtensa_softmax.h +2 -2
  96. xmos_ai_tools/runtime/include/tensorflow/lite/micro/memory_planner/greedy_memory_planner.h +5 -0
  97. xmos_ai_tools/runtime/include/tensorflow/lite/micro/memory_planner/linear_memory_planner.h +4 -0
  98. xmos_ai_tools/runtime/include/tensorflow/lite/micro/memory_planner/micro_memory_planner.h +4 -0
  99. xmos_ai_tools/runtime/include/tensorflow/lite/micro/memory_planner/non_persistent_buffer_planner_shim.h +4 -0
  100. xmos_ai_tools/runtime/include/tensorflow/lite/micro/micro_allocator.h +23 -8
  101. xmos_ai_tools/runtime/include/tensorflow/lite/micro/micro_common.h +38 -0
  102. xmos_ai_tools/runtime/include/tensorflow/lite/micro/micro_context.h +23 -65
  103. xmos_ai_tools/runtime/include/tensorflow/lite/micro/micro_graph.h +15 -57
  104. xmos_ai_tools/runtime/include/tensorflow/lite/micro/micro_interpreter.h +16 -5
  105. xmos_ai_tools/runtime/include/tensorflow/lite/micro/micro_interpreter_context.h +125 -0
  106. xmos_ai_tools/runtime/include/tensorflow/lite/micro/micro_interpreter_graph.h +110 -0
  107. xmos_ai_tools/runtime/include/tensorflow/lite/micro/micro_log.h +6 -8
  108. xmos_ai_tools/runtime/include/tensorflow/lite/micro/micro_mutable_op_resolver.h +114 -32
  109. xmos_ai_tools/runtime/include/tensorflow/lite/micro/micro_op_resolver.h +6 -5
  110. xmos_ai_tools/runtime/include/tensorflow/lite/micro/micro_profiler.h +1 -1
  111. xmos_ai_tools/runtime/include/tensorflow/lite/micro/mock_micro_graph.h +1 -1
  112. xmos_ai_tools/runtime/include/tensorflow/lite/micro/python/interpreter/src/python_ops_resolver.h +21 -0
  113. xmos_ai_tools/runtime/include/tensorflow/lite/micro/test_helper_custom_ops.h +3 -4
  114. xmos_ai_tools/runtime/include/tensorflow/lite/micro/test_helpers.h +28 -12
  115. xmos_ai_tools/runtime/include/tensorflow/lite/micro/testing/micro_test.h +1 -0
  116. xmos_ai_tools/runtime/include/tensorflow/lite/micro/tools/benchmarking/log_utils.h +273 -0
  117. xmos_ai_tools/runtime/include/tensorflow/lite/micro/tools/benchmarking/metrics.h +41 -0
  118. xmos_ai_tools/runtime/include/tensorflow/lite/micro/tools/benchmarking/op_resolver.h +127 -0
  119. xmos_ai_tools/runtime/include/tensorflow/lite/schema/schema_generated.h +9139 -5010
  120. xmos_ai_tools/runtime/lib/libhost_xtflitemicro.a +0 -0
  121. xmos_ai_tools/runtime/lib/libxtflitemicro.a +0 -0
  122. xmos_ai_tools/xinterpreters/libs/macos/xtflm_python.1.0.1.dylib +0 -0
  123. xmos_ai_tools/xinterpreters/libs/macos/xtflm_python.dylib +0 -0
  124. {xmos_ai_tools-1.1.2.dev216.data → xmos_ai_tools-1.1.2.dev236.data}/data/bin/xcore-opt +0 -0
  125. {xmos_ai_tools-1.1.2.dev216.dist-info → xmos_ai_tools-1.1.2.dev236.dist-info}/METADATA +3 -4
  126. {xmos_ai_tools-1.1.2.dev216.dist-info → xmos_ai_tools-1.1.2.dev236.dist-info}/RECORD +128 -105
  127. {xmos_ai_tools-1.1.2.dev216.dist-info → xmos_ai_tools-1.1.2.dev236.dist-info}/WHEEL +1 -1
  128. xmos_ai_tools/runtime/include/tensorflow/lite/core/api/op_resolver.h +0 -129
  129. xmos_ai_tools/runtime/include/tensorflow/lite/micro/all_ops_resolver.h +0 -38
  130. xmos_ai_tools/runtime/include/tensorflow/lite/micro/examples/micro_speech/audio_provider.h +0 -44
  131. xmos_ai_tools/runtime/include/tensorflow/lite/micro/examples/micro_speech/command_responder.h +0 -30
  132. xmos_ai_tools/runtime/include/tensorflow/lite/micro/examples/micro_speech/feature_provider.h +0 -50
  133. xmos_ai_tools/runtime/include/tensorflow/lite/micro/examples/micro_speech/micro_features/micro_features_generator.h +0 -30
  134. xmos_ai_tools/runtime/include/tensorflow/lite/micro/examples/micro_speech/micro_features/micro_model_settings.h +0 -43
  135. xmos_ai_tools/runtime/include/tensorflow/lite/micro/examples/micro_speech/micro_features/no_feature_data_slice.h +0 -29
  136. xmos_ai_tools/runtime/include/tensorflow/lite/micro/examples/micro_speech/micro_features/yes_feature_data_slice.h +0 -29
  137. xmos_ai_tools/runtime/include/tensorflow/lite/micro/examples/micro_speech/recognize_commands.h +0 -151
  138. xmos_ai_tools/runtime/include/tensorflow/lite/micro/examples/micro_speech/simple_features/no_power_spectrum_data.h +0 -29
  139. xmos_ai_tools/runtime/include/tensorflow/lite/micro/examples/micro_speech/simple_features/simple_features_generator.h +0 -29
  140. xmos_ai_tools/runtime/include/tensorflow/lite/micro/examples/micro_speech/simple_features/simple_model_settings.h +0 -43
  141. xmos_ai_tools/runtime/include/tensorflow/lite/micro/examples/micro_speech/simple_features/yes_power_spectrum_data.h +0 -29
  142. xmos_ai_tools/runtime/include/tensorflow/lite/micro/examples/micro_speech/simple_features/yes_simple_features_data.h +0 -23
  143. xmos_ai_tools/runtime/include/tensorflow/lite/micro/micro_string.h +0 -33
  144. xmos_ai_tools/runtime/include/tensorflow/lite/micro/python/interpreter/src/interpreter_wrapper.h +0 -51
  145. xmos_ai_tools/runtime/include/tensorflow/lite/micro/python/interpreter/src/pybind11_lib.h +0 -64
  146. xmos_ai_tools/runtime/include/tensorflow/lite/micro/python/interpreter/src/shared_library.h +0 -40
  147. {xmos_ai_tools-1.1.2.dev216.dist-info → xmos_ai_tools-1.1.2.dev236.dist-info}/top_level.txt +0 -0
@@ -20,6 +20,7 @@ limitations under the License.
20
20
  #ifndef TENSORFLOW_LITE_CORE_C_BUILTIN_OP_DATA_H_
21
21
  #define TENSORFLOW_LITE_CORE_C_BUILTIN_OP_DATA_H_
22
22
 
23
+ #include <stdbool.h>
23
24
  #include <stdint.h>
24
25
 
25
26
  #include "tensorflow/lite/core/c/common.h"
@@ -31,6 +32,8 @@ extern "C" {
31
32
  // TfLiteReshapeParams can't have dynamic data so we fix the maximum possible
32
33
  // number of dimensions.
33
34
  #define TFLITE_RESHAPE_PARAMS_MAX_DIMENSION_COUNT 8
35
+ #define TFLITE_STABLEHLO_SCATTER_PARAMS_MAX_DIMENSION_COUNT 8
36
+ #define TFLITE_STABLEHLO_GATHER_PARAMS_MAX_DIMENSION_COUNT 8
34
37
 
35
38
  // TODO(aselle): Consider using "if this then that" for testing.
36
39
 
@@ -89,6 +92,10 @@ typedef struct {
89
92
  // Note: Version 2 supports dilation values not equal to 1.
90
93
  int dilation_width_factor;
91
94
  int dilation_height_factor;
95
+
96
+ // Parameters for CONV_2D version 7 or above.
97
+ // Used to determine the default value for the quantized bias.
98
+ TfLiteType quantized_bias_type;
92
99
  } TfLiteConvParams;
93
100
 
94
101
  typedef struct {
@@ -166,7 +173,7 @@ typedef struct {
166
173
  TfLiteFusedActivation activation;
167
174
  bool merge_outputs;
168
175
 
169
- // Parameter for Bidirectional RNN verison 3.
176
+ // Parameter for Bidirectional RNN version 3.
170
177
  bool asymmetric_quantize_inputs;
171
178
  } TfLiteBidirectionalSequenceRNNParams;
172
179
 
@@ -192,6 +199,10 @@ typedef struct {
192
199
  // If set to true and the weights are quantized, then non constant inputs
193
200
  // are quantized at evaluation time with asymmetric quantization.
194
201
  bool asymmetric_quantize_inputs;
202
+
203
+ // Parameters for FullyConnected version 10 or above.
204
+ // Used to determine the default value for the quantized bias.
205
+ TfLiteType quantized_bias_type;
195
206
  } TfLiteFullyConnectedParams;
196
207
 
197
208
  typedef enum {
@@ -340,7 +351,7 @@ typedef struct {
340
351
  // These fields are only used in old models for backward compatibility.
341
352
  // In the current implementation, we use the 2nd input of the op as the shape,
342
353
  // and these fields are unused.
343
- int shape[TFLITE_RESHAPE_PARAMS_MAX_DIMENSION_COUNT];
354
+ int32_t shape[TFLITE_RESHAPE_PARAMS_MAX_DIMENSION_COUNT];
344
355
  int num_dimensions;
345
356
  } TfLiteReshapeParams;
346
357
 
@@ -397,7 +408,7 @@ typedef struct {
397
408
  typedef struct {
398
409
  // TODO(ahentz): We can't have dynamic data in this struct, at least not yet.
399
410
  // For now we will fix the maximum possible number of dimensions.
400
- int squeeze_dims[8];
411
+ int32_t squeeze_dims[8];
401
412
  int num_squeeze_dims;
402
413
  } TfLiteSqueezeParams;
403
414
 
@@ -407,6 +418,10 @@ typedef struct {
407
418
  int ellipsis_mask;
408
419
  int new_axis_mask;
409
420
  int shrink_axis_mask;
421
+
422
+ // Parameters supported by version 8:
423
+ // If true, then the end tensor is an offset of the begin tensor.
424
+ bool offset;
410
425
  } TfLiteStridedSliceParams;
411
426
 
412
427
  typedef struct {
@@ -425,6 +440,10 @@ typedef struct {
425
440
 
426
441
  // Parameters supported by version 4:
427
442
  TfLiteFusedActivation activation;
443
+
444
+ // Parameters for TransposeConv version 5 or above.
445
+ // Used to determine the default value for the quantized bias.
446
+ TfLiteType quantized_bias_type;
428
447
  } TfLiteTransposeConvParams;
429
448
 
430
449
  typedef struct {
@@ -530,6 +549,76 @@ typedef struct {
530
549
  bool approximate;
531
550
  } TfLiteGeluParams;
532
551
 
552
+ typedef struct {
553
+ int64_t dimension;
554
+ } TfLiteStablehloConcatenateParams;
555
+
556
+ typedef struct {
557
+ // See the stablehlo spec for the explanation of the attributes:
558
+ // https://github.com/openxla/stablehlo/blob/main/docs/spec.md#scatter
559
+ bool indices_are_sorted;
560
+ int64_t
561
+ update_window_dims[TFLITE_STABLEHLO_SCATTER_PARAMS_MAX_DIMENSION_COUNT];
562
+ int num_update_window_dims;
563
+ int64_t
564
+ inserted_window_dims[TFLITE_STABLEHLO_SCATTER_PARAMS_MAX_DIMENSION_COUNT];
565
+ int num_inserted_window_dims;
566
+ int64_t scatter_dims_to_operand_dims
567
+ [TFLITE_STABLEHLO_SCATTER_PARAMS_MAX_DIMENSION_COUNT];
568
+ int num_scatter_dims_to_operand_dims;
569
+ int64_t index_vector_dim;
570
+ bool unique_indices;
571
+ int update_computation_subgraph_index;
572
+ } TfLiteStablehloScatterParams;
573
+
574
+ typedef enum {
575
+ kTfLiteRngAlgorithmUnknown = 0,
576
+ // An algorithm auto-selected by the system according to device type.
577
+ kTfLiteRngAlgorithmDefault,
578
+ // The Philox algorithm, as described in paper
579
+ // ['Parallel Random Numbers: As Easy as 1, 2, 3']
580
+ // (https://www.thesalmons.org/john/random123/papers/random123sc11.pdf)
581
+ kTfLiteRngAlgorithmPhilox,
582
+ // The ThreeFry algorithm, as described in paper
583
+ // ['Parallel Random Numbers: As Easy as 1, 2, 3']
584
+ // (https://www.thesalmons.org/john/random123/papers/random123sc11.pdf)
585
+ kTfLiteRngAlgorithmThreefry,
586
+ } TfLiteRngAlgorithm;
587
+
588
+ typedef struct {
589
+ TfLiteRngAlgorithm algorithm;
590
+ } TfLiteStablehloRngBitGeneratorParams;
591
+
592
+ typedef struct {
593
+ // See the stablehlo spec for the explanation of the attributes:
594
+ // https://github.com/openxla/stablehlo/blob/main/docs/spec.md#gather
595
+ int64_t offset_dims[TFLITE_STABLEHLO_GATHER_PARAMS_MAX_DIMENSION_COUNT];
596
+ int num_offset_dims;
597
+ int64_t
598
+ collapsed_slice_dims[TFLITE_STABLEHLO_GATHER_PARAMS_MAX_DIMENSION_COUNT];
599
+ int num_collapsed_slice_dims;
600
+ int64_t start_index_map[TFLITE_STABLEHLO_GATHER_PARAMS_MAX_DIMENSION_COUNT];
601
+ int num_start_index_map;
602
+ int64_t index_vector_dim;
603
+ int64_t slice_sizes[TFLITE_STABLEHLO_GATHER_PARAMS_MAX_DIMENSION_COUNT];
604
+ int num_slice_sizes;
605
+ bool indices_are_sorted;
606
+ } TfLiteStablehloGatherParams;
607
+
608
+ enum TfLiteReduceWindowFunction {
609
+ TfLiteReduceWindowFunctionUnsupported,
610
+ TfLiteReduceWindowFunctionAdd,
611
+ TfLiteReduceWindowFunctionMul,
612
+ TfLiteReduceWindowFunctionMin,
613
+ TfLiteReduceWindowFunctionMax,
614
+ TfLiteReduceWindowFunctionAll,
615
+ TfLiteReduceWindowFunctionAny
616
+ };
617
+
618
+ typedef struct {
619
+ enum TfLiteReduceWindowFunction reduce_function;
620
+ } TfLiteReduceWindowParams;
621
+
533
622
  #ifdef __cplusplus
534
623
  } // extern "C"
535
624
  #endif // __cplusplus
@@ -13,14 +13,17 @@ See the License for the specific language governing permissions and
13
13
  limitations under the License.
14
14
  ==============================================================================*/
15
15
 
16
- // This file declares types used by the pure C inference API defined in c_api.h,
17
- // some of which are also used in the C++ and C kernel and interpreter APIs.
16
+ /// This file declares types used by the pure C inference API defined in
17
+ /// c_api.h, some of which are also used in the C++ and C kernel and interpreter
18
+ /// APIs.
18
19
 
19
- /// WARNING: Users of TensorFlow Lite should not include this file directly,
20
- /// but should instead include
21
- /// "third_party/tensorflow/lite/c/c_api_types.h".
22
- /// Only the TensorFlow Lite implementation itself should include this
23
- /// file directly.
20
+ // WARNING: Users of TensorFlow Lite should not include this file directly,
21
+ // but should instead include
22
+ // "third_party/tensorflow/lite/c/c_api_types.h".
23
+ // Only the TensorFlow Lite implementation itself should include this
24
+ // file directly.
25
+
26
+ // IWYU pragma: private, include "third_party/tensorflow/lite/c/c_api_types.h"
24
27
 
25
28
  #ifndef TENSORFLOW_LITE_CORE_C_C_API_TYPES_H_
26
29
  #define TENSORFLOW_LITE_CORE_C_C_API_TYPES_H_
@@ -31,6 +34,10 @@ limitations under the License.
31
34
  extern "C" {
32
35
  #endif
33
36
 
37
+ /** \addtogroup c_api_types tensorflow/lite/c/c_api_types.h
38
+ * @{
39
+ */
40
+
34
41
  // Define TFL_CAPI_EXPORT macro to export a function properly with a shared
35
42
  // library.
36
43
  #ifdef SWIG
@@ -49,50 +56,51 @@ extern "C" {
49
56
  #endif // _WIN32
50
57
  #endif // SWIG
51
58
 
52
- // Note that new error status values may be added in future in order to
53
- // indicate more fine-grained internal states, therefore, applications should
54
- // not rely on status values being members of the enum.
59
+ /// Note that new error status values may be added in future in order to
60
+ /// indicate more fine-grained internal states, therefore, applications should
61
+ /// not rely on status values being members of the enum.
55
62
  typedef enum TfLiteStatus {
63
+ /// Success
56
64
  kTfLiteOk = 0,
57
65
 
58
- // Generally referring to an error in the runtime (i.e. interpreter)
66
+ /// Generally referring to an error in the runtime (i.e. interpreter)
59
67
  kTfLiteError = 1,
60
68
 
61
- // Generally referring to an error from a TfLiteDelegate itself.
69
+ /// Generally referring to an error from a TfLiteDelegate itself.
62
70
  kTfLiteDelegateError = 2,
63
71
 
64
- // Generally referring to an error in applying a delegate due to
65
- // incompatibility between runtime and delegate, e.g., this error is returned
66
- // when trying to apply a TF Lite delegate onto a model graph that's already
67
- // immutable.
72
+ /// Generally referring to an error in applying a delegate due to
73
+ /// incompatibility between runtime and delegate, e.g., this error is returned
74
+ /// when trying to apply a TF Lite delegate onto a model graph that's already
75
+ /// immutable.
68
76
  kTfLiteApplicationError = 3,
69
77
 
70
- // Generally referring to serialized delegate data not being found.
71
- // See tflite::delegates::Serialization.
78
+ /// Generally referring to serialized delegate data not being found.
79
+ /// See tflite::delegates::Serialization.
72
80
  kTfLiteDelegateDataNotFound = 4,
73
81
 
74
- // Generally referring to data-writing issues in delegate serialization.
75
- // See tflite::delegates::Serialization.
82
+ /// Generally referring to data-writing issues in delegate serialization.
83
+ /// See tflite::delegates::Serialization.
76
84
  kTfLiteDelegateDataWriteError = 5,
77
85
 
78
- // Generally referring to data-reading issues in delegate serialization.
79
- // See tflite::delegates::Serialization.
86
+ /// Generally referring to data-reading issues in delegate serialization.
87
+ /// See tflite::delegates::Serialization.
80
88
  kTfLiteDelegateDataReadError = 6,
81
89
 
82
- // Generally referring to issues when the TF Lite model has ops that cannot be
83
- // resolved at runtime. This could happen when the specific op is not
84
- // registered or built with the TF Lite framework.
90
+ /// Generally referring to issues when the TF Lite model has ops that cannot
91
+ /// be resolved at runtime. This could happen when the specific op is not
92
+ /// registered or built with the TF Lite framework.
85
93
  kTfLiteUnresolvedOps = 7,
86
94
 
87
- // Generally referring to invocation cancelled by the user.
88
- // See `interpreter::Cancel`.
95
+ /// Generally referring to invocation cancelled by the user.
96
+ /// See `interpreter::Cancel`.
89
97
  // TODO(b/194915839): Implement `interpreter::Cancel`.
90
98
  // TODO(b/250636993): Cancellation triggered by `SetCancellationFunction`
91
99
  // should also return this status code.
92
100
  kTfLiteCancelled = 8,
93
101
  } TfLiteStatus;
94
102
 
95
- // Types supported by tensor
103
+ /// Types supported by tensor
96
104
  typedef enum {
97
105
  kTfLiteNoType = 0,
98
106
  kTfLiteFloat32 = 1,
@@ -115,12 +123,12 @@ typedef enum {
115
123
  kTfLiteInt4 = 18,
116
124
  } TfLiteType;
117
125
 
118
- // Legacy. Will be deprecated in favor of TfLiteAffineQuantization.
119
- // If per-layer quantization is specified this field will still be populated in
120
- // addition to TfLiteAffineQuantization.
121
- // Parameters for asymmetric quantization. Quantized values can be converted
122
- // back to float using:
123
- // real_value = scale * (quantized_value - zero_point)
126
+ /// Legacy. Will be deprecated in favor of TfLiteAffineQuantization.
127
+ /// If per-layer quantization is specified this field will still be populated in
128
+ /// addition to TfLiteAffineQuantization.
129
+ /// Parameters for asymmetric quantization. Quantized values can be converted
130
+ /// back to float using:
131
+ /// real_value = scale * (quantized_value - zero_point)
124
132
  typedef struct TfLiteQuantizationParams {
125
133
  float scale;
126
134
  int32_t zero_point;
@@ -129,39 +137,41 @@ typedef struct TfLiteQuantizationParams {
129
137
  // --------------------------------------------------------------------------
130
138
  // Opaque types used by c_api.h, c_api_opaque.h and common.h.
131
139
 
132
- // TfLiteOpaqueContext is an opaque version of TfLiteContext;
140
+ /// TfLiteOpaqueContext is an opaque version of TfLiteContext;
133
141
  typedef struct TfLiteOpaqueContext TfLiteOpaqueContext;
134
142
 
135
- // TfLiteOpaqueNode is an opaque version of TfLiteNode;
143
+ /// TfLiteOpaqueNode is an opaque version of TfLiteNode;
136
144
  typedef struct TfLiteOpaqueNode TfLiteOpaqueNode;
137
145
 
138
- // TfLiteOpaqueTensor is an opaque version of TfLiteTensor;
146
+ /// TfLiteOpaqueTensor is an opaque version of TfLiteTensor;
139
147
  typedef struct TfLiteOpaqueTensor TfLiteOpaqueTensor;
140
148
 
141
- // TfLiteDelegate: allows delegation of nodes to alternative backends.
142
- // Forward declaration of concrete type declared in common.h.
149
+ /// TfLiteDelegate: allows delegation of nodes to alternative backends.
150
+ /// Forward declaration of concrete type declared in common.h.
143
151
  typedef struct TfLiteDelegate TfLiteDelegate;
144
152
 
145
- // TfLiteOpaqueDelegateStruct: unconditionally opaque version of
146
- // TfLiteDelegate; allows delegation of nodes to alternative backends.
147
- //
148
- // This is an abstract type that is intended to have the same
149
- // role as TfLiteDelegate, but without exposing the implementation
150
- // details of how delegates are implemented.
151
- // WARNING: This is an experimental type and subject to change.
153
+ /// TfLiteOpaqueDelegateStruct: unconditionally opaque version of
154
+ /// TfLiteDelegate; allows delegation of nodes to alternative backends.
155
+ ///
156
+ /// This is an abstract type that is intended to have the same
157
+ /// role as TfLiteDelegate, but without exposing the implementation
158
+ /// details of how delegates are implemented.
159
+ /// WARNING: This is an experimental type and subject to change.
152
160
  typedef struct TfLiteOpaqueDelegateStruct TfLiteOpaqueDelegateStruct;
153
161
 
154
- // TfLiteOpaqueDelegate: conditionally opaque version of
155
- // TfLiteDelegate; allows delegation of nodes to alternative backends.
156
- // For TF Lite in Play Services, this is an opaque type,
157
- // but for regular TF Lite, this is just a typedef for TfLiteDelegate.
158
- // WARNING: This is an experimental type and subject to change.
162
+ /// TfLiteOpaqueDelegate: conditionally opaque version of
163
+ /// TfLiteDelegate; allows delegation of nodes to alternative backends.
164
+ /// For TF Lite in Play Services, this is an opaque type,
165
+ /// but for regular TF Lite, this is just a typedef for TfLiteDelegate.
166
+ /// WARNING: This is an experimental type and subject to change.
159
167
  #if TFLITE_WITH_STABLE_ABI || TFLITE_USE_OPAQUE_DELEGATE
160
168
  typedef TfLiteOpaqueDelegateStruct TfLiteOpaqueDelegate;
161
169
  #else
162
170
  typedef TfLiteDelegate TfLiteOpaqueDelegate;
163
171
  #endif
164
172
 
173
+ /** @} */
174
+
165
175
  #ifdef __cplusplus
166
176
  } // extern C
167
177
  #endif