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

#include "ItemSimilarityRecommender.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 ItemSimilarityRecommender_ConnectedItem::ItemSimilarityRecommender_ConnectedItem(
  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
  : itemid_(uint64_t{0u})
  , similarityscore_(0){}
struct ItemSimilarityRecommender_ConnectedItemDefaultTypeInternal {
  constexpr ItemSimilarityRecommender_ConnectedItemDefaultTypeInternal()
    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
  ~ItemSimilarityRecommender_ConnectedItemDefaultTypeInternal() {}
  union {
    ItemSimilarityRecommender_ConnectedItem _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT ItemSimilarityRecommender_ConnectedItemDefaultTypeInternal _ItemSimilarityRecommender_ConnectedItem_default_instance_;
constexpr ItemSimilarityRecommender_SimilarItems::ItemSimilarityRecommender_SimilarItems(
  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
  : similaritemlist_()
  , itemid_(uint64_t{0u})
  , itemscoreadjustment_(0){}
struct ItemSimilarityRecommender_SimilarItemsDefaultTypeInternal {
  constexpr ItemSimilarityRecommender_SimilarItemsDefaultTypeInternal()
    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
  ~ItemSimilarityRecommender_SimilarItemsDefaultTypeInternal() {}
  union {
    ItemSimilarityRecommender_SimilarItems _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT ItemSimilarityRecommender_SimilarItemsDefaultTypeInternal _ItemSimilarityRecommender_SimilarItems_default_instance_;
constexpr ItemSimilarityRecommender::ItemSimilarityRecommender(
  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
  : itemitemsimilarities_()
  , iteminputfeaturename_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
  , numrecommendationsinputfeaturename_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
  , itemrestrictioninputfeaturename_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
  , itemexclusioninputfeaturename_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
  , recommendeditemlistoutputfeaturename_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
  , recommendeditemscoreoutputfeaturename_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
  , itemstringids_(nullptr)
  , itemint64ids_(nullptr){}
struct ItemSimilarityRecommenderDefaultTypeInternal {
  constexpr ItemSimilarityRecommenderDefaultTypeInternal()
    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
  ~ItemSimilarityRecommenderDefaultTypeInternal() {}
  union {
    ItemSimilarityRecommender _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT ItemSimilarityRecommenderDefaultTypeInternal _ItemSimilarityRecommender_default_instance_;
}  // namespace Specification
}  // namespace CoreML
namespace CoreML {
namespace Specification {

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

class ItemSimilarityRecommender_ConnectedItem::_Internal {
 public:
};

ItemSimilarityRecommender_ConnectedItem::ItemSimilarityRecommender_ConnectedItem(::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.ItemSimilarityRecommender.ConnectedItem)
}
ItemSimilarityRecommender_ConnectedItem::ItemSimilarityRecommender_ConnectedItem(const ItemSimilarityRecommender_ConnectedItem& from)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
  ::memcpy(&itemid_, &from.itemid_,
    static_cast<size_t>(reinterpret_cast<char*>(&similarityscore_) -
    reinterpret_cast<char*>(&itemid_)) + sizeof(similarityscore_));
  // @@protoc_insertion_point(copy_constructor:CoreML.Specification.ItemSimilarityRecommender.ConnectedItem)
}

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

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

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

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

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

  ::memset(&itemid_, 0, static_cast<size_t>(
      reinterpret_cast<char*>(&similarityscore_) -
      reinterpret_cast<char*>(&itemid_)) + sizeof(similarityscore_));
  _internal_metadata_.Clear<std::string>();
}

const char* ItemSimilarityRecommender_ConnectedItem::_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) {
      // uint64 itemId = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
          itemid_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // double similarityScore = 2;
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 17)) {
          similarityscore_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<double>(ptr);
          ptr += sizeof(double);
        } 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* ItemSimilarityRecommender_ConnectedItem::_InternalSerialize(
    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:CoreML.Specification.ItemSimilarityRecommender.ConnectedItem)
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  // uint64 itemId = 1;
  if (this->_internal_itemid() != 0) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt64ToArray(1, this->_internal_itemid(), target);
  }

