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

#include "second/protos/train.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 second {
namespace protos {
PROTOBUF_CONSTEXPR Regularizer::Regularizer(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_.regularizer_oneof_)*/{}
  , /*decltype(_impl_._cached_size_)*/{}
  , /*decltype(_impl_._oneof_case_)*/{}} {}
struct RegularizerDefaultTypeInternal {
  PROTOBUF_CONSTEXPR RegularizerDefaultTypeInternal()
      : _instance(::_pbi::ConstantInitialized{}) {}
  ~RegularizerDefaultTypeInternal() {}
  union {
    Regularizer _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 RegularizerDefaultTypeInternal _Regularizer_default_instance_;
PROTOBUF_CONSTEXPR L1Regularizer::L1Regularizer(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_.weight_)*/0
  , /*decltype(_impl_._cached_size_)*/{}} {}
struct L1RegularizerDefaultTypeInternal {
  PROTOBUF_CONSTEXPR L1RegularizerDefaultTypeInternal()
      : _instance(::_pbi::ConstantInitialized{}) {}
  ~L1RegularizerDefaultTypeInternal() {}
  union {
    L1Regularizer _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 L1RegularizerDefaultTypeInternal _L1Regularizer_default_instance_;
PROTOBUF_CONSTEXPR L2Regularizer::L2Regularizer(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_.weight_)*/0
  , /*decltype(_impl_._cached_size_)*/{}} {}
struct L2RegularizerDefaultTypeInternal {
  PROTOBUF_CONSTEXPR L2RegularizerDefaultTypeInternal()
      : _instance(::_pbi::ConstantInitialized{}) {}
  ~L2RegularizerDefaultTypeInternal() {}
  union {
    L2Regularizer _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 L2RegularizerDefaultTypeInternal _L2Regularizer_default_instance_;
PROTOBUF_CONSTEXPR TrainConfig::TrainConfig(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_.optimizer_)*/nullptr
  , /*decltype(_impl_.inter_op_parallelism_threads_)*/0u
  , /*decltype(_impl_.intra_op_parallelism_threads_)*/0u
  , /*decltype(_impl_.steps_)*/0u
  , /*decltype(_impl_.steps_per_eval_)*/0u
  , /*decltype(_impl_.save_checkpoints_secs_)*/0u
  , /*decltype(_impl_.save_summary_steps_)*/0u
  , /*decltype(_impl_.loss_scale_factor_)*/0
  , /*decltype(_impl_.enable_mixed_precision_)*/false
  , /*decltype(_impl_.clear_metrics_every_epoch_)*/false
  , /*decltype(_impl_._cached_size_)*/{}} {}
struct TrainConfigDefaultTypeInternal {
  PROTOBUF_CONSTEXPR TrainConfigDefaultTypeInternal()
      : _instance(::_pbi::ConstantInitialized{}) {}
  ~TrainConfigDefaultTypeInternal() {}
  union {
    TrainConfig _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 TrainConfigDefaultTypeInternal _TrainConfig_default_instance_;
}  // namespace protos
}  // namespace second
static ::_pb::Metadata file_level_metadata_second_2fprotos_2ftrain_2eproto[4];
static constexpr ::_pb::EnumDescriptor const** file_level_enum_descriptors_second_2fprotos_2ftrain_2eproto = nullptr;
static constexpr ::_pb::ServiceDescriptor const** file_level_service_descriptors_second_2fprotos_2ftrain_2eproto = nullptr;

const uint32_t TableStruct_second_2fprotos_2ftrain_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
  ~0u,  // no _has_bits_
  PROTOBUF_FIELD_OFFSET(::second::protos::Regularizer, _internal_metadata_),
  ~0u,  // no _extensions_
  PROTOBUF_FIELD_OFFSET(::second::protos::Regularizer, _impl_._oneof_case_[0]),
  ~0u,  // no _weak_field_map_
  ~0u,  // no _inlined_string_donated_
  ::_pbi::kInvalidFieldOffsetTag,
  ::_pbi::kInvalidFieldOffsetTag,
  PROTOBUF_FIELD_OFFSET(::second::protos::Regularizer, _impl_.regularizer_oneof_),
  ~0u,  // no _has_bits_
  PROTOBUF_FIELD_OFFSET(::second::protos::L1Regularizer, _internal_metadata_),
  ~0u,  // no _extensions_
  ~0u,  // no _oneof_case_
  ~0u,  // no _weak_field_map_
  ~0u,  // no _inlined_string_donated_
  PROTOBUF_FIELD_OFFSET(::second::protos::L1Regularizer, _impl_.weight_),
  ~0u,  // no _has_bits_
  PROTOBUF_FIELD_OFFSET(::second::protos::L2Regularizer, _internal_metadata_),
  ~0u,  // no _extensions_
  ~0u,  // no _oneof_case_
  ~0u,  // no _weak_field_map_
  ~0u,  // no _inlined_string_donated_
  PROTOBUF_FIELD_OFFSET(::second::protos::L2Regularizer, _impl_.weight_),
  ~0u,  // no _has_bits_
  PROTOBUF_FIELD_OFFSET(::second::protos::TrainConfig, _internal_metadata_),
  ~0u,  // no _extensions_
  ~0u,  // no _oneof_case_
  ~0u,  // no _weak_field_map_
  ~0u,  // no _inlined_string_donated_
  PROTOBUF_FIELD_OFFSET(::second::protos::TrainConfig, _impl_.optimizer_),
  PROTOBUF_FIELD_OFFSET(::second::protos::TrainConfig, _impl_.inter_op_parallelism_threads_),
  PROTOBUF_FIELD_OFFSET(::second::protos::TrainConfig, _impl_.intra_op_parallelism_threads_),
  PROTOBUF_FIELD_OFFSET(::second::protos::TrainConfig, _impl_.steps_),
  PROTOBUF_FIELD_OFFSET(::second::protos::TrainConfig, _impl_.steps_per_eval_),
  PROTOBUF_FIELD_OFFSET(::second::protos::TrainConfig, _impl_.save_checkpoints_secs_),
  PROTOBUF_FIELD_OFFSET(::second::protos::TrainConfig, _impl_.save_summary_steps_),
  PROTOBUF_FIELD_OFFSET(::second::protos::TrainConfig, _impl_.enable_mixed_precision_),
  PROTOBUF_FIELD_OFFSET(::second::protos::TrainConfig, _impl_.loss_scale_factor_),
  PROTOBUF_FIELD_OFFSET(::second::protos::TrainConfig, _impl_.clear_metrics_every_epoch_),
};
static const ::_pbi::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
  { 0, -1, -1, sizeof(::second::protos::Regularizer)},
  { 9, -1, -1, sizeof(::second::protos::L1Regularizer)},
  { 16, -1, -1, sizeof(::second::protos::L2Regularizer)},
  { 23, -1, -1, sizeof(::second::protos::TrainConfig)},
};

static const ::_pb::Message* const file_default_instances[] = {
  &::second::protos::_Regularizer_default_instance_._instance,
  &::second::protos::_L1Regularizer_default_instance_._instance,
  &::second::protos::_L2Regularizer_default_instance_._instance,
  &::second::protos::_TrainConfig_default_instance_._instance,
};

const char descriptor_table_protodef_second_2fprotos_2ftrain_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) =
  "\n\031second/protos/train.proto\022\rsecond.prot"
  "os\032\035second/protos/optimizer.proto\032\036secon"
  "d/protos/preprocess.proto\"\222\001\n\013Regularize"
  "r\0226\n\016l1_regularizer\030\001 \001(\0132\034.second.proto"
  "s.L1RegularizerH\000\0226\n\016l2_regularizer\030\002 \001("
  "\0132\034.second.protos.L2RegularizerH\000B\023\n\021reg"
  "ularizer_oneof\"\037\n\rL1Regularizer\022\016\n\006weigh"
  "t\030\001 \001(\002\"\037\n\rL2Regularizer\022\016\n\006weight\030\001 \001(\002"
  "\"\306\002\n\013TrainConfig\022+\n\toptimizer\030\001 \001(\0132\030.se"
  "cond.protos.Optimizer\022$\n\034inter_op_parall"
  "elism_threads\030\003 \001(\r\022$\n\034intra_op_parallel"
  "ism_threads\030\004 \001(\r\022\r\n\005steps\030\005 \001(\r\022\026\n\016step"
  "s_per_eval\030\006 \001(\r\022\035\n\025save_checkpoints_sec"
  "s\030\007 \001(\r\022\032\n\022save_summary_steps\030\010 \001(\r\022\036\n\026e"
  "nable_mixed_precision\030\t \001(\010\022\031\n\021loss_scal"
  "e_factor\030\n \001(\002\022!\n\031clear_metrics_every_ep"
  "och\030\013 \001(\010b\006proto3"
  ;
