// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: MNN_compression.proto

#include "MNN_compression.pb.h"

#include <algorithm>

#include <google/protobuf/io/coded_stream.h>
#include <google/protobuf/extension_set.h>
#include <google/protobuf/wire_format_lite.h>
#include <google/protobuf/descriptor.h>
#include <google/protobuf/generated_message_reflection.h>
#include <google/protobuf/reflection_ops.h>
#include <google/protobuf/wire_format.h>
// @@protoc_insertion_point(includes)
#include <google/protobuf/port_def.inc>

PROTOBUF_PRAGMA_INIT_SEG
namespace MNN {
namespace Compression {
constexpr QuantizeParams::QuantizeParams(
  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
  : layer_()
  , round_mode_(1)
{}
struct QuantizeParamsDefaultTypeInternal {
  constexpr QuantizeParamsDefaultTypeInternal()
    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
  ~QuantizeParamsDefaultTypeInternal() {}
  union {
    QuantizeParams _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT QuantizeParamsDefaultTypeInternal _QuantizeParams_default_instance_;
constexpr LayerQuantizeParams_ActivationParams::LayerQuantizeParams_ActivationParams(
  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
  : scales_()
  , name_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
  , zero_point_(0)
  , clamp_max_(127)
  , bits_(8)
  , clamp_min_(-128){}
struct LayerQuantizeParams_ActivationParamsDefaultTypeInternal {
  constexpr LayerQuantizeParams_ActivationParamsDefaultTypeInternal()
    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
  ~LayerQuantizeParams_ActivationParamsDefaultTypeInternal() {}
  union {
    LayerQuantizeParams_ActivationParams _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT LayerQuantizeParams_ActivationParamsDefaultTypeInternal _LayerQuantizeParams_ActivationParams_default_instance_;
constexpr LayerQuantizeParams_WeightParams::LayerQuantizeParams_WeightParams(
  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
  : scales_()
  , name_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
  , clamp_max_(127)
  , bits_(8)
  , clamp_min_(-128){}
struct LayerQuantizeParams_WeightParamsDefaultTypeInternal {
  constexpr LayerQuantizeParams_WeightParamsDefaultTypeInternal()
    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
  ~LayerQuantizeParams_WeightParamsDefaultTypeInternal() {}
  union {
    LayerQuantizeParams_WeightParams _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT LayerQuantizeParams_WeightParamsDefaultTypeInternal _LayerQuantizeParams_WeightParams_default_instance_;
constexpr LayerQuantizeParams_WinogradParams::LayerQuantizeParams_WinogradParams(
  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
  : units_attr_()
  , version_(0){}
struct LayerQuantizeParams_WinogradParamsDefaultTypeInternal {
  constexpr LayerQuantizeParams_WinogradParamsDefaultTypeInternal()
    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
  ~LayerQuantizeParams_WinogradParamsDefaultTypeInternal() {}
  union {
    LayerQuantizeParams_WinogradParams _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT LayerQuantizeParams_WinogradParamsDefaultTypeInternal _LayerQuantizeParams_WinogradParams_default_instance_;
constexpr LayerQuantizeParams::LayerQuantizeParams(
  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
  : input_()
  , weight_()
  , output_()
  , wino_params_(nullptr)
  , method_(0)
{}
struct LayerQuantizeParamsDefaultTypeInternal {
  constexpr LayerQuantizeParamsDefaultTypeInternal()
    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
  ~LayerQuantizeParamsDefaultTypeInternal() {}
  union {
    LayerQuantizeParams _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT LayerQuantizeParamsDefaultTypeInternal _LayerQuantizeParams_default_instance_;
constexpr LevelPrunerParams::LevelPrunerParams(
  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
  : weight_tensor_names_()
  , prune_ratios_()
  , layer_names_(){}
struct LevelPrunerParamsDefaultTypeInternal {
  constexpr LevelPrunerParamsDefaultTypeInternal()
    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
  ~LevelPrunerParamsDefaultTypeInternal() {}
  union {
    LevelPrunerParams _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT LevelPrunerParamsDefaultTypeInternal _LevelPrunerParams_default_instance_;
constexpr SIMDOCPrunerParams::SIMDOCPrunerParams(
  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
  : weight_tensor_names_()
  , prune_ratios_()
  , layer_names_()
  , oc_blocks_(){}
struct SIMDOCPrunerParamsDefaultTypeInternal {
  constexpr SIMDOCPrunerParamsDefaultTypeInternal()
    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
  ~SIMDOCPrunerParamsDefaultTypeInternal() {}
  union {
    SIMDOCPrunerParams _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT SIMDOCPrunerParamsDefaultTypeInternal _SIMDOCPrunerParams_default_instance_;
constexpr PruneParams::PruneParams(
  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
  : level_pruner_params_(nullptr)
  , simd_oc_pruner_params_(nullptr)
  , type_(0)
{}
struct PruneParamsDefaultTypeInternal {
  constexpr PruneParamsDefaultTypeInternal()
    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
  ~PruneParamsDefaultTypeInternal() {}
  union {
    PruneParams _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PruneParamsDefaultTypeInternal _PruneParams_default_instance_;
constexpr CompressionAlgo::CompressionAlgo(
  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
  : quant_params_(nullptr)
  , prune_params_(nullptr)
  , type_(0)
{}
struct CompressionAlgoDefaultTypeInternal {
  constexpr CompressionAlgoDefaultTypeInternal()
    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
  ~CompressionAlgoDefaultTypeInternal() {}
  union {
    CompressionAlgo _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT CompressionAlgoDefaultTypeInternal _CompressionAlgo_default_instance_;
constexpr Pipeline::Pipeline(
  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
  : algo_()
  , version_(nullptr)
  , mnn_uuid_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string){}
struct PipelineDefaultTypeInternal {
  constexpr PipelineDefaultTypeInternal()
    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
  ~PipelineDefaultTypeInternal() {}
  union {
    Pipeline _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PipelineDefaultTypeInternal _Pipeline_default_instance_;
}  // namespace Compression
}  // namespace MNN
static ::PROTOBUF_NAMESPACE_ID::Metadata file_level_metadata_MNN_5fcompression_2eproto[10];
static const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* file_level_enum_descriptors_MNN_5fcompression_2eproto[4];
static constexpr ::PROTOBUF_NAMESPACE_ID::ServiceDescriptor const** file_level_service_descriptors_MNN_5fcompression_2eproto = nullptr;

const uint32_t TableStruct_MNN_5fcompression_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
  PROTOBUF_FIELD_OFFSET(::MNN::Compression::QuantizeParams, _has_bits_),
  PROTOBUF_FIELD_OFFSET(::MNN::Compression::QuantizeParams, _internal_metadata_),
  ~0u,  // no _extensions_
  ~0u,  // no _oneof_case_
  ~0u,  // no _weak_field_map_
  ~0u,  // no _inlined_string_donated_
  PROTOBUF_FIELD_OFFSET(::MNN::Compression::QuantizeParams, round_mode_),
  PROTOBUF_FIELD_OFFSET(::MNN::Compression::QuantizeParams, layer_),
  0,
  ~0u,
  PROTOBUF_FIELD_OFFSET(::MNN::Compression::LayerQuantizeParams_ActivationParams, _has_bits_),
  PROTOBUF_FIELD_OFFSET(::MNN::Compression::LayerQuantizeParams_ActivationParams, _internal_metadata_),
  ~0u,  // no _extensions_
  ~0u,  // no _oneof_case_
  ~0u,  // no _weak_field_map_
  ~0u,  // no _inlined_string_donated_
  PROTOBUF_FIELD_OFFSET(::MNN::Compression::LayerQuantizeParams_ActivationParams, name_),
  PROTOBUF_FIELD_OFFSET(::MNN::Compression::LayerQuantizeParams_ActivationParams, bits_),
  PROTOBUF_FIELD_OFFSET(::MNN::Compression::LayerQuantizeParams_ActivationParams, scales_),
  PROTOBUF_FIELD_OFFSET(::MNN::Compression::LayerQuantizeParams_ActivationParams, zero_point_),
  PROTOBUF_FIELD_OFFSET(::MNN::Compression::LayerQuantizeParams_ActivationParams, clamp_min_),
  PROTOBUF_FIELD_OFFSET(::MNN::Compression::LayerQuantizeParams_ActivationParams, clamp_max_),
  0,
  3,
  ~0u,
  1,
  4,
  2,
  PROTOBUF_FIELD_OFFSET(::MNN::Compression::LayerQuantizeParams_WeightParams, _has_bits_),
  PROTOBUF_FIELD_OFFSET(::MNN::Compression::LayerQuantizeParams_WeightParams, _internal_metadata_),
  ~0u,  // no _extensions_
  ~0u,  // no _oneof_case_
  ~0u,  // no _weak_field_map_
  ~0u,  // no _inlined_string_donated_
  PROTOBUF_FIELD_OFFSET(::MNN::Compression::LayerQuantizeParams_WeightParams, name_),
  PROTOBUF_FIELD_OFFSET(::MNN::Compression::LayerQuantizeParams_WeightParams, bits_),
  PROTOBUF_FIELD_OFFSET(::MNN::Compression::LayerQuantizeParams_WeightParams, scales_),
  PROTOBUF_FIELD_OFFSET(::MNN::Compression::LayerQuantizeParams_WeightParams, clamp_min_),
  PROTOBUF_FIELD_OFFSET(::MNN::Compression::LayerQuantizeParams_WeightParams, clamp_max_),
  0,
  2,
  ~0u,
  3,
  1,
  PROTOBUF_FIELD_OFFSET(::MNN::Compression::LayerQuantizeParams_WinogradParams, _has_bits_),
  PROTOBUF_FIELD_OFFSET(::MNN::Compression::LayerQuantizeParams_WinogradParams, _internal_metadata_),
  ~0u,  // no _extensions_
  ~0u,  // no _oneof_case_
  ~0u,  // no _weak_field_map_
  ~0u,  // no _inlined_string_donated_
  PROTOBUF_FIELD_OFFSET(::MNN::Compression::LayerQuantizeParams_WinogradParams, version_),
  PROTOBUF_FIELD_OFFSET(::MNN::Compression::LayerQuantizeParams_WinogradParams, units_attr_),
  0,
  ~0u,
  PROTOBUF_FIELD_OFFSET(::MNN::Compression::LayerQuantizeParams, _has_bits_),
  PROTOBUF_FIELD_OFFSET(::MNN::Compression::LayerQuantizeParams, _internal_metadata_),
  ~0u,  // no _extensions_
  ~0u,  // no _oneof_case_
  ~0u,  // no _weak_field_map_
  ~0u,  // no _inlined_string_donated_
  PROTOBUF_FIELD_OFFSET(::MNN::Compression::LayerQuantizeParams, input_),
  PROTOBUF_FIELD_OFFSET(::MNN::Compression::LayerQuantizeParams, weight_),
  PROTOBUF_FIELD_OFFSET(::MNN::Compression::LayerQuantizeParams, output_),
  PROTOBUF_FIELD_OFFSET(::MNN::Compression::LayerQuantizeParams, method_),
  PROTOBUF_FIELD_OFFSET(::MNN::Compression::LayerQuantizeParams, wino_params_),
  ~0u,
  ~0u,
  ~0u,
  1,
  0,
  ~0u,  // no _has_bits_
  PROTOBUF_FIELD_OFFSET(::MNN::Compression::LevelPrunerParams, _internal_metadata_),
  ~0u,  // no _extensions_
  ~0u,  // no _oneof_case_
  ~0u,  // no _weak_field_map_
  ~0u,  // no _inlined_string_donated_
  PROTOBUF_FIELD_OFFSET(::MNN::Compression::LevelPrunerParams, weight_tensor_names_),
  PROTOBUF_FIELD_OFFSET(::MNN::Compression::LevelPrunerParams, prune_ratios_),
  PROTOBUF_FIELD_OFFSET(::MNN::Compression::LevelPrunerParams, layer_names_),
  ~0u,  // no _has_bits_
  PROTOBUF_FIELD_OFFSET(::MNN::Compression::SIMDOCPrunerParams, _internal_metadata_),
  ~0u,  // no _extensions_
  ~0u,  // no _oneof_case_
  ~0u,  // no _weak_field_map_
  ~0u,  // no _inlined_string_donated_
  PROTOBUF_FIELD_OFFSET(::MNN::Compression::SIMDOCPrunerParams, weight_tensor_names_),
  PROTOBUF_FIELD_OFFSET(::MNN::Compression::SIMDOCPrunerParams, prune_ratios_),
  PROTOBUF_FIELD_OFFSET(::MNN::Compression::SIMDOCPrunerParams, layer_names_),
  PROTOBUF_FIELD_OFFSET(::MNN::Compression::SIMDOCPrunerParams, oc_blocks_),
  PROTOBUF_FIELD_OFFSET(::MNN::Compression::PruneParams, _has_bits_),
  PROTOBUF_FIELD_OFFSET(::MNN::Compression::PruneParams, _internal_metadata_),
  ~0u,  // no _extensions_
  ~0u,  // no _oneof_case_
  ~0u,  // no _weak_field_map_
  ~0u,  // no _inlined_string_donated_
  PROTOBUF_FIELD_OFFSET(::MNN::Compression::PruneParams, type_),
  PROTOBUF_FIELD_OFFSET(::MNN::Compression::PruneParams, level_pruner_params_),
  PROTOBUF_FIELD_OFFSET(::MNN::Compression::PruneParams, simd_oc_pruner_params_),
  2,
  0,
  1,
  PROTOBUF_FIELD_OFFSET(::MNN::Compression::CompressionAlgo, _has_bits_),
  PROTOBUF_FIELD_OFFSET(::MNN::Compression::CompressionAlgo, _internal_metadata_),
  ~0u,  // no _extensions_
  ~0u,  // no _oneof_case_
  ~0u,  // no _weak_field_map_
  ~0u,  // no _inlined_string_donated_
  PROTOBUF_FIELD_OFFSET(::MNN::Compression::CompressionAlgo, type_),
  PROTOBUF_FIELD_OFFSET(::MNN::Compression::CompressionAlgo, quant_params_),
  PROTOBUF_FIELD_OFFSET(::MNN::Compression::CompressionAlgo, prune_params_),
  2,
  0,
  1,
  PROTOBUF_FIELD_OFFSET(::MNN::Compression::Pipeline, _has_bits_),
  PROTOBUF_FIELD_OFFSET(::MNN::Compression::Pipeline, _internal_metadata_),
  ~0u,  // no _extensions_
  ~0u,  // no _oneof_case_
  ~0u,  // no _weak_field_map_
  ~0u,  // no _inlined_string_donated_
  PROTOBUF_FIELD_OFFSET(::MNN::Compression::Pipeline, version_),
  PROTOBUF_FIELD_OFFSET(::MNN::Compression::Pipeline, algo_),
  PROTOBUF_FIELD_OFFSET(::MNN::Compression::Pipeline, mnn_uuid_),
  0,
  ~0u,
  1,
};
static const ::PROTOBUF_NAMESPACE_ID::internal::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
  { 0, 8, -1, sizeof(::MNN::Compression::QuantizeParams)},
  { 10, 22, -1, sizeof(::MNN::Compression::LayerQuantizeParams_ActivationParams)},
  { 28, 39, -1, sizeof(::MNN::Compression::LayerQuantizeParams_WeightParams)},
  { 44, 52, -1, sizeof(::MNN::Compression::LayerQuantizeParams_WinogradParams)},
  { 54, 65, -1, sizeof(::MNN::Compression::LayerQuantizeParams)},
  { 70, -1, -1, sizeof(::MNN::Compression::LevelPrunerParams)},
  { 79, -1, -1, sizeof(::MNN::Compression::SIMDOCPrunerParams)},
  { 89, 98, -1, sizeof(::MNN::Compression::PruneParams)},
  { 101, 110, -1, sizeof(::MNN::Compression::CompressionAlgo)},
  { 113, 122, -1, sizeof(::MNN::Compression::Pipeline)},
};

static ::PROTOBUF_NAMESPACE_ID::Message const * const file_default_instances[] = {
  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::MNN::Compression::_QuantizeParams_default_instance_),
  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::MNN::Compression::_LayerQuantizeParams_ActivationParams_default_instance_),
  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::MNN::Compression::_LayerQuantizeParams_WeightParams_default_instance_),
  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::MNN::Compression::_LayerQuantizeParams_WinogradParams_default_instance_),
  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::MNN::Compression::_LayerQuantizeParams_default_instance_),
  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::MNN::Compression::_LevelPrunerParams_default_instance_),
  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::MNN::Compression::_SIMDOCPrunerParams_default_instance_),
  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::MNN::Compression::_PruneParams_default_instance_),
  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::MNN::Compression::_CompressionAlgo_default_instance_),
  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::MNN::Compression::_Pipeline_default_instance_),
};

const char descriptor_table_protodef_MNN_5fcompression_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) =
  "\n\025MNN_compression.proto\022\017MNN.Compression"
  "\"\361\001\n\016QuantizeParams\022S\n\nround_mode\030\001 \001(\0162"
  ").MNN.Compression.QuantizeParams.RoundMo"
  "de:\024ROUND_AWAY_FROM_ZERO\0223\n\005layer\030\004 \003(\0132"
  "$.MNN.Compression.LayerQuantizeParams\"U\n"
  "\tRoundMode\022\026\n\022ROUND_TOWARDS_ZERO\020\000\022\030\n\024RO"
  "UND_AWAY_FROM_ZERO\020\001\022\026\n\022ROUND_HALF_TO_EV"
  "EN\020\002\"\352\005\n\023LayerQuantizeParams\022D\n\005input\030\001 "
  "\003(\01325.MNN.Compression.LayerQuantizeParam"
  "s.ActivationParams\022A\n\006weight\030\002 \003(\01321.MNN"
  ".Compression.LayerQuantizeParams.WeightP"
  "arams\022E\n\006output\030\003 \003(\01325.MNN.Compression."
  "LayerQuantizeParams.ActivationParams\022E\n\006"
  "method\030\004 \001(\01620.MNN.Compression.LayerQuan"
  "tizeParams.QuantMethod:\003QAT\022H\n\013wino_para"
  "ms\030\005 \001(\01323.MNN.Compression.LayerQuantize"
  "Params.WinogradParams\032\211\001\n\020ActivationPara"
  "ms\022\014\n\004name\030\001 \002(\t\022\017\n\004bits\030\002 \001(\005:\0018\022\016\n\006sca"
  "les\030\003 \003(\002\022\025\n\nzero_point\030\004 \001(\005:\0010\022\027\n\tclam"
  "p_min\030\005 \001(\005:\004-128\022\026\n\tclamp_max\030\006 \001(\005:\00312"
  "7\032n\n\014WeightParams\022\014\n\004name\030\001 \002(\t\022\017\n\004bits\030"
  "\002 \001(\005:\0018\022\016\n\006scales\030\003 \003(\002\022\027\n\tclamp_min\030\004 "
  "\001(\005:\004-128\022\026\n\tclamp_max\030\005 \001(\005:\003127\0328\n\016Win"
  "ogradParams\022\022\n\007version\030\001 \002(\005:\0010\022\022\n\nunits"
  "_attr\030\004 \003(\005\"<\n\013QuantMethod\022\007\n\003QAT\020\000\022\021\n\rO"
  "verflowAware\020\001\022\021\n\rWinogradAware\020\002\"[\n\021Lev"
  "elPrunerParams\022\033\n\023weight_tensor_names\030\001 "
  "\003(\t\022\024\n\014prune_ratios\030\002 \003(\002\022\023\n\013layer_names"
  "\030\003 \003(\t\"o\n\022SIMDOCPrunerParams\022\033\n\023weight_t"
  "ensor_names\030\001 \003(\t\022\024\n\014prune_ratios\030\002 \003(\002\022"
  "\023\n\013layer_names\030\003 \003(\t\022\021\n\toc_blocks\030\004 \003(\005\""
  "\366\001\n\013PruneParams\022<\n\004type\030\001 \001(\0162&.MNN.Comp"
  "ression.PruneParams.PruneType:\006RANDOM\022\?\n"
  "\023level_pruner_params\030\002 \001(\0132\".MNN.Compres"
  "sion.LevelPrunerParams\022B\n\025simd_oc_pruner"
  "_params\030\003 \001(\0132#.MNN.Compression.SIMDOCPr"
  "unerParams\"$\n\tPruneType\022\n\n\006RANDOM\020\000\022\013\n\007S"
  "IMD_OC\020\001\"\362\001\n\017CompressionAlgo\022H\n\004type\030\001 \001"
  "(\01620.MNN.Compression.CompressionAlgo.Com"
  "pressionType:\010QUANTIZE\0225\n\014quant_params\030\002"
  " \001(\0132\037.MNN.Compression.QuantizeParams\0222\n"
  "\014prune_params\030\003 \001(\0132\034.MNN.Compression.Pr"
  "uneParams\"*\n\017CompressionType\022\014\n\010QUANTIZE"
  "\020\000\022\t\n\005PRUNE\020\001\"d\n\010Pipeline\022\026\n\007version\030\001 \002"
  "(\t:\0050.0.0\022.\n\004algo\030\002 \003(\0132 .MNN.Compressio"
  "n.CompressionAlgo\022\020\n\010mnn_uuid\030\003 \001(\t"
  ;
static ::PROTOBUF_NAMESPACE_ID::internal::once_flag descriptor_table_MNN_5fcompression_2eproto_once;
const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_MNN_5fcompression_2eproto = {
  false, false, 1835, descriptor_table_protodef_MNN_5fcompression_2eproto, "MNN_compression.proto", 
  &descriptor_table_MNN_5fcompression_2eproto_once, nullptr, 0, 10,
  schemas, file_default_instances, TableStruct_MNN_5fcompression_2eproto::offsets,
  file_level_metadata_MNN_5fcompression_2eproto, file_level_enum_descriptors_MNN_5fcompression_2eproto, file_level_service_descriptors_MNN_5fcompression_2eproto,
};
PROTOBUF_ATTRIBUTE_WEAK const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable* descriptor_table_MNN_5fcompression_2eproto_getter() {
  return &descriptor_table_MNN_5fcompression_2eproto;
}

// Force running AddDescriptors() at dynamic initialization time.
PROTOBUF_ATTRIBUTE_INIT_PRIORITY static ::PROTOBUF_NAMESPACE_ID::internal::AddDescriptorsRunner dynamic_init_dummy_MNN_5fcompression_2eproto(&descriptor_table_MNN_5fcompression_2eproto);
namespace MNN {
namespace Compression {
const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* QuantizeParams_RoundMode_descriptor() {
  ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_MNN_5fcompression_2eproto);
  return file_level_enum_descriptors_MNN_5fcompression_2eproto[0];
}
bool QuantizeParams_RoundMode_IsValid(int value) {
  switch (value) {
    case 0:
    case 1:
    case 2:
      return true;
    default:
      return false;
  }
}

#if (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
constexpr QuantizeParams_RoundMode QuantizeParams::ROUND_TOWARDS_ZERO;
constexpr QuantizeParams_RoundMode QuantizeParams::ROUND_AWAY_FROM_ZERO;
constexpr QuantizeParams_RoundMode QuantizeParams::ROUND_HALF_TO_EVEN;
constexpr QuantizeParams_RoundMode QuantizeParams::RoundMode_MIN;
constexpr QuantizeParams_RoundMode QuantizeParams::RoundMode_MAX;
constexpr int QuantizeParams::RoundMode_ARRAYSIZE;
#endif  // (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* LayerQuantizeParams_QuantMethod_descriptor() {
  ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_MNN_5fcompression_2eproto);
  return file_level_enum_descriptors_MNN_5fcompression_2eproto[1];
}
bool LayerQuantizeParams_QuantMethod_IsValid(int value) {
  switch (value) {
    case 0:
    case 1:
    case 2:
      return true;
    default:
      return false;
  }
}

#if (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
constexpr LayerQuantizeParams_QuantMethod LayerQuantizeParams::QAT;
constexpr LayerQuantizeParams_QuantMethod LayerQuantizeParams::OverflowAware;
constexpr LayerQuantizeParams_QuantMethod LayerQuantizeParams::WinogradAware;
constexpr LayerQuantizeParams_QuantMethod LayerQuantizeParams::QuantMethod_MIN;
constexpr LayerQuantizeParams_QuantMethod LayerQuantizeParams::QuantMethod_MAX;
constexpr int LayerQuantizeParams::QuantMethod_ARRAYSIZE;
#endif  // (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* PruneParams_PruneType_descriptor() {
  ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_MNN_5fcompression_2eproto);
  return file_level_enum_descriptors_MNN_5fcompression_2eproto[2];
}
bool PruneParams_PruneType_IsValid(int value) {
  switch (value) {
    case 0:
    case 1:
      return true;
    default:
      return false;
  }
}

#if (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
constexpr PruneParams_PruneType PruneParams::RANDOM;
constexpr PruneParams_PruneType PruneParams::SIMD_OC;
constexpr PruneParams_PruneType PruneParams::PruneType_MIN;
constexpr PruneParams_PruneType PruneParams::PruneType_MAX;
constexpr int PruneParams::PruneType_ARRAYSIZE;
#endif  // (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* CompressionAlgo_CompressionType_descriptor() {
  ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_MNN_5fcompression_2eproto);
  return file_level_enum_descriptors_MNN_5fcompression_2eproto[3];
}
bool CompressionAlgo_CompressionType_IsValid(int value) {
  switch (value) {
    case 0:
    case 1:
      return true;
    default:
      return false;
  }
}

#if (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
constexpr CompressionAlgo_CompressionType CompressionAlgo::QUANTIZE;
constexpr CompressionAlgo_CompressionType CompressionAlgo::PRUNE;
constexpr CompressionAlgo_CompressionType CompressionAlgo::CompressionType_MIN;
constexpr CompressionAlgo_CompressionType CompressionAlgo::CompressionType_MAX;
constexpr int CompressionAlgo::CompressionType_ARRAYSIZE;
#endif  // (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))

// ===================================================================

class QuantizeParams::_Internal {
 public:
  using HasBits = decltype(std::declval<QuantizeParams>()._has_bits_);
  static void set_has_round_mode(HasBits* has_bits) {
    (*has_bits)[0] |= 1u;
  }
};

QuantizeParams::QuantizeParams(::PROTOBUF_NAMESPACE_ID::Arena* arena,
                         bool is_message_owned)
  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned),
  layer_(arena) {
  SharedCtor();
  if (!is_message_owned) {
    RegisterArenaDtor(arena);
  }
  // @@protoc_insertion_point(arena_constructor:MNN.Compression.QuantizeParams)
}
QuantizeParams::QuantizeParams(const QuantizeParams& from)
  : ::PROTOBUF_NAMESPACE_ID::Message(),
      _has_bits_(from._has_bits_),
      layer_(from.layer_) {
  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
  round_mode_ = from.round_mode_;
  // @@protoc_insertion_point(copy_constructor:MNN.Compression.QuantizeParams)
}

inline void QuantizeParams::SharedCtor() {
round_mode_ = 1;
}

QuantizeParams::~QuantizeParams() {
  // @@protoc_insertion_point(destructor:MNN.Compression.QuantizeParams)
  if (GetArenaForAllocation() != nullptr) return;
  SharedDtor();
  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
}

inline void QuantizeParams::SharedDtor() {
  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
}

void QuantizeParams::ArenaDtor(void* object) {
  QuantizeParams* _this = reinterpret_cast< QuantizeParams* >(object);
  (void)_this;
}
void QuantizeParams::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
}
void QuantizeParams::SetCachedSize(int size) const {
  _cached_size_.Set(size);
}

void QuantizeParams::Clear() {
// @@protoc_insertion_point(message_clear_start:MNN.Compression.QuantizeParams)
  uint32_t cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  layer_.Clear();
  round_mode_ = 1;
  _has_bits_.Clear();
  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
}

const char* QuantizeParams::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  _Internal::HasBits has_bits{};
  while (!ctx->Done(&ptr)) {
    uint32_t tag;
    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
    switch (tag >> 3) {
      // optional .MNN.Compression.QuantizeParams.RoundMode round_mode = 1 [default = ROUND_AWAY_FROM_ZERO];
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
          uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
          if (PROTOBUF_PREDICT_TRUE(::MNN::Compression::QuantizeParams_RoundMode_IsValid(val))) {
            _internal_set_round_mode(static_cast<::MNN::Compression::QuantizeParams_RoundMode>(val));
          } else {
            ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(1, val, mutable_unknown_fields());
          }
        } else
          goto handle_unusual;
        continue;
      // repeated .MNN.Compression.LayerQuantizeParams layer = 4;
      case 4:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 34)) {
          ptr -= 1;
          do {
            ptr += 1;
            ptr = ctx->ParseMessage(_internal_add_layer(), ptr);
            CHK_(ptr);
            if (!ctx->DataAvailable(ptr)) break;
          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<34>(ptr));
        } else
          goto handle_unusual;
        continue;
      default:
        goto handle_unusual;
    }  // switch
  handle_unusual:
    if ((tag == 0) || ((tag & 7) == 4)) {
      CHK_(ptr);
      ctx->SetLastTag(tag);
      goto message_done;
    }
    ptr = UnknownFieldParse(
        tag,
        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
        ptr, ctx);
    CHK_(ptr != nullptr);
  }  // while
message_done:
  _has_bits_.Or(has_bits);
  return ptr;
failure:
  ptr = nullptr;
  goto message_done;
#undef CHK_
}

uint8_t* QuantizeParams::_InternalSerialize(
    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:MNN.Compression.QuantizeParams)
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  cached_has_bits = _has_bits_[0];
  // optional .MNN.Compression.QuantizeParams.RoundMode round_mode = 1 [default = ROUND_AWAY_FROM_ZERO];
  if (cached_has_bits & 0x00000001u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
      1, this->_internal_round_mode(), target);
  }

  // repeated .MNN.Compression.LayerQuantizeParams layer = 4;
  for (unsigned int i = 0,
      n = static_cast<unsigned int>(this->_internal_layer_size()); i < n; i++) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(4, this->_internal_layer(i), target, stream);
  }

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
  }
  // @@protoc_insertion_point(serialize_to_array_end:MNN.Compression.QuantizeParams)
  return target;
}

size_t QuantizeParams::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:MNN.Compression.QuantizeParams)
  size_t total_size = 0;

  uint32_t cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  // repeated .MNN.Compression.LayerQuantizeParams layer = 4;
  total_size += 1UL * this->_internal_layer_size();
  for (const auto& msg : this->layer_) {
    total_size +=
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
  }

  // optional .MNN.Compression.QuantizeParams.RoundMode round_mode = 1 [default = ROUND_AWAY_FROM_ZERO];
  cached_has_bits = _has_bits_[0];
  if (cached_has_bits & 0x00000001u) {
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_round_mode());
  }

  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
}

