Disable linter warnings.

PiperOrigin-RevId: 330637129
Change-Id: Ic473d6527a6f61591b4afdc8e2a8cb9a29100fff
This commit is contained in:
Robert David 2020-09-08 19:26:56 -07:00 committed by TensorFlower Gardener
parent ad66f588c1
commit ba7e0b1848

View File

@ -105,6 +105,7 @@ inline std::vector<float> Dequantize(const std::vector<T>& data, float scale,
// the actual data is known. This mimics what happens in practice: quantization // the actual data is known. This mimics what happens in practice: quantization
// parameters are calculated during training or post training.. // parameters are calculated during training or post training..
struct TensorData { struct TensorData {
// NOLINTNEXTLINE
TensorData(TensorType type = TensorType_FLOAT32, std::vector<int> shape = {}, TensorData(TensorType type = TensorType_FLOAT32, std::vector<int> shape = {},
float min = 0.0f, float max = 0.0f, float scale = 0.0f, float min = 0.0f, float max = 0.0f, float scale = 0.0f,
int32_t zero_point = 0, bool per_channel_quantization = false, int32_t zero_point = 0, bool per_channel_quantization = false,
@ -933,7 +934,9 @@ struct TypeUnion;
template <> template <>
struct TypeUnion<float> { struct TypeUnion<float> {
public: public:
// NOLINTNEXTLINE
static constexpr TensorType tensor_type = TensorType::TensorType_FLOAT32; static constexpr TensorType tensor_type = TensorType::TensorType_FLOAT32;
// NOLINTNEXTLINE
static constexpr TfLiteType tflite_type = TfLiteType::kTfLiteFloat32; static constexpr TfLiteType tflite_type = TfLiteType::kTfLiteFloat32;
typedef float ScalarType; typedef float ScalarType;
}; };
@ -941,7 +944,9 @@ struct TypeUnion<float> {
template <> template <>
struct TypeUnion<int32_t> { struct TypeUnion<int32_t> {
public: public:
// NOLINTNEXTLINE
static constexpr TensorType tensor_type = TensorType::TensorType_INT32; static constexpr TensorType tensor_type = TensorType::TensorType_INT32;
// NOLINTNEXTLINE
static constexpr TfLiteType tflite_type = TfLiteType::kTfLiteInt32; static constexpr TfLiteType tflite_type = TfLiteType::kTfLiteInt32;
typedef int32_t ScalarType; typedef int32_t ScalarType;
}; };
@ -949,7 +954,9 @@ struct TypeUnion<int32_t> {
template <> template <>
struct TypeUnion<int16_t> { struct TypeUnion<int16_t> {
public: public:
// NOLINTNEXTLINE
static constexpr TensorType tensor_type = TensorType::TensorType_INT16; static constexpr TensorType tensor_type = TensorType::TensorType_INT16;
// NOLINTNEXTLINE
static constexpr TfLiteType tflite_type = TfLiteType::kTfLiteInt16; static constexpr TfLiteType tflite_type = TfLiteType::kTfLiteInt16;
typedef int16_t ScalarType; typedef int16_t ScalarType;
}; };
@ -957,7 +964,9 @@ struct TypeUnion<int16_t> {
template <> template <>
struct TypeUnion<int8_t> { struct TypeUnion<int8_t> {
public: public:
// NOLINTNEXTLINE
static constexpr TensorType tensor_type = TensorType::TensorType_INT8; static constexpr TensorType tensor_type = TensorType::TensorType_INT8;
// NOLINTNEXTLINE
static constexpr TfLiteType tflite_type = TfLiteType::kTfLiteInt8; static constexpr TfLiteType tflite_type = TfLiteType::kTfLiteInt8;
typedef int8_t ScalarType; typedef int8_t ScalarType;
}; };
@ -965,7 +974,9 @@ struct TypeUnion<int8_t> {
template <> template <>
struct TypeUnion<uint8_t> { struct TypeUnion<uint8_t> {
public: public:
// NOLINTNEXTLINE
static constexpr TensorType tensor_type = TensorType::TensorType_UINT8; static constexpr TensorType tensor_type = TensorType::TensorType_UINT8;
// NOLINTNEXTLINE
static constexpr TfLiteType tflite_type = TfLiteType::kTfLiteUInt8; static constexpr TfLiteType tflite_type = TfLiteType::kTfLiteUInt8;
typedef uint8_t ScalarType; typedef uint8_t ScalarType;
}; };