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

#include "second/protos/optimizer.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 Optimizer::Optimizer(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_.use_moving_average_)*/false
  , /*decltype(_impl_.moving_average_decay_)*/0
  , /*decltype(_impl_.optimizer_)*/{}
  , /*decltype(_impl_._cached_size_)*/{}
  , /*decltype(_impl_._oneof_case_)*/{}} {}
struct OptimizerDefaultTypeInternal {
  PROTOBUF_CONSTEXPR OptimizerDefaultTypeInternal()
      : _instance(::_pbi::ConstantInitialized{}) {}
  ~OptimizerDefaultTypeInternal() {}
  union {
    Optimizer _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 OptimizerDefaultTypeInternal _Optimizer_default_instance_;
PROTOBUF_CONSTEXPR RMSPropOptimizer::RMSPropOptimizer(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_.learning_rate_)*/nullptr
  , /*decltype(_impl_.momentum_optimizer_value_)*/0
  , /*decltype(_impl_.decay_)*/0
  , /*decltype(_impl_.epsilon_)*/0
  , /*decltype(_impl_.weight_decay_)*/0
  , /*decltype(_impl_._cached_size_)*/{}} {}
struct RMSPropOptimizerDefaultTypeInternal {
  PROTOBUF_CONSTEXPR RMSPropOptimizerDefaultTypeInternal()
      : _instance(::_pbi::ConstantInitialized{}) {}
  ~RMSPropOptimizerDefaultTypeInternal() {}
  union {
    RMSPropOptimizer _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 RMSPropOptimizerDefaultTypeInternal _RMSPropOptimizer_default_instance_;
PROTOBUF_CONSTEXPR MomentumOptimizer::MomentumOptimizer(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_.learning_rate_)*/nullptr
  , /*decltype(_impl_.momentum_optimizer_value_)*/0
  , /*decltype(_impl_.weight_decay_)*/0
  , /*decltype(_impl_._cached_size_)*/{}} {}
struct MomentumOptimizerDefaultTypeInternal {
  PROTOBUF_CONSTEXPR MomentumOptimizerDefaultTypeInternal()
      : _instance(::_pbi::ConstantInitialized{}) {}
  ~MomentumOptimizerDefaultTypeInternal() {}
  union {
    MomentumOptimizer _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 MomentumOptimizerDefaultTypeInternal _MomentumOptimizer_default_instance_;
PROTOBUF_CONSTEXPR AdamOptimizer::AdamOptimizer(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_.learning_rate_)*/nullptr
  , /*decltype(_impl_.weight_decay_)*/0
  , /*decltype(_impl_._cached_size_)*/{}} {}
struct AdamOptimizerDefaultTypeInternal {
  PROTOBUF_CONSTEXPR AdamOptimizerDefaultTypeInternal()
      : _instance(::_pbi::ConstantInitialized{}) {}
  ~AdamOptimizerDefaultTypeInternal() {}
  union {
    AdamOptimizer _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 AdamOptimizerDefaultTypeInternal _AdamOptimizer_default_instance_;
PROTOBUF_CONSTEXPR LearningRate::LearningRate(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_.learning_rate_)*/{}
  , /*decltype(_impl_._cached_size_)*/{}
  , /*decltype(_impl_._oneof_case_)*/{}} {}
struct LearningRateDefaultTypeInternal {
  PROTOBUF_CONSTEXPR LearningRateDefaultTypeInternal()
      : _instance(::_pbi::ConstantInitialized{}) {}
  ~LearningRateDefaultTypeInternal() {}
  union {
    LearningRate _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 LearningRateDefaultTypeInternal _LearningRate_default_instance_;
PROTOBUF_CONSTEXPR ConstantLearningRate::ConstantLearningRate(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_.learning_rate_)*/0
  , /*decltype(_impl_._cached_size_)*/{}} {}
struct ConstantLearningRateDefaultTypeInternal {
  PROTOBUF_CONSTEXPR ConstantLearningRateDefaultTypeInternal()
      : _instance(::_pbi::ConstantInitialized{}) {}
  ~ConstantLearningRateDefaultTypeInternal() {}
  union {
    ConstantLearningRate _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ConstantLearningRateDefaultTypeInternal _ConstantLearningRate_default_instance_;
PROTOBUF_CONSTEXPR ExponentialDecayLearningRate::ExponentialDecayLearningRate(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_.initial_learning_rate_)*/0
  , /*decltype(_impl_.decay_steps_)*/0u
  , /*decltype(_impl_.decay_factor_)*/0
  , /*decltype(_impl_.staircase_)*/false
  , /*decltype(_impl_._cached_size_)*/{}} {}
struct ExponentialDecayLearningRateDefaultTypeInternal {
  PROTOBUF_CONSTEXPR ExponentialDecayLearningRateDefaultTypeInternal()
      : _instance(::_pbi::ConstantInitialized{}) {}
  ~ExponentialDecayLearningRateDefaultTypeInternal() {}
  union {
    ExponentialDecayLearningRate _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ExponentialDecayLearningRateDefaultTypeInternal _ExponentialDecayLearningRate_default_instance_;
PROTOBUF_CONSTEXPR ManualStepLearningRate_LearningRateSchedule::ManualStepLearningRate_LearningRateSchedule(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_.step_)*/0u
  , /*decltype(_impl_.learning_rate_)*/0
  , /*decltype(_impl_._cached_size_)*/{}} {}
struct ManualStepLearningRate_LearningRateScheduleDefaultTypeInternal {
  PROTOBUF_CONSTEXPR ManualStepLearningRate_LearningRateScheduleDefaultTypeInternal()
      : _instance(::_pbi::ConstantInitialized{}) {}
  ~ManualStepLearningRate_LearningRateScheduleDefaultTypeInternal() {}
  union {
    ManualStepLearningRate_LearningRateSchedule _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ManualStepLearningRate_LearningRateScheduleDefaultTypeInternal _ManualStepLearningRate_LearningRateSchedule_default_instance_;
PROTOBUF_CONSTEXPR ManualStepLearningRate::ManualStepLearningRate(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_.schedule_)*/{}
  , /*decltype(_impl_.initial_learning_rate_)*/0
  , /*decltype(_impl_._cached_size_)*/{}} {}
struct ManualStepLearningRateDefaultTypeInternal {
  PROTOBUF_CONSTEXPR ManualStepLearningRateDefaultTypeInternal()
      : _instance(::_pbi::ConstantInitialized{}) {}
  ~ManualStepLearningRateDefaultTypeInternal() {}
  union {
    ManualStepLearningRate _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ManualStepLearningRateDefaultTypeInternal _ManualStepLearningRate_default_instance_;
PROTOBUF_CONSTEXPR CosineDecayLearningRate::CosineDecayLearningRate(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_.learning_rate_base_)*/0
  , /*decltype(_impl_.total_steps_)*/0u
  , /*decltype(_impl_.warmup_learning_rate_)*/0
  , /*decltype(_impl_.warmup_steps_)*/0u
  , /*decltype(_impl_._cached_size_)*/{}} {}
struct CosineDecayLearningRateDefaultTypeInternal {
  PROTOBUF_CONSTEXPR CosineDecayLearningRateDefaultTypeInternal()
      : _instance(::_pbi::ConstantInitialized{}) {}
  ~CosineDecayLearningRateDefaultTypeInternal() {}
  union {
    CosineDecayLearningRate _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 CosineDecayLearningRateDefaultTypeInternal _CosineDecayLearningRate_default_instance_;
}  // namespace protos
}  // namespace second
static ::_pb::Metadata file_level_metadata_second_2fprotos_2foptimizer_2eproto[10];
static constexpr ::_pb::EnumDescriptor const** file_level_enum_descriptors_second_2fprotos_2foptimizer_2eproto = nullptr;
static constexpr ::_pb::ServiceDescriptor const** file_level_service_descriptors_second_2fprotos_2foptimizer_2eproto = nullptr;

const uint32_t TableStruct_second_2fprotos_2foptimizer_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
  ~0u,  // no _has_bits_
  PROTOBUF_FIELD_OFFSET(::second::protos::Optimizer, _internal_metadata_),
  ~0u,  // no _extensions_
  PROTOBUF_FIELD_OFFSET(::second::protos::Optimizer, _impl_._oneof_case_[0]),
  ~0u,  // no _weak_field_map_
  ~0u,  // no _inlined_string_donated_
  ::_pbi::kInvalidFieldOffsetTag,
  ::_pbi::kInvalidFieldOffsetTag,
  ::_pbi::kInvalidFieldOffsetTag,
  PROTOBUF_FIELD_OFFSET(::second::protos::Optimizer, _impl_.use_moving_average_),
  PROTOBUF_FIELD_OFFSET(::second::protos::Optimizer, _impl_.moving_average_decay_),
  PROTOBUF_FIELD_OFFSET(::second::protos::Optimizer, _impl_.optimizer_),
  ~0u,  // no _has_bits_
  PROTOBUF_FIELD_OFFSET(::second::protos::RMSPropOptimizer, _internal_metadata_),
  ~0u,  // no _extensions_
  ~0u,  // no _oneof_case_
  ~0u,  // no _weak_field_map_
  ~0u,  // no _inlined_string_donated_
  PROTOBUF_FIELD_OFFSET(::second::protos::RMSPropOptimizer, _impl_.learning_rate_),
  PROTOBUF_FIELD_OFFSET(::second::protos::RMSPropOptimizer, _impl_.momentum_optimizer_value_),
  PROTOBUF_FIELD_OFFSET(::second::protos::RMSPropOptimizer, _impl_.decay_),
  PROTOBUF_FIELD_OFFSET(::second::protos::RMSPropOptimizer, _impl_.epsilon_),
  PROTOBUF_FIELD_OFFSET(::second::protos::RMSPropOptimizer, _impl_.weight_decay_),
  ~0u,  // no _has_bits_
  PROTOBUF_FIELD_OFFSET(::second::protos::MomentumOptimizer, _internal_metadata_),
  ~0u,  // no _extensions_
  ~0u,  // no _oneof_case_
  ~0u,  // no _weak_field_map_
  ~0u,  // no _inlined_string_donated_
  PROTOBUF_FIELD_OFFSET(::second::protos::MomentumOptimizer, _impl_.learning_rate_),
  PROTOBUF_FIELD_OFFSET(::second::protos::MomentumOptimizer, _impl_.momentum_optimizer_value_),
  PROTOBUF_FIELD_OFFSET(::second::protos::MomentumOptimizer, _impl_.weight_decay_),
  ~0u,  // no _has_bits_
  PROTOBUF_FIELD_OFFSET(::second::protos::AdamOptimizer, _internal_metadata_),
  ~0u,  // no _extensions_
  ~0u,  // no _oneof_case_
  ~0u,  // no _weak_field_map_
  ~0u,  // no _inlined_string_donated_
  PROTOBUF_FIELD_OFFSET(::second::protos::AdamOptimizer, _impl_.learning_rate_),
  PROTOBUF_FIELD_OFFSET(::second::protos::AdamOptimizer, _impl_.weight_decay_),
  ~0u,  // no _has_bits_
  PROTOBUF_FIELD_OFFSET(::second::protos::LearningRate, _internal_metadata_),
  ~0u,  // no _extensions_
  PROTOBUF_FIELD_OFFSET(::second::protos::LearningRate, _impl_._oneof_case_[0]),
  ~0u,  // no _weak_field_map_
  ~0u,  // no _inlined_string_donated_
  ::_pbi::kInvalidFieldOffsetTag,
  ::_pbi::kInvalidFieldOffsetTag,
  ::_pbi::kInvalidFieldOffsetTag,
  ::_pbi::kInvalidFieldOffsetTag,
  PROTOBUF_FIELD_OFFSET(::second::protos::LearningRate, _impl_.learning_rate_),
  ~0u,  // no _has_bits_
  PROTOBUF_FIELD_OFFSET(::second::protos::ConstantLearningRate, _internal_metadata_),
  ~0u,  // no _extensions_
  ~0u,  // no _oneof_case_
  ~0u,  // no _weak_field_map_
  ~0u,  // no _inlined_string_donated_
  PROTOBUF_FIELD_OFFSET(::second::protos::ConstantLearningRate, _impl_.learning_rate_),
  ~0u,  // no _has_bits_
  PROTOBUF_FIELD_OFFSET(::second::protos::ExponentialDecayLearningRate, _internal_metadata_),
  ~0u,  // no _extensions_
  ~0u,  // no _oneof_case_
  ~0u,  // no _weak_field_map_
  ~0u,  // no _inlined_string_donated_
  PROTOBUF_FIELD_OFFSET(::second::protos::ExponentialDecayLearningRate, _impl_.initial_learning_rate_),
  PROTOBUF_FIELD_OFFSET(::second::protos::ExponentialDecayLearningRate, _impl_.decay_steps_),
  PROTOBUF_FIELD_OFFSET(::second::protos::ExponentialDecayLearningRate, _impl_.decay_factor_),
  PROTOBUF_FIELD_OFFSET(::second::protos::ExponentialDecayLearningRate, _impl_.staircase_),
  ~0u,  // no _has_bits_
  PROTOBUF_FIELD_OFFSET(::second::protos::ManualStepLearningRate_LearningRateSchedule, _internal_metadata_),
  ~0u,  // no _extensions_
  ~0u,  // no _oneof_case_
  ~0u,  // no _weak_field_map_
  ~0u,  // no _inlined_string_donated_
  PROTOBUF_FIELD_OFFSET(::second::protos::ManualStepLearningRate_LearningRateSchedule, _impl_.step_),
  PROTOBUF_FIELD_OFFSET(::second::protos::ManualStepLearningRate_LearningRateSchedule, _impl_.learning_rate_),
  ~0u,  // no _has_bits_
  PROTOBUF_FIELD_OFFSET(::second::protos::ManualStepLearningRate, _internal_metadata_),
  ~0u,  // no _extensions_
  ~0u,  // no _oneof_case_
  ~0u,  // no _weak_field_map_
  ~0u,  // no _inlined_string_donated_
  PROTOBUF_FIELD_OFFSET(::second::protos::ManualStepLearningRate, _impl_.initial_learning_rate_),
  PROTOBUF_FIELD_OFFSET(::second::protos::ManualStepLearningRate, _impl_.schedule_),
  ~0u,  // no _has_bits_
  PROTOBUF_FIELD_OFFSET(::second::protos::CosineDecayLearningRate, _internal_metadata_),
  ~0u,  // no _extensions_
  ~0u,  // no _oneof_case_
  ~0u,  // no _weak_field_map_
  ~0u,  // no _inlined_string_donated_
  PROTOBUF_FIELD_OFFSET(::second::protos::CosineDecayLearningRate, _impl_.learning_rate_base_),
  PROTOBUF_FIELD_OFFSET(::second::protos::CosineDecayLearningRate, _impl_.total_steps_),
  PROTOBUF_FIELD_OFFSET(::second::protos::CosineDecayLearningRate, _impl_.warmup_learning_rate_),
  PROTOBUF_FIELD_OFFSET(::second::protos::CosineDecayLearningRate, _impl_.warmup_steps_),
};
static const ::_pbi::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
  { 0, -1, -1, sizeof(::second::protos::Optimizer)},
  { 12, -1, -1, sizeof(::second::protos::RMSPropOptimizer)},
  { 23, -1, -1, sizeof(::second::protos::MomentumOptimizer)},
  { 32, -1, -1, sizeof(::second::protos::AdamOptimizer)},
  { 40, -1, -1, sizeof(::second::protos::LearningRate)},
  { 51, -1, -1, sizeof(::second::protos::ConstantLearningRate)},
  { 58, -1, -1, sizeof(::second::protos::ExponentialDecayLearningRate)},
  { 68, -1, -1, sizeof(::second::protos::ManualStepLearningRate_LearningRateSchedule)},
  { 76, -1, -1, sizeof(::second::protos::ManualStepLearningRate)},
  { 84, -1, -1, sizeof(::second::protos::CosineDecayLearningRate)},
};

static const ::_pb::Message* const file_default_instances[] = {
  &::second::protos::_Optimizer_default_instance_._instance,
  &::second::protos::_RMSPropOptimizer_default_instance_._instance,
  &::second::protos::_MomentumOptimizer_default_instance_._instance,
  &::second::protos::_AdamOptimizer_default_instance_._instance,
  &::second::protos::_LearningRate_default_instance_._instance,
  &::second::protos::_ConstantLearningRate_default_instance_._instance,
  &::second::protos::_ExponentialDecayLearningRate_default_instance_._instance,
  &::second::protos::_ManualStepLearningRate_LearningRateSchedule_default_instance_._instance,
  &::second::protos::_ManualStepLearningRate_default_instance_._instance,
  &::second::protos::_CosineDecayLearningRate_default_instance_._instance,
};

const char descriptor_table_protodef_second_2fprotos_2foptimizer_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) =
  "\n\035second/protos/optimizer.proto\022\rsecond."
  "protos\"\211\002\n\tOptimizer\022=\n\022rms_prop_optimiz"
  "er\030\001 \001(\0132\037.second.protos.RMSPropOptimize"
  "rH\000\022>\n\022momentum_optimizer\030\002 \001(\0132 .second"
  ".protos.MomentumOptimizerH\000\0226\n\016adam_opti"
  "mizer\030\003 \001(\0132\034.second.protos.AdamOptimize"
  "rH\000\022\032\n\022use_moving_average\030\004 \001(\010\022\034\n\024movin"
  "g_average_decay\030\005 \001(\002B\013\n\toptimizer\"\236\001\n\020R"
  "MSPropOptimizer\0222\n\rlearning_rate\030\001 \001(\0132\033"
  ".second.protos.LearningRate\022 \n\030momentum_"
  "optimizer_value\030\002 \001(\002\022\r\n\005decay\030\003 \001(\002\022\017\n\007"
  "epsilon\030\004 \001(\002\022\024\n\014weight_decay\030\005 \001(\002\"\177\n\021M"
  "omentumOptimizer\0222\n\rlearning_rate\030\001 \001(\0132"
  "\033.second.protos.LearningRate\022 \n\030momentum"
  "_optimizer_value\030\002 \001(\002\022\024\n\014weight_decay\030\003"
  " \001(\002\"Y\n\rAdamOptimizer\0222\n\rlearning_rate\030\001"
  " \001(\0132\033.second.protos.LearningRate\022\024\n\014wei"
  "ght_decay\030\002 \001(\002\"\330\002\n\014LearningRate\022E\n\026cons"
  "tant_learning_rate\030\001 \001(\0132#.second.protos"
  ".ConstantLearningRateH\000\022V\n\037exponential_d"
  "ecay_learning_rate\030\002 \001(\0132+.second.protos"
  ".ExponentialDecayLearningRateH\000\022J\n\031manua"
  "l_step_learning_rate\030\003 \001(\0132%.second.prot"
  "os.ManualStepLearningRateH\000\022L\n\032cosine_de"
  "cay_learning_rate\030\004 \001(\0132&.second.protos."
  "CosineDecayLearningRateH\000B\017\n\rlearning_ra"
  "te\"-\n\024ConstantLearningRate\022\025\n\rlearning_r"
  "ate\030\001 \001(\002\"{\n\034ExponentialDecayLearningRat"
  "e\022\035\n\025initial_learning_rate\030\001 \001(\002\022\023\n\013deca"
  "y_steps\030\002 \001(\r\022\024\n\014decay_factor\030\003 \001(\002\022\021\n\ts"
  "taircase\030\004 \001(\010\"\302\001\n\026ManualStepLearningRat"
  "e\022\035\n\025initial_learning_rate\030\001 \001(\002\022L\n\010sche"
  "dule\030\002 \003(\0132:.second.protos.ManualStepLea"
  "rningRate.LearningRateSchedule\032;\n\024Learni"
  "ngRateSchedule\022\014\n\004step\030\001 \001(\r\022\025\n\rlearning"
  "_rate\030\002 \001(\002\"~\n\027CosineDecayLearningRate\022\032"
  "\n\022learning_rate_base\030\001 \001(\002\022\023\n\013total_step"
  "s\030\002 \001(\r\022\034\n\024warmup_learning_rate\030\003 \001(\002\022\024\n"
  "\014warmup_steps\030\004 \001(\rb\006proto3"
  ;
static ::_pbi::once_flag descriptor_table_second_2fprotos_2foptimizer_2eproto_once;
const ::_pbi::DescriptorTable descriptor_table_second_2fprotos_2foptimizer_2eproto = {
    false, false, 1547, descriptor_table_protodef_second_2fprotos_2foptimizer_2eproto,
    "second/protos/optimizer.proto",
    &descriptor_table_second_2fprotos_2foptimizer_2eproto_once, nullptr, 0, 10,
    schemas, file_default_instances, TableStruct_second_2fprotos_2foptimizer_2eproto::offsets,
    file_level_metadata_second_2fprotos_2foptimizer_2eproto, file_level_enum_descriptors_second_2fprotos_2foptimizer_2eproto,
    file_level_service_descriptors_second_2fprotos_2foptimizer_2eproto,
};
PROTOBUF_ATTRIBUTE_WEAK const ::_pbi::DescriptorTable* descriptor_table_second_2fprotos_2foptimizer_2eproto_getter() {
  return &descriptor_table_second_2fprotos_2foptimizer_2eproto;
}

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

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

class Optimizer::_Internal {
 public:
  static const ::second::protos::RMSPropOptimizer& rms_prop_optimizer(const Optimizer* msg);
  static const ::second::protos::MomentumOptimizer& momentum_optimizer(const Optimizer* msg);
  static const ::second::protos::AdamOptimizer& adam_optimizer(const Optimizer* msg);
};

const ::second::protos::RMSPropOptimizer&
Optimizer::_Internal::rms_prop_optimizer(const Optimizer* msg) {
  return *msg->_impl_.optimizer_.rms_prop_optimizer_;
}
const ::second::protos::MomentumOptimizer&
Optimizer::_Internal::momentum_optimizer(const Optimizer* msg) {
  return *msg->_impl_.optimizer_.momentum_optimizer_;
}
const ::second::protos::AdamOptimizer&
Optimizer::_Internal::adam_optimizer(const Optimizer* msg) {
  return *msg->_impl_.optimizer_.adam_optimizer_;
}
void Optimizer::set_allocated_rms_prop_optimizer(::second::protos::RMSPropOptimizer* rms_prop_optimizer) {
  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
  clear_optimizer();
  if (rms_prop_optimizer) {
    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
      ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(rms_prop_optimizer);
    if (message_arena != submessage_arena) {
      rms_prop_optimizer = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
          message_arena, rms_prop_optimizer, submessage_arena);
    }
    set_has_rms_prop_optimizer();
    _impl_.optimizer_.rms_prop_optimizer_ = rms_prop_optimizer;
  }
  // @@protoc_insertion_point(field_set_allocated:second.protos.Optimizer.rms_prop_optimizer)
}
void Optimizer::set_allocated_momentum_optimizer(::second::protos::MomentumOptimizer* momentum_optimizer) {
  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
  clear_optimizer();
  if (momentum_optimizer) {
    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
      ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(momentum_optimizer);
    if (message_arena != submessage_arena) {
      momentum_optimizer = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
          message_arena, momentum_optimizer, submessage_arena);
    }
    set_has_momentum_optimizer();
    _impl_.optimizer_.momentum_optimizer_ = momentum_optimizer;
  }
  // @@protoc_insertion_point(field_set_allocated:second.protos.Optimizer.momentum_optimizer)
}
void Optimizer::set_allocated_adam_optimizer(::second::protos::AdamOptimizer* adam_optimizer) {
  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
  clear_optimizer();
  if (adam_optimizer) {
    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
      ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(adam_optimizer);
    if (message_arena != submessage_arena) {
      adam_optimizer = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
          message_arena, adam_optimizer, submessage_arena);
    }
    set_has_adam_optimizer();
    _impl_.optimizer_.adam_optimizer_ = adam_optimizer;
  }
  // @@protoc_insertion_point(field_set_allocated:second.protos.Optimizer.adam_optimizer)
}
Optimizer::Optimizer(::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.Optimizer)
}
Optimizer::Optimizer(const Optimizer& from)
  : ::PROTOBUF_NAMESPACE_ID::Message() {
  Optimizer* const _this = this; (void)_this;
  new (&_impl_) Impl_{
      decltype(_impl_.use_moving_average_){}
    , decltype(_impl_.moving_average_decay_){}
    , decltype(_impl_.optimizer_){}
    , /*decltype(_impl_._cached_size_)*/{}
    , /*decltype(_impl_._oneof_case_)*/{}};

  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
  ::memcpy(&_impl_.use_moving_average_, &from._impl_.use_moving_average_,
    static_cast<size_t>(reinterpret_cast<char*>(&_impl_.moving_average_decay_) -
    reinterpret_cast<char*>(&_impl_.use_moving_average_)) + sizeof(_impl_.moving_average_decay_));
  clear_has_optimizer();
  switch (from.optimizer_case()) {
    case kRmsPropOptimizer: {
      _this->_internal_mutable_rms_prop_optimizer()->::second::protos::RMSPropOptimizer::MergeFrom(
          from._internal_rms_prop_optimizer());
      break;
    }
    case kMomentumOptimizer: {
      _this->_internal_mutable_momentum_optimizer()->::second::protos::MomentumOptimizer::MergeFrom(
          from._internal_momentum_optimizer());
      break;
    }
    case kAdamOptimizer: {
      _this->_internal_mutable_adam_optimizer()->::second::protos::AdamOptimizer::MergeFrom(
          from._internal_adam_optimizer());
      break;
    }
    case OPTIMIZER_NOT_SET: {
      break;
    }
  }
  // @@protoc_insertion_point(copy_constructor:second.protos.Optimizer)
}

inline void Optimizer::SharedCtor(
    ::_pb::Arena* arena, bool is_message_owned) {
  (void)arena;
  (void)is_message_owned;
  new (&_impl_) Impl_{
      decltype(_impl_.use_moving_average_){false}
    , decltype(_impl_.moving_average_decay_){0}
    , decltype(_impl_.optimizer_){}
    , /*decltype(_impl_._cached_size_)*/{}
    , /*decltype(_impl_._oneof_case_)*/{}
  };
  clear_has_optimizer();
}

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

inline void Optimizer::SharedDtor() {
  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
  if (has_optimizer()) {
    clear_optimizer();
  }
}

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

void Optimizer::clear_optimizer() {
// @@protoc_insertion_point(one_of_clear_start:second.protos.Optimizer)
  switch (optimizer_case()) {
    case kRmsPropOptimizer: {
      if (GetArenaForAllocation() == nullptr) {
        delete _impl_.optimizer_.rms_prop_optimizer_;
      }
      break;
    }
    case kMomentumOptimizer: {
      if (GetArenaForAllocation() == nullptr) {
        delete _impl_.optimizer_.momentum_optimizer_;
      }
      break;
    }
    case kAdamOptimizer: {
      if (GetArenaForAllocation() == nullptr) {
        delete _impl_.optimizer_.adam_optimizer_;
      }
      break;
    }
    case OPTIMIZER_NOT_SET: {
      break;
    }
  }
  _impl_._oneof_case_[0] = OPTIMIZER_NOT_SET;
}


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