  // double similarityScore = 2;
  static_assert(sizeof(uint64_t) == sizeof(double), "Code assumes uint64_t and double are the same size.");
  double tmp_similarityscore = this->_internal_similarityscore();
  uint64_t raw_similarityscore;
  memcpy(&raw_similarityscore, &tmp_similarityscore, sizeof(tmp_similarityscore));
  if (raw_similarityscore != 0) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteDoubleToArray(2, this->_internal_similarityscore(), 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.ItemSimilarityRecommender.ConnectedItem)
  return target;
}

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

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

  // uint64 itemId = 1;
  if (this->_internal_itemid() != 0) {
    total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt64SizePlusOne(this->_internal_itemid());
  }

  // double similarityScore = 2;
  static_assert(sizeof(uint64_t) == sizeof(double), "Code assumes uint64_t and double are the same size.");
  double tmp_similarityscore = this->_internal_similarityscore();
  uint64_t raw_similarityscore;
  memcpy(&raw_similarityscore, &tmp_similarityscore, sizeof(tmp_similarityscore));
  if (raw_similarityscore != 0) {
    total_size += 1 + 8;
  }

  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 ItemSimilarityRecommender_ConnectedItem::CheckTypeAndMergeFrom(
    const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
  MergeFrom(*::PROTOBUF_NAMESPACE_ID::internal::DownCast<const ItemSimilarityRecommender_ConnectedItem*>(
      &from));
}

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

  if (from._internal_itemid() != 0) {
    _internal_set_itemid(from._internal_itemid());
  }
  static_assert(sizeof(uint64_t) == sizeof(double), "Code assumes uint64_t and double are the same size.");
  double tmp_similarityscore = from._internal_similarityscore();
  uint64_t raw_similarityscore;
  memcpy(&raw_similarityscore, &tmp_similarityscore, sizeof(tmp_similarityscore));
  if (raw_similarityscore != 0) {
    _internal_set_similarityscore(from._internal_similarityscore());
  }
  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
}

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

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

void ItemSimilarityRecommender_ConnectedItem::InternalSwap(ItemSimilarityRecommender_ConnectedItem* other) {
  using std::swap;
  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
      PROTOBUF_FIELD_OFFSET(ItemSimilarityRecommender_ConnectedItem, similarityscore_)
      + sizeof(ItemSimilarityRecommender_ConnectedItem::similarityscore_)
      - PROTOBUF_FIELD_OFFSET(ItemSimilarityRecommender_ConnectedItem, itemid_)>(
          reinterpret_cast<char*>(&itemid_),
          reinterpret_cast<char*>(&other->itemid_));
}

std::string ItemSimilarityRecommender_ConnectedItem::GetTypeName() const {
  return "CoreML.Specification.ItemSimilarityRecommender.ConnectedItem";
}


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

class ItemSimilarityRecommender_SimilarItems::_Internal {
 public:
};

ItemSimilarityRecommender_SimilarItems::ItemSimilarityRecommender_SimilarItems(::PROTOBUF_NAMESPACE_ID::Arena* arena,
                         bool is_message_owned)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned),
  similaritemlist_(arena) {
  SharedCtor();
  if (!is_message_owned) {
    RegisterArenaDtor(arena);
  }
  // @@protoc_insertion_point(arena_constructor:CoreML.Specification.ItemSimilarityRecommender.SimilarItems)
}
ItemSimilarityRecommender_SimilarItems::ItemSimilarityRecommender_SimilarItems(const ItemSimilarityRecommender_SimilarItems& from)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(),
      similaritemlist_(from.similaritemlist_) {
  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
  ::memcpy(&itemid_, &from.itemid_,
    static_cast<size_t>(reinterpret_cast<char*>(&itemscoreadjustment_) -
    reinterpret_cast<char*>(&itemid_)) + sizeof(itemscoreadjustment_));
  // @@protoc_insertion_point(copy_constructor:CoreML.Specification.ItemSimilarityRecommender.SimilarItems)
}

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

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

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

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

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

  similaritemlist_.Clear();
  ::memset(&itemid_, 0, static_cast<size_t>(
      reinterpret_cast<char*>(&itemscoreadjustment_) -
      reinterpret_cast<char*>(&itemid_)) + sizeof(itemscoreadjustment_));
  _internal_metadata_.Clear<std::string>();
}