const ::PROTOBUF_NAMESPACE_ID::Message::ClassData QuantizeParams::_class_data_ = {
    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
    QuantizeParams::MergeImpl
};
const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*QuantizeParams::GetClassData() const { return &_class_data_; }

void QuantizeParams::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
  static_cast<QuantizeParams *>(to)->MergeFrom(
      static_cast<const QuantizeParams &>(from));
}


void QuantizeParams::MergeFrom(const QuantizeParams& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:MNN.Compression.QuantizeParams)
  GOOGLE_DCHECK_NE(&from, this);
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  layer_.MergeFrom(from.layer_);
  if (from._internal_has_round_mode()) {
    _internal_set_round_mode(from._internal_round_mode());
  }
  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
}

void QuantizeParams::CopyFrom(const QuantizeParams& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:MNN.Compression.QuantizeParams)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool QuantizeParams::IsInitialized() const {
  if (!::PROTOBUF_NAMESPACE_ID::internal::AllAreInitialized(layer_))
    return false;
  return true;
}

void QuantizeParams::InternalSwap(QuantizeParams* other) {
  using std::swap;
  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
  swap(_has_bits_[0], other->_has_bits_[0]);
  layer_.InternalSwap(&other->layer_);
  swap(round_mode_, other->round_mode_);
}