  ::memset(&_impl_.use_moving_average_, 0, static_cast<size_t>(
      reinterpret_cast<char*>(&_impl_.moving_average_decay_) -
      reinterpret_cast<char*>(&_impl_.use_moving_average_)) + sizeof(_impl_.moving_average_decay_));
  clear_optimizer();
  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
}

const char* Optimizer::_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.RMSPropOptimizer rms_prop_optimizer = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
          ptr = ctx->ParseMessage(_internal_mutable_rms_prop_optimizer(), ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // .second.protos.MomentumOptimizer momentum_optimizer = 2;
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 18)) {
          ptr = ctx->ParseMessage(_internal_mutable_momentum_optimizer(), ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // .second.protos.AdamOptimizer adam_optimizer = 3;
      case 3:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 26)) {
          ptr = ctx->ParseMessage(_internal_mutable_adam_optimizer(), ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // bool use_moving_average = 4;
      case 4:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 32)) {
          _impl_.use_moving_average_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // float moving_average_decay = 5;
      case 5:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 45)) {
          _impl_.moving_average_decay_ = ::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* Optimizer::_InternalSerialize(
    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:second.protos.Optimizer)
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  // .second.protos.RMSPropOptimizer rms_prop_optimizer = 1;
  if (_internal_has_rms_prop_optimizer()) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(1, _Internal::rms_prop_optimizer(this),
        _Internal::rms_prop_optimizer(this).GetCachedSize(), target, stream);
  }

  // .second.protos.MomentumOptimizer momentum_optimizer = 2;
  if (_internal_has_momentum_optimizer()) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(2, _Internal::momentum_optimizer(this),
        _Internal::momentum_optimizer(this).GetCachedSize(), target, stream);
  }

  // .second.protos.AdamOptimizer adam_optimizer = 3;
  if (_internal_has_adam_optimizer()) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(3, _Internal::adam_optimizer(this),
        _Internal::adam_optimizer(this).GetCachedSize(), target, stream);
  }

  // bool use_moving_average = 4;
  if (this->_internal_use_moving_average() != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteBoolToArray(4, this->_internal_use_moving_average(), target);
  }

  // float moving_average_decay = 5;
  static_assert(sizeof(uint32_t) == sizeof(float), "Code assumes uint32_t and float are the same size.");
  float tmp_moving_average_decay = this->_internal_moving_average_decay();
  uint32_t raw_moving_average_decay;
  memcpy(&raw_moving_average_decay, &tmp_moving_average_decay, sizeof(tmp_moving_average_decay));
  if (raw_moving_average_decay != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteFloatToArray(5, this->_internal_moving_average_decay(), 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.Optimizer)
  return target;
}

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

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

  // bool use_moving_average = 4;
  if (this->_internal_use_moving_average() != 0) {
    total_size += 1 + 1;
  }

  // float moving_average_decay = 5;
  static_assert(sizeof(uint32_t) == sizeof(float), "Code assumes uint32_t and float are the same size.");
  float tmp_moving_average_decay = this->_internal_moving_average_decay();
  uint32_t raw_moving_average_decay;
  memcpy(&raw_moving_average_decay, &tmp_moving_average_decay, sizeof(tmp_moving_average_decay));
  if (raw_moving_average_decay != 0) {
    total_size += 1 + 4;
  }

  switch (optimizer_case()) {
    // .second.protos.RMSPropOptimizer rms_prop_optimizer = 1;
    case kRmsPropOptimizer: {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          *_impl_.optimizer_.rms_prop_optimizer_);
      break;
    }
    // .second.protos.MomentumOptimizer momentum_optimizer = 2;
    case kMomentumOptimizer: {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          *_impl_.optimizer_.momentum_optimizer_);
      break;
    }
    // .second.protos.AdamOptimizer adam_optimizer = 3;
    case kAdamOptimizer: {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          *_impl_.optimizer_.adam_optimizer_);
      break;
    }
    case OPTIMIZER_NOT_SET: {
      break;
    }
  }
  return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_);
}

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


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

  if (from._internal_use_moving_average() != 0) {
    _this->_internal_set_use_moving_average(from._internal_use_moving_average());
  }
  static_assert(sizeof(uint32_t) == sizeof(float), "Code assumes uint32_t and float are the same size.");
  float tmp_moving_average_decay = from._internal_moving_average_decay();
  uint32_t raw_moving_average_decay;
  memcpy(&raw_moving_average_decay, &tmp_moving_average_decay, sizeof(tmp_moving_average_decay));
  if (raw_moving_average_decay != 0) {
    _this->_internal_set_moving_average_decay(from._internal_moving_average_decay());
  }
  switch (from.optimizer_case()) {
    case kRmsPropOptimizer: {
      _this->_internal_mutable_rms_prop_optimizer()->::second::protos::RMSPropOptimizer::MergeFrom(
          from._internal_rms_prop_optimizer());
      break;
    }
    case kMomentumOptimizer: {
      _this->_internal_mutable_momentum_optimizer()->::second::protos::MomentumOptimizer::MergeFrom(
          from._internal_momentum_optimizer());
      break;
    }
    case kAdamOptimizer: {
      _this->_internal_mutable_adam_optimizer()->::second::protos::AdamOptimizer::MergeFrom(
          from._internal_adam_optimizer());
      break;
    }
    case OPTIMIZER_NOT_SET: {
      break;
    }
  }
  _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
}

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

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

