// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: object_detection/protos/graph_rewriter.proto

#include "object_detection/protos/graph_rewriter.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 _pb = ::PROTOBUF_NAMESPACE_ID;
namespace _pbi = _pb::internal;

namespace object_detection {
namespace protos {
PROTOBUF_CONSTEXPR GraphRewriter::GraphRewriter(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_._extensions_)*/{}
  , /*decltype(_impl_._has_bits_)*/{}
  , /*decltype(_impl_._cached_size_)*/{}
  , /*decltype(_impl_.quantization_)*/nullptr} {}
struct GraphRewriterDefaultTypeInternal {
  PROTOBUF_CONSTEXPR GraphRewriterDefaultTypeInternal()
      : _instance(::_pbi::ConstantInitialized{}) {}
  ~GraphRewriterDefaultTypeInternal() {}
  union {
    GraphRewriter _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 GraphRewriterDefaultTypeInternal _GraphRewriter_default_instance_;
PROTOBUF_CONSTEXPR Quantization::Quantization(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_._has_bits_)*/{}
  , /*decltype(_impl_._cached_size_)*/{}
  , /*decltype(_impl_.symmetric_)*/false
  , /*decltype(_impl_.activation_bits_)*/8
  , /*decltype(_impl_.delay_)*/500000
  , /*decltype(_impl_.weight_bits_)*/8} {}
struct QuantizationDefaultTypeInternal {
  PROTOBUF_CONSTEXPR QuantizationDefaultTypeInternal()
      : _instance(::_pbi::ConstantInitialized{}) {}
  ~QuantizationDefaultTypeInternal() {}
  union {
    Quantization _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 QuantizationDefaultTypeInternal _Quantization_default_instance_;
}  // namespace protos
}  // namespace object_detection
static ::_pb::Metadata file_level_metadata_object_5fdetection_2fprotos_2fgraph_5frewriter_2eproto[2];
static constexpr ::_pb::EnumDescriptor const** file_level_enum_descriptors_object_5fdetection_2fprotos_2fgraph_5frewriter_2eproto = nullptr;
static constexpr ::_pb::ServiceDescriptor const** file_level_service_descriptors_object_5fdetection_2fprotos_2fgraph_5frewriter_2eproto = nullptr;

const uint32_t TableStruct_object_5fdetection_2fprotos_2fgraph_5frewriter_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::GraphRewriter, _impl_._has_bits_),
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::GraphRewriter, _internal_metadata_),
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::GraphRewriter, _impl_._extensions_),
  ~0u,  // no _oneof_case_
  ~0u,  // no _weak_field_map_
  ~0u,  // no _inlined_string_donated_
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::GraphRewriter, _impl_.quantization_),
  0,
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::Quantization, _impl_._has_bits_),
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::Quantization, _internal_metadata_),
  ~0u,  // no _extensions_
  ~0u,  // no _oneof_case_
  ~0u,  // no _weak_field_map_
  ~0u,  // no _inlined_string_donated_
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::Quantization, _impl_.delay_),
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::Quantization, _impl_.weight_bits_),
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::Quantization, _impl_.activation_bits_),
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::Quantization, _impl_.symmetric_),
  2,
  3,
  1,
  0,
};
static const ::_pbi::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
  { 0, 7, -1, sizeof(::object_detection::protos::GraphRewriter)},
  { 8, 18, -1, sizeof(::object_detection::protos::Quantization)},
};

static const ::_pb::Message* const file_default_instances[] = {
  &::object_detection::protos::_GraphRewriter_default_instance_._instance,
  &::object_detection::protos::_Quantization_default_instance_._instance,
};

const char descriptor_table_protodef_object_5fdetection_2fprotos_2fgraph_5frewriter_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) =
  "\n,object_detection/protos/graph_rewriter"
  ".proto\022\027object_detection.protos\"W\n\rGraph"
  "Rewriter\022;\n\014quantization\030\001 \001(\0132%.object_"
  "detection.protos.Quantization*\t\010\350\007\020\200\200\200\200\002"
  "\"s\n\014Quantization\022\025\n\005delay\030\001 \001(\005:\006500000\022"
  "\026\n\013weight_bits\030\002 \001(\005:\0018\022\032\n\017activation_bi"
  "ts\030\003 \001(\005:\0018\022\030\n\tsymmetric\030\004 \001(\010:\005false"
  ;
