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

#include "CustomModel.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/io/zero_copy_stream_impl_lite.h>
// @@protoc_insertion_point(includes)
#include <google/protobuf/port_def.inc>

PROTOBUF_PRAGMA_INIT_SEG
namespace CoreML {
namespace Specification {
constexpr CustomModel_CustomModelParamValue::CustomModel_CustomModelParamValue(
  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
  : _oneof_case_{}{}
struct CustomModel_CustomModelParamValueDefaultTypeInternal {
  constexpr CustomModel_CustomModelParamValueDefaultTypeInternal()
    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
  ~CustomModel_CustomModelParamValueDefaultTypeInternal() {}
  union {
    CustomModel_CustomModelParamValue _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT CustomModel_CustomModelParamValueDefaultTypeInternal _CustomModel_CustomModelParamValue_default_instance_;
constexpr CustomModel_ParametersEntry_DoNotUse::CustomModel_ParametersEntry_DoNotUse(
  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized){}
struct CustomModel_ParametersEntry_DoNotUseDefaultTypeInternal {
  constexpr CustomModel_ParametersEntry_DoNotUseDefaultTypeInternal()
    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
  ~CustomModel_ParametersEntry_DoNotUseDefaultTypeInternal() {}
  union {
    CustomModel_ParametersEntry_DoNotUse _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT CustomModel_ParametersEntry_DoNotUseDefaultTypeInternal _CustomModel_ParametersEntry_DoNotUse_default_instance_;
constexpr CustomModel::CustomModel(
  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
  : parameters_()
  , classname_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
  , description_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string){}
struct CustomModelDefaultTypeInternal {
  constexpr CustomModelDefaultTypeInternal()
    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
  ~CustomModelDefaultTypeInternal() {}
  union {
    CustomModel _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT CustomModelDefaultTypeInternal _CustomModel_default_instance_;
}  // namespace Specification
}  // namespace CoreML
namespace CoreML {
namespace Specification {

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

class CustomModel_CustomModelParamValue::_Internal {
 public:
};

CustomModel_CustomModelParamValue::CustomModel_CustomModelParamValue(::PROTOBUF_NAMESPACE_ID::Arena* arena,
                         bool is_message_owned)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
  SharedCtor();
  if (!is_message_owned) {
    RegisterArenaDtor(arena);
  }
  // @@protoc_insertion_point(arena_constructor:CoreML.Specification.CustomModel.CustomModelParamValue)
}
CustomModel_CustomModelParamValue::CustomModel_CustomModelParamValue(const CustomModel_CustomModelParamValue& from)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
  clear_has_value();
  switch (from.value_case()) {
    case kDoubleValue: {
      _internal_set_doublevalue(from._internal_doublevalue());
      break;
    }
    case kStringValue: {
      _internal_set_stringvalue(from._internal_stringvalue());
      break;
    }
    case kIntValue: {
      _internal_set_intvalue(from._internal_intvalue());
      break;
    }
    case kLongValue: {
      _internal_set_longvalue(from._internal_longvalue());
      break;
    }
    case kBoolValue: {
      _internal_set_boolvalue(from._internal_boolvalue());
      break;
    }
    case kBytesValue: {
      _internal_set_bytesvalue(from._internal_bytesvalue());
      break;
    }
    case VALUE_NOT_SET: {
      break;
    }
  }
  // @@protoc_insertion_point(copy_constructor:CoreML.Specification.CustomModel.CustomModelParamValue)
}

inline void CustomModel_CustomModelParamValue::SharedCtor() {
clear_has_value();
}

CustomModel_CustomModelParamValue::~CustomModel_CustomModelParamValue() {
  // @@protoc_insertion_point(destructor:CoreML.Specification.CustomModel.CustomModelParamValue)
  if (GetArenaForAllocation() != nullptr) return;
  SharedDtor();
  _internal_metadata_.Delete<std::string>();
}

inline void CustomModel_CustomModelParamValue::SharedDtor() {
  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
  if (has_value()) {
    clear_value();
  }
}

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

void CustomModel_CustomModelParamValue::clear_value() {
// @@protoc_insertion_point(one_of_clear_start:CoreML.Specification.CustomModel.CustomModelParamValue)
  switch (value_case()) {
    case kDoubleValue: {
      // No need to clear
      break;
    }
    case kStringValue: {
      value_.stringvalue_.Destroy(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation());
      break;
    }
    case kIntValue: {
      // No need to clear
      break;
    }
    case kLongValue: {
      // No need to clear
      break;
    }
    case kBoolValue: {
      // No need to clear
      break;
    }
    case kBytesValue: {
      value_.bytesvalue_.Destroy(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation());
      break;
    }
    case VALUE_NOT_SET: {
      break;
    }
  }
  _oneof_case_[0] = VALUE_NOT_SET;
}


void CustomModel_CustomModelParamValue::Clear() {
// @@protoc_insertion_point(message_clear_start:CoreML.Specification.CustomModel.CustomModelParamValue)
  uint32_t cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  clear_value();
  _internal_metadata_.Clear<std::string>();
}

const char* CustomModel_CustomModelParamValue::_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) {
      // double doubleValue = 10;
      case 10:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 81)) {
          _internal_set_doublevalue(::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<double>(ptr));
          ptr += sizeof(double);
        } else
          goto handle_unusual;
        continue;
      // string stringValue = 20;
      case 20:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 162)) {
          auto str = _internal_mutable_stringvalue();
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
          CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, nullptr));
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // int32 intValue = 30;
      case 30:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 240)) {
          _internal_set_intvalue(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr));
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // int64 longValue = 40;
      case 40:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 64)) {
          _internal_set_longvalue(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr));
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // bool boolValue = 50;
      case 50:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 144)) {
          _internal_set_boolvalue(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr));
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // bytes bytesValue = 60;
      case 60:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 226)) {
          auto str = _internal_mutable_bytesvalue();
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, 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<std::string>(),
        ptr, ctx);
    CHK_(ptr != nullptr);
  }  // while