void Optimizer::InternalSwap(Optimizer* other) {
  using std::swap;
  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
      PROTOBUF_FIELD_OFFSET(Optimizer, _impl_.moving_average_decay_)
      + sizeof(Optimizer::_impl_.moving_average_decay_)
      - PROTOBUF_FIELD_OFFSET(Optimizer, _impl_.use_moving_average_)>(
          reinterpret_cast<char*>(&_impl_.use_moving_average_),
          reinterpret_cast<char*>(&other->_impl_.use_moving_average_));
  swap(_impl_.optimizer_, other->_impl_.optimizer_);
  swap(_impl_._oneof_case_[0], other->_impl_._oneof_case_[0]);
}

::PROTOBUF_NAMESPACE_ID::Metadata Optimizer::GetMetadata() const {
  return ::_pbi::AssignDescriptors(
      &descriptor_table_second_2fprotos_2foptimizer_2eproto_getter, &descriptor_table_second_2fprotos_2foptimizer_2eproto_once,
      file_level_metadata_second_2fprotos_2foptimizer_2eproto[0]);
}

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

class RMSPropOptimizer::_Internal {
 public:
  static const ::second::protos::LearningRate& learning_rate(const RMSPropOptimizer* msg);
};

const ::second::protos::LearningRate&
RMSPropOptimizer::_Internal::learning_rate(const RMSPropOptimizer* msg) {
  return *msg->_impl_.learning_rate_;
}
RMSPropOptimizer::RMSPropOptimizer(::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.RMSPropOptimizer)
}
RMSPropOptimizer::RMSPropOptimizer(const RMSPropOptimizer& from)
  : ::PROTOBUF_NAMESPACE_ID::Message() {
  RMSPropOptimizer* const _this = this; (void)_this;
  new (&_impl_) Impl_{
      decltype(_impl_.learning_rate_){nullptr}
    , decltype(_impl_.momentum_optimizer_value_){}
    , decltype(_impl_.decay_){}
    , decltype(_impl_.epsilon_){}
    , decltype(_impl_.weight_decay_){}
    , /*decltype(_impl_._cached_size_)*/{}};

  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
  if (from._internal_has_learning_rate()) {
    _this->_impl_.learning_rate_ = new ::second::protos::LearningRate(*from._impl_.learning_rate_);
  }
  ::memcpy(&_impl_.momentum_optimizer_value_, &from._impl_.momentum_optimizer_value_,
    static_cast<size_t>(reinterpret_cast<char*>(&_impl_.weight_decay_) -
    reinterpret_cast<char*>(&_impl_.momentum_optimizer_value_)) + sizeof(_impl_.weight_decay_));
  // @@protoc_insertion_point(copy_constructor:second.protos.RMSPropOptimizer)
}