static ::_pbi::once_flag descriptor_table_object_5fdetection_2fprotos_2fgraph_5frewriter_2eproto_once;
const ::_pbi::DescriptorTable descriptor_table_object_5fdetection_2fprotos_2fgraph_5frewriter_2eproto = {
    false, false, 277, descriptor_table_protodef_object_5fdetection_2fprotos_2fgraph_5frewriter_2eproto,
    "object_detection/protos/graph_rewriter.proto",
    &descriptor_table_object_5fdetection_2fprotos_2fgraph_5frewriter_2eproto_once, nullptr, 0, 2,
    schemas, file_default_instances, TableStruct_object_5fdetection_2fprotos_2fgraph_5frewriter_2eproto::offsets,
    file_level_metadata_object_5fdetection_2fprotos_2fgraph_5frewriter_2eproto, file_level_enum_descriptors_object_5fdetection_2fprotos_2fgraph_5frewriter_2eproto,
    file_level_service_descriptors_object_5fdetection_2fprotos_2fgraph_5frewriter_2eproto,
};
PROTOBUF_ATTRIBUTE_WEAK const ::_pbi::DescriptorTable* descriptor_table_object_5fdetection_2fprotos_2fgraph_5frewriter_2eproto_getter() {
  return &descriptor_table_object_5fdetection_2fprotos_2fgraph_5frewriter_2eproto;
}

// Force running AddDescriptors() at dynamic initialization time.
PROTOBUF_ATTRIBUTE_INIT_PRIORITY2 static ::_pbi::AddDescriptorsRunner dynamic_init_dummy_object_5fdetection_2fprotos_2fgraph_5frewriter_2eproto(&descriptor_table_object_5fdetection_2fprotos_2fgraph_5frewriter_2eproto);
namespace object_detection {
namespace protos {

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

class GraphRewriter::_Internal {
 public:
  using HasBits = decltype(std::declval<GraphRewriter>()._impl_._has_bits_);
  static const ::object_detection::protos::Quantization& quantization(const GraphRewriter* msg);
  static void set_has_quantization(HasBits* has_bits) {
    (*has_bits)[0] |= 1u;
  }
};

const ::object_detection::protos::Quantization&
GraphRewriter::_Internal::quantization(const GraphRewriter* msg) {
  return *msg->_impl_.quantization_;
}
GraphRewriter::GraphRewriter(::PROTOBUF_NAMESPACE_ID::Arena* arena,
                         bool is_message_owned)
  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) {
  SharedCtor(arena, is_message_owned);
  // @@protoc_insertion_point(arena_constructor:object_detection.protos.GraphRewriter)
}
GraphRewriter::GraphRewriter(const GraphRewriter& from)
  : ::PROTOBUF_NAMESPACE_ID::Message() {
  GraphRewriter* const _this = this; (void)_this;
  new (&_impl_) Impl_{
      /*decltype(_impl_._extensions_)*/{}
    , decltype(_impl_._has_bits_){from._impl_._has_bits_}
    , /*decltype(_impl_._cached_size_)*/{}
    , decltype(_impl_.quantization_){nullptr}};

  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
  _impl_._extensions_.MergeFrom(internal_default_instance(), from._impl_._extensions_);
  if (from._internal_has_quantization()) {
    _this->_impl_.quantization_ = new ::object_detection::protos::Quantization(*from._impl_.quantization_);
  }
  // @@protoc_insertion_point(copy_constructor:object_detection.protos.GraphRewriter)
}

inline void GraphRewriter::SharedCtor(
    ::_pb::Arena* arena, bool is_message_owned) {
  (void)arena;
  (void)is_message_owned;
  new (&_impl_) Impl_{
      /*decltype(_impl_._extensions_)*/{::_pbi::ArenaInitialized(), arena}
    , decltype(_impl_._has_bits_){}
    , /*decltype(_impl_._cached_size_)*/{}
    , decltype(_impl_.quantization_){nullptr}
  };
}

GraphRewriter::~GraphRewriter() {
  // @@protoc_insertion_point(destructor:object_detection.protos.GraphRewriter)
  if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) {
  (void)arena;
    return;
  }
  SharedDtor();
}