message_done:
  return ptr;
failure:
  ptr = nullptr;
  goto message_done;
#undef CHK_
}

uint8_t* CustomModel_CustomModelParamValue::_InternalSerialize(
    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:CoreML.Specification.CustomModel.CustomModelParamValue)
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  // double doubleValue = 10;
  if (_internal_has_doublevalue()) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteDoubleToArray(10, this->_internal_doublevalue(), target);
  }

  // string stringValue = 20;
  if (_internal_has_stringvalue()) {
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
      this->_internal_stringvalue().data(), static_cast<int>(this->_internal_stringvalue().length()),
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
      "CoreML.Specification.CustomModel.CustomModelParamValue.stringValue");
    target = stream->WriteStringMaybeAliased(
        20, this->_internal_stringvalue(), target);
  }

  // int32 intValue = 30;
  if (_internal_has_intvalue()) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(30, this->_internal_intvalue(), target);
  }

  // int64 longValue = 40;
  if (_internal_has_longvalue()) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(40, this->_internal_longvalue(), target);
  }

  // bool boolValue = 50;
  if (_internal_has_boolvalue()) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(50, this->_internal_boolvalue(), target);
  }

  // bytes bytesValue = 60;
  if (_internal_has_bytesvalue()) {
    target = stream->WriteBytesMaybeAliased(
        60, this->_internal_bytesvalue(), target);
  }

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
        static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:CoreML.Specification.CustomModel.CustomModelParamValue)
  return target;
}

size_t CustomModel_CustomModelParamValue::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:CoreML.Specification.CustomModel.CustomModelParamValue)
  size_t total_size = 0;

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

  switch (value_case()) {
    // double doubleValue = 10;
    case kDoubleValue: {
      total_size += 1 + 8;
      break;
    }
    // string stringValue = 20;
    case kStringValue: {
      total_size += 2 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
          this->_internal_stringvalue());
      break;
    }
    // int32 intValue = 30;
    case kIntValue: {
      total_size += 2 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
          this->_internal_intvalue());
      break;
    }
    // int64 longValue = 40;
    case kLongValue: {
      total_size += 2 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64Size(
          this->_internal_longvalue());
      break;
    }
    // bool boolValue = 50;
    case kBoolValue: {
      total_size += 2 + 1;
      break;
    }
    // bytes bytesValue = 60;
    case kBytesValue: {
      total_size += 2 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize(
          this->_internal_bytesvalue());
      break;
    }
    case VALUE_NOT_SET: {
      break;
    }
  }
  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
  }
  int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
  SetCachedSize(cached_size);
  return total_size;
}