inline void RMSPropOptimizer::SharedCtor(
    ::_pb::Arena* arena, bool is_message_owned) {
  (void)arena;
  (void)is_message_owned;
  new (&_impl_) Impl_{
      decltype(_impl_.learning_rate_){nullptr}
    , decltype(_impl_.momentum_optimizer_value_){0}
    , decltype(_impl_.decay_){0}
    , decltype(_impl_.epsilon_){0}
    , decltype(_impl_.weight_decay_){0}
    , /*decltype(_impl_._cached_size_)*/{}
  };
}

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

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

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

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

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

const char* RMSPropOptimizer::_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.LearningRate learning_rate = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
          ptr = ctx->ParseMessage(_internal_mutable_learning_rate(), ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // float momentum_optimizer_value = 2;
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 21)) {
          _impl_.momentum_optimizer_value_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
          ptr += sizeof(float);
        } else
          goto handle_unusual;
        continue;
      // float decay = 3;
      case 3:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 29)) {
          _impl_.decay_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
          ptr += sizeof(float);
        } else
          goto handle_unusual;
        continue;
      // float epsilon = 4;
      case 4:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 37)) {
          _impl_.epsilon_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
          ptr += sizeof(float);
        } else
          goto handle_unusual;
        continue;
      // float weight_decay = 5;
      case 5:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 45)) {
          _impl_.weight_decay_ = ::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* RMSPropOptimizer::_InternalSerialize(
    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:second.protos.RMSPropOptimizer)
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

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

  // float momentum_optimizer_value = 2;
  static_assert(sizeof(uint32_t) == sizeof(float), "Code assumes uint32_t and float are the same size.");
  float tmp_momentum_optimizer_value = this->_internal_momentum_optimizer_value();
  uint32_t raw_momentum_optimizer_value;
  memcpy(&raw_momentum_optimizer_value, &tmp_momentum_optimizer_value, sizeof(tmp_momentum_optimizer_value));
  if (raw_momentum_optimizer_value != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteFloatToArray(2, this->_internal_momentum_optimizer_value(), target);
  }

  // float decay = 3;
  static_assert(sizeof(uint32_t) == sizeof(float), "Code assumes uint32_t and float are the same size.");
  float tmp_decay = this->_internal_decay();
  uint32_t raw_decay;
  memcpy(&raw_decay, &tmp_decay, sizeof(tmp_decay));
  if (raw_decay != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteFloatToArray(3, this->_internal_decay(), target);
  }

  // float epsilon = 4;
  static_assert(sizeof(uint32_t) == sizeof(float), "Code assumes uint32_t and float are the same size.");
  float tmp_epsilon = this->_internal_epsilon();
  uint32_t raw_epsilon;
  memcpy(&raw_epsilon, &tmp_epsilon, sizeof(tmp_epsilon));
  if (raw_epsilon != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteFloatToArray(4, this->_internal_epsilon(), target);
  }

  // float weight_decay = 5;
  static_assert(sizeof(uint32_t) == sizeof(float), "Code assumes uint32_t and float are the same size.");
  float tmp_weight_decay = this->_internal_weight_decay();
  uint32_t raw_weight_decay;
  memcpy(&raw_weight_decay, &tmp_weight_decay, sizeof(tmp_weight_decay));
  if (raw_weight_decay != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteFloatToArray(5, this->_internal_weight_decay(), 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.RMSPropOptimizer)
  return target;
}

size_t RMSPropOptimizer::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:second.protos.RMSPropOptimizer)
  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.LearningRate learning_rate = 1;
  if (this->_internal_has_learning_rate()) {
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
        *_impl_.learning_rate_);
  }

  // float momentum_optimizer_value = 2;
  static_assert(sizeof(uint32_t) == sizeof(float), "Code assumes uint32_t and float are the same size.");
  float tmp_momentum_optimizer_value = this->_internal_momentum_optimizer_value();
  uint32_t raw_momentum_optimizer_value;
  memcpy(&raw_momentum_optimizer_value, &tmp_momentum_optimizer_value, sizeof(tmp_momentum_optimizer_value));
  if (raw_momentum_optimizer_value != 0) {
    total_size += 1 + 4;
  }

  // float decay = 3;
  static_assert(sizeof(uint32_t) == sizeof(float), "Code assumes uint32_t and float are the same size.");
  float tmp_decay = this->_internal_decay();
  uint32_t raw_decay;
  memcpy(&raw_decay, &tmp_decay, sizeof(tmp_decay));
  if (raw_decay != 0) {
    total_size += 1 + 4;
  }

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

  // float weight_decay = 5;
  static_assert(sizeof(uint32_t) == sizeof(float), "Code assumes uint32_t and float are the same size.");
  float tmp_weight_decay = this->_internal_weight_decay();
  uint32_t raw_weight_decay;
  memcpy(&raw_weight_decay, &tmp_weight_decay, sizeof(tmp_weight_decay));
  if (raw_weight_decay != 0) {
    total_size += 1 + 4;
  }

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

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


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

  if (from._internal_has_learning_rate()) {
    _this->_internal_mutable_learning_rate()->::second::protos::LearningRate::MergeFrom(
        from._internal_learning_rate());
  }
  static_assert(sizeof(uint32_t) == sizeof(float), "Code assumes uint32_t and float are the same size.");
  float tmp_momentum_optimizer_value = from._internal_momentum_optimizer_value();
  uint32_t raw_momentum_optimizer_value;
  memcpy(&raw_momentum_optimizer_value, &tmp_momentum_optimizer_value, sizeof(tmp_momentum_optimizer_value));
  if (raw_momentum_optimizer_value != 0) {
    _this->_internal_set_momentum_optimizer_value(from._internal_momentum_optimizer_value());
  }
  static_assert(sizeof(uint32_t) == sizeof(float), "Code assumes uint32_t and float are the same size.");
  float tmp_decay = from._internal_decay();
  uint32_t raw_decay;
  memcpy(&raw_decay, &tmp_decay, sizeof(tmp_decay));
  if (raw_decay != 0) {
    _this->_internal_set_decay(from._internal_decay());
  }
  static_assert(sizeof(uint32_t) == sizeof(float), "Code assumes uint32_t and float are the same size.");
  float tmp_epsilon = from._internal_epsilon();
  uint32_t raw_epsilon;
  memcpy(&raw_epsilon, &tmp_epsilon, sizeof(tmp_epsilon));
  if (raw_epsilon != 0) {
    _this->_internal_set_epsilon(from._internal_epsilon());
  }
  static_assert(sizeof(uint32_t) == sizeof(float), "Code assumes uint32_t and float are the same size.");
  float tmp_weight_decay = from._internal_weight_decay();
  uint32_t raw_weight_decay;
  memcpy(&raw_weight_decay, &tmp_weight_decay, sizeof(tmp_weight_decay));
  if (raw_weight_decay != 0) {
    _this->_internal_set_weight_decay(from._internal_weight_decay());
  }
  _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
}

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

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

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

::PROTOBUF_NAMESPACE_ID::Metadata RMSPropOptimizer::GetMetadata() const {
  return ::_pbi::AssignDescriptors(
      &descriptor_table_second_2fprotos_2foptimizer_2eproto_getter, &descriptor_table_second_2fprotos_2foptimizer_2eproto_once,
      file_level_metadata_second_2fprotos_2foptimizer_2eproto[1]);
}

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

class MomentumOptimizer::_Internal {
 public:
  static const ::second::protos::LearningRate& learning_rate(const MomentumOptimizer* msg);
};

const ::second::protos::LearningRate&
MomentumOptimizer::_Internal::learning_rate(const MomentumOptimizer* msg) {
  return *msg->_impl_.learning_rate_;
}
MomentumOptimizer::MomentumOptimizer(::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.MomentumOptimizer)
}
MomentumOptimizer::MomentumOptimizer(const MomentumOptimizer& from)
  : ::PROTOBUF_NAMESPACE_ID::Message() {
  MomentumOptimizer* const _this = this; (void)_this;
  new (&_impl_) Impl_{
      decltype(_impl_.learning_rate_){nullptr}
    , decltype(_impl_.momentum_optimizer_value_){}
    , decltype(_impl_.weight_decay_){}
    , /*decltype(_impl_._cached_size_)*/{}};

  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
  if (from._internal_has_learning_rate()) {
    _this->_impl_.learning_rate_ = new ::second::protos::LearningRate(*from._impl_.learning_rate_);
  }
  ::memcpy(&_impl_.momentum_optimizer_value_, &from._impl_.momentum_optimizer_value_,
    static_cast<size_t>(reinterpret_cast<char*>(&_impl_.weight_decay_) -
    reinterpret_cast<char*>(&_impl_.momentum_optimizer_value_)) + sizeof(_impl_.weight_decay_));
  // @@protoc_insertion_point(copy_constructor:second.protos.MomentumOptimizer)
}

inline void MomentumOptimizer::SharedCtor(
    ::_pb::Arena* arena, bool is_message_owned) {
  (void)arena;
  (void)is_message_owned;
  new (&_impl_) Impl_{
      decltype(_impl_.learning_rate_){nullptr}
    , decltype(_impl_.momentum_optimizer_value_){0}
    , decltype(_impl_.weight_decay_){0}
    , /*decltype(_impl_._cached_size_)*/{}
  };
}

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

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

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

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

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