const char* ItemSimilarityRecommender_SimilarItems::_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) {
      // uint64 itemId = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
          itemid_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // repeated .CoreML.Specification.ItemSimilarityRecommender.ConnectedItem similarItemList = 2;
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 18)) {
          ptr -= 1;
          do {
            ptr += 1;
            ptr = ctx->ParseMessage(_internal_add_similaritemlist(), ptr);
            CHK_(ptr);
            if (!ctx->DataAvailable(ptr)) break;
          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<18>(ptr));
        } else
          goto handle_unusual;
        continue;
      // double itemScoreAdjustment = 3;
      case 3:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 25)) {
          itemscoreadjustment_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<double>(ptr);
          ptr += sizeof(double);
        } 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* ItemSimilarityRecommender_SimilarItems::_InternalSerialize(
    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:CoreML.Specification.ItemSimilarityRecommender.SimilarItems)
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  // uint64 itemId = 1;
  if (this->_internal_itemid() != 0) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt64ToArray(1, this->_internal_itemid(), target);
  }

  // repeated .CoreML.Specification.ItemSimilarityRecommender.ConnectedItem similarItemList = 2;
  for (unsigned int i = 0,
      n = static_cast<unsigned int>(this->_internal_similaritemlist_size()); i < n; i++) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(2, this->_internal_similaritemlist(i), target, stream);
  }

  // double itemScoreAdjustment = 3;
  static_assert(sizeof(uint64_t) == sizeof(double), "Code assumes uint64_t and double are the same size.");
  double tmp_itemscoreadjustment = this->_internal_itemscoreadjustment();
  uint64_t raw_itemscoreadjustment;
  memcpy(&raw_itemscoreadjustment, &tmp_itemscoreadjustment, sizeof(tmp_itemscoreadjustment));
  if (raw_itemscoreadjustment != 0) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteDoubleToArray(3, this->_internal_itemscoreadjustment(), 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.ItemSimilarityRecommender.SimilarItems)
  return target;
}

size_t ItemSimilarityRecommender_SimilarItems::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:CoreML.Specification.ItemSimilarityRecommender.SimilarItems)
  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 .CoreML.Specification.ItemSimilarityRecommender.ConnectedItem similarItemList = 2;
  total_size += 1UL * this->_internal_similaritemlist_size();
  for (const auto& msg : this->similaritemlist_) {
    total_size +=
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
  }

  // uint64 itemId = 1;
  if (this->_internal_itemid() != 0) {
    total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt64SizePlusOne(this->_internal_itemid());
  }

  // double itemScoreAdjustment = 3;
  static_assert(sizeof(uint64_t) == sizeof(double), "Code assumes uint64_t and double are the same size.");
  double tmp_itemscoreadjustment = this->_internal_itemscoreadjustment();
  uint64_t raw_itemscoreadjustment;
  memcpy(&raw_itemscoreadjustment, &tmp_itemscoreadjustment, sizeof(tmp_itemscoreadjustment));
  if (raw_itemscoreadjustment != 0) {
    total_size += 1 + 8;
  }

  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 ItemSimilarityRecommender_SimilarItems::CheckTypeAndMergeFrom(
    const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
  MergeFrom(*::PROTOBUF_NAMESPACE_ID::internal::DownCast<const ItemSimilarityRecommender_SimilarItems*>(
      &from));
}

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

  similaritemlist_.MergeFrom(from.similaritemlist_);
  if (from._internal_itemid() != 0) {
    _internal_set_itemid(from._internal_itemid());
  }
  static_assert(sizeof(uint64_t) == sizeof(double), "Code assumes uint64_t and double are the same size.");
  double tmp_itemscoreadjustment = from._internal_itemscoreadjustment();
  uint64_t raw_itemscoreadjustment;
  memcpy(&raw_itemscoreadjustment, &tmp_itemscoreadjustment, sizeof(tmp_itemscoreadjustment));
  if (raw_itemscoreadjustment != 0) {
    _internal_set_itemscoreadjustment(from._internal_itemscoreadjustment());
  }
  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
}

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

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