void CustomModel_CustomModelParamValue::CheckTypeAndMergeFrom(
    const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
  MergeFrom(*::PROTOBUF_NAMESPACE_ID::internal::DownCast<const CustomModel_CustomModelParamValue*>(
      &from));
}

void CustomModel_CustomModelParamValue::MergeFrom(const CustomModel_CustomModelParamValue& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:CoreML.Specification.CustomModel.CustomModelParamValue)
  GOOGLE_DCHECK_NE(&from, this);
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  switch (from.value_case()) {
    case kDoubleValue: {
      _internal_set_doublevalue(from._internal_doublevalue());
      break;
    }
    case kStringValue: {
      _internal_set_stringvalue(from._internal_stringvalue());
      break;
    }
    case kIntValue: {
      _internal_set_intvalue(from._internal_intvalue());
      break;
    }
    case kLongValue: {
      _internal_set_longvalue(from._internal_longvalue());
      break;
    }
    case kBoolValue: {
      _internal_set_boolvalue(from._internal_boolvalue());
      break;
    }
    case kBytesValue: {
      _internal_set_bytesvalue(from._internal_bytesvalue());
      break;
    }
    case VALUE_NOT_SET: {
      break;
    }
  }
  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
}

void CustomModel_CustomModelParamValue::CopyFrom(const CustomModel_CustomModelParamValue& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:CoreML.Specification.CustomModel.CustomModelParamValue)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

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

void CustomModel_CustomModelParamValue::InternalSwap(CustomModel_CustomModelParamValue* other) {
  using std::swap;
  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
  swap(value_, other->value_);
  swap(_oneof_case_[0], other->_oneof_case_[0]);
}

std::string CustomModel_CustomModelParamValue::GetTypeName() const {
  return "CoreML.Specification.CustomModel.CustomModelParamValue";
}


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

CustomModel_ParametersEntry_DoNotUse::CustomModel_ParametersEntry_DoNotUse() {}
CustomModel_ParametersEntry_DoNotUse::CustomModel_ParametersEntry_DoNotUse(::PROTOBUF_NAMESPACE_ID::Arena* arena)
    : SuperType(arena) {}
void CustomModel_ParametersEntry_DoNotUse::MergeFrom(const CustomModel_ParametersEntry_DoNotUse& other) {
  MergeFromInternal(other);
}

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

class CustomModel::_Internal {
 public:
};

CustomModel::CustomModel(::PROTOBUF_NAMESPACE_ID::Arena* arena,
                         bool is_message_owned)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned),
  parameters_(arena) {
  SharedCtor();
  if (!is_message_owned) {
    RegisterArenaDtor(arena);
  }
  // @@protoc_insertion_point(arena_constructor:CoreML.Specification.CustomModel)
}
CustomModel::CustomModel(const CustomModel& from)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
  parameters_.MergeFrom(from.parameters_);
  classname_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
    classname_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  if (!from._internal_classname().empty()) {
    classname_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_classname(), 
      GetArenaForAllocation());
  }
  description_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
    description_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  if (!from._internal_description().empty()) {
    description_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_description(), 
      GetArenaForAllocation());
  }
  // @@protoc_insertion_point(copy_constructor:CoreML.Specification.CustomModel)
}

inline void CustomModel::SharedCtor() {
classname_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
  classname_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
description_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
  description_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
}

CustomModel::~CustomModel() {
  // @@protoc_insertion_point(destructor:CoreML.Specification.CustomModel)
  if (GetArenaForAllocation() != nullptr) return;
  SharedDtor();
  _internal_metadata_.Delete<std::string>();
}

