/* Copyright 2020 The TensorFlow Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ // WARNING: Users of TensorFlow Lite should not include this file directly, but // should instead include "third_party/tensorflow/lite/c/c_api_types.h". // Only the TensorFlow Lite implementation itself should include this file // directly. /// This file declares types used by the pure C inference API defined in /// c_api.h, some of which are also used in the C++ and C kernel and interpreter /// APIs. /// // clang-format off // NOLINTBEGIN(whitespace/line_length) /// \note Users of TensorFlow Lite should use /// \code /// #include "tensorflow/lite/c/c_api_types.h" /// \endcode /// to access the APIs documented on this page. // NOLINTEND(whitespace/line_length) // clang-format on // IWYU pragma: private, include "third_party/tensorflow/lite/c/c_api_types.h" #ifndef TENSORFLOW_LITE_CORE_C_C_API_TYPES_H_ #define TENSORFLOW_LITE_CORE_C_C_API_TYPES_H_ #include <stdint.h> #ifdef __cplusplus extern "C" { #endif // clang-format off // NOLINTBEGIN(whitespace/line_length) /** \defgroup c_api_types lite/c/c_api_types.h * @{ */ // NOLINTEND(whitespace/line_length) // clang-format on // Define TFL_CAPI_EXPORT macro to export a function properly with a shared // library. #ifdef SWIG #define TFL_CAPI_EXPORT #elif defined(TFL_STATIC_LIBRARY_BUILD) #define TFL_CAPI_EXPORT #else // not definded TFL_STATIC_LIBRARY_BUILD #if defined(_WIN32) #ifdef TFL_COMPILE_LIBRARY #define TFL_CAPI_EXPORT … #else #define TFL_CAPI_EXPORT … #endif // TFL_COMPILE_LIBRARY #else #define TFL_CAPI_EXPORT … #endif // _WIN32 #endif // SWIG /// Note that new error status values may be added in future in order to /// indicate more fine-grained internal states, therefore, applications should /// not rely on status values being members of the enum. TfLiteStatus; /// Types supported by tensor TfLiteType; /// Legacy. Will be deprecated in favor of `TfLiteAffineQuantization`. /// If per-layer quantization is specified this field will still be populated in /// addition to `TfLiteAffineQuantization`. /// Parameters for asymmetric quantization. Quantized values can be converted /// back to float using: `real_value = scale * (quantized_value - zero_point)` TfLiteQuantizationParams; // -------------------------------------------------------------------------- // Opaque types used by c_api.h, c_api_opaque.h and common.h. /// TfLiteOpaqueContext is an opaque version of TfLiteContext; TfLiteOpaqueContext; /// TfLiteOpaqueNode is an opaque version of TfLiteNode; TfLiteOpaqueNode; /// TfLiteOpaqueTensor is an opaque version of TfLiteTensor; TfLiteOpaqueTensor; /// TfLiteDelegate: allows delegation of nodes to alternative backends. /// Forward declaration of concrete type declared in common.h. TfLiteDelegate; /// TfLiteOpaqueDelegateStruct: unconditionally opaque version of /// TfLiteDelegate; allows delegation of nodes to alternative backends. /// /// This is an abstract type that is intended to have the same /// role as TfLiteDelegate, but without exposing the implementation /// details of how delegates are implemented. /// /// WARNING: This is an experimental type and subject to change. TfLiteOpaqueDelegateStruct; /// TfLiteOpaqueDelegate: conditionally opaque version of /// TfLiteDelegate; allows delegation of nodes to alternative backends. /// For TF Lite in Play Services, this is an opaque type, /// but for regular TF Lite, this is just a typedef for TfLiteDelegate. /// /// WARNING: This is an experimental type and subject to change. #if TFLITE_WITH_STABLE_ABI || TFLITE_USE_OPAQUE_DELEGATE typedef TfLiteOpaqueDelegateStruct TfLiteOpaqueDelegate; #else TfLiteOpaqueDelegate; #endif /** @} */ #ifdef __cplusplus } // extern C #endif #endif // TENSORFLOW_LITE_CORE_C_C_API_TYPES_H_