void ItemSimilarityRecommender_SimilarItems::InternalSwap(ItemSimilarityRecommender_SimilarItems* other) {
  using std::swap;
  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
  similaritemlist_.InternalSwap(&other->similaritemlist_);
  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
      PROTOBUF_FIELD_OFFSET(ItemSimilarityRecommender_SimilarItems, itemscoreadjustment_)
      + sizeof(ItemSimilarityRecommender_SimilarItems::itemscoreadjustment_)
      - PROTOBUF_FIELD_OFFSET(ItemSimilarityRecommender_SimilarItems, itemid_)>(
          reinterpret_cast<char*>(&itemid_),
          reinterpret_cast<char*>(&other->itemid_));
}

std::string ItemSimilarityRecommender_SimilarItems::GetTypeName() const {
  return "CoreML.Specification.ItemSimilarityRecommender.SimilarItems";
}


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

class ItemSimilarityRecommender::_Internal {
 public:
  static const ::CoreML::Specification::StringVector& itemstringids(const ItemSimilarityRecommender* msg);
  static const ::CoreML::Specification::Int64Vector& itemint64ids(const ItemSimilarityRecommender* msg);
};

const ::CoreML::Specification::StringVector&
ItemSimilarityRecommender::_Internal::itemstringids(const ItemSimilarityRecommender* msg) {
  return *msg->itemstringids_;
}
const ::CoreML::Specification::Int64Vector&
ItemSimilarityRecommender::_Internal::itemint64ids(const ItemSimilarityRecommender* msg) {
  return *msg->itemint64ids_;
}
void ItemSimilarityRecommender::clear_itemstringids() {
  if (GetArenaForAllocation() == nullptr && itemstringids_ != nullptr) {
    delete itemstringids_;
  }
  itemstringids_ = nullptr;
}
void ItemSimilarityRecommender::clear_itemint64ids() {
  if (GetArenaForAllocation() == nullptr && itemint64ids_ != nullptr) {
    delete itemint64ids_;
  }
  itemint64ids_ = nullptr;
}
ItemSimilarityRecommender::ItemSimilarityRecommender(::PROTOBUF_NAMESPACE_ID::Arena* arena,
                         bool is_message_owned)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned),
  itemitemsimilarities_(arena) {
  SharedCtor();
  if (!is_message_owned) {
    RegisterArenaDtor(arena);
  }
  // @@protoc_insertion_point(arena_constructor:CoreML.Specification.ItemSimilarityRecommender)
}
ItemSimilarityRecommender::ItemSimilarityRecommender(const ItemSimilarityRecommender& from)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(),
      itemitemsimilarities_(from.itemitemsimilarities_) {
  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
  iteminputfeaturename_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
    iteminputfeaturename_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  if (!from._internal_iteminputfeaturename().empty()) {
    iteminputfeaturename_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_iteminputfeaturename(), 
      GetArenaForAllocation());
  }
  numrecommendationsinputfeaturename_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
    numrecommendationsinputfeaturename_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  if (!from._internal_numrecommendationsinputfeaturename().empty()) {
    numrecommendationsinputfeaturename_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_numrecommendationsinputfeaturename(), 
      GetArenaForAllocation());
  }
  itemrestrictioninputfeaturename_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
    itemrestrictioninputfeaturename_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  if (!from._internal_itemrestrictioninputfeaturename().empty()) {
    itemrestrictioninputfeaturename_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_itemrestrictioninputfeaturename(), 
      GetArenaForAllocation());
  }
  itemexclusioninputfeaturename_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
    itemexclusioninputfeaturename_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  if (!from._internal_itemexclusioninputfeaturename().empty()) {
    itemexclusioninputfeaturename_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_itemexclusioninputfeaturename(), 
      GetArenaForAllocation());
  }
  recommendeditemlistoutputfeaturename_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
    recommendeditemlistoutputfeaturename_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  if (!from._internal_recommendeditemlistoutputfeaturename().empty()) {
    recommendeditemlistoutputfeaturename_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_recommendeditemlistoutputfeaturename(), 
      GetArenaForAllocation());
  }
  recommendeditemscoreoutputfeaturename_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
    recommendeditemscoreoutputfeaturename_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  if (!from._internal_recommendeditemscoreoutputfeaturename().empty()) {
    recommendeditemscoreoutputfeaturename_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_recommendeditemscoreoutputfeaturename(), 
      GetArenaForAllocation());
  }
  if (from._internal_has_itemstringids()) {
    itemstringids_ = new ::CoreML::Specification::StringVector(*from.itemstringids_);
  } else {
    itemstringids_ = nullptr;
  }
  if (from._internal_has_itemint64ids()) {
    itemint64ids_ = new ::CoreML::Specification::Int64Vector(*from.itemint64ids_);
  } else {
    itemint64ids_ = nullptr;
  }
  // @@protoc_insertion_point(copy_constructor:CoreML.Specification.ItemSimilarityRecommender)
}