const char* MomentumOptimizer::_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.LearningRate learning_rate = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
          ptr = ctx->ParseMessage(_internal_mutable_learning_rate(), ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // float momentum_optimizer_value = 2;
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 21)) {
          _impl_.momentum_optimizer_value_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
          ptr += sizeof(float);
        } else
          goto handle_unusual;
        continue;
      // float weight_decay = 3;
      case 3:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 29)) {
          _impl_.weight_decay_ = ::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* MomentumOptimizer::_InternalSerialize(
    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:second.protos.MomentumOptimizer)
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

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

  // float momentum_optimizer_value = 2;
  static_assert(sizeof(uint32_t) == sizeof(float), "Code assumes uint32_t and float are the same size.");
  float tmp_momentum_optimizer_value = this->_internal_momentum_optimizer_value();
  uint32_t raw_momentum_optimizer_value;
  memcpy(&raw_momentum_optimizer_value, &tmp_momentum_optimizer_value, sizeof(tmp_momentum_optimizer_value));
  if (raw_momentum_optimizer_value != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteFloatToArray(2, this->_internal_momentum_optimizer_value(), target);
  }

  // float weight_decay = 3;
  static_assert(sizeof(uint32_t) == sizeof(float), "Code assumes uint32_t and float are the same size.");
  float tmp_weight_decay = this->_internal_weight_decay();
  uint32_t raw_weight_decay;
  memcpy(&raw_weight_decay, &tmp_weight_decay, sizeof(tmp_weight_decay));
  if (raw_weight_decay != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteFloatToArray(3, this->_internal_weight_decay(), 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.MomentumOptimizer)
  return target;
}

size_t MomentumOptimizer::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:second.protos.MomentumOptimizer)
  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.LearningRate learning_rate = 1;
  if (this->_internal_has_learning_rate()) {
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
        *_impl_.learning_rate_);
  }

  // float momentum_optimizer_value = 2;
  static_assert(sizeof(uint32_t) == sizeof(float), "Code assumes uint32_t and float are the same size.");
  float tmp_momentum_optimizer_value = this->_internal_momentum_optimizer_value();
  uint32_t raw_momentum_optimizer_value;
  memcpy(&raw_momentum_optimizer_value, &tmp_momentum_optimizer_value, sizeof(tmp_momentum_optimizer_value));
  if (raw_momentum_optimizer_value != 0) {
    total_size += 1 + 4;
  }

  // float weight_decay = 3;
  static_assert(sizeof(uint32_t) == sizeof(float), "Code assumes uint32_t and float are the same size.");
  float tmp_weight_decay = this->_internal_weight_decay();
  uint32_t raw_weight_decay;
  memcpy(&raw_weight_decay, &tmp_weight_decay, sizeof(tmp_weight_decay));
  if (raw_weight_decay != 0) {
    total_size += 1 + 4;
  }

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

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


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

  if (from._internal_has_learning_rate()) {
    _this->_internal_mutable_learning_rate()->::second::protos::LearningRate::MergeFrom(
        from._internal_learning_rate());
  }
  static_assert(sizeof(uint32_t) == sizeof(float), "Code assumes uint32_t and float are the same size.");
  float tmp_momentum_optimizer_value = from._internal_momentum_optimizer_value();
  uint32_t raw_momentum_optimizer_value;
  memcpy(&raw_momentum_optimizer_value, &tmp_momentum_optimizer_value, sizeof(tmp_momentum_optimizer_value));
  if (raw_momentum_optimizer_value != 0) {
    _this->_internal_set_momentum_optimizer_value(from._internal_momentum_optimizer_value());
  }
  static_assert(sizeof(uint32_t) == sizeof(float), "Code assumes uint32_t and float are the same size.");
  float tmp_weight_decay = from._internal_weight_decay();
  uint32_t raw_weight_decay;
  memcpy(&raw_weight_decay, &tmp_weight_decay, sizeof(tmp_weight_decay));
  if (raw_weight_decay != 0) {
    _this->_internal_set_weight_decay(from._internal_weight_decay());
  }
  _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
}

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

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

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

::PROTOBUF_NAMESPACE_ID::Metadata MomentumOptimizer::GetMetadata() const {
  return ::_pbi::AssignDescriptors(
      &descriptor_table_second_2fprotos_2foptimizer_2eproto_getter, &descriptor_table_second_2fprotos_2foptimizer_2eproto_once,
      file_level_metadata_second_2fprotos_2foptimizer_2eproto[2]);
}

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

class AdamOptimizer::_Internal {
 public:
  static const ::second::protos::LearningRate& learning_rate(const AdamOptimizer* msg);
};

const ::second::protos::LearningRate&
AdamOptimizer::_Internal::learning_rate(const AdamOptimizer* msg) {
  return *msg->_impl_.learning_rate_;
}
AdamOptimizer::AdamOptimizer(::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.AdamOptimizer)
}
AdamOptimizer::AdamOptimizer(const AdamOptimizer& from)
  : ::PROTOBUF_NAMESPACE_ID::Message() {
  AdamOptimizer* const _this = this; (void)_this;
  new (&_impl_) Impl_{
      decltype(_impl_.learning_rate_){nullptr}
    , decltype(_impl_.weight_decay_){}
    , /*decltype(_impl_._cached_size_)*/{}};

  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
  if (from._internal_has_learning_rate()) {
    _this->_impl_.learning_rate_ = new ::second::protos::LearningRate(*from._impl_.learning_rate_);
  }
  _this->_impl_.weight_decay_ = from._impl_.weight_decay_;
  // @@protoc_insertion_point(copy_constructor:second.protos.AdamOptimizer)
}

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

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

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

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

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

  if (GetArenaForAllocation() == nullptr && _impl_.learning_rate_ != nullptr) {
    delete _impl_.learning_rate_;
  }
  _impl_.learning_rate_ = nullptr;
  _impl_.weight_decay_ = 0;
  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
}

const char* AdamOptimizer::_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.LearningRate learning_rate = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
          ptr = ctx->ParseMessage(_internal_mutable_learning_rate(), ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // float weight_decay = 2;
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 21)) {
          _impl_.weight_decay_ = ::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* AdamOptimizer::_InternalSerialize(
    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:second.protos.AdamOptimizer)
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

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

  // float weight_decay = 2;
  static_assert(sizeof(uint32_t) == sizeof(float), "Code assumes uint32_t and float are the same size.");
  float tmp_weight_decay = this->_internal_weight_decay();
  uint32_t raw_weight_decay;
  memcpy(&raw_weight_decay, &tmp_weight_decay, sizeof(tmp_weight_decay));
  if (raw_weight_decay != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteFloatToArray(2, this->_internal_weight_decay(), 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.AdamOptimizer)
  return target;
}

size_t AdamOptimizer::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:second.protos.AdamOptimizer)
  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.LearningRate learning_rate = 1;
  if (this->_internal_has_learning_rate()) {
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
        *_impl_.learning_rate_);
  }

  // float weight_decay = 2;
  static_assert(sizeof(uint32_t) == sizeof(float), "Code assumes uint32_t and float are the same size.");
  float tmp_weight_decay = this->_internal_weight_decay();
  uint32_t raw_weight_decay;
  memcpy(&raw_weight_decay, &tmp_weight_decay, sizeof(tmp_weight_decay));
  if (raw_weight_decay != 0) {
    total_size += 1 + 4;
  }

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

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


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

  if (from._internal_has_learning_rate()) {
    _this->_internal_mutable_learning_rate()->::second::protos::LearningRate::MergeFrom(
        from._internal_learning_rate());
  }
  static_assert(sizeof(uint32_t) == sizeof(float), "Code assumes uint32_t and float are the same size.");
  float tmp_weight_decay = from._internal_weight_decay();
  uint32_t raw_weight_decay;
  memcpy(&raw_weight_decay, &tmp_weight_decay, sizeof(tmp_weight_decay));
  if (raw_weight_decay != 0) {
    _this->_internal_set_weight_decay(from._internal_weight_decay());
  }
  _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
}

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

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

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

::PROTOBUF_NAMESPACE_ID::Metadata AdamOptimizer::GetMetadata() const {
  return ::_pbi::AssignDescriptors(
      &descriptor_table_second_2fprotos_2foptimizer_2eproto_getter, &descriptor_table_second_2fprotos_2foptimizer_2eproto_once,
      file_level_metadata_second_2fprotos_2foptimizer_2eproto[3]);
}

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

class LearningRate::_Internal {
 public:
  static const ::second::protos::ConstantLearningRate& constant_learning_rate(const LearningRate* msg);
  static const ::second::protos::ExponentialDecayLearningRate& exponential_decay_learning_rate(const LearningRate* msg);
  static const ::second::protos::ManualStepLearningRate& manual_step_learning_rate(const LearningRate* msg);
  static const ::second::protos::CosineDecayLearningRate& cosine_decay_learning_rate(const LearningRate* msg);
};

const ::second::protos::ConstantLearningRate&
LearningRate::_Internal::constant_learning_rate(const LearningRate* msg) {
  return *msg->_impl_.learning_rate_.constant_learning_rate_;
}
const ::second::protos::ExponentialDecayLearningRate&
LearningRate::_Internal::exponential_decay_learning_rate(const LearningRate* msg) {
  return *msg->_impl_.learning_rate_.exponential_decay_learning_rate_;
}
const ::second::protos::ManualStepLearningRate&
LearningRate::_Internal::manual_step_learning_rate(const LearningRate* msg) {
  return *msg->_impl_.learning_rate_.manual_step_learning_rate_;
}
const ::second::protos::CosineDecayLearningRate&
LearningRate::_Internal::cosine_decay_learning_rate(const LearningRate* msg) {
  return *msg->_impl_.learning_rate_.cosine_decay_learning_rate_;
}
void LearningRate::set_allocated_constant_learning_rate(::second::protos::ConstantLearningRate* constant_learning_rate) {
  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
  clear_learning_rate();
  if (constant_learning_rate) {
    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
      ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(constant_learning_rate);
    if (message_arena != submessage_arena) {
      constant_learning_rate = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
          message_arena, constant_learning_rate, submessage_arena);
    }
    set_has_constant_learning_rate();
    _impl_.learning_rate_.constant_learning_rate_ = constant_learning_rate;
  }
  // @@protoc_insertion_point(field_set_allocated:second.protos.LearningRate.constant_learning_rate)
}
void LearningRate::set_allocated_exponential_decay_learning_rate(::second::protos::ExponentialDecayLearningRate* exponential_decay_learning_rate) {
  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
  clear_learning_rate();
  if (exponential_decay_learning_rate) {
    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
      ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(exponential_decay_learning_rate);
    if (message_arena != submessage_arena) {
      exponential_decay_learning_rate = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
          message_arena, exponential_decay_learning_rate, submessage_arena);
    }
    set_has_exponential_decay_learning_rate();
    _impl_.learning_rate_.exponential_decay_learning_rate_ = exponential_decay_learning_rate;
  }
  // @@protoc_insertion_point(field_set_allocated:second.protos.LearningRate.exponential_decay_learning_rate)
}
void LearningRate::set_allocated_manual_step_learning_rate(::second::protos::ManualStepLearningRate* manual_step_learning_rate) {
  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
  clear_learning_rate();
  if (manual_step_learning_rate) {
    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
      ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(manual_step_learning_rate);
    if (message_arena != submessage_arena) {
      manual_step_learning_rate = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
          message_arena, manual_step_learning_rate, submessage_arena);
    }
    set_has_manual_step_learning_rate();
    _impl_.learning_rate_.manual_step_learning_rate_ = manual_step_learning_rate;
  }
  // @@protoc_insertion_point(field_set_allocated:second.protos.LearningRate.manual_step_learning_rate)
}
void LearningRate::set_allocated_cosine_decay_learning_rate(::second::protos::CosineDecayLearningRate* cosine_decay_learning_rate) {
  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
  clear_learning_rate();
  if (cosine_decay_learning_rate) {
    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
      ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(cosine_decay_learning_rate);
    if (message_arena != submessage_arena) {
      cosine_decay_learning_rate = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
          message_arena, cosine_decay_learning_rate, submessage_arena);
    }
    set_has_cosine_decay_learning_rate();
    _impl_.learning_rate_.cosine_decay_learning_rate_ = cosine_decay_learning_rate;
  }
  // @@protoc_insertion_point(field_set_allocated:second.protos.LearningRate.cosine_decay_learning_rate)
}
LearningRate::LearningRate(::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.LearningRate)
}
LearningRate::LearningRate(const LearningRate& from)
  : ::PROTOBUF_NAMESPACE_ID::Message() {
  LearningRate* const _this = this; (void)_this;
  new (&_impl_) Impl_{
      decltype(_impl_.learning_rate_){}
    , /*decltype(_impl_._cached_size_)*/{}
    , /*decltype(_impl_._oneof_case_)*/{}};

  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
  clear_has_learning_rate();
  switch (from.learning_rate_case()) {
    case kConstantLearningRate: {
      _this->_internal_mutable_constant_learning_rate()->::second::protos::ConstantLearningRate::MergeFrom(
          from._internal_constant_learning_rate());
      break;
    }
    case kExponentialDecayLearningRate: {
      _this->_internal_mutable_exponential_decay_learning_rate()->::second::protos::ExponentialDecayLearningRate::MergeFrom(
          from._internal_exponential_decay_learning_rate());
      break;
    }
    case kManualStepLearningRate: {
      _this->_internal_mutable_manual_step_learning_rate()->::second::protos::ManualStepLearningRate::MergeFrom(
          from._internal_manual_step_learning_rate());
      break;
    }
    case kCosineDecayLearningRate: {
      _this->_internal_mutable_cosine_decay_learning_rate()->::second::protos::CosineDecayLearningRate::MergeFrom(
          from._internal_cosine_decay_learning_rate());
      break;
    }
    case LEARNING_RATE_NOT_SET: {
      break;
    }
  }
  // @@protoc_insertion_point(copy_constructor:second.protos.LearningRate)
}

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

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