static const ::_pbi::DescriptorTable* const descriptor_table_second_2fprotos_2ftrain_2eproto_deps[2] = {
  &::descriptor_table_second_2fprotos_2foptimizer_2eproto,
  &::descriptor_table_second_2fprotos_2fpreprocess_2eproto,
};
static ::_pbi::once_flag descriptor_table_second_2fprotos_2ftrain_2eproto_once;
const ::_pbi::DescriptorTable descriptor_table_second_2fprotos_2ftrain_2eproto = {
    false, false, 657, descriptor_table_protodef_second_2fprotos_2ftrain_2eproto,
    "second/protos/train.proto",
    &descriptor_table_second_2fprotos_2ftrain_2eproto_once, descriptor_table_second_2fprotos_2ftrain_2eproto_deps, 2, 4,
    schemas, file_default_instances, TableStruct_second_2fprotos_2ftrain_2eproto::offsets,
    file_level_metadata_second_2fprotos_2ftrain_2eproto, file_level_enum_descriptors_second_2fprotos_2ftrain_2eproto,
    file_level_service_descriptors_second_2fprotos_2ftrain_2eproto,
};
PROTOBUF_ATTRIBUTE_WEAK const ::_pbi::DescriptorTable* descriptor_table_second_2fprotos_2ftrain_2eproto_getter() {
  return &descriptor_table_second_2fprotos_2ftrain_2eproto;
}