inline void CustomModel::SharedDtor() {
  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
  classname_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  description_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
}

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

void CustomModel::Clear() {
// @@protoc_insertion_point(message_clear_start:CoreML.Specification.CustomModel)
  uint32_t cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  parameters_.Clear();
  classname_.ClearToEmpty();
  description_.ClearToEmpty();
  _internal_metadata_.Clear<std::string>();
}

const char* CustomModel::_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) {
      // string className = 10;
      case 10:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 82)) {
          auto str = _internal_mutable_classname();
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
          CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, nullptr));
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // map<string, .CoreML.Specification.CustomModel.CustomModelParamValue> parameters = 30;
      case 30:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 242)) {
          ptr -= 2;
          do {
            ptr += 2;
            ptr = ctx->ParseMessage(&parameters_, ptr);
            CHK_(ptr);
            if (!ctx->DataAvailable(ptr)) break;
          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<242>(ptr));
        } else
          goto handle_unusual;
        continue;
      // string description = 40;
      case 40:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 66)) {
          auto str = _internal_mutable_description();
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
          CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, nullptr));
          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<std::string>(),
        ptr, ctx);
    CHK_(ptr != nullptr);
  }  // while
message_done:
  return ptr;
failure:
  ptr = nullptr;
  goto message_done;
#undef CHK_
}

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

  // string className = 10;
  if (!this->_internal_classname().empty()) {
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
      this->_internal_classname().data(), static_cast<int>(this->_internal_classname().length()),
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
      "CoreML.Specification.CustomModel.className");
    target = stream->WriteStringMaybeAliased(
        10, this->_internal_classname(), target);
  }

  // map<string, .CoreML.Specification.CustomModel.CustomModelParamValue> parameters = 30;
  if (!this->_internal_parameters().empty()) {
    typedef ::PROTOBUF_NAMESPACE_ID::Map< std::string, ::CoreML::Specification::CustomModel_CustomModelParamValue >::const_pointer
        ConstPtr;
    typedef ConstPtr SortItem;
    typedef ::PROTOBUF_NAMESPACE_ID::internal::CompareByDerefFirst<SortItem> Less;
    struct Utf8Check {
      static void Check(ConstPtr p) {
        (void)p;
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
          p->first.data(), static_cast<int>(p->first.length()),
          ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
          "CoreML.Specification.CustomModel.ParametersEntry.key");
      }
    };

    if (stream->IsSerializationDeterministic() &&
        this->_internal_parameters().size() > 1) {
      ::std::unique_ptr<SortItem[]> items(
          new SortItem[this->_internal_parameters().size()]);
      typedef ::PROTOBUF_NAMESPACE_ID::Map< std::string, ::CoreML::Specification::CustomModel_CustomModelParamValue >::size_type size_type;
      size_type n = 0;
      for (::PROTOBUF_NAMESPACE_ID::Map< std::string, ::CoreML::Specification::CustomModel_CustomModelParamValue >::const_iterator
          it = this->_internal_parameters().begin();
          it != this->_internal_parameters().end(); ++it, ++n) {
        items[static_cast<ptrdiff_t>(n)] = SortItem(&*it);
      }
      ::std::sort(&items[0], &items[static_cast<ptrdiff_t>(n)], Less());
      for (size_type i = 0; i < n; i++) {
        target = CustomModel_ParametersEntry_DoNotUse::Funcs::InternalSerialize(30, items[static_cast<ptrdiff_t>(i)]->first, items[static_cast<ptrdiff_t>(i)]->second, target, stream);
        Utf8Check::Check(&(*items[static_cast<ptrdiff_t>(i)]));
      }
    } else {
      for (::PROTOBUF_NAMESPACE_ID::Map< std::string, ::CoreML::Specification::CustomModel_CustomModelParamValue >::const_iterator
          it = this->_internal_parameters().begin();
          it != this->_internal_parameters().end(); ++it) {
        target = CustomModel_ParametersEntry_DoNotUse::Funcs::InternalSerialize(30, it->first, it->second, target, stream);
        Utf8Check::Check(&(*it));
      }
    }
  }

  // string description = 40;
  if (!this->_internal_description().empty()) {
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
      this->_internal_description().data(), static_cast<int>(this->_internal_description().length()),
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
      "CoreML.Specification.CustomModel.description");
    target = stream->WriteStringMaybeAliased(
        40, this->_internal_description(), target);
  }

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
        static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:CoreML.Specification.CustomModel)
  return target;
}