inline void LearningRate::SharedDtor() {
  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
  if (has_learning_rate()) {
    clear_learning_rate();
  }
}

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

void LearningRate::clear_learning_rate() {
// @@protoc_insertion_point(one_of_clear_start:second.protos.LearningRate)
  switch (learning_rate_case()) {
    case kConstantLearningRate: {
      if (GetArenaForAllocation() == nullptr) {
        delete _impl_.learning_rate_.constant_learning_rate_;
      }
      break;
    }
    case kExponentialDecayLearningRate: {
      if (GetArenaForAllocation() == nullptr) {
        delete _impl_.learning_rate_.exponential_decay_learning_rate_;
      }
      break;
    }
    case kManualStepLearningRate: {
      if (GetArenaForAllocation() == nullptr) {
        delete _impl_.learning_rate_.manual_step_learning_rate_;
      }
      break;
    }
    case kCosineDecayLearningRate: {
      if (GetArenaForAllocation() == nullptr) {
        delete _impl_.learning_rate_.cosine_decay_learning_rate_;
      }
      break;
    }
    case LEARNING_RATE_NOT_SET: {
      break;
    }
  }
  _impl_._oneof_case_[0] = LEARNING_RATE_NOT_SET;
}


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

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

const char* LearningRate::_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.ConstantLearningRate constant_learning_rate = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
          ptr = ctx->ParseMessage(_internal_mutable_constant_learning_rate(), ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // .second.protos.ExponentialDecayLearningRate exponential_decay_learning_rate = 2;
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 18)) {
          ptr = ctx->ParseMessage(_internal_mutable_exponential_decay_learning_rate(), ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // .second.protos.ManualStepLearningRate manual_step_learning_rate = 3;
      case 3:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 26)) {
          ptr = ctx->ParseMessage(_internal_mutable_manual_step_learning_rate(), ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // .second.protos.CosineDecayLearningRate cosine_decay_learning_rate = 4;
      case 4:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 34)) {
          ptr = ctx->ParseMessage(_internal_mutable_cosine_decay_learning_rate(), 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* LearningRate::_InternalSerialize(
    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:second.protos.LearningRate)
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  // .second.protos.ConstantLearningRate constant_learning_rate = 1;
  if (_internal_has_constant_learning_rate()) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(1, _Internal::constant_learning_rate(this),
        _Internal::constant_learning_rate(this).GetCachedSize(), target, stream);
  }

  // .second.protos.ExponentialDecayLearningRate exponential_decay_learning_rate = 2;
  if (_internal_has_exponential_decay_learning_rate()) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(2, _Internal::exponential_decay_learning_rate(this),
        _Internal::exponential_decay_learning_rate(this).GetCachedSize(), target, stream);
  }

  // .second.protos.ManualStepLearningRate manual_step_learning_rate = 3;
  if (_internal_has_manual_step_learning_rate()) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(3, _Internal::manual_step_learning_rate(this),
        _Internal::manual_step_learning_rate(this).GetCachedSize(), target, stream);
  }

  // .second.protos.CosineDecayLearningRate cosine_decay_learning_rate = 4;
  if (_internal_has_cosine_decay_learning_rate()) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(4, _Internal::cosine_decay_learning_rate(this),
        _Internal::cosine_decay_learning_rate(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.LearningRate)
  return target;
}

size_t LearningRate::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:second.protos.LearningRate)
  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 (learning_rate_case()) {
    // .second.protos.ConstantLearningRate constant_learning_rate = 1;
    case kConstantLearningRate: {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          *_impl_.learning_rate_.constant_learning_rate_);
      break;
    }
    // .second.protos.ExponentialDecayLearningRate exponential_decay_learning_rate = 2;
    case kExponentialDecayLearningRate: {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          *_impl_.learning_rate_.exponential_decay_learning_rate_);
      break;
    }
    // .second.protos.ManualStepLearningRate manual_step_learning_rate = 3;
    case kManualStepLearningRate: {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          *_impl_.learning_rate_.manual_step_learning_rate_);
      break;
    }
    // .second.protos.CosineDecayLearningRate cosine_decay_learning_rate = 4;
    case kCosineDecayLearningRate: {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          *_impl_.learning_rate_.cosine_decay_learning_rate_);
      break;
    }
    case LEARNING_RATE_NOT_SET: {
      break;
    }
  }
  return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_);
}

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


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

  switch (from.learning_rate_case()) {
    case kConstantLearningRate: {
      _this->_internal_mutable_constant_learning_rate()->::second::protos::ConstantLearningRate::MergeFrom(
          from._internal_constant_learning_rate());
      break;
    }
    case kExponentialDecayLearningRate: {
      _this->_internal_mutable_exponential_decay_learning_rate()->::second::protos::ExponentialDecayLearningRate::MergeFrom(
          from._internal_exponential_decay_learning_rate());
      break;
    }
    case kManualStepLearningRate: {
      _this->_internal_mutable_manual_step_learning_rate()->::second::protos::ManualStepLearningRate::MergeFrom(
          from._internal_manual_step_learning_rate());
      break;
    }
    case kCosineDecayLearningRate: {
      _this->_internal_mutable_cosine_decay_learning_rate()->::second::protos::CosineDecayLearningRate::MergeFrom(
          from._internal_cosine_decay_learning_rate());
      break;
    }
    case LEARNING_RATE_NOT_SET: {
      break;
    }
  }
  _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
}

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

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

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

::PROTOBUF_NAMESPACE_ID::Metadata LearningRate::GetMetadata() const {
  return ::_pbi::AssignDescriptors(
      &descriptor_table_second_2fprotos_2foptimizer_2eproto_getter, &descriptor_table_second_2fprotos_2foptimizer_2eproto_once,
      file_level_metadata_second_2fprotos_2foptimizer_2eproto[4]);
}

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

class ConstantLearningRate::_Internal {
 public:
};

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

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

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

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

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

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

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

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

const char* ConstantLearningRate::_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 learning_rate = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 13)) {
          _impl_.learning_rate_ = ::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* ConstantLearningRate::_InternalSerialize(
    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:second.protos.ConstantLearningRate)
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  // float learning_rate = 1;
  static_assert(sizeof(uint32_t) == sizeof(float), "Code assumes uint32_t and float are the same size.");
  float tmp_learning_rate = this->_internal_learning_rate();
  uint32_t raw_learning_rate;
  memcpy(&raw_learning_rate, &tmp_learning_rate, sizeof(tmp_learning_rate));
  if (raw_learning_rate != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteFloatToArray(1, this->_internal_learning_rate(), 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.ConstantLearningRate)
  return target;
}

size_t ConstantLearningRate::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:second.protos.ConstantLearningRate)
  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 learning_rate = 1;
  static_assert(sizeof(uint32_t) == sizeof(float), "Code assumes uint32_t and float are the same size.");
  float tmp_learning_rate = this->_internal_learning_rate();
  uint32_t raw_learning_rate;
  memcpy(&raw_learning_rate, &tmp_learning_rate, sizeof(tmp_learning_rate));
  if (raw_learning_rate != 0) {
    total_size += 1 + 4;
  }

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

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


void ConstantLearningRate::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) {
  auto* const _this = static_cast<ConstantLearningRate*>(&to_msg);
  auto& from = static_cast<const ConstantLearningRate&>(from_msg);
  // @@protoc_insertion_point(class_specific_merge_from_start:second.protos.ConstantLearningRate)
  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_learning_rate = from._internal_learning_rate();
  uint32_t raw_learning_rate;
  memcpy(&raw_learning_rate, &tmp_learning_rate, sizeof(tmp_learning_rate));
  if (raw_learning_rate != 0) {
    _this->_internal_set_learning_rate(from._internal_learning_rate());
  }
  _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
}

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

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

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

::PROTOBUF_NAMESPACE_ID::Metadata ConstantLearningRate::GetMetadata() const {
  return ::_pbi::AssignDescriptors(
      &descriptor_table_second_2fprotos_2foptimizer_2eproto_getter, &descriptor_table_second_2fprotos_2foptimizer_2eproto_once,
      file_level_metadata_second_2fprotos_2foptimizer_2eproto[5]);
}

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

class ExponentialDecayLearningRate::_Internal {
 public:
};

ExponentialDecayLearningRate::ExponentialDecayLearningRate(::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.ExponentialDecayLearningRate)
}
ExponentialDecayLearningRate::ExponentialDecayLearningRate(const ExponentialDecayLearningRate& from)
  : ::PROTOBUF_NAMESPACE_ID::Message() {
  ExponentialDecayLearningRate* const _this = this; (void)_this;
  new (&_impl_) Impl_{
      decltype(_impl_.initial_learning_rate_){}
    , decltype(_impl_.decay_steps_){}
    , decltype(_impl_.decay_factor_){}
    , decltype(_impl_.staircase_){}
    , /*decltype(_impl_._cached_size_)*/{}};

  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
  ::memcpy(&_impl_.initial_learning_rate_, &from._impl_.initial_learning_rate_,
    static_cast<size_t>(reinterpret_cast<char*>(&_impl_.staircase_) -
    reinterpret_cast<char*>(&_impl_.initial_learning_rate_)) + sizeof(_impl_.staircase_));
  // @@protoc_insertion_point(copy_constructor:second.protos.ExponentialDecayLearningRate)
}

inline void ExponentialDecayLearningRate::SharedCtor(
    ::_pb::Arena* arena, bool is_message_owned) {
  (void)arena;
  (void)is_message_owned;
  new (&_impl_) Impl_{
      decltype(_impl_.initial_learning_rate_){0}
    , decltype(_impl_.decay_steps_){0u}
    , decltype(_impl_.decay_factor_){0}
    , decltype(_impl_.staircase_){false}
    , /*decltype(_impl_._cached_size_)*/{}
  };
}

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

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

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

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

  ::memset(&_impl_.initial_learning_rate_, 0, static_cast<size_t>(
      reinterpret_cast<char*>(&_impl_.staircase_) -
      reinterpret_cast<char*>(&_impl_.initial_learning_rate_)) + sizeof(_impl_.staircase_));
  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
}