::PROTOBUF_NAMESPACE_ID::Metadata QuantizeParams::GetMetadata() const {
  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
      &descriptor_table_MNN_5fcompression_2eproto_getter, &descriptor_table_MNN_5fcompression_2eproto_once,
      file_level_metadata_MNN_5fcompression_2eproto[0]);
}

// ===================================================================

class LayerQuantizeParams_ActivationParams::_Internal {
 public:
  using HasBits = decltype(std::declval<LayerQuantizeParams_ActivationParams>()._has_bits_);
  static void set_has_name(HasBits* has_bits) {
    (*has_bits)[0] |= 1u;
  }
  static void set_has_bits(HasBits* has_bits) {
    (*has_bits)[0] |= 8u;
  }
  static void set_has_zero_point(HasBits* has_bits) {
    (*has_bits)[0] |= 2u;
  }
  static void set_has_clamp_min(HasBits* has_bits) {
    (*has_bits)[0] |= 16u;
  }
  static void set_has_clamp_max(HasBits* has_bits) {
    (*has_bits)[0] |= 4u;
  }
  static bool MissingRequiredFields(const HasBits& has_bits) {
    return ((has_bits[0] & 0x00000001) ^ 0x00000001) != 0;
  }
};

LayerQuantizeParams_ActivationParams::LayerQuantizeParams_ActivationParams(::PROTOBUF_NAMESPACE_ID::Arena* arena,
                         bool is_message_owned)
  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned),
  scales_(arena) {
  SharedCtor();
  if (!is_message_owned) {
    RegisterArenaDtor(arena);
  }
  // @@protoc_insertion_point(arena_constructor:MNN.Compression.LayerQuantizeParams.ActivationParams)
}
LayerQuantizeParams_ActivationParams::LayerQuantizeParams_ActivationParams(const LayerQuantizeParams_ActivationParams& from)
  : ::PROTOBUF_NAMESPACE_ID::Message(),
      _has_bits_(from._has_bits_),
      scales_(from.scales_) {
  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
  name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
    name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  if (from._internal_has_name()) {
    name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_name(), 
      GetArenaForAllocation());
  }
  ::memcpy(&zero_point_, &from.zero_point_,
    static_cast<size_t>(reinterpret_cast<char*>(&clamp_min_) -
    reinterpret_cast<char*>(&zero_point_)) + sizeof(clamp_min_));
  // @@protoc_insertion_point(copy_constructor:MNN.Compression.LayerQuantizeParams.ActivationParams)
}

inline void LayerQuantizeParams_ActivationParams::SharedCtor() {
name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
  name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
zero_point_ = 0;
clamp_max_ = 127;
bits_ = 8;
clamp_min_ = -128;
}

LayerQuantizeParams_ActivationParams::~LayerQuantizeParams_ActivationParams() {
  // @@protoc_insertion_point(destructor:MNN.Compression.LayerQuantizeParams.ActivationParams)
  if (GetArenaForAllocation() != nullptr) return;
  SharedDtor();
  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
}

inline void LayerQuantizeParams_ActivationParams::SharedDtor() {
  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
  name_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
}

void LayerQuantizeParams_ActivationParams::ArenaDtor(void* object) {
  LayerQuantizeParams_ActivationParams* _this = reinterpret_cast< LayerQuantizeParams_ActivationParams* >(object);
  (void)_this;
}
void LayerQuantizeParams_ActivationParams::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
}
void LayerQuantizeParams_ActivationParams::SetCachedSize(int size) const {
  _cached_size_.Set(size);
}

void LayerQuantizeParams_ActivationParams::Clear() {
// @@protoc_insertion_point(message_clear_start:MNN.Compression.LayerQuantizeParams.ActivationParams)
  uint32_t cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  scales_.Clear();
  cached_has_bits = _has_bits_[0];
  if (cached_has_bits & 0x00000001u) {
    name_.ClearNonDefaultToEmpty();
  }
  if (cached_has_bits & 0x0000001eu) {
    zero_point_ = 0;
    clamp_max_ = 127;
    bits_ = 8;
    clamp_min_ = -128;
  }
  _has_bits_.Clear();
  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
}

const char* LayerQuantizeParams_ActivationParams::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  _Internal::HasBits has_bits{};
  while (!ctx->Done(&ptr)) {
    uint32_t tag;
    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
    switch (tag >> 3) {
      // required string name = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
          auto str = _internal_mutable_name();
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
          #ifndef NDEBUG
          ::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "MNN.Compression.LayerQuantizeParams.ActivationParams.name");
          #endif  // !NDEBUG
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional int32 bits = 2 [default = 8];
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 16)) {
          _Internal::set_has_bits(&has_bits);
          bits_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // repeated float scales = 3;
      case 3:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 29)) {
          ptr -= 1;
          do {
            ptr += 1;
            _internal_add_scales(::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr));
            ptr += sizeof(float);
            if (!ctx->DataAvailable(ptr)) break;
          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<29>(ptr));
        } else if (static_cast<uint8_t>(tag) == 26) {
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedFloatParser(_internal_mutable_scales(), ptr, ctx);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional int32 zero_point = 4 [default = 0];
      case 4:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 32)) {
          _Internal::set_has_zero_point(&has_bits);
          zero_point_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional int32 clamp_min = 5 [default = -128];
      case 5:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 40)) {
          _Internal::set_has_clamp_min(&has_bits);
          clamp_min_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional int32 clamp_max = 6 [default = 127];
      case 6:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 48)) {
          _Internal::set_has_clamp_max(&has_bits);
          clamp_max_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      default:
        goto handle_unusual;
    }  // switch
  handle_unusual:
    if ((tag == 0) || ((tag & 7) == 4)) {
      CHK_(ptr);
      ctx->SetLastTag(tag);
      goto message_done;
    }
    ptr = UnknownFieldParse(
        tag,
        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
        ptr, ctx);
    CHK_(ptr != nullptr);
  }  // while
message_done:
  _has_bits_.Or(has_bits);
  return ptr;
failure:
  ptr = nullptr;
  goto message_done;
#undef CHK_
}

uint8_t* LayerQuantizeParams_ActivationParams::_InternalSerialize(
    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:MNN.Compression.LayerQuantizeParams.ActivationParams)
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  cached_has_bits = _has_bits_[0];
  // required string name = 1;
  if (cached_has_bits & 0x00000001u) {
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
      this->_internal_name().data(), static_cast<int>(this->_internal_name().length()),
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
      "MNN.Compression.LayerQuantizeParams.ActivationParams.name");
    target = stream->WriteStringMaybeAliased(
        1, this->_internal_name(), target);
  }

  // optional int32 bits = 2 [default = 8];
  if (cached_has_bits & 0x00000008u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(2, this->_internal_bits(), target);
  }

  // repeated float scales = 3;
  for (int i = 0, n = this->_internal_scales_size(); i < n; i++) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(3, this->_internal_scales(i), target);
  }

  // optional int32 zero_point = 4 [default = 0];
  if (cached_has_bits & 0x00000002u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(4, this->_internal_zero_point(), target);
  }

  // optional int32 clamp_min = 5 [default = -128];
  if (cached_has_bits & 0x00000010u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(5, this->_internal_clamp_min(), target);
  }

  // optional int32 clamp_max = 6 [default = 127];
  if (cached_has_bits & 0x00000004u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(6, this->_internal_clamp_max(), target);
  }

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
  }
  // @@protoc_insertion_point(serialize_to_array_end:MNN.Compression.LayerQuantizeParams.ActivationParams)
  return target;
}

size_t LayerQuantizeParams_ActivationParams::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:MNN.Compression.LayerQuantizeParams.ActivationParams)
  size_t total_size = 0;

  // required string name = 1;
  if (_internal_has_name()) {
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
        this->_internal_name());
  }
  uint32_t cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  // repeated float scales = 3;
  {
    unsigned int count = static_cast<unsigned int>(this->_internal_scales_size());
    size_t data_size = 4UL * count;
    total_size += 1 *
                  ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(this->_internal_scales_size());
    total_size += data_size;
  }

  cached_has_bits = _has_bits_[0];
  if (cached_has_bits & 0x0000001eu) {
    // optional int32 zero_point = 4 [default = 0];
    if (cached_has_bits & 0x00000002u) {
      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32SizePlusOne(this->_internal_zero_point());
    }

    // optional int32 clamp_max = 6 [default = 127];
    if (cached_has_bits & 0x00000004u) {
      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32SizePlusOne(this->_internal_clamp_max());
    }

    // optional int32 bits = 2 [default = 8];
    if (cached_has_bits & 0x00000008u) {
      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32SizePlusOne(this->_internal_bits());
    }

    // optional int32 clamp_min = 5 [default = -128];
    if (cached_has_bits & 0x00000010u) {
      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32SizePlusOne(this->_internal_clamp_min());
    }

  }
  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
}

const ::PROTOBUF_NAMESPACE_ID::Message::ClassData LayerQuantizeParams_ActivationParams::_class_data_ = {
    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
    LayerQuantizeParams_ActivationParams::MergeImpl
};
const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*LayerQuantizeParams_ActivationParams::GetClassData() const { return &_class_data_; }

void LayerQuantizeParams_ActivationParams::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
  static_cast<LayerQuantizeParams_ActivationParams *>(to)->MergeFrom(
      static_cast<const LayerQuantizeParams_ActivationParams &>(from));
}


void LayerQuantizeParams_ActivationParams::MergeFrom(const LayerQuantizeParams_ActivationParams& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:MNN.Compression.LayerQuantizeParams.ActivationParams)
  GOOGLE_DCHECK_NE(&from, this);
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  scales_.MergeFrom(from.scales_);
  cached_has_bits = from._has_bits_[0];
  if (cached_has_bits & 0x0000001fu) {
    if (cached_has_bits & 0x00000001u) {
      _internal_set_name(from._internal_name());
    }
    if (cached_has_bits & 0x00000002u) {
      zero_point_ = from.zero_point_;
    }
    if (cached_has_bits & 0x00000004u) {
      clamp_max_ = from.clamp_max_;
    }
    if (cached_has_bits & 0x00000008u) {
      bits_ = from.bits_;
    }
    if (cached_has_bits & 0x00000010u) {
      clamp_min_ = from.clamp_min_;
    }
    _has_bits_[0] |= cached_has_bits;
  }
  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
}

void LayerQuantizeParams_ActivationParams::CopyFrom(const LayerQuantizeParams_ActivationParams& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:MNN.Compression.LayerQuantizeParams.ActivationParams)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool LayerQuantizeParams_ActivationParams::IsInitialized() const {
  if (_Internal::MissingRequiredFields(_has_bits_)) return false;
  return true;
}

void LayerQuantizeParams_ActivationParams::InternalSwap(LayerQuantizeParams_ActivationParams* other) {
  using std::swap;
  auto* lhs_arena = GetArenaForAllocation();
  auto* rhs_arena = other->GetArenaForAllocation();
  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
  swap(_has_bits_[0], other->_has_bits_[0]);
  scales_.InternalSwap(&other->scales_);
  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
      &name_, lhs_arena,
      &other->name_, rhs_arena
  );
  swap(zero_point_, other->zero_point_);
  swap(clamp_max_, other->clamp_max_);
  swap(bits_, other->bits_);
  swap(clamp_min_, other->clamp_min_);
}

::PROTOBUF_NAMESPACE_ID::Metadata LayerQuantizeParams_ActivationParams::GetMetadata() const {
  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
      &descriptor_table_MNN_5fcompression_2eproto_getter, &descriptor_table_MNN_5fcompression_2eproto_once,
      file_level_metadata_MNN_5fcompression_2eproto[1]);
}

// ===================================================================

class LayerQuantizeParams_WeightParams::_Internal {
 public:
  using HasBits = decltype(std::declval<LayerQuantizeParams_WeightParams>()._has_bits_);
  static void set_has_name(HasBits* has_bits) {
    (*has_bits)[0] |= 1u;
  }
  static void set_has_bits(HasBits* has_bits) {
    (*has_bits)[0] |= 4u;
  }
  static void set_has_clamp_min(HasBits* has_bits) {
    (*has_bits)[0] |= 8u;
  }
  static void set_has_clamp_max(HasBits* has_bits) {
    (*has_bits)[0] |= 2u;
  }
  static bool MissingRequiredFields(const HasBits& has_bits) {
    return ((has_bits[0] & 0x00000001) ^ 0x00000001) != 0;
  }
};