// Force running AddDescriptors() at dynamic initialization time.
PROTOBUF_ATTRIBUTE_INIT_PRIORITY2 static ::_pbi::AddDescriptorsRunner dynamic_init_dummy_second_2fprotos_2ftrain_2eproto(&descriptor_table_second_2fprotos_2ftrain_2eproto);
namespace second {
namespace protos {

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

class Regularizer::_Internal {
 public:
  static const ::second::protos::L1Regularizer& l1_regularizer(const Regularizer* msg);
  static const ::second::protos::L2Regularizer& l2_regularizer(const Regularizer* msg);
};

const ::second::protos::L1Regularizer&
Regularizer::_Internal::l1_regularizer(const Regularizer* msg) {
  return *msg->_impl_.regularizer_oneof_.l1_regularizer_;
}
const ::second::protos::L2Regularizer&
Regularizer::_Internal::l2_regularizer(const Regularizer* msg) {
  return *msg->_impl_.regularizer_oneof_.l2_regularizer_;
}
void Regularizer::set_allocated_l1_regularizer(::second::protos::L1Regularizer* l1_regularizer) {
  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
  clear_regularizer_oneof();
  if (l1_regularizer) {
    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
      ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(l1_regularizer);
    if (message_arena != submessage_arena) {
      l1_regularizer = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
          message_arena, l1_regularizer, submessage_arena);
    }
    set_has_l1_regularizer();
    _impl_.regularizer_oneof_.l1_regularizer_ = l1_regularizer;
  }
  // @@protoc_insertion_point(field_set_allocated:second.protos.Regularizer.l1_regularizer)
}
void Regularizer::set_allocated_l2_regularizer(::second::protos::L2Regularizer* l2_regularizer) {
  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
  clear_regularizer_oneof();
  if (l2_regularizer) {
    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
      ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(l2_regularizer);
    if (message_arena != submessage_arena) {
      l2_regularizer = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
          message_arena, l2_regularizer, submessage_arena);
    }
    set_has_l2_regularizer();
    _impl_.regularizer_oneof_.l2_regularizer_ = l2_regularizer;
  }
  // @@protoc_insertion_point(field_set_allocated:second.protos.Regularizer.l2_regularizer)
}
Regularizer::Regularizer(::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:second.protos.Regularizer)
}
Regularizer::Regularizer(const Regularizer& from)
  : ::PROTOBUF_NAMESPACE_ID::Message() {
  Regularizer* const _this = this; (void)_this;
  new (&_impl_) Impl_{
      decltype(_impl_.regularizer_oneof_){}
    , /*decltype(_impl_._cached_size_)*/{}
    , /*decltype(_impl_._oneof_case_)*/{}};

  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
  clear_has_regularizer_oneof();
  switch (from.regularizer_oneof_case()) {
    case kL1Regularizer: {
      _this->_internal_mutable_l1_regularizer()->::second::protos::L1Regularizer::MergeFrom(
          from._internal_l1_regularizer());
      break;
    }
    case kL2Regularizer: {
      _this->_internal_mutable_l2_regularizer()->::second::protos::L2Regularizer::MergeFrom(
          from._internal_l2_regularizer());
      break;
    }
    case REGULARIZER_ONEOF_NOT_SET: {
      break;
    }
  }
  // @@protoc_insertion_point(copy_constructor:second.protos.Regularizer)
}

inline void Regularizer::SharedCtor(
    ::_pb::Arena* arena, bool is_message_owned) {
  (void)arena;
  (void)is_message_owned;
  new (&_impl_) Impl_{
      decltype(_impl_.regularizer_oneof_){}
    , /*decltype(_impl_._cached_size_)*/{}
    , /*decltype(_impl_._oneof_case_)*/{}
  };
  clear_has_regularizer_oneof();
}

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

inline void Regularizer::SharedDtor() {
  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
  if (has_regularizer_oneof()) {
    clear_regularizer_oneof();
  }
}

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

