1 /* Copyright 2021 The TensorFlow Authors. All Rights Reserved. 2 3 Licensed under the Apache License, Version 2.0 (the "License"); 4 you may not use this file except in compliance with the License. 5 You may obtain a copy of the License at 6 7 http://www.apache.org/licenses/LICENSE-2.0 8 9 Unless required by applicable law or agreed to in writing, software 10 distributed under the License is distributed on an "AS IS" BASIS, 11 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 See the License for the specific language governing permissions and 13 limitations under the License. 14 ==============================================================================*/ 15 #ifndef TENSORFLOW_LITE_MICRO_KERNELS_MICRO_OPS_H_ 16 #define TENSORFLOW_LITE_MICRO_KERNELS_MICRO_OPS_H_ 17 18 #include "tensorflow/lite/c/common.h" 19 20 // Forward declaration of all micro op kernel registration methods. These 21 // registrations are included with the standard `BuiltinOpResolver`. 22 // 23 // This header is particularly useful in cases where only a subset of ops are 24 // needed. In such cases, the client can selectively add only the registrations 25 // their model requires, using a custom `(Micro)MutableOpResolver`. Selective 26 // registration in turn allows the linker to strip unused kernels. 27 28 namespace tflite { 29 30 // TFLM is incrementally moving towards a flat tflite namespace 31 // (https://abseil.io/tips/130). Any new ops (or cleanup of existing ops should 32 // have their Register function declarations in the tflite namespace. 33 34 TfLiteRegistration Register_ADD_N(); 35 TfLiteRegistration Register_AVERAGE_POOL_2D(); 36 TfLiteRegistration Register_BATCH_TO_SPACE_ND(); 37 TfLiteRegistration Register_CAST(); 38 TfLiteRegistration Register_CUMSUM(); 39 TfLiteRegistration Register_DEPTH_TO_SPACE(); 40 TfLiteRegistration Register_DEPTHWISE_CONV_2D(); 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_QUANTIZE(); 60 TfLiteRegistration Register_RELU(); 61 TfLiteRegistration Register_RELU6(); 62 TfLiteRegistration Register_RESIZE_BILINEAR(); 63 TfLiteRegistration Register_SHAPE(); 64 TfLiteRegistration Register_SPACE_TO_BATCH_ND(); 65 TfLiteRegistration Register_SPACE_TO_DEPTH(); 66 TfLiteRegistration Register_SQUEEZE(); 67 TfLiteRegistration Register_SVDF(); 68 TfLiteRegistration Register_TRANSPOSE(); 69 TfLiteRegistration Register_TRANSPOSE_CONV(); 70 TfLiteRegistration Register_ZEROS_LIKE(); 71 72 namespace ops { 73 namespace micro { 74 75 TfLiteRegistration Register_ABS(); 76 TfLiteRegistration Register_ADD(); 77 TfLiteRegistration Register_ARG_MAX(); 78 TfLiteRegistration Register_ARG_MIN(); 79 TfLiteRegistration Register_CEIL(); 80 // TODO(b/160234179): Change custom OPs to also return by value. 81 TfLiteRegistration* Register_CIRCULAR_BUFFER(); 82 TfLiteRegistration Register_CONCATENATION(); 83 TfLiteRegistration Register_COS(); 84 TfLiteRegistration Register_DEQUANTIZE(); 85 TfLiteRegistration Register_EQUAL(); 86 TfLiteRegistration Register_FLOOR(); 87 TfLiteRegistration Register_GREATER(); 88 TfLiteRegistration Register_GREATER_EQUAL(); 89 TfLiteRegistration Register_LESS(); 90 TfLiteRegistration Register_LESS_EQUAL(); 91 TfLiteRegistration Register_LOG(); 92 TfLiteRegistration Register_LOGICAL_NOT(); 93 TfLiteRegistration Register_MAXIMUM(); 94 TfLiteRegistration Register_MEAN(); 95 TfLiteRegistration Register_MINIMUM(); 96 TfLiteRegistration Register_MUL(); 97 TfLiteRegistration Register_NEG(); 98 TfLiteRegistration Register_NOT_EQUAL(); 99 TfLiteRegistration Register_PACK(); 100 TfLiteRegistration Register_PAD(); 101 TfLiteRegistration Register_PADV2(); 102 TfLiteRegistration Register_PRELU(); 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_SUB(); 115 TfLiteRegistration Register_UNPACK(); 116 TfLiteRegistration Register_L2_NORMALIZATION(); 117 TfLiteRegistration Register_TANH(); 118 119 } // namespace micro 120 } // namespace ops 121 } // namespace tflite 122 123 #endif // TENSORFLOW_LITE_MICRO_KERNELS_MICRO_OPS_H_ 124