#ifndef TENSORFLOW_LITE_KERNELS_INTERNAL_TYPES_H_
#define TENSORFLOW_LITE_KERNELS_INTERNAL_TYPES_H_
#include <algorithm>
#include <cstdint>
#include <cstring>
#include <initializer_list>
#include "tensorflow/lite/kernels/internal/compatibility.h"
#include "tensorflow/lite/kernels/internal/runtime_shape.h"
namespace tflite {
enum class FusedActivationFunctionType : uint8_t { … };
enum class PaddingType : uint8_t { … };
struct PaddingValues { … };
struct Padding3DValues { … };
enum class FullyConnectedWeightsFormat : uint8_t { … };
struct QuantizationParams { … };
inline bool operator==(const QuantizationParams& qp1,
const QuantizationParams& qp2) { … }
struct PerChannelQuantizationParams { … };
template <typename IndexType = int>
inline bool NextIndex(const int num_dims, const int* dims, IndexType* current) { … }
inline size_t ReducedOutputOffset(const int num_dims, const int* dims,
const int* index, const int num_axis,
const int* axis) { … }
inline int Offset(const Dims<4>& dims, int i0, int i1, int i2, int i3) { … }
inline int Offset(const Dims<4>& dims, int* index) { … }
template <int N>
int ArraySize(const Dims<N>& array, int index) { … }
template <typename ArrayType1, typename ArrayType2>
int MatchingArraySize(const ArrayType1& array1, int index1,
const ArrayType2& array2, int index2) { … }
template <typename ArrayType1, typename ArrayType2, typename... Args>
int MatchingArraySize(const ArrayType1& array1, int index1,
const ArrayType2& array2, int index2, Args... args) { … }
inline int MatchingDim(const RuntimeShape& shape1, int index1,
const RuntimeShape& shape2, int index2) { … }
template <typename... Args>
int MatchingDim(const RuntimeShape& shape1, int index1,
const RuntimeShape& shape2, int index2, Args... args) { … }
template <int N>
inline int FlatSize(const Dims<N>& dims) { … }
TFLITE_DEPRECATED("Prefer FlatSize.")
inline int RequiredBufferSizeForDims(const Dims<4>& dims) { … }
inline int MatchingElementsSize(const RuntimeShape& shape,
const RuntimeShape& check_shape_0) { … }
inline int MatchingElementsSize(const RuntimeShape& shape,
const RuntimeShape& check_shape_0,
const RuntimeShape& check_shape_1) { … }
inline int MatchingFlatSize(const RuntimeShape& shape,
const RuntimeShape& check_shape_0) { … }
inline int MatchingFlatSize(const RuntimeShape& shape,
const RuntimeShape& check_shape_0,
const RuntimeShape& check_shape_1) { … }
inline int MatchingFlatSize(const RuntimeShape& shape,
const RuntimeShape& check_shape_0,
const RuntimeShape& check_shape_1,
const RuntimeShape& check_shape_2) { … }
inline int MatchingFlatSize(const RuntimeShape& shape,
const RuntimeShape& check_shape_0,
const RuntimeShape& check_shape_1,
const RuntimeShape& check_shape_2,
const RuntimeShape& check_shape_3) { … }
template <int N>
inline int MatchingFlatSize(const Dims<N>& dims, const Dims<N>& check_dims_0) { … }
template <int N>
inline int MatchingFlatSize(const Dims<N>& dims, const Dims<N>& check_dims_0,
const Dims<N>& check_dims_1) { … }
template <int N>
inline int MatchingFlatSize(const Dims<N>& dims, const Dims<N>& check_dims_0,
const Dims<N>& check_dims_1,
const Dims<N>& check_dims_2) { … }
template <int N>
inline int MatchingFlatSize(const Dims<N>& dims, const Dims<N>& check_dims_0,
const Dims<N>& check_dims_1,
const Dims<N>& check_dims_2,
const Dims<N>& check_dims_3) { … }
inline int MatchingExtendedShapeFlatSize(const RuntimeShape& shape,
const RuntimeShape& check_shape_0) { … }
inline int MatchingExtendedShapeFlatSize(const RuntimeShape& shape,
const RuntimeShape& check_shape_0,
const RuntimeShape& check_shape_1) { … }
inline int MatchingExtendedShapeFlatSize(const RuntimeShape& shape,
const RuntimeShape& check_shape_0,
const RuntimeShape& check_shape_1,
const RuntimeShape& check_shape_2) { … }
inline int MatchingExtendedShapeFlatSize(const RuntimeShape& shape,
const RuntimeShape& check_shape_0,
const RuntimeShape& check_shape_1,
const RuntimeShape& check_shape_2,
const RuntimeShape& check_shape_3) { … }
template <int N>
inline int FlatSizeSkipDim(const Dims<N>& dims, int skip_dim) { … }
template <int N>
inline int MatchingFlatSizeSkipDim(const Dims<N>& dims, int skip_dim,
const Dims<N>& check_dims_0) { … }
template <int N>
inline int MatchingFlatSizeSkipDim(const Dims<N>& dims, int skip_dim,
const Dims<N>& check_dims_0,
const Dims<N>& check_dims_1) { … }
template <int N>
inline int MatchingFlatSizeSkipDim(const Dims<N>& dims, int skip_dim,
const Dims<N>& check_dims_0,
const Dims<N>& check_dims_1,
const Dims<N>& check_dims_2) { … }
template <int N>
inline int MatchingFlatSizeSkipDim(const Dims<N>& dims, int skip_dim,
const Dims<N>& check_dims_0,
const Dims<N>& check_dims_1,
const Dims<N>& check_dims_2,
const Dims<N>& check_dims_3) { … }
inline int FlatSizeSkipDim(const RuntimeShape& shape, int skip_dim) { … }
inline int MatchingFlatSizeSkipDim(const RuntimeShape& shape, int skip_dim,
const RuntimeShape& check_shape_0) { … }
inline int MatchingFlatSizeSkipDim(const RuntimeShape& shape, int skip_dim,
const RuntimeShape& check_shape_0,
const RuntimeShape& check_shape_1) { … }
inline int MatchingFlatSizeSkipDim(const RuntimeShape& shape, int skip_dim,
const RuntimeShape& check_shape_0,
const RuntimeShape& check_shape_1,
const RuntimeShape& check_shape_2) { … }
inline int MatchingFlatSizeSkipDim(const RuntimeShape& shape, int skip_dim,
const RuntimeShape& check_shape_0,
const RuntimeShape& check_shape_1,
const RuntimeShape& check_shape_2,
const RuntimeShape& check_shape_3) { … }
template <int N>
bool IsPackedWithoutStrides(const Dims<N>& dims) { … }
template <int N>
void ComputeStrides(Dims<N>* dims) { … }
enum class BroadcastableOpCategory : uint8_t { … };
struct MinMax { … };
static_assert …;
struct ActivationParams { … };
struct ReluParams : public ActivationParams { … };
enum class ResizingCategory : uint8_t { … };
struct ArithmeticParams { … };
struct ConcatenationParams { … };
struct ComparisonParams { … };
struct ConvParams { … };
struct Conv3DParams { … };
Conv3DTransposeParams;
struct DepthToSpaceParams { … };
struct DepthwiseParams { … };
struct DequantizationParams { … };
struct PerChannelDequantizationParams { … };
struct FakeQuantParams { … };
struct FullyConnectedParams { … };
struct GatherParams { … };
struct L2NormalizationParams { … };
struct LocalResponseNormalizationParams { … };
struct HardSwishParams { … };
struct LogisticParams { … };
struct LstmCellParams { … };
struct MeanParams { … };
struct PackParams { … };
struct PadParams { … };
struct PreluParams { … };
struct PoolParams { … };
struct ReshapeParams { … };
struct ResizeBilinearParams { … };
struct ResizeNearestNeighborParams { … };
struct SliceParams { … };
struct SoftmaxParams { … };
struct SpaceToBatchParams { … };
struct SpaceToDepthParams { … };
struct SplitParams { … };
struct SqueezeParams { … };
struct StridedSliceParams { … };
struct TanhParams { … };
constexpr int kTransposeMaxDimensions = …;
struct TransposeParams { … };
struct UnpackParams { … };
struct LeakyReluParams { … };
template <typename P>
inline void SetActivationParams(float min, float max, P* params) { … }
template <typename P>
inline void SetActivationParams(int32_t min, int32_t max, P* params) { … }
template <typename P>
inline void SetActivationParams(uint32_t min, uint32_t max, P* params) { … }
template <typename P>
inline void SetActivationParams(int16_t min, int16_t max, P* params) { … }
template <typename P>
inline void SetActivationParams(int64_t min, int64_t max, P* params) { … }
template <typename P>
inline void GetActivationParams(const P& params, int32_t* min, int32_t* max) { … }
template <typename P>
inline void GetActivationParams(const P& params, uint32_t* min, uint32_t* max) { … }
template <typename P>
inline void GetActivationParams(const P& params, int16_t* min, int16_t* max) { … }
template <typename P>
inline void GetActivationParams(const P& params, float* min, float* max) { … }
template <typename P>
inline void GetActivationParams(const P& params, int64_t* min, int64_t* max) { … }
template <typename T>
struct is_small_integer
: public std::integral_constant<bool,
std::is_same<T, int8_t>::value ||
std::is_same<T, uint8_t>::value ||
std::is_same<T, int16_t>::value ||
std::is_same<T, uint16_t>::value> { … };
template <typename T>
struct is_int32_or_int64
: public std::integral_constant<bool, std::is_same<T, int32_t>::value ||
std::is_same<T, int64_t>::value> { … };
}
#endif