micro_ops.h 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. /* Copyright 2021 The TensorFlow Authors. All Rights Reserved.
  2. Licensed under the Apache License, Version 2.0 (the "License");
  3. you may not use this file except in compliance with the License.
  4. You may obtain a copy of the License at
  5. http://www.apache.org/licenses/LICENSE-2.0
  6. Unless required by applicable law or agreed to in writing, software
  7. distributed under the License is distributed on an "AS IS" BASIS,
  8. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  9. See the License for the specific language governing permissions and
  10. limitations under the License.
  11. ==============================================================================*/
  12. #ifndef TENSORFLOW_LITE_MICRO_KERNELS_MICRO_OPS_H_
  13. #define TENSORFLOW_LITE_MICRO_KERNELS_MICRO_OPS_H_
  14. #include "tensorflow/lite/c/common.h"
  15. // Forward declaration of all micro op kernel registration methods. These
  16. // registrations are included with the standard `BuiltinOpResolver`.
  17. //
  18. // This header is particularly useful in cases where only a subset of ops are
  19. // needed. In such cases, the client can selectively add only the registrations
  20. // their model requires, using a custom `(Micro)MutableOpResolver`. Selective
  21. // registration in turn allows the linker to strip unused kernels.
  22. namespace tflite {
  23. // TFLM is incrementally moving towards a flat tflite namespace
  24. // (https://abseil.io/tips/130). Any new ops (or cleanup of existing ops should
  25. // have their Register function declarations in the tflite namespace.
  26. TfLiteRegistration Register_ADD();
  27. TfLiteRegistration Register_ADD_N();
  28. TfLiteRegistration Register_ASSIGN_VARIABLE();
  29. TfLiteRegistration Register_AVERAGE_POOL_2D();
  30. TfLiteRegistration Register_BATCH_TO_SPACE_ND();
  31. TfLiteRegistration Register_BROADCAST_ARGS();
  32. TfLiteRegistration Register_BROADCAST_TO();
  33. TfLiteRegistration Register_CALL_ONCE();
  34. TfLiteRegistration Register_CAST();
  35. // TODO(b/160234179): Change custom OPs to also return by value.
  36. TfLiteRegistration* Register_CIRCULAR_BUFFER();
  37. TfLiteRegistration Register_CUMSUM();
  38. TfLiteRegistration Register_DEPTH_TO_SPACE();
  39. TfLiteRegistration Register_DEPTHWISE_CONV_2D();
  40. TfLiteRegistration Register_DEQUANTIZE();
  41. TfLiteRegistration Register_DIV();
  42. TfLiteRegistration Register_ELU();
  43. TfLiteRegistration Register_EXP();
  44. TfLiteRegistration Register_EXPAND_DIMS();
  45. TfLiteRegistration Register_FILL();
  46. TfLiteRegistration Register_FLOOR_DIV();
  47. TfLiteRegistration Register_FLOOR_MOD();
  48. TfLiteRegistration Register_GATHER();
  49. TfLiteRegistration Register_GATHER_ND();
  50. TfLiteRegistration Register_HARD_SWISH();
  51. TfLiteRegistration Register_IF();
  52. TfLiteRegistration Register_L2_POOL_2D();
  53. TfLiteRegistration Register_LEAKY_RELU();
  54. TfLiteRegistration Register_LOG_SOFTMAX();
  55. TfLiteRegistration Register_LOGICAL_AND();
  56. TfLiteRegistration Register_LOGICAL_OR();
  57. TfLiteRegistration Register_LOGISTIC();
  58. TfLiteRegistration Register_MAX_POOL_2D();
  59. TfLiteRegistration Register_MIRROR_PAD();
  60. TfLiteRegistration Register_PRELU();
  61. TfLiteRegistration Register_MUL();
  62. TfLiteRegistration Register_QUANTIZE();
  63. TfLiteRegistration Register_READ_VARIABLE();
  64. TfLiteRegistration Register_RELU();
  65. TfLiteRegistration Register_RELU6();
  66. TfLiteRegistration Register_RESIZE_BILINEAR();
  67. TfLiteRegistration Register_SHAPE();
  68. TfLiteRegistration Register_SLICE();
  69. TfLiteRegistration Register_SPACE_TO_BATCH_ND();
  70. TfLiteRegistration Register_SPACE_TO_DEPTH();
  71. TfLiteRegistration Register_SQUEEZE();
  72. TfLiteRegistration Register_SUB();
  73. TfLiteRegistration Register_SVDF();
  74. TfLiteRegistration Register_TRANSPOSE();
  75. TfLiteRegistration Register_TRANSPOSE_CONV();
  76. TfLiteRegistration Register_VAR_HANDLE();
  77. TfLiteRegistration Register_WHILE();
  78. TfLiteRegistration Register_ZEROS_LIKE();
  79. namespace ops {
  80. namespace micro {
  81. TfLiteRegistration Register_ABS();
  82. TfLiteRegistration Register_ARG_MAX();
  83. TfLiteRegistration Register_ARG_MIN();
  84. TfLiteRegistration Register_CEIL();
  85. TfLiteRegistration Register_CONCATENATION();
  86. TfLiteRegistration Register_COS();
  87. TfLiteRegistration Register_EQUAL();
  88. TfLiteRegistration Register_FLOOR();
  89. TfLiteRegistration Register_GREATER();
  90. TfLiteRegistration Register_GREATER_EQUAL();
  91. TfLiteRegistration Register_LESS();
  92. TfLiteRegistration Register_LESS_EQUAL();
  93. TfLiteRegistration Register_LOG();
  94. TfLiteRegistration Register_LOGICAL_NOT();
  95. TfLiteRegistration Register_MAXIMUM();
  96. TfLiteRegistration Register_MEAN();
  97. TfLiteRegistration Register_MINIMUM();
  98. TfLiteRegistration Register_NEG();
  99. TfLiteRegistration Register_NOT_EQUAL();
  100. TfLiteRegistration Register_PACK();
  101. TfLiteRegistration Register_PAD();
  102. TfLiteRegistration Register_PADV2();
  103. TfLiteRegistration Register_REDUCE_MAX();
  104. TfLiteRegistration Register_RESHAPE();
  105. TfLiteRegistration Register_RESIZE_NEAREST_NEIGHBOR();
  106. TfLiteRegistration Register_ROUND();
  107. TfLiteRegistration Register_RSQRT();
  108. TfLiteRegistration Register_SIN();
  109. TfLiteRegistration Register_SPLIT();
  110. TfLiteRegistration Register_SPLIT_V();
  111. TfLiteRegistration Register_SQRT();
  112. TfLiteRegistration Register_SQUARE();
  113. TfLiteRegistration Register_STRIDED_SLICE();
  114. TfLiteRegistration Register_UNIDIRECTIONAL_SEQUENCE_LSTM();
  115. TfLiteRegistration Register_UNPACK();
  116. TfLiteRegistration Register_L2_NORMALIZATION();
  117. TfLiteRegistration Register_TANH();
  118. } // namespace micro
  119. } // namespace ops
  120. } // namespace tflite
  121. #endif // TENSORFLOW_LITE_MICRO_KERNELS_MICRO_OPS_H_