inline void ItemSimilarityRecommender::SharedCtor() {
iteminputfeaturename_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
  iteminputfeaturename_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
numrecommendationsinputfeaturename_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
  numrecommendationsinputfeaturename_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
itemrestrictioninputfeaturename_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
  itemrestrictioninputfeaturename_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
itemexclusioninputfeaturename_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
  itemexclusioninputfeaturename_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
recommendeditemlistoutputfeaturename_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
  recommendeditemlistoutputfeaturename_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
recommendeditemscoreoutputfeaturename_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
  recommendeditemscoreoutputfeaturename_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
::memset(reinterpret_cast<char*>(this) + static_cast<size_t>(
    reinterpret_cast<char*>(&itemstringids_) - reinterpret_cast<char*>(this)),
    0, static_cast<size_t>(reinterpret_cast<char*>(&itemint64ids_) -
    reinterpret_cast<char*>(&itemstringids_)) + sizeof(itemint64ids_));
}

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

inline void ItemSimilarityRecommender::SharedDtor() {
  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
  iteminputfeaturename_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  numrecommendationsinputfeaturename_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  itemrestrictioninputfeaturename_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  itemexclusioninputfeaturename_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  recommendeditemlistoutputfeaturename_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  recommendeditemscoreoutputfeaturename_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  if (this != internal_default_instance()) delete itemstringids_;
  if (this != internal_default_instance()) delete itemint64ids_;
}

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

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

  itemitemsimilarities_.Clear();
  iteminputfeaturename_.ClearToEmpty();
  numrecommendationsinputfeaturename_.ClearToEmpty();
  itemrestrictioninputfeaturename_.ClearToEmpty();
  itemexclusioninputfeaturename_.ClearToEmpty();
  recommendeditemlistoutputfeaturename_.ClearToEmpty();
  recommendeditemscoreoutputfeaturename_.ClearToEmpty();
  if (GetArenaForAllocation() == nullptr && itemstringids_ != nullptr) {
    delete itemstringids_;
  }
  itemstringids_ = nullptr;
  if (GetArenaForAllocation() == nullptr && itemint64ids_ != nullptr) {
    delete itemint64ids_;
  }
  itemint64ids_ = nullptr;
  _internal_metadata_.Clear<std::string>();
}