LayerQuantizeParams_WeightParams::LayerQuantizeParams_WeightParams(::PROTOBUF_NAMESPACE_ID::Arena* arena,
                         bool is_message_owned)
  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned),
  scales_(arena) {
  SharedCtor();
  if (!is_message_owned) {
    RegisterArenaDtor(arena);
  }
  // @@protoc_insertion_point(arena_constructor:MNN.Compression.LayerQuantizeParams.WeightParams)
}
LayerQuantizeParams_WeightParams::LayerQuantizeParams_WeightParams(const LayerQuantizeParams_WeightParams& from)
  : ::PROTOBUF_NAMESPACE_ID::Message(),
      _has_bits_(from._has_bits_),
      scales_(from.scales_) {
  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
  name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
    name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  if (from._internal_has_name()) {
    name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_name(), 
      GetArenaForAllocation());
  }
  ::memcpy(&clamp_max_, &from.clamp_max_,
    static_cast<size_t>(reinterpret_cast<char*>(&clamp_min_) -
    reinterpret_cast<char*>(&clamp_max_)) + sizeof(clamp_min_));
  // @@protoc_insertion_point(copy_constructor:MNN.Compression.LayerQuantizeParams.WeightParams)
}

inline void LayerQuantizeParams_WeightParams::SharedCtor() {
name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
  name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
clamp_max_ = 127;
bits_ = 8;
clamp_min_ = -128;
}

LayerQuantizeParams_WeightParams::~LayerQuantizeParams_WeightParams() {
  // @@protoc_insertion_point(destructor:MNN.Compression.LayerQuantizeParams.WeightParams)
  if (GetArenaForAllocation() != nullptr) return;
  SharedDtor();
  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
}

inline void LayerQuantizeParams_WeightParams::SharedDtor() {
  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
  name_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
}

void LayerQuantizeParams_WeightParams::ArenaDtor(void* object) {
  LayerQuantizeParams_WeightParams* _this = reinterpret_cast< LayerQuantizeParams_WeightParams* >(object);
  (void)_this;
}
void LayerQuantizeParams_WeightParams::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
}
void LayerQuantizeParams_WeightParams::SetCachedSize(int size) const {
  _cached_size_.Set(size);
}

void LayerQuantizeParams_WeightParams::Clear() {
// @@protoc_insertion_point(message_clear_start:MNN.Compression.LayerQuantizeParams.WeightParams)
  uint32_t cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  scales_.Clear();
  cached_has_bits = _has_bits_[0];
  if (cached_has_bits & 0x0000000fu) {
    if (cached_has_bits & 0x00000001u) {
      name_.ClearNonDefaultToEmpty();
    }
    clamp_max_ = 127;
    bits_ = 8;
    clamp_min_ = -128;
  }
  _has_bits_.Clear();
  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
}

const char* LayerQuantizeParams_WeightParams::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  _Internal::HasBits has_bits{};
  while (!ctx->Done(&ptr)) {
    uint32_t tag;
    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
    switch (tag >> 3) {
      // required string name = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
          auto str = _internal_mutable_name();
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
          #ifndef NDEBUG
          ::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "MNN.Compression.LayerQuantizeParams.WeightParams.name");
          #endif  // !NDEBUG
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional int32 bits = 2 [default = 8];
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 16)) {
          _Internal::set_has_bits(&has_bits);
          bits_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // repeated float scales = 3;
      case 3:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 29)) {
          ptr -= 1;
          do {
            ptr += 1;
            _internal_add_scales(::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr));
            ptr += sizeof(float);
            if (!ctx->DataAvailable(ptr)) break;
          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<29>(ptr));
        } else if (static_cast<uint8_t>(tag) == 26) {
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedFloatParser(_internal_mutable_scales(), ptr, ctx);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional int32 clamp_min = 4 [default = -128];
      case 4:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 32)) {
          _Internal::set_has_clamp_min(&has_bits);
          clamp_min_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional int32 clamp_max = 5 [default = 127];
      case 5:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 40)) {
          _Internal::set_has_clamp_max(&has_bits);
          clamp_max_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      default:
        goto handle_unusual;
    }  // switch
  handle_unusual:
    if ((tag == 0) || ((tag & 7) == 4)) {
      CHK_(ptr);
      ctx->SetLastTag(tag);
      goto message_done;
    }
    ptr = UnknownFieldParse(
        tag,
        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
        ptr, ctx);
    CHK_(ptr != nullptr);
  }  // while
message_done:
  _has_bits_.Or(has_bits);
  return ptr;
failure:
  ptr = nullptr;
  goto message_done;
#undef CHK_
}

uint8_t* LayerQuantizeParams_WeightParams::_InternalSerialize(
    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:MNN.Compression.LayerQuantizeParams.WeightParams)
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  cached_has_bits = _has_bits_[0];
  // required string name = 1;
  if (cached_has_bits & 0x00000001u) {
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
      this->_internal_name().data(), static_cast<int>(this->_internal_name().length()),
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
      "MNN.Compression.LayerQuantizeParams.WeightParams.name");
    target = stream->WriteStringMaybeAliased(
        1, this->_internal_name(), target);
  }

  // optional int32 bits = 2 [default = 8];
  if (cached_has_bits & 0x00000004u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(2, this->_internal_bits(), target);
  }

  // repeated float scales = 3;
  for (int i = 0, n = this->_internal_scales_size(); i < n; i++) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(3, this->_internal_scales(i), target);
  }

  // optional int32 clamp_min = 4 [default = -128];
  if (cached_has_bits & 0x00000008u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(4, this->_internal_clamp_min(), target);
  }

  // optional int32 clamp_max = 5 [default = 127];
  if (cached_has_bits & 0x00000002u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(5, this->_internal_clamp_max(), target);
  }

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
  }
  // @@protoc_insertion_point(serialize_to_array_end:MNN.Compression.LayerQuantizeParams.WeightParams)
  return target;
}

size_t LayerQuantizeParams_WeightParams::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:MNN.Compression.LayerQuantizeParams.WeightParams)
  size_t total_size = 0;

  // required string name = 1;
  if (_internal_has_name()) {
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
        this->_internal_name());
  }
  uint32_t cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  // repeated float scales = 3;
  {
    unsigned int count = static_cast<unsigned int>(this->_internal_scales_size());
    size_t data_size = 4UL * count;
    total_size += 1 *
                  ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(this->_internal_scales_size());
    total_size += data_size;
  }

  cached_has_bits = _has_bits_[0];
  if (cached_has_bits & 0x0000000eu) {
    // optional int32 clamp_max = 5 [default = 127];
    if (cached_has_bits & 0x00000002u) {
      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32SizePlusOne(this->_internal_clamp_max());
    }

    // optional int32 bits = 2 [default = 8];
    if (cached_has_bits & 0x00000004u) {
      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32SizePlusOne(this->_internal_bits());
    }

    // optional int32 clamp_min = 4 [default = -128];
    if (cached_has_bits & 0x00000008u) {
      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32SizePlusOne(this->_internal_clamp_min());
    }

  }
  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
}

const ::PROTOBUF_NAMESPACE_ID::Message::ClassData LayerQuantizeParams_WeightParams::_class_data_ = {
    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
    LayerQuantizeParams_WeightParams::MergeImpl
};
const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*LayerQuantizeParams_WeightParams::GetClassData() const { return &_class_data_; }

void LayerQuantizeParams_WeightParams::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
  static_cast<LayerQuantizeParams_WeightParams *>(to)->MergeFrom(
      static_cast<const LayerQuantizeParams_WeightParams &>(from));
}


void LayerQuantizeParams_WeightParams::MergeFrom(const LayerQuantizeParams_WeightParams& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:MNN.Compression.LayerQuantizeParams.WeightParams)
  GOOGLE_DCHECK_NE(&from, this);
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  scales_.MergeFrom(from.scales_);
  cached_has_bits = from._has_bits_[0];
  if (cached_has_bits & 0x0000000fu) {
    if (cached_has_bits & 0x00000001u) {
      _internal_set_name(from._internal_name());
    }
    if (cached_has_bits & 0x00000002u) {
      clamp_max_ = from.clamp_max_;
    }
    if (cached_has_bits & 0x00000004u) {
      bits_ = from.bits_;
    }
    if (cached_has_bits & 0x00000008u) {
      clamp_min_ = from.clamp_min_;
    }
    _has_bits_[0] |= cached_has_bits;
  }
  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
}

void LayerQuantizeParams_WeightParams::CopyFrom(const LayerQuantizeParams_WeightParams& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:MNN.Compression.LayerQuantizeParams.WeightParams)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool LayerQuantizeParams_WeightParams::IsInitialized() const {
  if (_Internal::MissingRequiredFields(_has_bits_)) return false;
  return true;
}

void LayerQuantizeParams_WeightParams::InternalSwap(LayerQuantizeParams_WeightParams* other) {
  using std::swap;
  auto* lhs_arena = GetArenaForAllocation();
  auto* rhs_arena = other->GetArenaForAllocation();
  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
  swap(_has_bits_[0], other->_has_bits_[0]);
  scales_.InternalSwap(&other->scales_);
  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
      &name_, lhs_arena,
      &other->name_, rhs_arena
  );
  swap(clamp_max_, other->clamp_max_);
  swap(bits_, other->bits_);
  swap(clamp_min_, other->clamp_min_);
}

::PROTOBUF_NAMESPACE_ID::Metadata LayerQuantizeParams_WeightParams::GetMetadata() const {
  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
      &descriptor_table_MNN_5fcompression_2eproto_getter, &descriptor_table_MNN_5fcompression_2eproto_once,
      file_level_metadata_MNN_5fcompression_2eproto[2]);
}

// ===================================================================

class LayerQuantizeParams_WinogradParams::_Internal {
 public:
  using HasBits = decltype(std::declval<LayerQuantizeParams_WinogradParams>()._has_bits_);
  static void set_has_version(HasBits* has_bits) {
    (*has_bits)[0] |= 1u;
  }
  static bool MissingRequiredFields(const HasBits& has_bits) {
    return ((has_bits[0] & 0x00000001) ^ 0x00000001) != 0;
  }
};

LayerQuantizeParams_WinogradParams::LayerQuantizeParams_WinogradParams(::PROTOBUF_NAMESPACE_ID::Arena* arena,
                         bool is_message_owned)
  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned),
  units_attr_(arena) {
  SharedCtor();
  if (!is_message_owned) {
    RegisterArenaDtor(arena);
  }
  // @@protoc_insertion_point(arena_constructor:MNN.Compression.LayerQuantizeParams.WinogradParams)
}
LayerQuantizeParams_WinogradParams::LayerQuantizeParams_WinogradParams(const LayerQuantizeParams_WinogradParams& from)
  : ::PROTOBUF_NAMESPACE_ID::Message(),
      _has_bits_(from._has_bits_),
      units_attr_(from.units_attr_) {
  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
  version_ = from.version_;
  // @@protoc_insertion_point(copy_constructor:MNN.Compression.LayerQuantizeParams.WinogradParams)
}

inline void LayerQuantizeParams_WinogradParams::SharedCtor() {
version_ = 0;
}

LayerQuantizeParams_WinogradParams::~LayerQuantizeParams_WinogradParams() {
  // @@protoc_insertion_point(destructor:MNN.Compression.LayerQuantizeParams.WinogradParams)
  if (GetArenaForAllocation() != nullptr) return;
  SharedDtor();
  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
}

inline void LayerQuantizeParams_WinogradParams::SharedDtor() {
  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
}

void LayerQuantizeParams_WinogradParams::ArenaDtor(void* object) {
  LayerQuantizeParams_WinogradParams* _this = reinterpret_cast< LayerQuantizeParams_WinogradParams* >(object);
  (void)_this;
}
void LayerQuantizeParams_WinogradParams::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
}
void LayerQuantizeParams_WinogradParams::SetCachedSize(int size) const {
  _cached_size_.Set(size);
}

void LayerQuantizeParams_WinogradParams::Clear() {
// @@protoc_insertion_point(message_clear_start:MNN.Compression.LayerQuantizeParams.WinogradParams)
  uint32_t cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  units_attr_.Clear();
  version_ = 0;
  _has_bits_.Clear();
  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
}

const char* LayerQuantizeParams_WinogradParams::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  _Internal::HasBits has_bits{};
  while (!ctx->Done(&ptr)) {
    uint32_t tag;
    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
    switch (tag >> 3) {
      // required int32 version = 1 [default = 0];
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
          _Internal::set_has_version(&has_bits);
          version_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // repeated int32 units_attr = 4;
      case 4:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 32)) {
          ptr -= 1;
          do {
            ptr += 1;
            _internal_add_units_attr(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr));
            CHK_(ptr);
            if (!ctx->DataAvailable(ptr)) break;
          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<32>(ptr));
        } else if (static_cast<uint8_t>(tag) == 34) {
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedInt32Parser(_internal_mutable_units_attr(), ptr, ctx);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      default:
        goto handle_unusual;
    }  // switch
  handle_unusual:
    if ((tag == 0) || ((tag & 7) == 4)) {
      CHK_(ptr);
      ctx->SetLastTag(tag);
      goto message_done;
    }
    ptr = UnknownFieldParse(
        tag,
        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
        ptr, ctx);
    CHK_(ptr != nullptr);
  }  // while
message_done:
  _has_bits_.Or(has_bits);
  return ptr;
failure:
  ptr = nullptr;
  goto message_done;
#undef CHK_
}

uint8_t* LayerQuantizeParams_WinogradParams::_InternalSerialize(
    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:MNN.Compression.LayerQuantizeParams.WinogradParams)
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  cached_has_bits = _has_bits_[0];
  // required int32 version = 1 [default = 0];
  if (cached_has_bits & 0x00000001u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(1, this->_internal_version(), target);
  }

  // repeated int32 units_attr = 4;
  for (int i = 0, n = this->_internal_units_attr_size(); i < n; i++) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(4, this->_internal_units_attr(i), target);
  }

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
  }
  // @@protoc_insertion_point(serialize_to_array_end:MNN.Compression.LayerQuantizeParams.WinogradParams)
  return target;
}

size_t LayerQuantizeParams_WinogradParams::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:MNN.Compression.LayerQuantizeParams.WinogradParams)
  size_t total_size = 0;

  // required int32 version = 1 [default = 0];
  if (_internal_has_version()) {
    total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32SizePlusOne(this->_internal_version());
  }
  uint32_t cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  // repeated int32 units_attr = 4;
  {
    size_t data_size = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      Int32Size(this->units_attr_);
    total_size += 1 *
                  ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(this->_internal_units_attr_size());
    total_size += data_size;
  }

  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
}

const ::PROTOBUF_NAMESPACE_ID::Message::ClassData LayerQuantizeParams_WinogradParams::_class_data_ = {
    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
    LayerQuantizeParams_WinogradParams::MergeImpl
};
const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*LayerQuantizeParams_WinogradParams::GetClassData() const { return &_class_data_; }

void LayerQuantizeParams_WinogradParams::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
  static_cast<LayerQuantizeParams_WinogradParams *>(to)->MergeFrom(
      static_cast<const LayerQuantizeParams_WinogradParams &>(from));
}


void LayerQuantizeParams_WinogradParams::MergeFrom(const LayerQuantizeParams_WinogradParams& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:MNN.Compression.LayerQuantizeParams.WinogradParams)
  GOOGLE_DCHECK_NE(&from, this);
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  units_attr_.MergeFrom(from.units_attr_);
  if (from._internal_has_version()) {
    _internal_set_version(from._internal_version());
  }
  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
}