inline void GraphRewriter::SharedDtor() {
  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
  _impl_._extensions_.~ExtensionSet();
  if (this != internal_default_instance()) delete _impl_.quantization_;
}

void GraphRewriter::SetCachedSize(int size) const {
  _impl_._cached_size_.Set(size);
}

void GraphRewriter::Clear() {
// @@protoc_insertion_point(message_clear_start:object_detection.protos.GraphRewriter)
  uint32_t cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  _impl_._extensions_.Clear();
  cached_has_bits = _impl_._has_bits_[0];
  if (cached_has_bits & 0x00000001u) {
    GOOGLE_DCHECK(_impl_.quantization_ != nullptr);
    _impl_.quantization_->Clear();
  }
  _impl_._has_bits_.Clear();
  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
}

const char* GraphRewriter::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  _Internal::HasBits has_bits{};
  while (!ctx->Done(&ptr)) {
    uint32_t tag;
    ptr = ::_pbi::ReadTag(ptr, &tag);
    switch (tag >> 3) {
      // optional .object_detection.protos.Quantization quantization = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
          ptr = ctx->ParseMessage(_internal_mutable_quantization(), 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;
    }
    if ((8000u <= tag)) {
      ptr = _impl_._extensions_.ParseField(tag, ptr, internal_default_instance(), &_internal_metadata_, ctx);
      CHK_(ptr != nullptr);
      continue;
    }
    ptr = UnknownFieldParse(
        tag,
        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
        ptr, ctx);
    CHK_(ptr != nullptr);
  }  // while
message_done:
  _impl_._has_bits_.Or(has_bits);
  return ptr;
failure:
  ptr = nullptr;
  goto message_done;
#undef CHK_
}

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

  cached_has_bits = _impl_._has_bits_[0];
  // optional .object_detection.protos.Quantization quantization = 1;
  if (cached_has_bits & 0x00000001u) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(1, _Internal::quantization(this),
        _Internal::quantization(this).GetCachedSize(), target, stream);
  }

  // Extension range [1000, 536870912)
  target = _impl_._extensions_._InternalSerialize(
  internal_default_instance(), 1000, 536870912, target, stream);

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    target = ::_pbi::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:object_detection.protos.GraphRewriter)
  return target;
}

size_t GraphRewriter::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:object_detection.protos.GraphRewriter)
  size_t total_size = 0;

  total_size += _impl_._extensions_.ByteSize();

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

  // optional .object_detection.protos.Quantization quantization = 1;
  cached_has_bits = _impl_._has_bits_[0];
  if (cached_has_bits & 0x00000001u) {
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
        *_impl_.quantization_);
  }

  return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_);
}

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


void GraphRewriter::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) {
  auto* const _this = static_cast<GraphRewriter*>(&to_msg);
  auto& from = static_cast<const GraphRewriter&>(from_msg);
  // @@protoc_insertion_point(class_specific_merge_from_start:object_detection.protos.GraphRewriter)
  GOOGLE_DCHECK_NE(&from, _this);
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  if (from._internal_has_quantization()) {
    _this->_internal_mutable_quantization()->::object_detection::protos::Quantization::MergeFrom(
        from._internal_quantization());
  }
  _this->_impl_._extensions_.MergeFrom(internal_default_instance(), from._impl_._extensions_);
  _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
}

void GraphRewriter::CopyFrom(const GraphRewriter& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:object_detection.protos.GraphRewriter)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool GraphRewriter::IsInitialized() const {
  if (!_impl_._extensions_.IsInitialized()) {
    return false;
  }

  return true;
}

void GraphRewriter::InternalSwap(GraphRewriter* other) {
  using std::swap;
  _impl_._extensions_.InternalSwap(&other->_impl_._extensions_);
  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
  swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
  swap(_impl_.quantization_, other->_impl_.quantization_);
}

::PROTOBUF_NAMESPACE_ID::Metadata GraphRewriter::GetMetadata() const {
  return ::_pbi::AssignDescriptors(
      &descriptor_table_object_5fdetection_2fprotos_2fgraph_5frewriter_2eproto_getter, &descriptor_table_object_5fdetection_2fprotos_2fgraph_5frewriter_2eproto_once,
      file_level_metadata_object_5fdetection_2fprotos_2fgraph_5frewriter_2eproto[0]);
}

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