const char* ItemSimilarityRecommender::_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 .CoreML.Specification.ItemSimilarityRecommender.SimilarItems itemItemSimilarities = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
          ptr -= 1;
          do {
            ptr += 1;
            ptr = ctx->ParseMessage(_internal_add_itemitemsimilarities(), ptr);
            CHK_(ptr);
            if (!ctx->DataAvailable(ptr)) break;
          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<10>(ptr));
        } else
          goto handle_unusual;
        continue;
      // .CoreML.Specification.StringVector itemStringIds = 2;
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 18)) {
          ptr = ctx->ParseMessage(_internal_mutable_itemstringids(), ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // .CoreML.Specification.Int64Vector itemInt64Ids = 3;
      case 3:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 26)) {
          ptr = ctx->ParseMessage(_internal_mutable_itemint64ids(), ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // string itemInputFeatureName = 10;
      case 10:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 82)) {
          auto str = _internal_mutable_iteminputfeaturename();
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
          CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, nullptr));
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // string numRecommendationsInputFeatureName = 11;
      case 11:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 90)) {
          auto str = _internal_mutable_numrecommendationsinputfeaturename();
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
          CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, nullptr));
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // string itemRestrictionInputFeatureName = 12;
      case 12:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 98)) {
          auto str = _internal_mutable_itemrestrictioninputfeaturename();
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
          CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, nullptr));
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // string itemExclusionInputFeatureName = 13;
      case 13:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 106)) {
          auto str = _internal_mutable_itemexclusioninputfeaturename();
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
          CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, nullptr));
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // string recommendedItemListOutputFeatureName = 20;
      case 20:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 162)) {
          auto str = _internal_mutable_recommendeditemlistoutputfeaturename();
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
          CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, nullptr));
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // string recommendedItemScoreOutputFeatureName = 21;
      case 21:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 170)) {
          auto str = _internal_mutable_recommendeditemscoreoutputfeaturename();
          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* ItemSimilarityRecommender::_InternalSerialize(
    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:CoreML.Specification.ItemSimilarityRecommender)
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  // repeated .CoreML.Specification.ItemSimilarityRecommender.SimilarItems itemItemSimilarities = 1;
  for (unsigned int i = 0,
      n = static_cast<unsigned int>(this->_internal_itemitemsimilarities_size()); i < n; i++) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(1, this->_internal_itemitemsimilarities(i), target, stream);
  }

  // .CoreML.Specification.StringVector itemStringIds = 2;
  if (this->_internal_has_itemstringids()) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(
        2, _Internal::itemstringids(this), target, stream);
  }

  // .CoreML.Specification.Int64Vector itemInt64Ids = 3;
  if (this->_internal_has_itemint64ids()) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(
        3, _Internal::itemint64ids(this), target, stream);
  }

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

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

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

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

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

  // string recommendedItemScoreOutputFeatureName = 21;
  if (!this->_internal_recommendeditemscoreoutputfeaturename().empty()) {
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
      this->_internal_recommendeditemscoreoutputfeaturename().data(), static_cast<int>(this->_internal_recommendeditemscoreoutputfeaturename().length()),
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
      "CoreML.Specification.ItemSimilarityRecommender.recommendedItemScoreOutputFeatureName");
    target = stream->WriteStringMaybeAliased(
        21, this->_internal_recommendeditemscoreoutputfeaturename(), 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.ItemSimilarityRecommender)
  return target;
}