size_t CustomModel::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:CoreML.Specification.CustomModel)
  size_t total_size = 0;

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

  // map<string, .CoreML.Specification.CustomModel.CustomModelParamValue> parameters = 30;
  total_size += 2 *
      ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(this->_internal_parameters_size());
  for (::PROTOBUF_NAMESPACE_ID::Map< std::string, ::CoreML::Specification::CustomModel_CustomModelParamValue >::const_iterator
      it = this->_internal_parameters().begin();
      it != this->_internal_parameters().end(); ++it) {
    total_size += CustomModel_ParametersEntry_DoNotUse::Funcs::ByteSizeLong(it->first, it->second);
  }

  // string className = 10;
  if (!this->_internal_classname().empty()) {
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
        this->_internal_classname());
  }

  // string description = 40;
  if (!this->_internal_description().empty()) {
    total_size += 2 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
        this->_internal_description());
  }

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
  }
  int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
  SetCachedSize(cached_size);
  return total_size;
}

void CustomModel::CheckTypeAndMergeFrom(
    const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
  MergeFrom(*::PROTOBUF_NAMESPACE_ID::internal::DownCast<const CustomModel*>(
      &from));
}

void CustomModel::MergeFrom(const CustomModel& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:CoreML.Specification.CustomModel)
  GOOGLE_DCHECK_NE(&from, this);
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  parameters_.MergeFrom(from.parameters_);
  if (!from._internal_classname().empty()) {
    _internal_set_classname(from._internal_classname());
  }
  if (!from._internal_description().empty()) {
    _internal_set_description(from._internal_description());
  }
  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
}

void CustomModel::CopyFrom(const CustomModel& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:CoreML.Specification.CustomModel)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

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

void CustomModel::InternalSwap(CustomModel* other) {
  using std::swap;
  auto* lhs_arena = GetArenaForAllocation();
  auto* rhs_arena = other->GetArenaForAllocation();
  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
  parameters_.InternalSwap(&other->parameters_);
  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
      &classname_, lhs_arena,
      &other->classname_, rhs_arena
  );
  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
      &description_, lhs_arena,
      &other->description_, rhs_arena
  );
}

std::string CustomModel::GetTypeName() const {
  return "CoreML.Specification.CustomModel";
}


// @@protoc_insertion_point(namespace_scope)
}  // namespace Specification
}  // namespace CoreML
PROTOBUF_NAMESPACE_OPEN
template<> PROTOBUF_NOINLINE ::CoreML::Specification::CustomModel_CustomModelParamValue* Arena::CreateMaybeMessage< ::CoreML::Specification::CustomModel_CustomModelParamValue >(Arena* arena) {
  return Arena::CreateMessageInternal< ::CoreML::Specification::CustomModel_CustomModelParamValue >(arena);
}
template<> PROTOBUF_NOINLINE ::CoreML::Specification::CustomModel_ParametersEntry_DoNotUse* Arena::CreateMaybeMessage< ::CoreML::Specification::CustomModel_ParametersEntry_DoNotUse >(Arena* arena) {
  return Arena::CreateMessageInternal< ::CoreML::Specification::CustomModel_ParametersEntry_DoNotUse >(arena);
}
template<> PROTOBUF_NOINLINE ::CoreML::Specification::CustomModel* Arena::CreateMaybeMessage< ::CoreML::Specification::CustomModel >(Arena* arena) {
  return Arena::CreateMessageInternal< ::CoreML::Specification::CustomModel >(arena);
}
PROTOBUF_NAMESPACE_CLOSE

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