void LayerQuantizeParams_WinogradParams::CopyFrom(const LayerQuantizeParams_WinogradParams& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:MNN.Compression.LayerQuantizeParams.WinogradParams)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool LayerQuantizeParams_WinogradParams::IsInitialized() const {
  if (_Internal::MissingRequiredFields(_has_bits_)) return false;
  return true;
}

void LayerQuantizeParams_WinogradParams::InternalSwap(LayerQuantizeParams_WinogradParams* other) {
  using std::swap;
  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
  swap(_has_bits_[0], other->_has_bits_[0]);
  units_attr_.InternalSwap(&other->units_attr_);
  swap(version_, other->version_);
}

::PROTOBUF_NAMESPACE_ID::Metadata LayerQuantizeParams_WinogradParams::GetMetadata() const {
  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
      &descriptor_table_MNN_5fcompression_2eproto_getter, &descriptor_table_MNN_5fcompression_2eproto_once,
      file_level_metadata_MNN_5fcompression_2eproto[3]);
}

// ===================================================================

class LayerQuantizeParams::_Internal {
 public:
  using HasBits = decltype(std::declval<LayerQuantizeParams>()._has_bits_);
  static void set_has_method(HasBits* has_bits) {
    (*has_bits)[0] |= 2u;
  }
  static const ::MNN::Compression::LayerQuantizeParams_WinogradParams& wino_params(const LayerQuantizeParams* msg);
  static void set_has_wino_params(HasBits* has_bits) {
    (*has_bits)[0] |= 1u;
  }
};

const ::MNN::Compression::LayerQuantizeParams_WinogradParams&
LayerQuantizeParams::_Internal::wino_params(const LayerQuantizeParams* msg) {
  return *msg->wino_params_;
}
LayerQuantizeParams::LayerQuantizeParams(::PROTOBUF_NAMESPACE_ID::Arena* arena,
                         bool is_message_owned)
  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned),
  input_(arena),
  weight_(arena),
  output_(arena) {
  SharedCtor();
  if (!is_message_owned) {
    RegisterArenaDtor(arena);
  }
  // @@protoc_insertion_point(arena_constructor:MNN.Compression.LayerQuantizeParams)
}
LayerQuantizeParams::LayerQuantizeParams(const LayerQuantizeParams& from)
  : ::PROTOBUF_NAMESPACE_ID::Message(),
      _has_bits_(from._has_bits_),
      input_(from.input_),
      weight_(from.weight_),
      output_(from.output_) {
  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
  if (from._internal_has_wino_params()) {
    wino_params_ = new ::MNN::Compression::LayerQuantizeParams_WinogradParams(*from.wino_params_);
  } else {
    wino_params_ = nullptr;
  }
  method_ = from.method_;
  // @@protoc_insertion_point(copy_constructor:MNN.Compression.LayerQuantizeParams)
}

inline void LayerQuantizeParams::SharedCtor() {
::memset(reinterpret_cast<char*>(this) + static_cast<size_t>(
    reinterpret_cast<char*>(&wino_params_) - reinterpret_cast<char*>(this)),
    0, static_cast<size_t>(reinterpret_cast<char*>(&method_) -
    reinterpret_cast<char*>(&wino_params_)) + sizeof(method_));
}

LayerQuantizeParams::~LayerQuantizeParams() {
  // @@protoc_insertion_point(destructor:MNN.Compression.LayerQuantizeParams)
  if (GetArenaForAllocation() != nullptr) return;
  SharedDtor();
  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
}

inline void LayerQuantizeParams::SharedDtor() {
  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
  if (this != internal_default_instance()) delete wino_params_;
}

void LayerQuantizeParams::ArenaDtor(void* object) {
  LayerQuantizeParams* _this = reinterpret_cast< LayerQuantizeParams* >(object);
  (void)_this;
}
void LayerQuantizeParams::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
}
void LayerQuantizeParams::SetCachedSize(int size) const {
  _cached_size_.Set(size);
}

void LayerQuantizeParams::Clear() {
// @@protoc_insertion_point(message_clear_start:MNN.Compression.LayerQuantizeParams)
  uint32_t cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  input_.Clear();
  weight_.Clear();
  output_.Clear();
  cached_has_bits = _has_bits_[0];
  if (cached_has_bits & 0x00000001u) {
    GOOGLE_DCHECK(wino_params_ != nullptr);
    wino_params_->Clear();
  }
  method_ = 0;
  _has_bits_.Clear();
  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
}

const char* LayerQuantizeParams::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  _Internal::HasBits has_bits{};
  while (!ctx->Done(&ptr)) {
    uint32_t tag;
    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
    switch (tag >> 3) {
      // repeated .MNN.Compression.LayerQuantizeParams.ActivationParams input = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
          ptr -= 1;
          do {
            ptr += 1;
            ptr = ctx->ParseMessage(_internal_add_input(), ptr);
            CHK_(ptr);
            if (!ctx->DataAvailable(ptr)) break;
          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<10>(ptr));
        } else
          goto handle_unusual;
        continue;
      // repeated .MNN.Compression.LayerQuantizeParams.WeightParams weight = 2;
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 18)) {
          ptr -= 1;
          do {
            ptr += 1;
            ptr = ctx->ParseMessage(_internal_add_weight(), ptr);
            CHK_(ptr);
            if (!ctx->DataAvailable(ptr)) break;
          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<18>(ptr));
        } else
          goto handle_unusual;
        continue;
      // repeated .MNN.Compression.LayerQuantizeParams.ActivationParams output = 3;
      case 3:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 26)) {
          ptr -= 1;
          do {
            ptr += 1;
            ptr = ctx->ParseMessage(_internal_add_output(), ptr);
            CHK_(ptr);
            if (!ctx->DataAvailable(ptr)) break;
          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<26>(ptr));
        } else
          goto handle_unusual;
        continue;
      // optional .MNN.Compression.LayerQuantizeParams.QuantMethod method = 4 [default = QAT];
      case 4:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 32)) {
          uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
          if (PROTOBUF_PREDICT_TRUE(::MNN::Compression::LayerQuantizeParams_QuantMethod_IsValid(val))) {
            _internal_set_method(static_cast<::MNN::Compression::LayerQuantizeParams_QuantMethod>(val));
          } else {
            ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(4, val, mutable_unknown_fields());
          }
        } else
          goto handle_unusual;
        continue;
      // optional .MNN.Compression.LayerQuantizeParams.WinogradParams wino_params = 5;
      case 5:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 42)) {
          ptr = ctx->ParseMessage(_internal_mutable_wino_params(), ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      default:
        goto handle_unusual;
    }  // switch
  handle_unusual:
    if ((tag == 0) || ((tag & 7) == 4)) {
      CHK_(ptr);
      ctx->SetLastTag(tag);
      goto message_done;
    }
    ptr = UnknownFieldParse(
        tag,
        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
        ptr, ctx);
    CHK_(ptr != nullptr);
  }  // while
message_done:
  _has_bits_.Or(has_bits);
  return ptr;
failure:
  ptr = nullptr;
  goto message_done;
#undef CHK_
}

uint8_t* LayerQuantizeParams::_InternalSerialize(
    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:MNN.Compression.LayerQuantizeParams)
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  // repeated .MNN.Compression.LayerQuantizeParams.ActivationParams input = 1;
  for (unsigned int i = 0,
      n = static_cast<unsigned int>(this->_internal_input_size()); i < n; i++) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(1, this->_internal_input(i), target, stream);
  }

  // repeated .MNN.Compression.LayerQuantizeParams.WeightParams weight = 2;
  for (unsigned int i = 0,
      n = static_cast<unsigned int>(this->_internal_weight_size()); i < n; i++) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(2, this->_internal_weight(i), target, stream);
  }

  // repeated .MNN.Compression.LayerQuantizeParams.ActivationParams output = 3;
  for (unsigned int i = 0,
      n = static_cast<unsigned int>(this->_internal_output_size()); i < n; i++) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(3, this->_internal_output(i), target, stream);
  }

  cached_has_bits = _has_bits_[0];
  // optional .MNN.Compression.LayerQuantizeParams.QuantMethod method = 4 [default = QAT];
  if (cached_has_bits & 0x00000002u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
      4, this->_internal_method(), target);
  }

  // optional .MNN.Compression.LayerQuantizeParams.WinogradParams wino_params = 5;
  if (cached_has_bits & 0x00000001u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(
        5, _Internal::wino_params(this), target, stream);
  }

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
  }
  // @@protoc_insertion_point(serialize_to_array_end:MNN.Compression.LayerQuantizeParams)
  return target;
}

size_t LayerQuantizeParams::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:MNN.Compression.LayerQuantizeParams)
  size_t total_size = 0;

  uint32_t cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  // repeated .MNN.Compression.LayerQuantizeParams.ActivationParams input = 1;
  total_size += 1UL * this->_internal_input_size();
  for (const auto& msg : this->input_) {
    total_size +=
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
  }

  // repeated .MNN.Compression.LayerQuantizeParams.WeightParams weight = 2;
  total_size += 1UL * this->_internal_weight_size();
  for (const auto& msg : this->weight_) {
    total_size +=
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
  }

  // repeated .MNN.Compression.LayerQuantizeParams.ActivationParams output = 3;
  total_size += 1UL * this->_internal_output_size();
  for (const auto& msg : this->output_) {
    total_size +=
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
  }

  cached_has_bits = _has_bits_[0];
  if (cached_has_bits & 0x00000003u) {
    // optional .MNN.Compression.LayerQuantizeParams.WinogradParams wino_params = 5;
    if (cached_has_bits & 0x00000001u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          *wino_params_);
    }

    // optional .MNN.Compression.LayerQuantizeParams.QuantMethod method = 4 [default = QAT];
    if (cached_has_bits & 0x00000002u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_method());
    }

  }
  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
}

const ::PROTOBUF_NAMESPACE_ID::Message::ClassData LayerQuantizeParams::_class_data_ = {
    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
    LayerQuantizeParams::MergeImpl
};
const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*LayerQuantizeParams::GetClassData() const { return &_class_data_; }

void LayerQuantizeParams::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
  static_cast<LayerQuantizeParams *>(to)->MergeFrom(
      static_cast<const LayerQuantizeParams &>(from));
}


void LayerQuantizeParams::MergeFrom(const LayerQuantizeParams& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:MNN.Compression.LayerQuantizeParams)
  GOOGLE_DCHECK_NE(&from, this);
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  input_.MergeFrom(from.input_);
  weight_.MergeFrom(from.weight_);
  output_.MergeFrom(from.output_);
  cached_has_bits = from._has_bits_[0];
  if (cached_has_bits & 0x00000003u) {
    if (cached_has_bits & 0x00000001u) {
      _internal_mutable_wino_params()->::MNN::Compression::LayerQuantizeParams_WinogradParams::MergeFrom(from._internal_wino_params());
    }
    if (cached_has_bits & 0x00000002u) {
      method_ = from.method_;
    }
    _has_bits_[0] |= cached_has_bits;
  }
  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
}

void LayerQuantizeParams::CopyFrom(const LayerQuantizeParams& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:MNN.Compression.LayerQuantizeParams)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool LayerQuantizeParams::IsInitialized() const {
  if (!::PROTOBUF_NAMESPACE_ID::internal::AllAreInitialized(input_))
    return false;
  if (!::PROTOBUF_NAMESPACE_ID::internal::AllAreInitialized(weight_))
    return false;
  if (!::PROTOBUF_NAMESPACE_ID::internal::AllAreInitialized(output_))
    return false;
  if (_internal_has_wino_params()) {
    if (!wino_params_->IsInitialized()) return false;
  }
  return true;
}

void LayerQuantizeParams::InternalSwap(LayerQuantizeParams* other) {
  using std::swap;
  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
  swap(_has_bits_[0], other->_has_bits_[0]);
  input_.InternalSwap(&other->input_);
  weight_.InternalSwap(&other->weight_);
  output_.InternalSwap(&other->output_);
  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
      PROTOBUF_FIELD_OFFSET(LayerQuantizeParams, method_)
      + sizeof(LayerQuantizeParams::method_)
      - PROTOBUF_FIELD_OFFSET(LayerQuantizeParams, wino_params_)>(
          reinterpret_cast<char*>(&wino_params_),
          reinterpret_cast<char*>(&other->wino_params_));
}

::PROTOBUF_NAMESPACE_ID::Metadata LayerQuantizeParams::GetMetadata() const {
  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
      &descriptor_table_MNN_5fcompression_2eproto_getter, &descriptor_table_MNN_5fcompression_2eproto_once,
      file_level_metadata_MNN_5fcompression_2eproto[4]);
}

// ===================================================================

class LevelPrunerParams::_Internal {
 public:
};

LevelPrunerParams::LevelPrunerParams(::PROTOBUF_NAMESPACE_ID::Arena* arena,
                         bool is_message_owned)
  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned),
  weight_tensor_names_(arena),
  prune_ratios_(arena),
  layer_names_(arena) {
  SharedCtor();
  if (!is_message_owned) {
    RegisterArenaDtor(arena);
  }
  // @@protoc_insertion_point(arena_constructor:MNN.Compression.LevelPrunerParams)
}
LevelPrunerParams::LevelPrunerParams(const LevelPrunerParams& from)
  : ::PROTOBUF_NAMESPACE_ID::Message(),
      weight_tensor_names_(from.weight_tensor_names_),
      prune_ratios_(from.prune_ratios_),
      layer_names_(from.layer_names_) {
  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
  // @@protoc_insertion_point(copy_constructor:MNN.Compression.LevelPrunerParams)
}

inline void LevelPrunerParams::SharedCtor() {
}

LevelPrunerParams::~LevelPrunerParams() {
  // @@protoc_insertion_point(destructor:MNN.Compression.LevelPrunerParams)
  if (GetArenaForAllocation() != nullptr) return;
  SharedDtor();
  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
}

inline void LevelPrunerParams::SharedDtor() {
  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
}

void LevelPrunerParams::ArenaDtor(void* object) {
  LevelPrunerParams* _this = reinterpret_cast< LevelPrunerParams* >(object);
  (void)_this;
}
void LevelPrunerParams::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
}
void LevelPrunerParams::SetCachedSize(int size) const {
  _cached_size_.Set(size);
}

void LevelPrunerParams::Clear() {
// @@protoc_insertion_point(message_clear_start:MNN.Compression.LevelPrunerParams)
  uint32_t cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  weight_tensor_names_.Clear();
  prune_ratios_.Clear();
  layer_names_.Clear();
  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
}