void Regularizer::clear_regularizer_oneof() {
// @@protoc_insertion_point(one_of_clear_start:second.protos.Regularizer)
  switch (regularizer_oneof_case()) {
    case kL1Regularizer: {
      if (GetArenaForAllocation() == nullptr) {
        delete _impl_.regularizer_oneof_.l1_regularizer_;
      }
      break;
    }
    case kL2Regularizer: {
      if (GetArenaForAllocation() == nullptr) {
        delete _impl_.regularizer_oneof_.l2_regularizer_;
      }
      break;
    }
    case REGULARIZER_ONEOF_NOT_SET: {
      break;
    }
  }
  _impl_._oneof_case_[0] = REGULARIZER_ONEOF_NOT_SET;
}


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

  clear_regularizer_oneof();
  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
}

const char* Regularizer::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  while (!ctx->Done(&ptr)) {
    uint32_t tag;
    ptr = ::_pbi::ReadTag(ptr, &tag);
    switch (tag >> 3) {
      // .second.protos.L1Regularizer l1_regularizer = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
          ptr = ctx->ParseMessage(_internal_mutable_l1_regularizer(), ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // .second.protos.L2Regularizer l2_regularizer = 2;
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 18)) {
          ptr = ctx->ParseMessage(_internal_mutable_l2_regularizer(), 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:
  return ptr;
failure:
  ptr = nullptr;
  goto message_done;
#undef CHK_
}

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

  // .second.protos.L1Regularizer l1_regularizer = 1;
  if (_internal_has_l1_regularizer()) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(1, _Internal::l1_regularizer(this),
        _Internal::l1_regularizer(this).GetCachedSize(), target, stream);
  }

  // .second.protos.L2Regularizer l2_regularizer = 2;
  if (_internal_has_l2_regularizer()) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(2, _Internal::l2_regularizer(this),
        _Internal::l2_regularizer(this).GetCachedSize(), 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:second.protos.Regularizer)
  return target;
}

size_t Regularizer::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:second.protos.Regularizer)
  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 (regularizer_oneof_case()) {
    // .second.protos.L1Regularizer l1_regularizer = 1;
    case kL1Regularizer: {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          *_impl_.regularizer_oneof_.l1_regularizer_);
      break;
    }
    // .second.protos.L2Regularizer l2_regularizer = 2;
    case kL2Regularizer: {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          *_impl_.regularizer_oneof_.l2_regularizer_);
      break;
    }
    case REGULARIZER_ONEOF_NOT_SET: {
      break;
    }
  }
  return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_);
}

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


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

  switch (from.regularizer_oneof_case()) {
    case kL1Regularizer: {
      _this->_internal_mutable_l1_regularizer()->::second::protos::L1Regularizer::MergeFrom(
          from._internal_l1_regularizer());
      break;
    }
    case kL2Regularizer: {
      _this->_internal_mutable_l2_regularizer()->::second::protos::L2Regularizer::MergeFrom(
          from._internal_l2_regularizer());
      break;
    }
    case REGULARIZER_ONEOF_NOT_SET: {
      break;
    }
  }
  _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
}

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

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

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

::PROTOBUF_NAMESPACE_ID::Metadata Regularizer::GetMetadata() const {
  return ::_pbi::AssignDescriptors(
      &descriptor_table_second_2fprotos_2ftrain_2eproto_getter, &descriptor_table_second_2fprotos_2ftrain_2eproto_once,
      file_level_metadata_second_2fprotos_2ftrain_2eproto[0]);
}

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

class L1Regularizer::_Internal {
 public:
};

L1Regularizer::L1Regularizer(::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:second.protos.L1Regularizer)
}
L1Regularizer::L1Regularizer(const L1Regularizer& from)
  : ::PROTOBUF_NAMESPACE_ID::Message() {
  L1Regularizer* const _this = this; (void)_this;
  new (&_impl_) Impl_{
      decltype(_impl_.weight_){}
    , /*decltype(_impl_._cached_size_)*/{}};

  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
  _this->_impl_.weight_ = from._impl_.weight_;
  // @@protoc_insertion_point(copy_constructor:second.protos.L1Regularizer)
}

inline void L1Regularizer::SharedCtor(
    ::_pb::Arena* arena, bool is_message_owned) {
  (void)arena;
  (void)is_message_owned;
  new (&_impl_) Impl_{
      decltype(_impl_.weight_){0}
    , /*decltype(_impl_._cached_size_)*/{}
  };
}

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

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

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

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

  _impl_.weight_ = 0;
  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
}

const char* L1Regularizer::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  while (!ctx->Done(&ptr)) {
    uint32_t tag;
    ptr = ::_pbi::ReadTag(ptr, &tag);
    switch (tag >> 3) {
      // float weight = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 13)) {
          _impl_.weight_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
          ptr += sizeof(float);
        } else
          goto handle_unusual;
        continue;
      default:
        goto handle_unusual;
    }  // switch
  handle_unusual:
    if ((tag == 0) || ((tag & 7) == 4)) {
      CHK_(ptr);
      ctx->SetLastTag(tag);
      goto message_done;
    }
    ptr = UnknownFieldParse(
        tag,
        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
        ptr, ctx);
    CHK_(ptr != nullptr);
  }  // while