class Quantization::_Internal {
 public:
  using HasBits = decltype(std::declval<Quantization>()._impl_._has_bits_);
  static void set_has_delay(HasBits* has_bits) {
    (*has_bits)[0] |= 4u;
  }
  static void set_has_weight_bits(HasBits* has_bits) {
    (*has_bits)[0] |= 8u;
  }
  static void set_has_activation_bits(HasBits* has_bits) {
    (*has_bits)[0] |= 2u;
  }
  static void set_has_symmetric(HasBits* has_bits) {
    (*has_bits)[0] |= 1u;
  }
};

Quantization::Quantization(::PROTOBUF_NAMESPACE_ID::Arena* arena,
                         bool is_message_owned)
  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) {
  SharedCtor(arena, is_message_owned);
  // @@protoc_insertion_point(arena_constructor:object_detection.protos.Quantization)
}
Quantization::Quantization(const Quantization& from)
  : ::PROTOBUF_NAMESPACE_ID::Message() {
  Quantization* const _this = this; (void)_this;
  new (&_impl_) Impl_{
      decltype(_impl_._has_bits_){from._impl_._has_bits_}
    , /*decltype(_impl_._cached_size_)*/{}
    , decltype(_impl_.symmetric_){}
    , decltype(_impl_.activation_bits_){}
    , decltype(_impl_.delay_){}
    , decltype(_impl_.weight_bits_){}};

  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
  ::memcpy(&_impl_.symmetric_, &from._impl_.symmetric_,
    static_cast<size_t>(reinterpret_cast<char*>(&_impl_.weight_bits_) -
    reinterpret_cast<char*>(&_impl_.symmetric_)) + sizeof(_impl_.weight_bits_));
  // @@protoc_insertion_point(copy_constructor:object_detection.protos.Quantization)
}

inline void Quantization::SharedCtor(
    ::_pb::Arena* arena, bool is_message_owned) {
  (void)arena;
  (void)is_message_owned;
  new (&_impl_) Impl_{
      decltype(_impl_._has_bits_){}
    , /*decltype(_impl_._cached_size_)*/{}
    , decltype(_impl_.symmetric_){false}
    , decltype(_impl_.activation_bits_){8}
    , decltype(_impl_.delay_){500000}
    , decltype(_impl_.weight_bits_){8}
  };
}

Quantization::~Quantization() {
  // @@protoc_insertion_point(destructor:object_detection.protos.Quantization)
  if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) {
  (void)arena;
    return;
  }
  SharedDtor();
}

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

void Quantization::SetCachedSize(int size) const {
  _impl_._cached_size_.Set(size);
}

void Quantization::Clear() {
// @@protoc_insertion_point(message_clear_start:object_detection.protos.Quantization)
  uint32_t cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  cached_has_bits = _impl_._has_bits_[0];
  if (cached_has_bits & 0x0000000fu) {
    _impl_.symmetric_ = false;
    _impl_.activation_bits_ = 8;
    _impl_.delay_ = 500000;
    _impl_.weight_bits_ = 8;
  }
  _impl_._has_bits_.Clear();
  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
}

const char* Quantization::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  _Internal::HasBits has_bits{};
  while (!ctx->Done(&ptr)) {
    uint32_t tag;
    ptr = ::_pbi::ReadTag(ptr, &tag);
    switch (tag >> 3) {
      // optional int32 delay = 1 [default = 500000];
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
          _Internal::set_has_delay(&has_bits);
          _impl_.delay_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional int32 weight_bits = 2 [default = 8];
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 16)) {
          _Internal::set_has_weight_bits(&has_bits);
          _impl_.weight_bits_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional int32 activation_bits = 3 [default = 8];
      case 3:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 24)) {
          _Internal::set_has_activation_bits(&has_bits);
          _impl_.activation_bits_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional bool symmetric = 4 [default = false];
      case 4:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 32)) {
          _Internal::set_has_symmetric(&has_bits);
          _impl_.symmetric_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&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:
  _impl_._has_bits_.Or(has_bits);
  return ptr;
failure:
  ptr = nullptr;
  goto message_done;
#undef CHK_
}

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

  cached_has_bits = _impl_._has_bits_[0];
  // optional int32 delay = 1 [default = 500000];
  if (cached_has_bits & 0x00000004u) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteInt32ToArray(1, this->_internal_delay(), target);
  }

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

  // optional int32 activation_bits = 3 [default = 8];
  if (cached_has_bits & 0x00000002u) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteInt32ToArray(3, this->_internal_activation_bits(), target);
  }

  // optional bool symmetric = 4 [default = false];
  if (cached_has_bits & 0x00000001u) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteBoolToArray(4, this->_internal_symmetric(), target);
  }

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    target = ::_pbi::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:object_detection.protos.Quantization)
  return target;
}