const char* ExponentialDecayLearningRate::_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 initial_learning_rate = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 13)) {
          _impl_.initial_learning_rate_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
          ptr += sizeof(float);
        } else
          goto handle_unusual;
        continue;
      // uint32 decay_steps = 2;
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 16)) {
          _impl_.decay_steps_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // float decay_factor = 3;
      case 3:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 29)) {
          _impl_.decay_factor_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
          ptr += sizeof(float);
        } else
          goto handle_unusual;
        continue;
      // bool staircase = 4;
      case 4:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 32)) {
          _impl_.staircase_ = ::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* ExponentialDecayLearningRate::_InternalSerialize(
    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:second.protos.ExponentialDecayLearningRate)
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  // float initial_learning_rate = 1;
  static_assert(sizeof(uint32_t) == sizeof(float), "Code assumes uint32_t and float are the same size.");
  float tmp_initial_learning_rate = this->_internal_initial_learning_rate();
  uint32_t raw_initial_learning_rate;
  memcpy(&raw_initial_learning_rate, &tmp_initial_learning_rate, sizeof(tmp_initial_learning_rate));
  if (raw_initial_learning_rate != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteFloatToArray(1, this->_internal_initial_learning_rate(), target);
  }

  // uint32 decay_steps = 2;
  if (this->_internal_decay_steps() != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteUInt32ToArray(2, this->_internal_decay_steps(), target);
  }

  // float decay_factor = 3;
  static_assert(sizeof(uint32_t) == sizeof(float), "Code assumes uint32_t and float are the same size.");
  float tmp_decay_factor = this->_internal_decay_factor();
  uint32_t raw_decay_factor;
  memcpy(&raw_decay_factor, &tmp_decay_factor, sizeof(tmp_decay_factor));
  if (raw_decay_factor != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteFloatToArray(3, this->_internal_decay_factor(), target);
  }

  // bool staircase = 4;
  if (this->_internal_staircase() != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteBoolToArray(4, this->_internal_staircase(), 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.ExponentialDecayLearningRate)
  return target;
}

size_t ExponentialDecayLearningRate::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:second.protos.ExponentialDecayLearningRate)
  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 initial_learning_rate = 1;
  static_assert(sizeof(uint32_t) == sizeof(float), "Code assumes uint32_t and float are the same size.");
  float tmp_initial_learning_rate = this->_internal_initial_learning_rate();
  uint32_t raw_initial_learning_rate;
  memcpy(&raw_initial_learning_rate, &tmp_initial_learning_rate, sizeof(tmp_initial_learning_rate));
  if (raw_initial_learning_rate != 0) {
    total_size += 1 + 4;
  }

  // uint32 decay_steps = 2;
  if (this->_internal_decay_steps() != 0) {
    total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_decay_steps());
  }

  // float decay_factor = 3;
  static_assert(sizeof(uint32_t) == sizeof(float), "Code assumes uint32_t and float are the same size.");
  float tmp_decay_factor = this->_internal_decay_factor();
  uint32_t raw_decay_factor;
  memcpy(&raw_decay_factor, &tmp_decay_factor, sizeof(tmp_decay_factor));
  if (raw_decay_factor != 0) {
    total_size += 1 + 4;
  }

  // bool staircase = 4;
  if (this->_internal_staircase() != 0) {
    total_size += 1 + 1;
  }

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

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


void ExponentialDecayLearningRate::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) {
  auto* const _this = static_cast<ExponentialDecayLearningRate*>(&to_msg);
  auto& from = static_cast<const ExponentialDecayLearningRate&>(from_msg);
  // @@protoc_insertion_point(class_specific_merge_from_start:second.protos.ExponentialDecayLearningRate)
  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_initial_learning_rate = from._internal_initial_learning_rate();
  uint32_t raw_initial_learning_rate;
  memcpy(&raw_initial_learning_rate, &tmp_initial_learning_rate, sizeof(tmp_initial_learning_rate));
  if (raw_initial_learning_rate != 0) {
    _this->_internal_set_initial_learning_rate(from._internal_initial_learning_rate());
  }
  if (from._internal_decay_steps() != 0) {
    _this->_internal_set_decay_steps(from._internal_decay_steps());
  }
  static_assert(sizeof(uint32_t) == sizeof(float), "Code assumes uint32_t and float are the same size.");
  float tmp_decay_factor = from._internal_decay_factor();
  uint32_t raw_decay_factor;
  memcpy(&raw_decay_factor, &tmp_decay_factor, sizeof(tmp_decay_factor));
  if (raw_decay_factor != 0) {
    _this->_internal_set_decay_factor(from._internal_decay_factor());
  }
  if (from._internal_staircase() != 0) {
    _this->_internal_set_staircase(from._internal_staircase());
  }
  _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
}

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

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

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

::PROTOBUF_NAMESPACE_ID::Metadata ExponentialDecayLearningRate::GetMetadata() const {
  return ::_pbi::AssignDescriptors(
      &descriptor_table_second_2fprotos_2foptimizer_2eproto_getter, &descriptor_table_second_2fprotos_2foptimizer_2eproto_once,
      file_level_metadata_second_2fprotos_2foptimizer_2eproto[6]);
}

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

class ManualStepLearningRate_LearningRateSchedule::_Internal {
 public:
};

ManualStepLearningRate_LearningRateSchedule::ManualStepLearningRate_LearningRateSchedule(::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.ManualStepLearningRate.LearningRateSchedule)
}
ManualStepLearningRate_LearningRateSchedule::ManualStepLearningRate_LearningRateSchedule(const ManualStepLearningRate_LearningRateSchedule& from)
  : ::PROTOBUF_NAMESPACE_ID::Message() {
  ManualStepLearningRate_LearningRateSchedule* const _this = this; (void)_this;
  new (&_impl_) Impl_{
      decltype(_impl_.step_){}
    , decltype(_impl_.learning_rate_){}
    , /*decltype(_impl_._cached_size_)*/{}};

  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
  ::memcpy(&_impl_.step_, &from._impl_.step_,
    static_cast<size_t>(reinterpret_cast<char*>(&_impl_.learning_rate_) -
    reinterpret_cast<char*>(&_impl_.step_)) + sizeof(_impl_.learning_rate_));
  // @@protoc_insertion_point(copy_constructor:second.protos.ManualStepLearningRate.LearningRateSchedule)
}

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

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

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

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

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

  ::memset(&_impl_.step_, 0, static_cast<size_t>(
      reinterpret_cast<char*>(&_impl_.learning_rate_) -
      reinterpret_cast<char*>(&_impl_.step_)) + sizeof(_impl_.learning_rate_));
  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
}

const char* ManualStepLearningRate_LearningRateSchedule::_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) {
      // uint32 step = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
          _impl_.step_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // float learning_rate = 2;
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 21)) {
          _impl_.learning_rate_ = ::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* ManualStepLearningRate_LearningRateSchedule::_InternalSerialize(
    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:second.protos.ManualStepLearningRate.LearningRateSchedule)
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  // uint32 step = 1;
  if (this->_internal_step() != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteUInt32ToArray(1, this->_internal_step(), target);
  }

  // float learning_rate = 2;
  static_assert(sizeof(uint32_t) == sizeof(float), "Code assumes uint32_t and float are the same size.");
  float tmp_learning_rate = this->_internal_learning_rate();
  uint32_t raw_learning_rate;
  memcpy(&raw_learning_rate, &tmp_learning_rate, sizeof(tmp_learning_rate));
  if (raw_learning_rate != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteFloatToArray(2, this->_internal_learning_rate(), 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.ManualStepLearningRate.LearningRateSchedule)
  return target;
}

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

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

  // uint32 step = 1;
  if (this->_internal_step() != 0) {
    total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_step());
  }

  // float learning_rate = 2;
  static_assert(sizeof(uint32_t) == sizeof(float), "Code assumes uint32_t and float are the same size.");
  float tmp_learning_rate = this->_internal_learning_rate();
  uint32_t raw_learning_rate;
  memcpy(&raw_learning_rate, &tmp_learning_rate, sizeof(tmp_learning_rate));
  if (raw_learning_rate != 0) {
    total_size += 1 + 4;
  }

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

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


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

  if (from._internal_step() != 0) {
    _this->_internal_set_step(from._internal_step());
  }
  static_assert(sizeof(uint32_t) == sizeof(float), "Code assumes uint32_t and float are the same size.");
  float tmp_learning_rate = from._internal_learning_rate();
  uint32_t raw_learning_rate;
  memcpy(&raw_learning_rate, &tmp_learning_rate, sizeof(tmp_learning_rate));
  if (raw_learning_rate != 0) {
    _this->_internal_set_learning_rate(from._internal_learning_rate());
  }
  _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
}

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

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

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

::PROTOBUF_NAMESPACE_ID::Metadata ManualStepLearningRate_LearningRateSchedule::GetMetadata() const {
  return ::_pbi::AssignDescriptors(
      &descriptor_table_second_2fprotos_2foptimizer_2eproto_getter, &descriptor_table_second_2fprotos_2foptimizer_2eproto_once,
      file_level_metadata_second_2fprotos_2foptimizer_2eproto[7]);
}

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

class ManualStepLearningRate::_Internal {
 public:
};

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

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

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

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

inline void ManualStepLearningRate::SharedDtor() {
  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
  _impl_.schedule_.~RepeatedPtrField();
}

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

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

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

const char* ManualStepLearningRate::_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 initial_learning_rate = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 13)) {
          _impl_.initial_learning_rate_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
          ptr += sizeof(float);
        } else
          goto handle_unusual;
        continue;
      // repeated .second.protos.ManualStepLearningRate.LearningRateSchedule schedule = 2;
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 18)) {
          ptr -= 1;
          do {
            ptr += 1;
            ptr = ctx->ParseMessage(_internal_add_schedule(), ptr);
            CHK_(ptr);
            if (!ctx->DataAvailable(ptr)) break;
          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<18>(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* ManualStepLearningRate::_InternalSerialize(
    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:second.protos.ManualStepLearningRate)
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  // float initial_learning_rate = 1;
  static_assert(sizeof(uint32_t) == sizeof(float), "Code assumes uint32_t and float are the same size.");
  float tmp_initial_learning_rate = this->_internal_initial_learning_rate();
  uint32_t raw_initial_learning_rate;
  memcpy(&raw_initial_learning_rate, &tmp_initial_learning_rate, sizeof(tmp_initial_learning_rate));
  if (raw_initial_learning_rate != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteFloatToArray(1, this->_internal_initial_learning_rate(), target);
  }

  // repeated .second.protos.ManualStepLearningRate.LearningRateSchedule schedule = 2;
  for (unsigned i = 0,
      n = static_cast<unsigned>(this->_internal_schedule_size()); i < n; i++) {
    const auto& repfield = this->_internal_schedule(i);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
        InternalWriteMessage(2, repfield, repfield.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.ManualStepLearningRate)
  return target;
}

size_t ManualStepLearningRate::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:second.protos.ManualStepLearningRate)
  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 .second.protos.ManualStepLearningRate.LearningRateSchedule schedule = 2;
  total_size += 1UL * this->_internal_schedule_size();
  for (const auto& msg : this->_impl_.schedule_) {
    total_size +=
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
  }

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

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

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


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

  _this->_impl_.schedule_.MergeFrom(from._impl_.schedule_);
  static_assert(sizeof(uint32_t) == sizeof(float), "Code assumes uint32_t and float are the same size.");
  float tmp_initial_learning_rate = from._internal_initial_learning_rate();
  uint32_t raw_initial_learning_rate;
  memcpy(&raw_initial_learning_rate, &tmp_initial_learning_rate, sizeof(tmp_initial_learning_rate));
  if (raw_initial_learning_rate != 0) {
    _this->_internal_set_initial_learning_rate(from._internal_initial_learning_rate());
  }
  _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
}

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

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

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

::PROTOBUF_NAMESPACE_ID::Metadata ManualStepLearningRate::GetMetadata() const {
  return ::_pbi::AssignDescriptors(
      &descriptor_table_second_2fprotos_2foptimizer_2eproto_getter, &descriptor_table_second_2fprotos_2foptimizer_2eproto_once,
      file_level_metadata_second_2fprotos_2foptimizer_2eproto[8]);
}

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

class CosineDecayLearningRate::_Internal {
 public:
};

CosineDecayLearningRate::CosineDecayLearningRate(::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.CosineDecayLearningRate)
}
CosineDecayLearningRate::CosineDecayLearningRate(const CosineDecayLearningRate& from)
  : ::PROTOBUF_NAMESPACE_ID::Message() {
  CosineDecayLearningRate* const _this = this; (void)_this;
  new (&_impl_) Impl_{
      decltype(_impl_.learning_rate_base_){}
    , decltype(_impl_.total_steps_){}
    , decltype(_impl_.warmup_learning_rate_){}
    , decltype(_impl_.warmup_steps_){}
    , /*decltype(_impl_._cached_size_)*/{}};

  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
  ::memcpy(&_impl_.learning_rate_base_, &from._impl_.learning_rate_base_,
    static_cast<size_t>(reinterpret_cast<char*>(&_impl_.warmup_steps_) -
    reinterpret_cast<char*>(&_impl_.learning_rate_base_)) + sizeof(_impl_.warmup_steps_));
  // @@protoc_insertion_point(copy_constructor:second.protos.CosineDecayLearningRate)
}