const char* LevelPrunerParams::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  while (!ctx->Done(&ptr)) {
    uint32_t tag;
    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
    switch (tag >> 3) {
      // repeated string weight_tensor_names = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
          ptr -= 1;
          do {
            ptr += 1;
            auto str = _internal_add_weight_tensor_names();
            ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
            #ifndef NDEBUG
            ::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "MNN.Compression.LevelPrunerParams.weight_tensor_names");
            #endif  // !NDEBUG
            CHK_(ptr);
            if (!ctx->DataAvailable(ptr)) break;
          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<10>(ptr));
        } else
          goto handle_unusual;
        continue;
      // repeated float prune_ratios = 2;
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 21)) {
          ptr -= 1;
          do {
            ptr += 1;
            _internal_add_prune_ratios(::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr));
            ptr += sizeof(float);
            if (!ctx->DataAvailable(ptr)) break;
          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<21>(ptr));
        } else if (static_cast<uint8_t>(tag) == 18) {
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedFloatParser(_internal_mutable_prune_ratios(), ptr, ctx);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // repeated string layer_names = 3;
      case 3:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 26)) {
          ptr -= 1;
          do {
            ptr += 1;
            auto str = _internal_add_layer_names();
            ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
            #ifndef NDEBUG
            ::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "MNN.Compression.LevelPrunerParams.layer_names");
            #endif  // !NDEBUG
            CHK_(ptr);
            if (!ctx->DataAvailable(ptr)) break;
          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<26>(ptr));
        } else
          goto handle_unusual;
        continue;
      default:
        goto handle_unusual;
    }  // switch
  handle_unusual:
    if ((tag == 0) || ((tag & 7) == 4)) {
      CHK_(ptr);
      ctx->SetLastTag(tag);
      goto message_done;
    }
    ptr = UnknownFieldParse(
        tag,
        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
        ptr, ctx);
    CHK_(ptr != nullptr);
  }  // while
message_done:
  return ptr;
failure:
  ptr = nullptr;
  goto message_done;
#undef CHK_
}

uint8_t* LevelPrunerParams::_InternalSerialize(
    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:MNN.Compression.LevelPrunerParams)
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  // repeated string weight_tensor_names = 1;
  for (int i = 0, n = this->_internal_weight_tensor_names_size(); i < n; i++) {
    const auto& s = this->_internal_weight_tensor_names(i);
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
      s.data(), static_cast<int>(s.length()),
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
      "MNN.Compression.LevelPrunerParams.weight_tensor_names");
    target = stream->WriteString(1, s, target);
  }

  // repeated float prune_ratios = 2;
  for (int i = 0, n = this->_internal_prune_ratios_size(); i < n; i++) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(2, this->_internal_prune_ratios(i), target);
  }

  // repeated string layer_names = 3;
  for (int i = 0, n = this->_internal_layer_names_size(); i < n; i++) {
    const auto& s = this->_internal_layer_names(i);
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
      s.data(), static_cast<int>(s.length()),
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
      "MNN.Compression.LevelPrunerParams.layer_names");
    target = stream->WriteString(3, s, target);
  }

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
  }
  // @@protoc_insertion_point(serialize_to_array_end:MNN.Compression.LevelPrunerParams)
  return target;
}

size_t LevelPrunerParams::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:MNN.Compression.LevelPrunerParams)
  size_t total_size = 0;

  uint32_t cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  // repeated string weight_tensor_names = 1;
  total_size += 1 *
      ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(weight_tensor_names_.size());
  for (int i = 0, n = weight_tensor_names_.size(); i < n; i++) {
    total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
      weight_tensor_names_.Get(i));
  }

  // repeated float prune_ratios = 2;
  {
    unsigned int count = static_cast<unsigned int>(this->_internal_prune_ratios_size());
    size_t data_size = 4UL * count;
    total_size += 1 *
                  ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(this->_internal_prune_ratios_size());
    total_size += data_size;
  }

  // repeated string layer_names = 3;
  total_size += 1 *
      ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(layer_names_.size());
  for (int i = 0, n = layer_names_.size(); i < n; i++) {
    total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
      layer_names_.Get(i));
  }

  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
}

const ::PROTOBUF_NAMESPACE_ID::Message::ClassData LevelPrunerParams::_class_data_ = {
    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
    LevelPrunerParams::MergeImpl
};
const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*LevelPrunerParams::GetClassData() const { return &_class_data_; }

void LevelPrunerParams::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
  static_cast<LevelPrunerParams *>(to)->MergeFrom(
      static_cast<const LevelPrunerParams &>(from));
}


void LevelPrunerParams::MergeFrom(const LevelPrunerParams& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:MNN.Compression.LevelPrunerParams)
  GOOGLE_DCHECK_NE(&from, this);
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  weight_tensor_names_.MergeFrom(from.weight_tensor_names_);
  prune_ratios_.MergeFrom(from.prune_ratios_);
  layer_names_.MergeFrom(from.layer_names_);
  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
}

void LevelPrunerParams::CopyFrom(const LevelPrunerParams& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:MNN.Compression.LevelPrunerParams)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool LevelPrunerParams::IsInitialized() const {
  return true;
}

void LevelPrunerParams::InternalSwap(LevelPrunerParams* other) {
  using std::swap;
  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
  weight_tensor_names_.InternalSwap(&other->weight_tensor_names_);
  prune_ratios_.InternalSwap(&other->prune_ratios_);
  layer_names_.InternalSwap(&other->layer_names_);
}

::PROTOBUF_NAMESPACE_ID::Metadata LevelPrunerParams::GetMetadata() const {
  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
      &descriptor_table_MNN_5fcompression_2eproto_getter, &descriptor_table_MNN_5fcompression_2eproto_once,
      file_level_metadata_MNN_5fcompression_2eproto[5]);
}

// ===================================================================

class SIMDOCPrunerParams::_Internal {
 public:
};

SIMDOCPrunerParams::SIMDOCPrunerParams(::PROTOBUF_NAMESPACE_ID::Arena* arena,
                         bool is_message_owned)
  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned),
  weight_tensor_names_(arena),
  prune_ratios_(arena),
  layer_names_(arena),
  oc_blocks_(arena) {
  SharedCtor();
  if (!is_message_owned) {
    RegisterArenaDtor(arena);
  }
  // @@protoc_insertion_point(arena_constructor:MNN.Compression.SIMDOCPrunerParams)
}
SIMDOCPrunerParams::SIMDOCPrunerParams(const SIMDOCPrunerParams& from)
  : ::PROTOBUF_NAMESPACE_ID::Message(),
      weight_tensor_names_(from.weight_tensor_names_),
      prune_ratios_(from.prune_ratios_),
      layer_names_(from.layer_names_),
      oc_blocks_(from.oc_blocks_) {
  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
  // @@protoc_insertion_point(copy_constructor:MNN.Compression.SIMDOCPrunerParams)
}

inline void SIMDOCPrunerParams::SharedCtor() {
}

SIMDOCPrunerParams::~SIMDOCPrunerParams() {
  // @@protoc_insertion_point(destructor:MNN.Compression.SIMDOCPrunerParams)
  if (GetArenaForAllocation() != nullptr) return;
  SharedDtor();
  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
}

inline void SIMDOCPrunerParams::SharedDtor() {
  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
}

void SIMDOCPrunerParams::ArenaDtor(void* object) {
  SIMDOCPrunerParams* _this = reinterpret_cast< SIMDOCPrunerParams* >(object);
  (void)_this;
}
void SIMDOCPrunerParams::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
}
void SIMDOCPrunerParams::SetCachedSize(int size) const {
  _cached_size_.Set(size);
}

void SIMDOCPrunerParams::Clear() {
// @@protoc_insertion_point(message_clear_start:MNN.Compression.SIMDOCPrunerParams)
  uint32_t cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  weight_tensor_names_.Clear();
  prune_ratios_.Clear();
  layer_names_.Clear();
  oc_blocks_.Clear();
  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
}

const char* SIMDOCPrunerParams::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  while (!ctx->Done(&ptr)) {
    uint32_t tag;
    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
    switch (tag >> 3) {
      // repeated string weight_tensor_names = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
          ptr -= 1;
          do {
            ptr += 1;
            auto str = _internal_add_weight_tensor_names();
            ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
            #ifndef NDEBUG
            ::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "MNN.Compression.SIMDOCPrunerParams.weight_tensor_names");
            #endif  // !NDEBUG
            CHK_(ptr);
            if (!ctx->DataAvailable(ptr)) break;
          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<10>(ptr));
        } else
          goto handle_unusual;
        continue;
      // repeated float prune_ratios = 2;
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 21)) {
          ptr -= 1;
          do {
            ptr += 1;
            _internal_add_prune_ratios(::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr));
            ptr += sizeof(float);
            if (!ctx->DataAvailable(ptr)) break;
          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<21>(ptr));
        } else if (static_cast<uint8_t>(tag) == 18) {
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedFloatParser(_internal_mutable_prune_ratios(), ptr, ctx);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // repeated string layer_names = 3;
      case 3:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 26)) {
          ptr -= 1;
          do {
            ptr += 1;
            auto str = _internal_add_layer_names();
            ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
            #ifndef NDEBUG
            ::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "MNN.Compression.SIMDOCPrunerParams.layer_names");
            #endif  // !NDEBUG
            CHK_(ptr);
            if (!ctx->DataAvailable(ptr)) break;
          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<26>(ptr));
        } else
          goto handle_unusual;
        continue;
      // repeated int32 oc_blocks = 4;
      case 4:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 32)) {
          ptr -= 1;
          do {
            ptr += 1;
            _internal_add_oc_blocks(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr));
            CHK_(ptr);
            if (!ctx->DataAvailable(ptr)) break;
          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<32>(ptr));
        } else if (static_cast<uint8_t>(tag) == 34) {
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedInt32Parser(_internal_mutable_oc_blocks(), ptr, ctx);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      default:
        goto handle_unusual;
    }  // switch
  handle_unusual:
    if ((tag == 0) || ((tag & 7) == 4)) {
      CHK_(ptr);
      ctx->SetLastTag(tag);
      goto message_done;
    }
    ptr = UnknownFieldParse(
        tag,
        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
        ptr, ctx);
    CHK_(ptr != nullptr);
  }  // while
message_done:
  return ptr;
failure:
  ptr = nullptr;
  goto message_done;
#undef CHK_
}

uint8_t* SIMDOCPrunerParams::_InternalSerialize(
    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:MNN.Compression.SIMDOCPrunerParams)
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  // repeated string weight_tensor_names = 1;
  for (int i = 0, n = this->_internal_weight_tensor_names_size(); i < n; i++) {
    const auto& s = this->_internal_weight_tensor_names(i);
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
      s.data(), static_cast<int>(s.length()),
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
      "MNN.Compression.SIMDOCPrunerParams.weight_tensor_names");
    target = stream->WriteString(1, s, target);
  }

  // repeated float prune_ratios = 2;
  for (int i = 0, n = this->_internal_prune_ratios_size(); i < n; i++) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(2, this->_internal_prune_ratios(i), target);
  }

  // repeated string layer_names = 3;
  for (int i = 0, n = this->_internal_layer_names_size(); i < n; i++) {
    const auto& s = this->_internal_layer_names(i);
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
      s.data(), static_cast<int>(s.length()),
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
      "MNN.Compression.SIMDOCPrunerParams.layer_names");
    target = stream->WriteString(3, s, target);
  }

  // repeated int32 oc_blocks = 4;
  for (int i = 0, n = this->_internal_oc_blocks_size(); i < n; i++) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(4, this->_internal_oc_blocks(i), target);
  }

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
  }
  // @@protoc_insertion_point(serialize_to_array_end:MNN.Compression.SIMDOCPrunerParams)
  return target;
}

size_t SIMDOCPrunerParams::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:MNN.Compression.SIMDOCPrunerParams)
  size_t total_size = 0;

  uint32_t cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  // repeated string weight_tensor_names = 1;
  total_size += 1 *
      ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(weight_tensor_names_.size());
  for (int i = 0, n = weight_tensor_names_.size(); i < n; i++) {
    total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
      weight_tensor_names_.Get(i));
  }

  // repeated float prune_ratios = 2;
  {
    unsigned int count = static_cast<unsigned int>(this->_internal_prune_ratios_size());
    size_t data_size = 4UL * count;
    total_size += 1 *
                  ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(this->_internal_prune_ratios_size());
    total_size += data_size;
  }

  // repeated string layer_names = 3;
  total_size += 1 *
      ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(layer_names_.size());
  for (int i = 0, n = layer_names_.size(); i < n; i++) {
    total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
      layer_names_.Get(i));
  }

  // repeated int32 oc_blocks = 4;
  {
    size_t data_size = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      Int32Size(this->oc_blocks_);
    total_size += 1 *
                  ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(this->_internal_oc_blocks_size());
    total_size += data_size;
  }

  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
}

const ::PROTOBUF_NAMESPACE_ID::Message::ClassData SIMDOCPrunerParams::_class_data_ = {
    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
    SIMDOCPrunerParams::MergeImpl
};
const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*SIMDOCPrunerParams::GetClassData() const { return &_class_data_; }

void SIMDOCPrunerParams::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
  static_cast<SIMDOCPrunerParams *>(to)->MergeFrom(
      static_cast<const SIMDOCPrunerParams &>(from));
}


void SIMDOCPrunerParams::MergeFrom(const SIMDOCPrunerParams& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:MNN.Compression.SIMDOCPrunerParams)
  GOOGLE_DCHECK_NE(&from, this);
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  weight_tensor_names_.MergeFrom(from.weight_tensor_names_);
  prune_ratios_.MergeFrom(from.prune_ratios_);
  layer_names_.MergeFrom(from.layer_names_);
  oc_blocks_.MergeFrom(from.oc_blocks_);
  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
}

void SIMDOCPrunerParams::CopyFrom(const SIMDOCPrunerParams& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:MNN.Compression.SIMDOCPrunerParams)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool SIMDOCPrunerParams::IsInitialized() const {
  return true;
}

void SIMDOCPrunerParams::InternalSwap(SIMDOCPrunerParams* other) {
  using std::swap;
  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
  weight_tensor_names_.InternalSwap(&other->weight_tensor_names_);
  prune_ratios_.InternalSwap(&other->prune_ratios_);
  layer_names_.InternalSwap(&other->layer_names_);
  oc_blocks_.InternalSwap(&other->oc_blocks_);
}

::PROTOBUF_NAMESPACE_ID::Metadata SIMDOCPrunerParams::GetMetadata() const {
  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
      &descriptor_table_MNN_5fcompression_2eproto_getter, &descriptor_table_MNN_5fcompression_2eproto_once,
      file_level_metadata_MNN_5fcompression_2eproto[6]);
}

// ===================================================================

class PruneParams::_Internal {
 public:
  using HasBits = decltype(std::declval<PruneParams>()._has_bits_);
  static void set_has_type(HasBits* has_bits) {
    (*has_bits)[0] |= 4u;
  }
  static const ::MNN::Compression::LevelPrunerParams& level_pruner_params(const PruneParams* msg);
  static void set_has_level_pruner_params(HasBits* has_bits) {
    (*has_bits)[0] |= 1u;
  }
  static const ::MNN::Compression::SIMDOCPrunerParams& simd_oc_pruner_params(const PruneParams* msg);
  static void set_has_simd_oc_pruner_params(HasBits* has_bits) {
    (*has_bits)[0] |= 2u;
  }
};