size_t Quantization::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:object_detection.protos.Quantization)
  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 = _impl_._has_bits_[0];
  if (cached_has_bits & 0x0000000fu) {
    // optional bool symmetric = 4 [default = false];
    if (cached_has_bits & 0x00000001u) {
      total_size += 1 + 1;
    }

    // optional int32 activation_bits = 3 [default = 8];
    if (cached_has_bits & 0x00000002u) {
      total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_activation_bits());
    }

    // optional int32 delay = 1 [default = 500000];
    if (cached_has_bits & 0x00000004u) {
      total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_delay());
    }

    // optional int32 weight_bits = 2 [default = 8];
    if (cached_has_bits & 0x00000008u) {
      total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_weight_bits());
    }

  }
  return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_);
}

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


void Quantization::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) {
  auto* const _this = static_cast<Quantization*>(&to_msg);
  auto& from = static_cast<const Quantization&>(from_msg);
  // @@protoc_insertion_point(class_specific_merge_from_start:object_detection.protos.Quantization)
  GOOGLE_DCHECK_NE(&from, _this);
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  cached_has_bits = from._impl_._has_bits_[0];
  if (cached_has_bits & 0x0000000fu) {
    if (cached_has_bits & 0x00000001u) {
      _this->_impl_.symmetric_ = from._impl_.symmetric_;
    }
    if (cached_has_bits & 0x00000002u) {
      _this->_impl_.activation_bits_ = from._impl_.activation_bits_;
    }
    if (cached_has_bits & 0x00000004u) {
      _this->_impl_.delay_ = from._impl_.delay_;
    }
    if (cached_has_bits & 0x00000008u) {
      _this->_impl_.weight_bits_ = from._impl_.weight_bits_;
    }
    _this->_impl_._has_bits_[0] |= cached_has_bits;
  }
  _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
}

void Quantization::CopyFrom(const Quantization& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:object_detection.protos.Quantization)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

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

void Quantization::InternalSwap(Quantization* other) {
  using std::swap;
  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
  swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
  swap(_impl_.symmetric_, other->_impl_.symmetric_);
  swap(_impl_.activation_bits_, other->_impl_.activation_bits_);
  swap(_impl_.delay_, other->_impl_.delay_);
  swap(_impl_.weight_bits_, other->_impl_.weight_bits_);
}

::PROTOBUF_NAMESPACE_ID::Metadata Quantization::GetMetadata() const {
  return ::_pbi::AssignDescriptors(
      &descriptor_table_object_5fdetection_2fprotos_2fgraph_5frewriter_2eproto_getter, &descriptor_table_object_5fdetection_2fprotos_2fgraph_5frewriter_2eproto_once,
      file_level_metadata_object_5fdetection_2fprotos_2fgraph_5frewriter_2eproto[1]);
}

// @@protoc_insertion_point(namespace_scope)
}  // namespace protos
}  // namespace object_detection
PROTOBUF_NAMESPACE_OPEN
template<> PROTOBUF_NOINLINE ::object_detection::protos::GraphRewriter*
Arena::CreateMaybeMessage< ::object_detection::protos::GraphRewriter >(Arena* arena) {
  return Arena::CreateMessageInternal< ::object_detection::protos::GraphRewriter >(arena);
}
template<> PROTOBUF_NOINLINE ::object_detection::protos::Quantization*
Arena::CreateMaybeMessage< ::object_detection::protos::Quantization >(Arena* arena) {
  return Arena::CreateMessageInternal< ::object_detection::protos::Quantization >(arena);
}
PROTOBUF_NAMESPACE_CLOSE

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