inline void CosineDecayLearningRate::SharedCtor(
    ::_pb::Arena* arena, bool is_message_owned) {
  (void)arena;
  (void)is_message_owned;
  new (&_impl_) Impl_{
      decltype(_impl_.learning_rate_base_){0}
    , decltype(_impl_.total_steps_){0u}
    , decltype(_impl_.warmup_learning_rate_){0}
    , decltype(_impl_.warmup_steps_){0u}
    , /*decltype(_impl_._cached_size_)*/{}
  };
}

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

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

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

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

  ::memset(&_impl_.learning_rate_base_, 0, static_cast<size_t>(
      reinterpret_cast<char*>(&_impl_.warmup_steps_) -
      reinterpret_cast<char*>(&_impl_.learning_rate_base_)) + sizeof(_impl_.warmup_steps_));
  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
}

const char* CosineDecayLearningRate::_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 learning_rate_base = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 13)) {
          _impl_.learning_rate_base_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
          ptr += sizeof(float);
        } else
          goto handle_unusual;
        continue;
      // uint32 total_steps = 2;
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 16)) {
          _impl_.total_steps_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // float warmup_learning_rate = 3;
      case 3:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 29)) {
          _impl_.warmup_learning_rate_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
          ptr += sizeof(float);
        } else
          goto handle_unusual;
        continue;
      // uint32 warmup_steps = 4;
      case 4:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 32)) {
          _impl_.warmup_steps_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      default:
        goto handle_unusual;
    }  // switch
  handle_unusual:
    if ((tag == 0) || ((tag & 7) == 4)) {
      CHK_(ptr);
      ctx->SetLastTag(tag);
      goto message_done;
    }
    ptr = UnknownFieldParse(
        tag,
        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
        ptr, ctx);
    CHK_(ptr != nullptr);
  }  // while
message_done:
  return ptr;
failure:
  ptr = nullptr;
  goto message_done;
#undef CHK_
}

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

  // float learning_rate_base = 1;
  static_assert(sizeof(uint32_t) == sizeof(float), "Code assumes uint32_t and float are the same size.");
  float tmp_learning_rate_base = this->_internal_learning_rate_base();
  uint32_t raw_learning_rate_base;
  memcpy(&raw_learning_rate_base, &tmp_learning_rate_base, sizeof(tmp_learning_rate_base));
  if (raw_learning_rate_base != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteFloatToArray(1, this->_internal_learning_rate_base(), target);
  }

  // uint32 total_steps = 2;
  if (this->_internal_total_steps() != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteUInt32ToArray(2, this->_internal_total_steps(), target);
  }

  // float warmup_learning_rate = 3;
  static_assert(sizeof(uint32_t) == sizeof(float), "Code assumes uint32_t and float are the same size.");
  float tmp_warmup_learning_rate = this->_internal_warmup_learning_rate();
  uint32_t raw_warmup_learning_rate;
  memcpy(&raw_warmup_learning_rate, &tmp_warmup_learning_rate, sizeof(tmp_warmup_learning_rate));
  if (raw_warmup_learning_rate != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteFloatToArray(3, this->_internal_warmup_learning_rate(), target);
  }

  // uint32 warmup_steps = 4;
  if (this->_internal_warmup_steps() != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteUInt32ToArray(4, this->_internal_warmup_steps(), 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.CosineDecayLearningRate)
  return target;
}

size_t CosineDecayLearningRate::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:second.protos.CosineDecayLearningRate)
  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 learning_rate_base = 1;
  static_assert(sizeof(uint32_t) == sizeof(float), "Code assumes uint32_t and float are the same size.");
  float tmp_learning_rate_base = this->_internal_learning_rate_base();
  uint32_t raw_learning_rate_base;
  memcpy(&raw_learning_rate_base, &tmp_learning_rate_base, sizeof(tmp_learning_rate_base));
  if (raw_learning_rate_base != 0) {
    total_size += 1 + 4;
  }

  // uint32 total_steps = 2;
  if (this->_internal_total_steps() != 0) {
    total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_total_steps());
  }

  // float warmup_learning_rate = 3;
  static_assert(sizeof(uint32_t) == sizeof(float), "Code assumes uint32_t and float are the same size.");
  float tmp_warmup_learning_rate = this->_internal_warmup_learning_rate();
  uint32_t raw_warmup_learning_rate;
  memcpy(&raw_warmup_learning_rate, &tmp_warmup_learning_rate, sizeof(tmp_warmup_learning_rate));
  if (raw_warmup_learning_rate != 0) {
    total_size += 1 + 4;
  }

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

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

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


void CosineDecayLearningRate::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) {
  auto* const _this = static_cast<CosineDecayLearningRate*>(&to_msg);
  auto& from = static_cast<const CosineDecayLearningRate&>(from_msg);
  // @@protoc_insertion_point(class_specific_merge_from_start:second.protos.CosineDecayLearningRate)
  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_learning_rate_base = from._internal_learning_rate_base();
  uint32_t raw_learning_rate_base;
  memcpy(&raw_learning_rate_base, &tmp_learning_rate_base, sizeof(tmp_learning_rate_base));
  if (raw_learning_rate_base != 0) {
    _this->_internal_set_learning_rate_base(from._internal_learning_rate_base());
  }
  if (from._internal_total_steps() != 0) {
    _this->_internal_set_total_steps(from._internal_total_steps());
  }
  static_assert(sizeof(uint32_t) == sizeof(float), "Code assumes uint32_t and float are the same size.");
  float tmp_warmup_learning_rate = from._internal_warmup_learning_rate();
  uint32_t raw_warmup_learning_rate;
  memcpy(&raw_warmup_learning_rate, &tmp_warmup_learning_rate, sizeof(tmp_warmup_learning_rate));
  if (raw_warmup_learning_rate != 0) {
    _this->_internal_set_warmup_learning_rate(from._internal_warmup_learning_rate());
  }
  if (from._internal_warmup_steps() != 0) {
    _this->_internal_set_warmup_steps(from._internal_warmup_steps());
  }
  _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
}

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

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

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

::PROTOBUF_NAMESPACE_ID::Metadata CosineDecayLearningRate::GetMetadata() const {
  return ::_pbi::AssignDescriptors(
      &descriptor_table_second_2fprotos_2foptimizer_2eproto_getter, &descriptor_table_second_2fprotos_2foptimizer_2eproto_once,
      file_level_metadata_second_2fprotos_2foptimizer_2eproto[9]);
}

// @@protoc_insertion_point(namespace_scope)
}  // namespace protos
}  // namespace second
PROTOBUF_NAMESPACE_OPEN
template<> PROTOBUF_NOINLINE ::second::protos::Optimizer*
Arena::CreateMaybeMessage< ::second::protos::Optimizer >(Arena* arena) {
  return Arena::CreateMessageInternal< ::second::protos::Optimizer >(arena);
}
template<> PROTOBUF_NOINLINE ::second::protos::RMSPropOptimizer*
Arena::CreateMaybeMessage< ::second::protos::RMSPropOptimizer >(Arena* arena) {
  return Arena::CreateMessageInternal< ::second::protos::RMSPropOptimizer >(arena);
}
template<> PROTOBUF_NOINLINE ::second::protos::MomentumOptimizer*
Arena::CreateMaybeMessage< ::second::protos::MomentumOptimizer >(Arena* arena) {
  return Arena::CreateMessageInternal< ::second::protos::MomentumOptimizer >(arena);
}
template<> PROTOBUF_NOINLINE ::second::protos::AdamOptimizer*
Arena::CreateMaybeMessage< ::second::protos::AdamOptimizer >(Arena* arena) {
  return Arena::CreateMessageInternal< ::second::protos::AdamOptimizer >(arena);
}
template<> PROTOBUF_NOINLINE ::second::protos::LearningRate*
Arena::CreateMaybeMessage< ::second::protos::LearningRate >(Arena* arena) {
  return Arena::CreateMessageInternal< ::second::protos::LearningRate >(arena);
}
template<> PROTOBUF_NOINLINE ::second::protos::ConstantLearningRate*
Arena::CreateMaybeMessage< ::second::protos::ConstantLearningRate >(Arena* arena) {
  return Arena::CreateMessageInternal< ::second::protos::ConstantLearningRate >(arena);
}
template<> PROTOBUF_NOINLINE ::second::protos::ExponentialDecayLearningRate*
Arena::CreateMaybeMessage< ::second::protos::ExponentialDecayLearningRate >(Arena* arena) {
  return Arena::CreateMessageInternal< ::second::protos::ExponentialDecayLearningRate >(arena);
}
template<> PROTOBUF_NOINLINE ::second::protos::ManualStepLearningRate_LearningRateSchedule*
Arena::CreateMaybeMessage< ::second::protos::ManualStepLearningRate_LearningRateSchedule >(Arena* arena) {
  return Arena::CreateMessageInternal< ::second::protos::ManualStepLearningRate_LearningRateSchedule >(arena);
}
template<> PROTOBUF_NOINLINE ::second::protos::ManualStepLearningRate*
Arena::CreateMaybeMessage< ::second::protos::ManualStepLearningRate >(Arena* arena) {
  return Arena::CreateMessageInternal< ::second::protos::ManualStepLearningRate >(arena);
}
template<> PROTOBUF_NOINLINE ::second::protos::CosineDecayLearningRate*
Arena::CreateMaybeMessage< ::second::protos::CosineDecayLearningRate >(Arena* arena) {
  return Arena::CreateMessageInternal< ::second::protos::CosineDecayLearningRate >(arena);
}
PROTOBUF_NAMESPACE_CLOSE

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