const ::MNN::Compression::LevelPrunerParams&
PruneParams::_Internal::level_pruner_params(const PruneParams* msg) {
  return *msg->level_pruner_params_;
}
const ::MNN::Compression::SIMDOCPrunerParams&
PruneParams::_Internal::simd_oc_pruner_params(const PruneParams* msg) {
  return *msg->simd_oc_pruner_params_;
}
PruneParams::PruneParams(::PROTOBUF_NAMESPACE_ID::Arena* arena,
                         bool is_message_owned)
  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) {
  SharedCtor();
  if (!is_message_owned) {
    RegisterArenaDtor(arena);
  }
  // @@protoc_insertion_point(arena_constructor:MNN.Compression.PruneParams)
}
PruneParams::PruneParams(const PruneParams& from)
  : ::PROTOBUF_NAMESPACE_ID::Message(),
      _has_bits_(from._has_bits_) {
  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
  if (from._internal_has_level_pruner_params()) {
    level_pruner_params_ = new ::MNN::Compression::LevelPrunerParams(*from.level_pruner_params_);
  } else {
    level_pruner_params_ = nullptr;
  }
  if (from._internal_has_simd_oc_pruner_params()) {
    simd_oc_pruner_params_ = new ::MNN::Compression::SIMDOCPrunerParams(*from.simd_oc_pruner_params_);
  } else {
    simd_oc_pruner_params_ = nullptr;
  }
  type_ = from.type_;
  // @@protoc_insertion_point(copy_constructor:MNN.Compression.PruneParams)
}

inline void PruneParams::SharedCtor() {
::memset(reinterpret_cast<char*>(this) + static_cast<size_t>(
    reinterpret_cast<char*>(&level_pruner_params_) - reinterpret_cast<char*>(this)),
    0, static_cast<size_t>(reinterpret_cast<char*>(&type_) -
    reinterpret_cast<char*>(&level_pruner_params_)) + sizeof(type_));
}

PruneParams::~PruneParams() {
  // @@protoc_insertion_point(destructor:MNN.Compression.PruneParams)
  if (GetArenaForAllocation() != nullptr) return;
  SharedDtor();
  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
}

inline void PruneParams::SharedDtor() {
  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
  if (this != internal_default_instance()) delete level_pruner_params_;
  if (this != internal_default_instance()) delete simd_oc_pruner_params_;
}

void PruneParams::ArenaDtor(void* object) {
  PruneParams* _this = reinterpret_cast< PruneParams* >(object);
  (void)_this;
}
void PruneParams::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
}
void PruneParams::SetCachedSize(int size) const {
  _cached_size_.Set(size);
}

void PruneParams::Clear() {
// @@protoc_insertion_point(message_clear_start:MNN.Compression.PruneParams)
  uint32_t cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  cached_has_bits = _has_bits_[0];
  if (cached_has_bits & 0x00000003u) {
    if (cached_has_bits & 0x00000001u) {
      GOOGLE_DCHECK(level_pruner_params_ != nullptr);
      level_pruner_params_->Clear();
    }
    if (cached_has_bits & 0x00000002u) {
      GOOGLE_DCHECK(simd_oc_pruner_params_ != nullptr);
      simd_oc_pruner_params_->Clear();
    }
  }
  type_ = 0;
  _has_bits_.Clear();
  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
}

const char* PruneParams::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  _Internal::HasBits has_bits{};
  while (!ctx->Done(&ptr)) {
    uint32_t tag;
    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
    switch (tag >> 3) {
      // optional .MNN.Compression.PruneParams.PruneType type = 1 [default = RANDOM];
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
          uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
          if (PROTOBUF_PREDICT_TRUE(::MNN::Compression::PruneParams_PruneType_IsValid(val))) {
            _internal_set_type(static_cast<::MNN::Compression::PruneParams_PruneType>(val));
          } else {
            ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(1, val, mutable_unknown_fields());
          }
        } else
          goto handle_unusual;
        continue;
      // optional .MNN.Compression.LevelPrunerParams level_pruner_params = 2;
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 18)) {
          ptr = ctx->ParseMessage(_internal_mutable_level_pruner_params(), ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional .MNN.Compression.SIMDOCPrunerParams simd_oc_pruner_params = 3;
      case 3:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 26)) {
          ptr = ctx->ParseMessage(_internal_mutable_simd_oc_pruner_params(), ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      default:
        goto handle_unusual;
    }  // switch
  handle_unusual:
    if ((tag == 0) || ((tag & 7) == 4)) {
      CHK_(ptr);
      ctx->SetLastTag(tag);
      goto message_done;
    }
    ptr = UnknownFieldParse(
        tag,
        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
        ptr, ctx);
    CHK_(ptr != nullptr);
  }  // while
message_done:
  _has_bits_.Or(has_bits);
  return ptr;
failure:
  ptr = nullptr;
  goto message_done;
#undef CHK_
}

uint8_t* PruneParams::_InternalSerialize(
    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:MNN.Compression.PruneParams)
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  cached_has_bits = _has_bits_[0];
  // optional .MNN.Compression.PruneParams.PruneType type = 1 [default = RANDOM];
  if (cached_has_bits & 0x00000004u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
      1, this->_internal_type(), target);
  }

  // optional .MNN.Compression.LevelPrunerParams level_pruner_params = 2;
  if (cached_has_bits & 0x00000001u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(
        2, _Internal::level_pruner_params(this), target, stream);
  }

  // optional .MNN.Compression.SIMDOCPrunerParams simd_oc_pruner_params = 3;
  if (cached_has_bits & 0x00000002u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(
        3, _Internal::simd_oc_pruner_params(this), target, stream);
  }

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
  }
  // @@protoc_insertion_point(serialize_to_array_end:MNN.Compression.PruneParams)
  return target;
}

size_t PruneParams::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:MNN.Compression.PruneParams)
  size_t total_size = 0;

  uint32_t cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  cached_has_bits = _has_bits_[0];
  if (cached_has_bits & 0x00000007u) {
    // optional .MNN.Compression.LevelPrunerParams level_pruner_params = 2;
    if (cached_has_bits & 0x00000001u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          *level_pruner_params_);
    }

    // optional .MNN.Compression.SIMDOCPrunerParams simd_oc_pruner_params = 3;
    if (cached_has_bits & 0x00000002u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          *simd_oc_pruner_params_);
    }

    // optional .MNN.Compression.PruneParams.PruneType type = 1 [default = RANDOM];
    if (cached_has_bits & 0x00000004u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_type());
    }

  }
  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
}

const ::PROTOBUF_NAMESPACE_ID::Message::ClassData PruneParams::_class_data_ = {
    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
    PruneParams::MergeImpl
};
const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*PruneParams::GetClassData() const { return &_class_data_; }

void PruneParams::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
  static_cast<PruneParams *>(to)->MergeFrom(
      static_cast<const PruneParams &>(from));
}


void PruneParams::MergeFrom(const PruneParams& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:MNN.Compression.PruneParams)
  GOOGLE_DCHECK_NE(&from, this);
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  cached_has_bits = from._has_bits_[0];
  if (cached_has_bits & 0x00000007u) {
    if (cached_has_bits & 0x00000001u) {
      _internal_mutable_level_pruner_params()->::MNN::Compression::LevelPrunerParams::MergeFrom(from._internal_level_pruner_params());
    }
    if (cached_has_bits & 0x00000002u) {
      _internal_mutable_simd_oc_pruner_params()->::MNN::Compression::SIMDOCPrunerParams::MergeFrom(from._internal_simd_oc_pruner_params());
    }
    if (cached_has_bits & 0x00000004u) {
      type_ = from.type_;
    }
    _has_bits_[0] |= cached_has_bits;
  }
  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
}

void PruneParams::CopyFrom(const PruneParams& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:MNN.Compression.PruneParams)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool PruneParams::IsInitialized() const {
  return true;
}

void PruneParams::InternalSwap(PruneParams* other) {
  using std::swap;
  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
  swap(_has_bits_[0], other->_has_bits_[0]);
  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
      PROTOBUF_FIELD_OFFSET(PruneParams, type_)
      + sizeof(PruneParams::type_)
      - PROTOBUF_FIELD_OFFSET(PruneParams, level_pruner_params_)>(
          reinterpret_cast<char*>(&level_pruner_params_),
          reinterpret_cast<char*>(&other->level_pruner_params_));
}

::PROTOBUF_NAMESPACE_ID::Metadata PruneParams::GetMetadata() const {
  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
      &descriptor_table_MNN_5fcompression_2eproto_getter, &descriptor_table_MNN_5fcompression_2eproto_once,
      file_level_metadata_MNN_5fcompression_2eproto[7]);
}

// ===================================================================

class CompressionAlgo::_Internal {
 public:
  using HasBits = decltype(std::declval<CompressionAlgo>()._has_bits_);
  static void set_has_type(HasBits* has_bits) {
    (*has_bits)[0] |= 4u;
  }
  static const ::MNN::Compression::QuantizeParams& quant_params(const CompressionAlgo* msg);
  static void set_has_quant_params(HasBits* has_bits) {
    (*has_bits)[0] |= 1u;
  }
  static const ::MNN::Compression::PruneParams& prune_params(const CompressionAlgo* msg);
  static void set_has_prune_params(HasBits* has_bits) {
    (*has_bits)[0] |= 2u;
  }
};

const ::MNN::Compression::QuantizeParams&
CompressionAlgo::_Internal::quant_params(const CompressionAlgo* msg) {
  return *msg->quant_params_;
}
const ::MNN::Compression::PruneParams&
CompressionAlgo::_Internal::prune_params(const CompressionAlgo* msg) {
  return *msg->prune_params_;
}
CompressionAlgo::CompressionAlgo(::PROTOBUF_NAMESPACE_ID::Arena* arena,
                         bool is_message_owned)
  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) {
  SharedCtor();
  if (!is_message_owned) {
    RegisterArenaDtor(arena);
  }
  // @@protoc_insertion_point(arena_constructor:MNN.Compression.CompressionAlgo)
}
CompressionAlgo::CompressionAlgo(const CompressionAlgo& from)
  : ::PROTOBUF_NAMESPACE_ID::Message(),
      _has_bits_(from._has_bits_) {
  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
  if (from._internal_has_quant_params()) {
    quant_params_ = new ::MNN::Compression::QuantizeParams(*from.quant_params_);
  } else {
    quant_params_ = nullptr;
  }
  if (from._internal_has_prune_params()) {
    prune_params_ = new ::MNN::Compression::PruneParams(*from.prune_params_);
  } else {
    prune_params_ = nullptr;
  }
  type_ = from.type_;
  // @@protoc_insertion_point(copy_constructor:MNN.Compression.CompressionAlgo)
}

inline void CompressionAlgo::SharedCtor() {
::memset(reinterpret_cast<char*>(this) + static_cast<size_t>(
    reinterpret_cast<char*>(&quant_params_) - reinterpret_cast<char*>(this)),
    0, static_cast<size_t>(reinterpret_cast<char*>(&type_) -
    reinterpret_cast<char*>(&quant_params_)) + sizeof(type_));
}

CompressionAlgo::~CompressionAlgo() {
  // @@protoc_insertion_point(destructor:MNN.Compression.CompressionAlgo)
  if (GetArenaForAllocation() != nullptr) return;
  SharedDtor();
  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
}

inline void CompressionAlgo::SharedDtor() {
  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
  if (this != internal_default_instance()) delete quant_params_;
  if (this != internal_default_instance()) delete prune_params_;
}

void CompressionAlgo::ArenaDtor(void* object) {
  CompressionAlgo* _this = reinterpret_cast< CompressionAlgo* >(object);
  (void)_this;
}
void CompressionAlgo::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
}
void CompressionAlgo::SetCachedSize(int size) const {
  _cached_size_.Set(size);
}

void CompressionAlgo::Clear() {
// @@protoc_insertion_point(message_clear_start:MNN.Compression.CompressionAlgo)
  uint32_t cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  cached_has_bits = _has_bits_[0];
  if (cached_has_bits & 0x00000003u) {
    if (cached_has_bits & 0x00000001u) {
      GOOGLE_DCHECK(quant_params_ != nullptr);
      quant_params_->Clear();
    }
    if (cached_has_bits & 0x00000002u) {
      GOOGLE_DCHECK(prune_params_ != nullptr);
      prune_params_->Clear();
    }
  }
  type_ = 0;
  _has_bits_.Clear();
  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
}

const char* CompressionAlgo::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  _Internal::HasBits has_bits{};
  while (!ctx->Done(&ptr)) {
    uint32_t tag;
    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
    switch (tag >> 3) {
      // optional .MNN.Compression.CompressionAlgo.CompressionType type = 1 [default = QUANTIZE];
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
          uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
          if (PROTOBUF_PREDICT_TRUE(::MNN::Compression::CompressionAlgo_CompressionType_IsValid(val))) {
            _internal_set_type(static_cast<::MNN::Compression::CompressionAlgo_CompressionType>(val));
          } else {
            ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(1, val, mutable_unknown_fields());
          }
        } else
          goto handle_unusual;
        continue;
      // optional .MNN.Compression.QuantizeParams quant_params = 2;
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 18)) {
          ptr = ctx->ParseMessage(_internal_mutable_quant_params(), ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional .MNN.Compression.PruneParams prune_params = 3;
      case 3:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 26)) {
          ptr = ctx->ParseMessage(_internal_mutable_prune_params(), ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      default:
        goto handle_unusual;
    }  // switch
  handle_unusual:
    if ((tag == 0) || ((tag & 7) == 4)) {
      CHK_(ptr);
      ctx->SetLastTag(tag);
      goto message_done;
    }
    ptr = UnknownFieldParse(
        tag,
        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
        ptr, ctx);
    CHK_(ptr != nullptr);
  }  // while
message_done:
  _has_bits_.Or(has_bits);
  return ptr;
failure:
  ptr = nullptr;
  goto message_done;
#undef CHK_
}

uint8_t* CompressionAlgo::_InternalSerialize(
    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:MNN.Compression.CompressionAlgo)
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  cached_has_bits = _has_bits_[0];
  // optional .MNN.Compression.CompressionAlgo.CompressionType type = 1 [default = QUANTIZE];
  if (cached_has_bits & 0x00000004u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
      1, this->_internal_type(), target);
  }

  // optional .MNN.Compression.QuantizeParams quant_params = 2;
  if (cached_has_bits & 0x00000001u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(
        2, _Internal::quant_params(this), target, stream);
  }

  // optional .MNN.Compression.PruneParams prune_params = 3;
  if (cached_has_bits & 0x00000002u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(
        3, _Internal::prune_params(this), target, stream);
  }

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
  }
  // @@protoc_insertion_point(serialize_to_array_end:MNN.Compression.CompressionAlgo)
  return target;
}