message_done:
  return ptr;
failure:
  ptr = nullptr;
  goto message_done;
#undef CHK_
}

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

  // float weight = 1;
  static_assert(sizeof(uint32_t) == sizeof(float), "Code assumes uint32_t and float are the same size.");
  float tmp_weight = this->_internal_weight();
  uint32_t raw_weight;
  memcpy(&raw_weight, &tmp_weight, sizeof(tmp_weight));
  if (raw_weight != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteFloatToArray(1, this->_internal_weight(), 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:second.protos.L1Regularizer)
  return target;
}

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

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

  // float weight = 1;
  static_assert(sizeof(uint32_t) == sizeof(float), "Code assumes uint32_t and float are the same size.");
  float tmp_weight = this->_internal_weight();
  uint32_t raw_weight;
  memcpy(&raw_weight, &tmp_weight, sizeof(tmp_weight));
  if (raw_weight != 0) {
    total_size += 1 + 4;
  }

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

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


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

  static_assert(sizeof(uint32_t) == sizeof(float), "Code assumes uint32_t and float are the same size.");
  float tmp_weight = from._internal_weight();
  uint32_t raw_weight;
  memcpy(&raw_weight, &tmp_weight, sizeof(tmp_weight));
  if (raw_weight != 0) {
    _this->_internal_set_weight(from._internal_weight());
  }
  _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
}

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

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

void L1Regularizer::InternalSwap(L1Regularizer* other) {
  using std::swap;
  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
  swap(_impl_.weight_, other->_impl_.weight_);
}

::PROTOBUF_NAMESPACE_ID::Metadata L1Regularizer::GetMetadata() const {
  return ::_pbi::AssignDescriptors(
      &descriptor_table_second_2fprotos_2ftrain_2eproto_getter, &descriptor_table_second_2fprotos_2ftrain_2eproto_once,
      file_level_metadata_second_2fprotos_2ftrain_2eproto[1]);
}

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

class L2Regularizer::_Internal {
 public:
};

L2Regularizer::L2Regularizer(::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:second.protos.L2Regularizer)
}
L2Regularizer::L2Regularizer(const L2Regularizer& from)
  : ::PROTOBUF_NAMESPACE_ID::Message() {
  L2Regularizer* const _this = this; (void)_this;
  new (&_impl_) Impl_{
      decltype(_impl_.weight_){}
    , /*decltype(_impl_._cached_size_)*/{}};

  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
  _this->_impl_.weight_ = from._impl_.weight_;
  // @@protoc_insertion_point(copy_constructor:second.protos.L2Regularizer)
}

inline void L2Regularizer::SharedCtor(
    ::_pb::Arena* arena, bool is_message_owned) {
  (void)arena;
  (void)is_message_owned;
  new (&_impl_) Impl_{
      decltype(_impl_.weight_){0}
    , /*decltype(_impl_._cached_size_)*/{}
  };
}

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

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

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

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

  _impl_.weight_ = 0;
  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
}

const char* L2Regularizer::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  while (!ctx->Done(&ptr)) {
    uint32_t tag;
    ptr = ::_pbi::ReadTag(ptr, &tag);
    switch (tag >> 3) {
      // float weight = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 13)) {
          _impl_.weight_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
          ptr += sizeof(float);
        } else
          goto handle_unusual;
        continue;
      default:
        goto handle_unusual;
    }  // switch
  handle_unusual:
    if ((tag == 0) || ((tag & 7) == 4)) {
      CHK_(ptr);
      ctx->SetLastTag(tag);
      goto message_done;
    }
    ptr = UnknownFieldParse(
        tag,
        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
        ptr, ctx);
    CHK_(ptr != nullptr);
  }  // while
message_done:
  return ptr;
failure:
  ptr = nullptr;
  goto message_done;
#undef CHK_
}

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

  // float weight = 1;
  static_assert(sizeof(uint32_t) == sizeof(float), "Code assumes uint32_t and float are the same size.");
  float tmp_weight = this->_internal_weight();
  uint32_t raw_weight;
  memcpy(&raw_weight, &tmp_weight, sizeof(tmp_weight));
  if (raw_weight != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteFloatToArray(1, this->_internal_weight(), 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:second.protos.L2Regularizer)
  return target;
}

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

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

  // float weight = 1;
  static_assert(sizeof(uint32_t) == sizeof(float), "Code assumes uint32_t and float are the same size.");
  float tmp_weight = this->_internal_weight();
  uint32_t raw_weight;
  memcpy(&raw_weight, &tmp_weight, sizeof(tmp_weight));
  if (raw_weight != 0) {
    total_size += 1 + 4;
  }

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

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


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

  static_assert(sizeof(uint32_t) == sizeof(float), "Code assumes uint32_t and float are the same size.");
  float tmp_weight = from._internal_weight();
  uint32_t raw_weight;
  memcpy(&raw_weight, &tmp_weight, sizeof(tmp_weight));
  if (raw_weight != 0) {
    _this->_internal_set_weight(from._internal_weight());
  }
  _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
}

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

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

