1 /* Copyright 2019 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_BATCH_TO_SPACE_ND(); 35 TfLiteRegistration Register_CAST(); 36 TfLiteRegistration Register_CONV_2D(); 37 TfLiteRegistration Register_DEPTHWISE_CONV_2D(); 38 TfLiteRegistration Register_EXP(); 39 TfLiteRegistration Register_QUANTIZE(); 40 TfLiteRegistration Register_SHAPE(); 41 TfLiteRegistration Register_SOFTMAX(); 42 TfLiteRegistration Register_SPACE_TO_BATCH_ND(); 43 TfLiteRegistration Register_SVDF(); 44 TfLiteRegistration Register_TRANSPOSE_CONV(); 45 TfLiteRegistration Register_ZEROS_LIKE(); 46 47 namespace ops { 48 namespace micro { 49 50 TfLiteRegistration Register_ABS(); 51 TfLiteRegistration Register_ADD(); 52 TfLiteRegistration Register_ARG_MAX(); 53 TfLiteRegistration Register_ARG_MIN(); 54 TfLiteRegistration Register_AVERAGE_POOL_2D(); 55 TfLiteRegistration Register_CEIL(); 56 // TODO(b/160234179): Change custom OPs to also return by value. 57 TfLiteRegistration* Register_CIRCULAR_BUFFER(); 58 TfLiteRegistration Register_CONCATENATION(); 59 TfLiteRegistration Register_COS(); 60 TfLiteRegistration Register_DEQUANTIZE(); 61 TfLiteRegistration Register_EQUAL(); 62 TfLiteRegistration Register_FLOOR(); 63 TfLiteRegistration Register_GREATER(); 64 TfLiteRegistration Register_GREATER_EQUAL(); 65 TfLiteRegistration Register_HARD_SWISH(); 66 TfLiteRegistration Register_LESS(); 67 TfLiteRegistration Register_LESS_EQUAL(); 68 TfLiteRegistration Register_LOG(); 69 TfLiteRegistration Register_LOGICAL_AND(); 70 TfLiteRegistration Register_LOGICAL_NOT(); 71 TfLiteRegistration Register_LOGICAL_OR(); 72 TfLiteRegistration Register_LOGISTIC(); 73 TfLiteRegistration Register_MAXIMUM(); 74 TfLiteRegistration Register_MAX_POOL_2D(); 75 TfLiteRegistration Register_MEAN(); 76 TfLiteRegistration Register_MINIMUM(); 77 TfLiteRegistration Register_MUL(); 78 TfLiteRegistration Register_NEG(); 79 TfLiteRegistration Register_NOT_EQUAL(); 80 TfLiteRegistration Register_PACK(); 81 TfLiteRegistration Register_PAD(); 82 TfLiteRegistration Register_PADV2(); 83 TfLiteRegistration Register_PRELU(); 84 TfLiteRegistration Register_REDUCE_MAX(); 85 TfLiteRegistration Register_RELU(); 86 TfLiteRegistration Register_RELU6(); 87 TfLiteRegistration Register_RESHAPE(); 88 TfLiteRegistration Register_RESIZE_NEAREST_NEIGHBOR(); 89 TfLiteRegistration Register_ROUND(); 90 TfLiteRegistration Register_RSQRT(); 91 TfLiteRegistration Register_SIN(); 92 TfLiteRegistration Register_SPLIT(); 93 TfLiteRegistration Register_SPLIT_V(); 94 TfLiteRegistration Register_SQRT(); 95 TfLiteRegistration Register_SQUARE(); 96 TfLiteRegistration Register_STRIDED_SLICE(); 97 TfLiteRegistration Register_SUB(); 98 TfLiteRegistration Register_UNPACK(); 99 TfLiteRegistration Register_L2_NORMALIZATION(); 100 TfLiteRegistration Register_TANH(); 101 102 } // namespace micro 103 } // namespace ops 104 } // namespace tflite 105 106 #endif // TENSORFLOW_LITE_MICRO_KERNELS_MICRO_OPS_H_ 107