size_t ItemSimilarityRecommender::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:CoreML.Specification.ItemSimilarityRecommender)
  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 .CoreML.Specification.ItemSimilarityRecommender.SimilarItems itemItemSimilarities = 1;
  total_size += 1UL * this->_internal_itemitemsimilarities_size();
  for (const auto& msg : this->itemitemsimilarities_) {
    total_size +=
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
  }

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

  // string numRecommendationsInputFeatureName = 11;
  if (!this->_internal_numrecommendationsinputfeaturename().empty()) {
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
        this->_internal_numrecommendationsinputfeaturename());
  }

  // string itemRestrictionInputFeatureName = 12;
  if (!this->_internal_itemrestrictioninputfeaturename().empty()) {
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
        this->_internal_itemrestrictioninputfeaturename());
  }

  // string itemExclusionInputFeatureName = 13;
  if (!this->_internal_itemexclusioninputfeaturename().empty()) {
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
        this->_internal_itemexclusioninputfeaturename());
  }

  // string recommendedItemListOutputFeatureName = 20;
  if (!this->_internal_recommendeditemlistoutputfeaturename().empty()) {
    total_size += 2 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
        this->_internal_recommendeditemlistoutputfeaturename());
  }

  // string recommendedItemScoreOutputFeatureName = 21;
  if (!this->_internal_recommendeditemscoreoutputfeaturename().empty()) {
    total_size += 2 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
        this->_internal_recommendeditemscoreoutputfeaturename());
  }

  // .CoreML.Specification.StringVector itemStringIds = 2;
  if (this->_internal_has_itemstringids()) {
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
        *itemstringids_);
  }

  // .CoreML.Specification.Int64Vector itemInt64Ids = 3;
  if (this->_internal_has_itemint64ids()) {
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
        *itemint64ids_);
  }

  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 ItemSimilarityRecommender::CheckTypeAndMergeFrom(
    const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
  MergeFrom(*::PROTOBUF_NAMESPACE_ID::internal::DownCast<const ItemSimilarityRecommender*>(
      &from));
}

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

  itemitemsimilarities_.MergeFrom(from.itemitemsimilarities_);
  if (!from._internal_iteminputfeaturename().empty()) {
    _internal_set_iteminputfeaturename(from._internal_iteminputfeaturename());
  }
  if (!from._internal_numrecommendationsinputfeaturename().empty()) {
    _internal_set_numrecommendationsinputfeaturename(from._internal_numrecommendationsinputfeaturename());
  }
  if (!from._internal_itemrestrictioninputfeaturename().empty()) {
    _internal_set_itemrestrictioninputfeaturename(from._internal_itemrestrictioninputfeaturename());
  }
  if (!from._internal_itemexclusioninputfeaturename().empty()) {
    _internal_set_itemexclusioninputfeaturename(from._internal_itemexclusioninputfeaturename());
  }
  if (!from._internal_recommendeditemlistoutputfeaturename().empty()) {
    _internal_set_recommendeditemlistoutputfeaturename(from._internal_recommendeditemlistoutputfeaturename());
  }
  if (!from._internal_recommendeditemscoreoutputfeaturename().empty()) {
    _internal_set_recommendeditemscoreoutputfeaturename(from._internal_recommendeditemscoreoutputfeaturename());
  }
  if (from._internal_has_itemstringids()) {
    _internal_mutable_itemstringids()->::CoreML::Specification::StringVector::MergeFrom(from._internal_itemstringids());
  }
  if (from._internal_has_itemint64ids()) {
    _internal_mutable_itemint64ids()->::CoreML::Specification::Int64Vector::MergeFrom(from._internal_itemint64ids());
  }
  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
}

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

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

void ItemSimilarityRecommender::InternalSwap(ItemSimilarityRecommender* other) {
  using std::swap;
  auto* lhs_arena = GetArenaForAllocation();
  auto* rhs_arena = other->GetArenaForAllocation();
  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
  itemitemsimilarities_.InternalSwap(&other->itemitemsimilarities_);
  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
      &iteminputfeaturename_, lhs_arena,
      &other->iteminputfeaturename_, rhs_arena
  );
  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
      &numrecommendationsinputfeaturename_, lhs_arena,
      &other->numrecommendationsinputfeaturename_, rhs_arena
  );
  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
      &itemrestrictioninputfeaturename_, lhs_arena,
      &other->itemrestrictioninputfeaturename_, rhs_arena
  );
  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
      &itemexclusioninputfeaturename_, lhs_arena,
      &other->itemexclusioninputfeaturename_, rhs_arena
  );
  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
      &recommendeditemlistoutputfeaturename_, lhs_arena,
      &other->recommendeditemlistoutputfeaturename_, rhs_arena
  );
  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
      &recommendeditemscoreoutputfeaturename_, lhs_arena,
      &other->recommendeditemscoreoutputfeaturename_, rhs_arena
  );
  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
      PROTOBUF_FIELD_OFFSET(ItemSimilarityRecommender, itemint64ids_)
      + sizeof(ItemSimilarityRecommender::itemint64ids_)
      - PROTOBUF_FIELD_OFFSET(ItemSimilarityRecommender, itemstringids_)>(
          reinterpret_cast<char*>(&itemstringids_),
          reinterpret_cast<char*>(&other->itemstringids_));
}

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


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

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