void L2Regularizer::InternalSwap(L2Regularizer* other) {
  using std::swap;
  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
  swap(_impl_.weight_, other->_impl_.weight_);
}

::PROTOBUF_NAMESPACE_ID::Metadata L2Regularizer::GetMetadata() const {
  return ::_pbi::AssignDescriptors(
      &descriptor_table_second_2fprotos_2ftrain_2eproto_getter, &descriptor_table_second_2fprotos_2ftrain_2eproto_once,
      file_level_metadata_second_2fprotos_2ftrain_2eproto[2]);
}

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

class TrainConfig::_Internal {
 public:
  static const ::second::protos::Optimizer& optimizer(const TrainConfig* msg);
};

const ::second::protos::Optimizer&
TrainConfig::_Internal::optimizer(const TrainConfig* msg) {
  return *msg->_impl_.optimizer_;
}
void TrainConfig::clear_optimizer() {
  if (GetArenaForAllocation() == nullptr && _impl_.optimizer_ != nullptr) {
    delete _impl_.optimizer_;
  }
  _impl_.optimizer_ = nullptr;
}
TrainConfig::TrainConfig(::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:second.protos.TrainConfig)
}
TrainConfig::TrainConfig(const TrainConfig& from)
  : ::PROTOBUF_NAMESPACE_ID::Message() {
  TrainConfig* const _this = this; (void)_this;
  new (&_impl_) Impl_{
      decltype(_impl_.optimizer_){nullptr}
    , decltype(_impl_.inter_op_parallelism_threads_){}
    , decltype(_impl_.intra_op_parallelism_threads_){}
    , decltype(_impl_.steps_){}
    , decltype(_impl_.steps_per_eval_){}
    , decltype(_impl_.save_checkpoints_secs_){}
    , decltype(_impl_.save_summary_steps_){}
    , decltype(_impl_.loss_scale_factor_){}
    , decltype(_impl_.enable_mixed_precision_){}
    , decltype(_impl_.clear_metrics_every_epoch_){}
    , /*decltype(_impl_._cached_size_)*/{}};

  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
  if (from._internal_has_optimizer()) {
    _this->_impl_.optimizer_ = new ::second::protos::Optimizer(*from._impl_.optimizer_);
  }
  ::memcpy(&_impl_.inter_op_parallelism_threads_, &from._impl_.inter_op_parallelism_threads_,
    static_cast<size_t>(reinterpret_cast<char*>(&_impl_.clear_metrics_every_epoch_) -
    reinterpret_cast<char*>(&_impl_.inter_op_parallelism_threads_)) + sizeof(_impl_.clear_metrics_every_epoch_));
  // @@protoc_insertion_point(copy_constructor:second.protos.TrainConfig)
}

inline void TrainConfig::SharedCtor(
    ::_pb::Arena* arena, bool is_message_owned) {
  (void)arena;
  (void)is_message_owned;
  new (&_impl_) Impl_{
      decltype(_impl_.optimizer_){nullptr}
    , decltype(_impl_.inter_op_parallelism_threads_){0u}
    , decltype(_impl_.intra_op_parallelism_threads_){0u}
    , decltype(_impl_.steps_){0u}
    , decltype(_impl_.steps_per_eval_){0u}
    , decltype(_impl_.save_checkpoints_secs_){0u}
    , decltype(_impl_.save_summary_steps_){0u}
    , decltype(_impl_.loss_scale_factor_){0}
    , decltype(_impl_.enable_mixed_precision_){false}
    , decltype(_impl_.clear_metrics_every_epoch_){false}
    , /*decltype(_impl_._cached_size_)*/{}
  };
}

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

inline void TrainConfig::SharedDtor() {
  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
  if (this != internal_default_instance()) delete _impl_.optimizer_;
}

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

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

  if (GetArenaForAllocation() == nullptr && _impl_.optimizer_ != nullptr) {
    delete _impl_.optimizer_;
  }
  _impl_.optimizer_ = nullptr;
  ::memset(&_impl_.inter_op_parallelism_threads_, 0, static_cast<size_t>(
      reinterpret_cast<char*>(&_impl_.clear_metrics_every_epoch_) -
      reinterpret_cast<char*>(&_impl_.inter_op_parallelism_threads_)) + sizeof(_impl_.clear_metrics_every_epoch_));
  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
}