size_t CompressionAlgo::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:MNN.Compression.CompressionAlgo)
  size_t total_size = 0;

  uint32_t cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  cached_has_bits = _has_bits_[0];
  if (cached_has_bits & 0x00000007u) {
    // optional .MNN.Compression.QuantizeParams quant_params = 2;
    if (cached_has_bits & 0x00000001u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          *quant_params_);
    }

    // optional .MNN.Compression.PruneParams prune_params = 3;
    if (cached_has_bits & 0x00000002u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          *prune_params_);
    }

    // optional .MNN.Compression.CompressionAlgo.CompressionType type = 1 [default = QUANTIZE];
    if (cached_has_bits & 0x00000004u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_type());
    }

  }
  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
}

const ::PROTOBUF_NAMESPACE_ID::Message::ClassData CompressionAlgo::_class_data_ = {
    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
    CompressionAlgo::MergeImpl
};
const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*CompressionAlgo::GetClassData() const { return &_class_data_; }

void CompressionAlgo::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
  static_cast<CompressionAlgo *>(to)->MergeFrom(
      static_cast<const CompressionAlgo &>(from));
}


void CompressionAlgo::MergeFrom(const CompressionAlgo& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:MNN.Compression.CompressionAlgo)
  GOOGLE_DCHECK_NE(&from, this);
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  cached_has_bits = from._has_bits_[0];
  if (cached_has_bits & 0x00000007u) {
    if (cached_has_bits & 0x00000001u) {
      _internal_mutable_quant_params()->::MNN::Compression::QuantizeParams::MergeFrom(from._internal_quant_params());
    }
    if (cached_has_bits & 0x00000002u) {
      _internal_mutable_prune_params()->::MNN::Compression::PruneParams::MergeFrom(from._internal_prune_params());
    }
    if (cached_has_bits & 0x00000004u) {
      type_ = from.type_;
    }
    _has_bits_[0] |= cached_has_bits;
  }
  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
}

void CompressionAlgo::CopyFrom(const CompressionAlgo& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:MNN.Compression.CompressionAlgo)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool CompressionAlgo::IsInitialized() const {
  if (_internal_has_quant_params()) {
    if (!quant_params_->IsInitialized()) return false;
  }
  return true;
}

void CompressionAlgo::InternalSwap(CompressionAlgo* other) {
  using std::swap;
  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
  swap(_has_bits_[0], other->_has_bits_[0]);
  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
      PROTOBUF_FIELD_OFFSET(CompressionAlgo, type_)
      + sizeof(CompressionAlgo::type_)
      - PROTOBUF_FIELD_OFFSET(CompressionAlgo, quant_params_)>(
          reinterpret_cast<char*>(&quant_params_),
          reinterpret_cast<char*>(&other->quant_params_));
}

::PROTOBUF_NAMESPACE_ID::Metadata CompressionAlgo::GetMetadata() const {
  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
      &descriptor_table_MNN_5fcompression_2eproto_getter, &descriptor_table_MNN_5fcompression_2eproto_once,
      file_level_metadata_MNN_5fcompression_2eproto[8]);
}

// ===================================================================

class Pipeline::_Internal {
 public:
  using HasBits = decltype(std::declval<Pipeline>()._has_bits_);
  static void set_has_version(HasBits* has_bits) {
    (*has_bits)[0] |= 1u;
  }
  static void set_has_mnn_uuid(HasBits* has_bits) {
    (*has_bits)[0] |= 2u;
  }
  static bool MissingRequiredFields(const HasBits& has_bits) {
    return ((has_bits[0] & 0x00000001) ^ 0x00000001) != 0;
  }
};

const ::PROTOBUF_NAMESPACE_ID::internal::LazyString Pipeline::_i_give_permission_to_break_this_code_default_version_{{{"0.0.0", 5}}, {nullptr}};
Pipeline::Pipeline(::PROTOBUF_NAMESPACE_ID::Arena* arena,
                         bool is_message_owned)
  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned),
  algo_(arena) {
  SharedCtor();
  if (!is_message_owned) {
    RegisterArenaDtor(arena);
  }
  // @@protoc_insertion_point(arena_constructor:MNN.Compression.Pipeline)
}
Pipeline::Pipeline(const Pipeline& from)
  : ::PROTOBUF_NAMESPACE_ID::Message(),
      _has_bits_(from._has_bits_),
      algo_(from.algo_) {
  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
  version_.UnsafeSetDefault(nullptr);
  if (from._internal_has_version()) {
    version_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::NonEmptyDefault{}, from._internal_version(), 
      GetArenaForAllocation());
  }
  mnn_uuid_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
    mnn_uuid_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  if (from._internal_has_mnn_uuid()) {
    mnn_uuid_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_mnn_uuid(), 
      GetArenaForAllocation());
  }
  // @@protoc_insertion_point(copy_constructor:MNN.Compression.Pipeline)
}

inline void Pipeline::SharedCtor() {
version_.UnsafeSetDefault(nullptr);
mnn_uuid_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
  mnn_uuid_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
}

Pipeline::~Pipeline() {
  // @@protoc_insertion_point(destructor:MNN.Compression.Pipeline)
  if (GetArenaForAllocation() != nullptr) return;
  SharedDtor();
  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
}

inline void Pipeline::SharedDtor() {
  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
  version_.DestroyNoArena(nullptr);
  mnn_uuid_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
}

void Pipeline::ArenaDtor(void* object) {
  Pipeline* _this = reinterpret_cast< Pipeline* >(object);
  (void)_this;
}
void Pipeline::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
}
void Pipeline::SetCachedSize(int size) const {
  _cached_size_.Set(size);
}

void Pipeline::Clear() {
// @@protoc_insertion_point(message_clear_start:MNN.Compression.Pipeline)
  uint32_t cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  algo_.Clear();
  cached_has_bits = _has_bits_[0];
  if (cached_has_bits & 0x00000003u) {
    if (cached_has_bits & 0x00000001u) {
      version_.ClearToDefault(::MNN::Compression::Pipeline::_i_give_permission_to_break_this_code_default_version_, GetArenaForAllocation());
       }
    if (cached_has_bits & 0x00000002u) {
      mnn_uuid_.ClearNonDefaultToEmpty();
    }
  }
  _has_bits_.Clear();
  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
}

const char* Pipeline::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  _Internal::HasBits has_bits{};
  while (!ctx->Done(&ptr)) {
    uint32_t tag;
    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
    switch (tag >> 3) {
      // required string version = 1 [default = "0.0.0"];
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
          auto str = _internal_mutable_version();
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
          #ifndef NDEBUG
          ::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "MNN.Compression.Pipeline.version");
          #endif  // !NDEBUG
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // repeated .MNN.Compression.CompressionAlgo algo = 2;
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 18)) {
          ptr -= 1;
          do {
            ptr += 1;
            ptr = ctx->ParseMessage(_internal_add_algo(), ptr);
            CHK_(ptr);
            if (!ctx->DataAvailable(ptr)) break;
          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<18>(ptr));
        } else
          goto handle_unusual;
        continue;
      // optional string mnn_uuid = 3;
      case 3:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 26)) {
          auto str = _internal_mutable_mnn_uuid();
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
          #ifndef NDEBUG
          ::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "MNN.Compression.Pipeline.mnn_uuid");
          #endif  // !NDEBUG
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      default:
        goto handle_unusual;
    }  // switch
  handle_unusual:
    if ((tag == 0) || ((tag & 7) == 4)) {
      CHK_(ptr);
      ctx->SetLastTag(tag);
      goto message_done;
    }
    ptr = UnknownFieldParse(
        tag,
        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
        ptr, ctx);
    CHK_(ptr != nullptr);
  }  // while
message_done:
  _has_bits_.Or(has_bits);
  return ptr;
failure:
  ptr = nullptr;
  goto message_done;
#undef CHK_
}

uint8_t* Pipeline::_InternalSerialize(
    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:MNN.Compression.Pipeline)
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  cached_has_bits = _has_bits_[0];
  // required string version = 1 [default = "0.0.0"];
  if (cached_has_bits & 0x00000001u) {
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
      this->_internal_version().data(), static_cast<int>(this->_internal_version().length()),
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
      "MNN.Compression.Pipeline.version");
    target = stream->WriteStringMaybeAliased(
        1, this->_internal_version(), target);
  }

  // repeated .MNN.Compression.CompressionAlgo algo = 2;
  for (unsigned int i = 0,
      n = static_cast<unsigned int>(this->_internal_algo_size()); i < n; i++) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(2, this->_internal_algo(i), target, stream);
  }

  // optional string mnn_uuid = 3;
  if (cached_has_bits & 0x00000002u) {
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
      this->_internal_mnn_uuid().data(), static_cast<int>(this->_internal_mnn_uuid().length()),
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
      "MNN.Compression.Pipeline.mnn_uuid");
    target = stream->WriteStringMaybeAliased(
        3, this->_internal_mnn_uuid(), target);
  }

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
  }
  // @@protoc_insertion_point(serialize_to_array_end:MNN.Compression.Pipeline)
  return target;
}

size_t Pipeline::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:MNN.Compression.Pipeline)
  size_t total_size = 0;

  // required string version = 1 [default = "0.0.0"];
  if (_internal_has_version()) {
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
        this->_internal_version());
  }
  uint32_t cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  // repeated .MNN.Compression.CompressionAlgo algo = 2;
  total_size += 1UL * this->_internal_algo_size();
  for (const auto& msg : this->algo_) {
    total_size +=
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
  }

  // optional string mnn_uuid = 3;
  cached_has_bits = _has_bits_[0];
  if (cached_has_bits & 0x00000002u) {
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
        this->_internal_mnn_uuid());
  }

  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
}

const ::PROTOBUF_NAMESPACE_ID::Message::ClassData Pipeline::_class_data_ = {
    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
    Pipeline::MergeImpl
};
const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*Pipeline::GetClassData() const { return &_class_data_; }

void Pipeline::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
  static_cast<Pipeline *>(to)->MergeFrom(
      static_cast<const Pipeline &>(from));
}


void Pipeline::MergeFrom(const Pipeline& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:MNN.Compression.Pipeline)
  GOOGLE_DCHECK_NE(&from, this);
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  algo_.MergeFrom(from.algo_);
  cached_has_bits = from._has_bits_[0];
  if (cached_has_bits & 0x00000003u) {
    if (cached_has_bits & 0x00000001u) {
      _internal_set_version(from._internal_version());
    }
    if (cached_has_bits & 0x00000002u) {
      _internal_set_mnn_uuid(from._internal_mnn_uuid());
    }
  }
  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
}

void Pipeline::CopyFrom(const Pipeline& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:MNN.Compression.Pipeline)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool Pipeline::IsInitialized() const {
  if (_Internal::MissingRequiredFields(_has_bits_)) return false;
  if (!::PROTOBUF_NAMESPACE_ID::internal::AllAreInitialized(algo_))
    return false;
  return true;
}

void Pipeline::InternalSwap(Pipeline* other) {
  using std::swap;
  auto* lhs_arena = GetArenaForAllocation();
  auto* rhs_arena = other->GetArenaForAllocation();
  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
  swap(_has_bits_[0], other->_has_bits_[0]);
  algo_.InternalSwap(&other->algo_);
  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
      nullptr,
      &version_, lhs_arena,
      &other->version_, rhs_arena
  );
  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
      &mnn_uuid_, lhs_arena,
      &other->mnn_uuid_, rhs_arena
  );
}

::PROTOBUF_NAMESPACE_ID::Metadata Pipeline::GetMetadata() const {
  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
      &descriptor_table_MNN_5fcompression_2eproto_getter, &descriptor_table_MNN_5fcompression_2eproto_once,
      file_level_metadata_MNN_5fcompression_2eproto[9]);
}

// @@protoc_insertion_point(namespace_scope)
}  // namespace Compression
}  // namespace MNN
PROTOBUF_NAMESPACE_OPEN
template<> PROTOBUF_NOINLINE ::MNN::Compression::QuantizeParams* Arena::CreateMaybeMessage< ::MNN::Compression::QuantizeParams >(Arena* arena) {
  return Arena::CreateMessageInternal< ::MNN::Compression::QuantizeParams >(arena);
}
template<> PROTOBUF_NOINLINE ::MNN::Compression::LayerQuantizeParams_ActivationParams* Arena::CreateMaybeMessage< ::MNN::Compression::LayerQuantizeParams_ActivationParams >(Arena* arena) {
  return Arena::CreateMessageInternal< ::MNN::Compression::LayerQuantizeParams_ActivationParams >(arena);
}
template<> PROTOBUF_NOINLINE ::MNN::Compression::LayerQuantizeParams_WeightParams* Arena::CreateMaybeMessage< ::MNN::Compression::LayerQuantizeParams_WeightParams >(Arena* arena) {
  return Arena::CreateMessageInternal< ::MNN::Compression::LayerQuantizeParams_WeightParams >(arena);
}
template<> PROTOBUF_NOINLINE ::MNN::Compression::LayerQuantizeParams_WinogradParams* Arena::CreateMaybeMessage< ::MNN::Compression::LayerQuantizeParams_WinogradParams >(Arena* arena) {
  return Arena::CreateMessageInternal< ::MNN::Compression::LayerQuantizeParams_WinogradParams >(arena);
}
template<> PROTOBUF_NOINLINE ::MNN::Compression::LayerQuantizeParams* Arena::CreateMaybeMessage< ::MNN::Compression::LayerQuantizeParams >(Arena* arena) {
  return Arena::CreateMessageInternal< ::MNN::Compression::LayerQuantizeParams >(arena);
}
template<> PROTOBUF_NOINLINE ::MNN::Compression::LevelPrunerParams* Arena::CreateMaybeMessage< ::MNN::Compression::LevelPrunerParams >(Arena* arena) {
  return Arena::CreateMessageInternal< ::MNN::Compression::LevelPrunerParams >(arena);
}
template<> PROTOBUF_NOINLINE ::MNN::Compression::SIMDOCPrunerParams* Arena::CreateMaybeMessage< ::MNN::Compression::SIMDOCPrunerParams >(Arena* arena) {
  return Arena::CreateMessageInternal< ::MNN::Compression::SIMDOCPrunerParams >(arena);
}
template<> PROTOBUF_NOINLINE ::MNN::Compression::PruneParams* Arena::CreateMaybeMessage< ::MNN::Compression::PruneParams >(Arena* arena) {
  return Arena::CreateMessageInternal< ::MNN::Compression::PruneParams >(arena);
}
template<> PROTOBUF_NOINLINE ::MNN::Compression::CompressionAlgo* Arena::CreateMaybeMessage< ::MNN::Compression::CompressionAlgo >(Arena* arena) {
  return Arena::CreateMessageInternal< ::MNN::Compression::CompressionAlgo >(arena);
}
template<> PROTOBUF_NOINLINE ::MNN::Compression::Pipeline* Arena::CreateMaybeMessage< ::MNN::Compression::Pipeline >(Arena* arena) {
  return Arena::CreateMessageInternal< ::MNN::Compression::Pipeline >(arena);
}
PROTOBUF_NAMESPACE_CLOSE

// @@protoc_insertion_point(global_scope)
#include <google/protobuf/port_undef.inc>