const char* TrainConfig::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  while (!ctx->Done(&ptr)) {
    uint32_t tag;
    ptr = ::_pbi::ReadTag(ptr, &tag);
    switch (tag >> 3) {
      // .second.protos.Optimizer optimizer = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
          ptr = ctx->ParseMessage(_internal_mutable_optimizer(), ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // uint32 inter_op_parallelism_threads = 3;
      case 3:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 24)) {
          _impl_.inter_op_parallelism_threads_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // uint32 intra_op_parallelism_threads = 4;
      case 4:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 32)) {
          _impl_.intra_op_parallelism_threads_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // uint32 steps = 5;
      case 5:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 40)) {
          _impl_.steps_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // uint32 steps_per_eval = 6;
      case 6:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 48)) {
          _impl_.steps_per_eval_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // uint32 save_checkpoints_secs = 7;
      case 7:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 56)) {
          _impl_.save_checkpoints_secs_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // uint32 save_summary_steps = 8;
      case 8:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 64)) {
          _impl_.save_summary_steps_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // bool enable_mixed_precision = 9;
      case 9:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 72)) {
          _impl_.enable_mixed_precision_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // float loss_scale_factor = 10;
      case 10:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 85)) {
          _impl_.loss_scale_factor_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
          ptr += sizeof(float);
        } else
          goto handle_unusual;
        continue;
      // bool clear_metrics_every_epoch = 11;
      case 11:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 88)) {
          _impl_.clear_metrics_every_epoch_ = ::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:
  return ptr;
failure:
  ptr = nullptr;
  goto message_done;
#undef CHK_
}

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

  // .second.protos.Optimizer optimizer = 1;
  if (this->_internal_has_optimizer()) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(1, _Internal::optimizer(this),
        _Internal::optimizer(this).GetCachedSize(), target, stream);
  }

  // uint32 inter_op_parallelism_threads = 3;
  if (this->_internal_inter_op_parallelism_threads() != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteUInt32ToArray(3, this->_internal_inter_op_parallelism_threads(), target);
  }

  // uint32 intra_op_parallelism_threads = 4;
  if (this->_internal_intra_op_parallelism_threads() != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteUInt32ToArray(4, this->_internal_intra_op_parallelism_threads(), target);
  }

  // uint32 steps = 5;
  if (this->_internal_steps() != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteUInt32ToArray(5, this->_internal_steps(), target);
  }

  // uint32 steps_per_eval = 6;
  if (this->_internal_steps_per_eval() != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteUInt32ToArray(6, this->_internal_steps_per_eval(), target);
  }

  // uint32 save_checkpoints_secs = 7;
  if (this->_internal_save_checkpoints_secs() != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteUInt32ToArray(7, this->_internal_save_checkpoints_secs(), target);
  }

  // uint32 save_summary_steps = 8;
  if (this->_internal_save_summary_steps() != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteUInt32ToArray(8, this->_internal_save_summary_steps(), target);
  }

  // bool enable_mixed_precision = 9;
  if (this->_internal_enable_mixed_precision() != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteBoolToArray(9, this->_internal_enable_mixed_precision(), target);
  }

  // float loss_scale_factor = 10;
  static_assert(sizeof(uint32_t) == sizeof(float), "Code assumes uint32_t and float are the same size.");
  float tmp_loss_scale_factor = this->_internal_loss_scale_factor();
  uint32_t raw_loss_scale_factor;
  memcpy(&raw_loss_scale_factor, &tmp_loss_scale_factor, sizeof(tmp_loss_scale_factor));
  if (raw_loss_scale_factor != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteFloatToArray(10, this->_internal_loss_scale_factor(), target);
  }

  // bool clear_metrics_every_epoch = 11;
  if (this->_internal_clear_metrics_every_epoch() != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteBoolToArray(11, this->_internal_clear_metrics_every_epoch(), 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:second.protos.TrainConfig)
  return target;
}

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

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

  // .second.protos.Optimizer optimizer = 1;
  if (this->_internal_has_optimizer()) {
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
        *_impl_.optimizer_);
  }

  // uint32 inter_op_parallelism_threads = 3;
  if (this->_internal_inter_op_parallelism_threads() != 0) {
    total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_inter_op_parallelism_threads());
  }

  // uint32 intra_op_parallelism_threads = 4;
  if (this->_internal_intra_op_parallelism_threads() != 0) {
    total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_intra_op_parallelism_threads());
  }

  // uint32 steps = 5;
  if (this->_internal_steps() != 0) {
    total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_steps());
  }

  // uint32 steps_per_eval = 6;
  if (this->_internal_steps_per_eval() != 0) {
    total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_steps_per_eval());
  }

  // uint32 save_checkpoints_secs = 7;
  if (this->_internal_save_checkpoints_secs() != 0) {
    total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_save_checkpoints_secs());
  }

  // uint32 save_summary_steps = 8;
  if (this->_internal_save_summary_steps() != 0) {
    total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_save_summary_steps());
  }

  // float loss_scale_factor = 10;
  static_assert(sizeof(uint32_t) == sizeof(float), "Code assumes uint32_t and float are the same size.");
  float tmp_loss_scale_factor = this->_internal_loss_scale_factor();
  uint32_t raw_loss_scale_factor;
  memcpy(&raw_loss_scale_factor, &tmp_loss_scale_factor, sizeof(tmp_loss_scale_factor));
  if (raw_loss_scale_factor != 0) {
    total_size += 1 + 4;
  }

  // bool enable_mixed_precision = 9;
  if (this->_internal_enable_mixed_precision() != 0) {
    total_size += 1 + 1;
  }

  // bool clear_metrics_every_epoch = 11;
  if (this->_internal_clear_metrics_every_epoch() != 0) {
    total_size += 1 + 1;
  }

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

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


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

  if (from._internal_has_optimizer()) {
    _this->_internal_mutable_optimizer()->::second::protos::Optimizer::MergeFrom(
        from._internal_optimizer());
  }
  if (from._internal_inter_op_parallelism_threads() != 0) {
    _this->_internal_set_inter_op_parallelism_threads(from._internal_inter_op_parallelism_threads());
  }
  if (from._internal_intra_op_parallelism_threads() != 0) {
    _this->_internal_set_intra_op_parallelism_threads(from._internal_intra_op_parallelism_threads());
  }
  if (from._internal_steps() != 0) {
    _this->_internal_set_steps(from._internal_steps());
  }
  if (from._internal_steps_per_eval() != 0) {
    _this->_internal_set_steps_per_eval(from._internal_steps_per_eval());
  }
  if (from._internal_save_checkpoints_secs() != 0) {
    _this->_internal_set_save_checkpoints_secs(from._internal_save_checkpoints_secs());
  }
  if (from._internal_save_summary_steps() != 0) {
    _this->_internal_set_save_summary_steps(from._internal_save_summary_steps());
  }
  static_assert(sizeof(uint32_t) == sizeof(float), "Code assumes uint32_t and float are the same size.");
  float tmp_loss_scale_factor = from._internal_loss_scale_factor();
  uint32_t raw_loss_scale_factor;
  memcpy(&raw_loss_scale_factor, &tmp_loss_scale_factor, sizeof(tmp_loss_scale_factor));
  if (raw_loss_scale_factor != 0) {
    _this->_internal_set_loss_scale_factor(from._internal_loss_scale_factor());
  }
  if (from._internal_enable_mixed_precision() != 0) {
    _this->_internal_set_enable_mixed_precision(from._internal_enable_mixed_precision());
  }
  if (from._internal_clear_metrics_every_epoch() != 0) {
    _this->_internal_set_clear_metrics_every_epoch(from._internal_clear_metrics_every_epoch());
  }
  _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
}

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

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

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

::PROTOBUF_NAMESPACE_ID::Metadata TrainConfig::GetMetadata() const {
  return ::_pbi::AssignDescriptors(
      &descriptor_table_second_2fprotos_2ftrain_2eproto_getter, &descriptor_table_second_2fprotos_2ftrain_2eproto_once,
      file_level_metadata_second_2fprotos_2ftrain_2eproto[3]);
}

// @@protoc_insertion_point(namespace_scope)
}  // namespace protos
}  // namespace second
PROTOBUF_NAMESPACE_OPEN
template<> PROTOBUF_NOINLINE ::second::protos::Regularizer*
Arena::CreateMaybeMessage< ::second::protos::Regularizer >(Arena* arena) {
  return Arena::CreateMessageInternal< ::second::protos::Regularizer >(arena);
}
template<> PROTOBUF_NOINLINE ::second::protos::L1Regularizer*
Arena::CreateMaybeMessage< ::second::protos::L1Regularizer >(Arena* arena) {
  return Arena::CreateMessageInternal< ::second::protos::L1Regularizer >(arena);
}
template<> PROTOBUF_NOINLINE ::second::protos::L2Regularizer*
Arena::CreateMaybeMessage< ::second::protos::L2Regularizer >(Arena* arena) {
  return Arena::CreateMessageInternal< ::second::protos::L2Regularizer >(arena);
}
template<> PROTOBUF_NOINLINE ::second::protos::TrainConfig*
Arena::CreateMaybeMessage< ::second::protos::TrainConfig >(Arena* arena) {
  return Arena::CreateMessageInternal< ::second::protos::TrainConfig >(arena);
}
PROTOBUF_NAMESPACE_CLOSE

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