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

#include "second/protos/losses.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 Loss::Loss(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_.localization_loss_)*/nullptr
  , /*decltype(_impl_.classification_loss_)*/nullptr
  , /*decltype(_impl_.hard_example_miner_)*/nullptr
  , /*decltype(_impl_.classification_weight_)*/0
  , /*decltype(_impl_.localization_weight_)*/0
  , /*decltype(_impl_._cached_size_)*/{}} {}
struct LossDefaultTypeInternal {
  PROTOBUF_CONSTEXPR LossDefaultTypeInternal()
      : _instance(::_pbi::ConstantInitialized{}) {}
  ~LossDefaultTypeInternal() {}
  union {
    Loss _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 LossDefaultTypeInternal _Loss_default_instance_;
PROTOBUF_CONSTEXPR LocalizationLoss::LocalizationLoss(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_.encode_rad_error_by_sin_)*/false
  , /*decltype(_impl_.localization_loss_)*/{}
  , /*decltype(_impl_._cached_size_)*/{}
  , /*decltype(_impl_._oneof_case_)*/{}} {}
struct LocalizationLossDefaultTypeInternal {
  PROTOBUF_CONSTEXPR LocalizationLossDefaultTypeInternal()
      : _instance(::_pbi::ConstantInitialized{}) {}
  ~LocalizationLossDefaultTypeInternal() {}
  union {
    LocalizationLoss _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 LocalizationLossDefaultTypeInternal _LocalizationLoss_default_instance_;
PROTOBUF_CONSTEXPR WeightedL2LocalizationLoss::WeightedL2LocalizationLoss(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_.code_weight_)*/{}
  , /*decltype(_impl_.anchorwise_output_)*/false
  , /*decltype(_impl_._cached_size_)*/{}} {}
struct WeightedL2LocalizationLossDefaultTypeInternal {
  PROTOBUF_CONSTEXPR WeightedL2LocalizationLossDefaultTypeInternal()
      : _instance(::_pbi::ConstantInitialized{}) {}
  ~WeightedL2LocalizationLossDefaultTypeInternal() {}
  union {
    WeightedL2LocalizationLoss _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 WeightedL2LocalizationLossDefaultTypeInternal _WeightedL2LocalizationLoss_default_instance_;
PROTOBUF_CONSTEXPR WeightedSmoothL1LocalizationLoss::WeightedSmoothL1LocalizationLoss(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_.code_weight_)*/{}
  , /*decltype(_impl_.anchorwise_output_)*/false
  , /*decltype(_impl_.sigma_)*/0
  , /*decltype(_impl_._cached_size_)*/{}} {}
struct WeightedSmoothL1LocalizationLossDefaultTypeInternal {
  PROTOBUF_CONSTEXPR WeightedSmoothL1LocalizationLossDefaultTypeInternal()
      : _instance(::_pbi::ConstantInitialized{}) {}
  ~WeightedSmoothL1LocalizationLossDefaultTypeInternal() {}
  union {
    WeightedSmoothL1LocalizationLoss _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 WeightedSmoothL1LocalizationLossDefaultTypeInternal _WeightedSmoothL1LocalizationLoss_default_instance_;
PROTOBUF_CONSTEXPR ClassificationLoss::ClassificationLoss(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_.classification_loss_)*/{}
  , /*decltype(_impl_._cached_size_)*/{}
  , /*decltype(_impl_._oneof_case_)*/{}} {}
struct ClassificationLossDefaultTypeInternal {
  PROTOBUF_CONSTEXPR ClassificationLossDefaultTypeInternal()
      : _instance(::_pbi::ConstantInitialized{}) {}
  ~ClassificationLossDefaultTypeInternal() {}
  union {
    ClassificationLoss _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ClassificationLossDefaultTypeInternal _ClassificationLoss_default_instance_;
PROTOBUF_CONSTEXPR WeightedSigmoidClassificationLoss::WeightedSigmoidClassificationLoss(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_.anchorwise_output_)*/false
  , /*decltype(_impl_._cached_size_)*/{}} {}
struct WeightedSigmoidClassificationLossDefaultTypeInternal {
  PROTOBUF_CONSTEXPR WeightedSigmoidClassificationLossDefaultTypeInternal()
      : _instance(::_pbi::ConstantInitialized{}) {}
  ~WeightedSigmoidClassificationLossDefaultTypeInternal() {}
  union {
    WeightedSigmoidClassificationLoss _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 WeightedSigmoidClassificationLossDefaultTypeInternal _WeightedSigmoidClassificationLoss_default_instance_;
PROTOBUF_CONSTEXPR SigmoidFocalClassificationLoss::SigmoidFocalClassificationLoss(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_.anchorwise_output_)*/false
  , /*decltype(_impl_.gamma_)*/0
  , /*decltype(_impl_.alpha_)*/0
  , /*decltype(_impl_._cached_size_)*/{}} {}
struct SigmoidFocalClassificationLossDefaultTypeInternal {
  PROTOBUF_CONSTEXPR SigmoidFocalClassificationLossDefaultTypeInternal()
      : _instance(::_pbi::ConstantInitialized{}) {}
  ~SigmoidFocalClassificationLossDefaultTypeInternal() {}
  union {
    SigmoidFocalClassificationLoss _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 SigmoidFocalClassificationLossDefaultTypeInternal _SigmoidFocalClassificationLoss_default_instance_;
PROTOBUF_CONSTEXPR SoftmaxFocalClassificationLoss::SoftmaxFocalClassificationLoss(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_.anchorwise_output_)*/false
  , /*decltype(_impl_.gamma_)*/0
  , /*decltype(_impl_.alpha_)*/0
  , /*decltype(_impl_._cached_size_)*/{}} {}
struct SoftmaxFocalClassificationLossDefaultTypeInternal {
  PROTOBUF_CONSTEXPR SoftmaxFocalClassificationLossDefaultTypeInternal()
      : _instance(::_pbi::ConstantInitialized{}) {}
  ~SoftmaxFocalClassificationLossDefaultTypeInternal() {}
  union {
    SoftmaxFocalClassificationLoss _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 SoftmaxFocalClassificationLossDefaultTypeInternal _SoftmaxFocalClassificationLoss_default_instance_;
PROTOBUF_CONSTEXPR WeightedSoftmaxClassificationLoss::WeightedSoftmaxClassificationLoss(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_.anchorwise_output_)*/false
  , /*decltype(_impl_.logit_scale_)*/0
  , /*decltype(_impl_._cached_size_)*/{}} {}
struct WeightedSoftmaxClassificationLossDefaultTypeInternal {
  PROTOBUF_CONSTEXPR WeightedSoftmaxClassificationLossDefaultTypeInternal()
      : _instance(::_pbi::ConstantInitialized{}) {}
  ~WeightedSoftmaxClassificationLossDefaultTypeInternal() {}
  union {
    WeightedSoftmaxClassificationLoss _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 WeightedSoftmaxClassificationLossDefaultTypeInternal _WeightedSoftmaxClassificationLoss_default_instance_;
PROTOBUF_CONSTEXPR BootstrappedSigmoidClassificationLoss::BootstrappedSigmoidClassificationLoss(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_.alpha_)*/0
  , /*decltype(_impl_.hard_bootstrap_)*/false
  , /*decltype(_impl_.anchorwise_output_)*/false
  , /*decltype(_impl_._cached_size_)*/{}} {}
struct BootstrappedSigmoidClassificationLossDefaultTypeInternal {
  PROTOBUF_CONSTEXPR BootstrappedSigmoidClassificationLossDefaultTypeInternal()
      : _instance(::_pbi::ConstantInitialized{}) {}
  ~BootstrappedSigmoidClassificationLossDefaultTypeInternal() {}
  union {
    BootstrappedSigmoidClassificationLoss _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 BootstrappedSigmoidClassificationLossDefaultTypeInternal _BootstrappedSigmoidClassificationLoss_default_instance_;
PROTOBUF_CONSTEXPR HardExampleMiner::HardExampleMiner(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_.num_hard_examples_)*/0
  , /*decltype(_impl_.iou_threshold_)*/0
  , /*decltype(_impl_.loss_type_)*/0
  , /*decltype(_impl_.max_negatives_per_positive_)*/0
  , /*decltype(_impl_.min_negatives_per_image_)*/0
  , /*decltype(_impl_._cached_size_)*/{}} {}
struct HardExampleMinerDefaultTypeInternal {
  PROTOBUF_CONSTEXPR HardExampleMinerDefaultTypeInternal()
      : _instance(::_pbi::ConstantInitialized{}) {}
  ~HardExampleMinerDefaultTypeInternal() {}
  union {
    HardExampleMiner _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 HardExampleMinerDefaultTypeInternal _HardExampleMiner_default_instance_;
}  // namespace protos
}  // namespace second
static ::_pb::Metadata file_level_metadata_second_2fprotos_2flosses_2eproto[11];
static const ::_pb::EnumDescriptor* file_level_enum_descriptors_second_2fprotos_2flosses_2eproto[1];
static constexpr ::_pb::ServiceDescriptor const** file_level_service_descriptors_second_2fprotos_2flosses_2eproto = nullptr;

const uint32_t TableStruct_second_2fprotos_2flosses_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
  ~0u,  // no _has_bits_
  PROTOBUF_FIELD_OFFSET(::second::protos::Loss, _internal_metadata_),
  ~0u,  // no _extensions_
  ~0u,  // no _oneof_case_
  ~0u,  // no _weak_field_map_
  ~0u,  // no _inlined_string_donated_
  PROTOBUF_FIELD_OFFSET(::second::protos::Loss, _impl_.localization_loss_),
  PROTOBUF_FIELD_OFFSET(::second::protos::Loss, _impl_.classification_loss_),
  PROTOBUF_FIELD_OFFSET(::second::protos::Loss, _impl_.hard_example_miner_),
  PROTOBUF_FIELD_OFFSET(::second::protos::Loss, _impl_.classification_weight_),
  PROTOBUF_FIELD_OFFSET(::second::protos::Loss, _impl_.localization_weight_),
  ~0u,  // no _has_bits_
  PROTOBUF_FIELD_OFFSET(::second::protos::LocalizationLoss, _internal_metadata_),
  ~0u,  // no _extensions_
  PROTOBUF_FIELD_OFFSET(::second::protos::LocalizationLoss, _impl_._oneof_case_[0]),
  ~0u,  // no _weak_field_map_
  ~0u,  // no _inlined_string_donated_
  ::_pbi::kInvalidFieldOffsetTag,
  ::_pbi::kInvalidFieldOffsetTag,
  PROTOBUF_FIELD_OFFSET(::second::protos::LocalizationLoss, _impl_.encode_rad_error_by_sin_),
  PROTOBUF_FIELD_OFFSET(::second::protos::LocalizationLoss, _impl_.localization_loss_),
  ~0u,  // no _has_bits_
  PROTOBUF_FIELD_OFFSET(::second::protos::WeightedL2LocalizationLoss, _internal_metadata_),
  ~0u,  // no _extensions_
  ~0u,  // no _oneof_case_
  ~0u,  // no _weak_field_map_
  ~0u,  // no _inlined_string_donated_
  PROTOBUF_FIELD_OFFSET(::second::protos::WeightedL2LocalizationLoss, _impl_.anchorwise_output_),
  PROTOBUF_FIELD_OFFSET(::second::protos::WeightedL2LocalizationLoss, _impl_.code_weight_),
  ~0u,  // no _has_bits_
  PROTOBUF_FIELD_OFFSET(::second::protos::WeightedSmoothL1LocalizationLoss, _internal_metadata_),
  ~0u,  // no _extensions_
  ~0u,  // no _oneof_case_
  ~0u,  // no _weak_field_map_
  ~0u,  // no _inlined_string_donated_
  PROTOBUF_FIELD_OFFSET(::second::protos::WeightedSmoothL1LocalizationLoss, _impl_.anchorwise_output_),
  PROTOBUF_FIELD_OFFSET(::second::protos::WeightedSmoothL1LocalizationLoss, _impl_.sigma_),
  PROTOBUF_FIELD_OFFSET(::second::protos::WeightedSmoothL1LocalizationLoss, _impl_.code_weight_),
  ~0u,  // no _has_bits_
  PROTOBUF_FIELD_OFFSET(::second::protos::ClassificationLoss, _internal_metadata_),
  ~0u,  // no _extensions_
  PROTOBUF_FIELD_OFFSET(::second::protos::ClassificationLoss, _impl_._oneof_case_[0]),
  ~0u,  // no _weak_field_map_
  ~0u,  // no _inlined_string_donated_
  ::_pbi::kInvalidFieldOffsetTag,
  ::_pbi::kInvalidFieldOffsetTag,
  ::_pbi::kInvalidFieldOffsetTag,
  ::_pbi::kInvalidFieldOffsetTag,
  ::_pbi::kInvalidFieldOffsetTag,
  PROTOBUF_FIELD_OFFSET(::second::protos::ClassificationLoss, _impl_.classification_loss_),
  ~0u,  // no _has_bits_
  PROTOBUF_FIELD_OFFSET(::second::protos::WeightedSigmoidClassificationLoss, _internal_metadata_),
  ~0u,  // no _extensions_
  ~0u,  // no _oneof_case_
  ~0u,  // no _weak_field_map_
  ~0u,  // no _inlined_string_donated_
  PROTOBUF_FIELD_OFFSET(::second::protos::WeightedSigmoidClassificationLoss, _impl_.anchorwise_output_),
  ~0u,  // no _has_bits_
  PROTOBUF_FIELD_OFFSET(::second::protos::SigmoidFocalClassificationLoss, _internal_metadata_),
  ~0u,  // no _extensions_
  ~0u,  // no _oneof_case_
  ~0u,  // no _weak_field_map_
  ~0u,  // no _inlined_string_donated_
  PROTOBUF_FIELD_OFFSET(::second::protos::SigmoidFocalClassificationLoss, _impl_.anchorwise_output_),
  PROTOBUF_FIELD_OFFSET(::second::protos::SigmoidFocalClassificationLoss, _impl_.gamma_),
  PROTOBUF_FIELD_OFFSET(::second::protos::SigmoidFocalClassificationLoss, _impl_.alpha_),
  ~0u,  // no _has_bits_
  PROTOBUF_FIELD_OFFSET(::second::protos::SoftmaxFocalClassificationLoss, _internal_metadata_),
  ~0u,  // no _extensions_
  ~0u,  // no _oneof_case_
  ~0u,  // no _weak_field_map_
  ~0u,  // no _inlined_string_donated_
  PROTOBUF_FIELD_OFFSET(::second::protos::SoftmaxFocalClassificationLoss, _impl_.anchorwise_output_),
  PROTOBUF_FIELD_OFFSET(::second::protos::SoftmaxFocalClassificationLoss, _impl_.gamma_),
  PROTOBUF_FIELD_OFFSET(::second::protos::SoftmaxFocalClassificationLoss, _impl_.alpha_),
  ~0u,  // no _has_bits_
  PROTOBUF_FIELD_OFFSET(::second::protos::WeightedSoftmaxClassificationLoss, _internal_metadata_),
  ~0u,  // no _extensions_
  ~0u,  // no _oneof_case_
  ~0u,  // no _weak_field_map_
  ~0u,  // no _inlined_string_donated_
  PROTOBUF_FIELD_OFFSET(::second::protos::WeightedSoftmaxClassificationLoss, _impl_.anchorwise_output_),
  PROTOBUF_FIELD_OFFSET(::second::protos::WeightedSoftmaxClassificationLoss, _impl_.logit_scale_),
  ~0u,  // no _has_bits_
  PROTOBUF_FIELD_OFFSET(::second::protos::BootstrappedSigmoidClassificationLoss, _internal_metadata_),
  ~0u,  // no _extensions_
  ~0u,  // no _oneof_case_
  ~0u,  // no _weak_field_map_
  ~0u,  // no _inlined_string_donated_
  PROTOBUF_FIELD_OFFSET(::second::protos::BootstrappedSigmoidClassificationLoss, _impl_.alpha_),
  PROTOBUF_FIELD_OFFSET(::second::protos::BootstrappedSigmoidClassificationLoss, _impl_.hard_bootstrap_),
  PROTOBUF_FIELD_OFFSET(::second::protos::BootstrappedSigmoidClassificationLoss, _impl_.anchorwise_output_),
  ~0u,  // no _has_bits_
  PROTOBUF_FIELD_OFFSET(::second::protos::HardExampleMiner, _internal_metadata_),
  ~0u,  // no _extensions_
  ~0u,  // no _oneof_case_
  ~0u,  // no _weak_field_map_
  ~0u,  // no _inlined_string_donated_
  PROTOBUF_FIELD_OFFSET(::second::protos::HardExampleMiner, _impl_.num_hard_examples_),
  PROTOBUF_FIELD_OFFSET(::second::protos::HardExampleMiner, _impl_.iou_threshold_),
  PROTOBUF_FIELD_OFFSET(::second::protos::HardExampleMiner, _impl_.loss_type_),
  PROTOBUF_FIELD_OFFSET(::second::protos::HardExampleMiner, _impl_.max_negatives_per_positive_),
  PROTOBUF_FIELD_OFFSET(::second::protos::HardExampleMiner, _impl_.min_negatives_per_image_),
};
static const ::_pbi::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
  { 0, -1, -1, sizeof(::second::protos::Loss)},
  { 11, -1, -1, sizeof(::second::protos::LocalizationLoss)},
  { 21, -1, -1, sizeof(::second::protos::WeightedL2LocalizationLoss)},
  { 29, -1, -1, sizeof(::second::protos::WeightedSmoothL1LocalizationLoss)},
  { 38, -1, -1, sizeof(::second::protos::ClassificationLoss)},
  { 50, -1, -1, sizeof(::second::protos::WeightedSigmoidClassificationLoss)},
  { 57, -1, -1, sizeof(::second::protos::SigmoidFocalClassificationLoss)},
  { 66, -1, -1, sizeof(::second::protos::SoftmaxFocalClassificationLoss)},
  { 75, -1, -1, sizeof(::second::protos::WeightedSoftmaxClassificationLoss)},
  { 83, -1, -1, sizeof(::second::protos::BootstrappedSigmoidClassificationLoss)},
  { 92, -1, -1, sizeof(::second::protos::HardExampleMiner)},
};

static const ::_pb::Message* const file_default_instances[] = {
  &::second::protos::_Loss_default_instance_._instance,
  &::second::protos::_LocalizationLoss_default_instance_._instance,
  &::second::protos::_WeightedL2LocalizationLoss_default_instance_._instance,
  &::second::protos::_WeightedSmoothL1LocalizationLoss_default_instance_._instance,
  &::second::protos::_ClassificationLoss_default_instance_._instance,
  &::second::protos::_WeightedSigmoidClassificationLoss_default_instance_._instance,
  &::second::protos::_SigmoidFocalClassificationLoss_default_instance_._instance,
  &::second::protos::_SoftmaxFocalClassificationLoss_default_instance_._instance,
  &::second::protos::_WeightedSoftmaxClassificationLoss_default_instance_._instance,
  &::second::protos::_BootstrappedSigmoidClassificationLoss_default_instance_._instance,
  &::second::protos::_HardExampleMiner_default_instance_._instance,
};

const char descriptor_table_protodef_second_2fprotos_2flosses_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) =
  "\n\032second/protos/losses.proto\022\rsecond.pro"
  "tos\"\373\001\n\004Loss\022:\n\021localization_loss\030\001 \001(\0132"
  "\037.second.protos.LocalizationLoss\022>\n\023clas"
  "sification_loss\030\002 \001(\0132!.second.protos.Cl"
  "assificationLoss\022;\n\022hard_example_miner\030\003"
  " \001(\0132\037.second.protos.HardExampleMiner\022\035\n"
  "\025classification_weight\030\004 \001(\002\022\033\n\023localiza"
  "tion_weight\030\005 \001(\002\"\331\001\n\020LocalizationLoss\022@"
  "\n\013weighted_l2\030\001 \001(\0132).second.protos.Weig"
  "htedL2LocalizationLossH\000\022M\n\022weighted_smo"
  "oth_l1\030\002 \001(\0132/.second.protos.WeightedSmo"
  "othL1LocalizationLossH\000\022\037\n\027encode_rad_er"
  "ror_by_sin\030\003 \001(\010B\023\n\021localization_loss\"L\n"
  "\032WeightedL2LocalizationLoss\022\031\n\021anchorwis"
  "e_output\030\001 \001(\010\022\023\n\013code_weight\030\002 \003(\002\"a\n W"
  "eightedSmoothL1LocalizationLoss\022\031\n\021ancho"
  "rwise_output\030\001 \001(\010\022\r\n\005sigma\030\002 \001(\002\022\023\n\013cod"
  "e_weight\030\003 \003(\002\"\277\003\n\022ClassificationLoss\022L\n"
  "\020weighted_sigmoid\030\001 \001(\01320.second.protos."
  "WeightedSigmoidClassificationLossH\000\022L\n\020w"
  "eighted_softmax\030\002 \001(\01320.second.protos.We"
  "ightedSoftmaxClassificationLossH\000\022T\n\024boo"
  "tstrapped_sigmoid\030\003 \001(\01324.second.protos."
  "BootstrappedSigmoidClassificationLossH\000\022"
  "O\n\026weighted_sigmoid_focal\030\004 \001(\0132-.second"
  ".protos.SigmoidFocalClassificationLossH\000"
  "\022O\n\026weighted_softmax_focal\030\005 \001(\0132-.secon"
  "d.protos.SoftmaxFocalClassificationLossH"
  "\000B\025\n\023classification_loss\">\n!WeightedSigm"
  "oidClassificationLoss\022\031\n\021anchorwise_outp"
  "ut\030\001 \001(\010\"Y\n\036SigmoidFocalClassificationLo"
  "ss\022\031\n\021anchorwise_output\030\001 \001(\010\022\r\n\005gamma\030\002"
  " \001(\002\022\r\n\005alpha\030\003 \001(\002\"Y\n\036SoftmaxFocalClass"
  "ificationLoss\022\031\n\021anchorwise_output\030\001 \001(\010"
  "\022\r\n\005gamma\030\002 \001(\002\022\r\n\005alpha\030\003 \001(\002\"S\n!Weight"
  "edSoftmaxClassificationLoss\022\031\n\021anchorwis"
  "e_output\030\001 \001(\010\022\023\n\013logit_scale\030\002 \001(\002\"i\n%B"
  "ootstrappedSigmoidClassificationLoss\022\r\n\005"
  "alpha\030\001 \001(\002\022\026\n\016hard_bootstrap\030\002 \001(\010\022\031\n\021a"
  "nchorwise_output\030\003 \001(\010\"\202\002\n\020HardExampleMi"
  "ner\022\031\n\021num_hard_examples\030\001 \001(\005\022\025\n\riou_th"
  "reshold\030\002 \001(\002\022;\n\tloss_type\030\003 \001(\0162(.secon"
  "d.protos.HardExampleMiner.LossType\022\"\n\032ma"
  "x_negatives_per_positive\030\004 \001(\005\022\037\n\027min_ne"
  "gatives_per_image\030\005 \001(\005\":\n\010LossType\022\010\n\004B"
  "OTH\020\000\022\022\n\016CLASSIFICATION\020\001\022\020\n\014LOCALIZATIO"
  "N\020\002b\006proto3"
  ;
static ::_pbi::once_flag descriptor_table_second_2fprotos_2flosses_2eproto_once;
const ::_pbi::DescriptorTable descriptor_table_second_2fprotos_2flosses_2eproto = {
    false, false, 1851, descriptor_table_protodef_second_2fprotos_2flosses_2eproto,
    "second/protos/losses.proto",
    &descriptor_table_second_2fprotos_2flosses_2eproto_once, nullptr, 0, 11,
    schemas, file_default_instances, TableStruct_second_2fprotos_2flosses_2eproto::offsets,
    file_level_metadata_second_2fprotos_2flosses_2eproto, file_level_enum_descriptors_second_2fprotos_2flosses_2eproto,
    file_level_service_descriptors_second_2fprotos_2flosses_2eproto,
};
PROTOBUF_ATTRIBUTE_WEAK const ::_pbi::DescriptorTable* descriptor_table_second_2fprotos_2flosses_2eproto_getter() {
  return &descriptor_table_second_2fprotos_2flosses_2eproto;
}

// Force running AddDescriptors() at dynamic initialization time.
PROTOBUF_ATTRIBUTE_INIT_PRIORITY2 static ::_pbi::AddDescriptorsRunner dynamic_init_dummy_second_2fprotos_2flosses_2eproto(&descriptor_table_second_2fprotos_2flosses_2eproto);
namespace second {
namespace protos {
const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* HardExampleMiner_LossType_descriptor() {
  ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_second_2fprotos_2flosses_2eproto);
  return file_level_enum_descriptors_second_2fprotos_2flosses_2eproto[0];
}
bool HardExampleMiner_LossType_IsValid(int value) {
  switch (value) {
    case 0:
    case 1:
    case 2:
      return true;
    default:
      return false;
  }
}

#if (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
constexpr HardExampleMiner_LossType HardExampleMiner::BOTH;
constexpr HardExampleMiner_LossType HardExampleMiner::CLASSIFICATION;
constexpr HardExampleMiner_LossType HardExampleMiner::LOCALIZATION;
constexpr HardExampleMiner_LossType HardExampleMiner::LossType_MIN;
constexpr HardExampleMiner_LossType HardExampleMiner::LossType_MAX;
constexpr int HardExampleMiner::LossType_ARRAYSIZE;
#endif  // (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))

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

class Loss::_Internal {
 public:
  static const ::second::protos::LocalizationLoss& localization_loss(const Loss* msg);
  static const ::second::protos::ClassificationLoss& classification_loss(const Loss* msg);
  static const ::second::protos::HardExampleMiner& hard_example_miner(const Loss* msg);
};

const ::second::protos::LocalizationLoss&
Loss::_Internal::localization_loss(const Loss* msg) {
  return *msg->_impl_.localization_loss_;
}
const ::second::protos::ClassificationLoss&
Loss::_Internal::classification_loss(const Loss* msg) {
  return *msg->_impl_.classification_loss_;
}
const ::second::protos::HardExampleMiner&
Loss::_Internal::hard_example_miner(const Loss* msg) {
  return *msg->_impl_.hard_example_miner_;
}
Loss::Loss(::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.Loss)
}
Loss::Loss(const Loss& from)
  : ::PROTOBUF_NAMESPACE_ID::Message() {
  Loss* const _this = this; (void)_this;
  new (&_impl_) Impl_{
      decltype(_impl_.localization_loss_){nullptr}
    , decltype(_impl_.classification_loss_){nullptr}
    , decltype(_impl_.hard_example_miner_){nullptr}
    , decltype(_impl_.classification_weight_){}
    , decltype(_impl_.localization_weight_){}
    , /*decltype(_impl_._cached_size_)*/{}};

  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
  if (from._internal_has_localization_loss()) {
    _this->_impl_.localization_loss_ = new ::second::protos::LocalizationLoss(*from._impl_.localization_loss_);
  }
  if (from._internal_has_classification_loss()) {
    _this->_impl_.classification_loss_ = new ::second::protos::ClassificationLoss(*from._impl_.classification_loss_);
  }
  if (from._internal_has_hard_example_miner()) {
    _this->_impl_.hard_example_miner_ = new ::second::protos::HardExampleMiner(*from._impl_.hard_example_miner_);
  }
  ::memcpy(&_impl_.classification_weight_, &from._impl_.classification_weight_,
    static_cast<size_t>(reinterpret_cast<char*>(&_impl_.localization_weight_) -
    reinterpret_cast<char*>(&_impl_.classification_weight_)) + sizeof(_impl_.localization_weight_));
  // @@protoc_insertion_point(copy_constructor:second.protos.Loss)
}

inline void Loss::SharedCtor(
    ::_pb::Arena* arena, bool is_message_owned) {
  (void)arena;
  (void)is_message_owned;
  new (&_impl_) Impl_{
      decltype(_impl_.localization_loss_){nullptr}
    , decltype(_impl_.classification_loss_){nullptr}
    , decltype(_impl_.hard_example_miner_){nullptr}
    , decltype(_impl_.classification_weight_){0}
    , decltype(_impl_.localization_weight_){0}
    , /*decltype(_impl_._cached_size_)*/{}
  };
}

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

inline void Loss::SharedDtor() {
  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
  if (this != internal_default_instance()) delete _impl_.localization_loss_;
  if (this != internal_default_instance()) delete _impl_.classification_loss_;
  if (this != internal_default_instance()) delete _impl_.hard_example_miner_;
}

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

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

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

const char* Loss::_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.LocalizationLoss localization_loss = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
          ptr = ctx->ParseMessage(_internal_mutable_localization_loss(), ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // .second.protos.ClassificationLoss classification_loss = 2;
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 18)) {
          ptr = ctx->ParseMessage(_internal_mutable_classification_loss(), ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // .second.protos.HardExampleMiner hard_example_miner = 3;
      case 3:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 26)) {
          ptr = ctx->ParseMessage(_internal_mutable_hard_example_miner(), ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // float classification_weight = 4;
      case 4:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 37)) {
          _impl_.classification_weight_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
          ptr += sizeof(float);
        } else
          goto handle_unusual;
        continue;
      // float localization_weight = 5;
      case 5:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 45)) {
          _impl_.localization_weight_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
          ptr += sizeof(float);
        } else
          goto handle_unusual;
        continue;
      default:
        goto handle_unusual;
    }  // switch
  handle_unusual:
    if ((tag == 0) || ((tag & 7) == 4)) {
      CHK_(ptr);
      ctx->SetLastTag(tag);
      goto message_done;
    }
    ptr = UnknownFieldParse(
        tag,
        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
        ptr, ctx);
    CHK_(ptr != nullptr);
  }  // while
message_done:
  return ptr;
failure:
  ptr = nullptr;
  goto message_done;
#undef CHK_
}

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

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

  // .second.protos.ClassificationLoss classification_loss = 2;
  if (this->_internal_has_classification_loss()) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(2, _Internal::classification_loss(this),
        _Internal::classification_loss(this).GetCachedSize(), target, stream);
  }

  // .second.protos.HardExampleMiner hard_example_miner = 3;
  if (this->_internal_has_hard_example_miner()) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(3, _Internal::hard_example_miner(this),
        _Internal::hard_example_miner(this).GetCachedSize(), target, stream);
  }

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

  // float localization_weight = 5;
  static_assert(sizeof(uint32_t) == sizeof(float), "Code assumes uint32_t and float are the same size.");
  float tmp_localization_weight = this->_internal_localization_weight();
  uint32_t raw_localization_weight;
  memcpy(&raw_localization_weight, &tmp_localization_weight, sizeof(tmp_localization_weight));
  if (raw_localization_weight != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteFloatToArray(5, this->_internal_localization_weight(), target);
  }

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray(
        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
  }
  // @@protoc_insertion_point(serialize_to_array_end:second.protos.Loss)
  return target;
}

size_t Loss::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:second.protos.Loss)
  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.LocalizationLoss localization_loss = 1;
  if (this->_internal_has_localization_loss()) {
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
        *_impl_.localization_loss_);
  }

  // .second.protos.ClassificationLoss classification_loss = 2;
  if (this->_internal_has_classification_loss()) {
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
        *_impl_.classification_loss_);
  }

  // .second.protos.HardExampleMiner hard_example_miner = 3;
  if (this->_internal_has_hard_example_miner()) {
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
        *_impl_.hard_example_miner_);
  }

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

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

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

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


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

  if (from._internal_has_localization_loss()) {
    _this->_internal_mutable_localization_loss()->::second::protos::LocalizationLoss::MergeFrom(
        from._internal_localization_loss());
  }
  if (from._internal_has_classification_loss()) {
    _this->_internal_mutable_classification_loss()->::second::protos::ClassificationLoss::MergeFrom(
        from._internal_classification_loss());
  }
  if (from._internal_has_hard_example_miner()) {
    _this->_internal_mutable_hard_example_miner()->::second::protos::HardExampleMiner::MergeFrom(
        from._internal_hard_example_miner());
  }
  static_assert(sizeof(uint32_t) == sizeof(float), "Code assumes uint32_t and float are the same size.");
  float tmp_classification_weight = from._internal_classification_weight();
  uint32_t raw_classification_weight;
  memcpy(&raw_classification_weight, &tmp_classification_weight, sizeof(tmp_classification_weight));
  if (raw_classification_weight != 0) {
    _this->_internal_set_classification_weight(from._internal_classification_weight());
  }
  static_assert(sizeof(uint32_t) == sizeof(float), "Code assumes uint32_t and float are the same size.");
  float tmp_localization_weight = from._internal_localization_weight();
  uint32_t raw_localization_weight;
  memcpy(&raw_localization_weight, &tmp_localization_weight, sizeof(tmp_localization_weight));
  if (raw_localization_weight != 0) {
    _this->_internal_set_localization_weight(from._internal_localization_weight());
  }
  _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
}

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

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

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

::PROTOBUF_NAMESPACE_ID::Metadata Loss::GetMetadata() const {
  return ::_pbi::AssignDescriptors(
      &descriptor_table_second_2fprotos_2flosses_2eproto_getter, &descriptor_table_second_2fprotos_2flosses_2eproto_once,
      file_level_metadata_second_2fprotos_2flosses_2eproto[0]);
}

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

class LocalizationLoss::_Internal {
 public:
  static const ::second::protos::WeightedL2LocalizationLoss& weighted_l2(const LocalizationLoss* msg);
  static const ::second::protos::WeightedSmoothL1LocalizationLoss& weighted_smooth_l1(const LocalizationLoss* msg);
};

const ::second::protos::WeightedL2LocalizationLoss&
LocalizationLoss::_Internal::weighted_l2(const LocalizationLoss* msg) {
  return *msg->_impl_.localization_loss_.weighted_l2_;
}
const ::second::protos::WeightedSmoothL1LocalizationLoss&
LocalizationLoss::_Internal::weighted_smooth_l1(const LocalizationLoss* msg) {
  return *msg->_impl_.localization_loss_.weighted_smooth_l1_;
}
void LocalizationLoss::set_allocated_weighted_l2(::second::protos::WeightedL2LocalizationLoss* weighted_l2) {
  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
  clear_localization_loss();
  if (weighted_l2) {
    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
      ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(weighted_l2);
    if (message_arena != submessage_arena) {
      weighted_l2 = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
          message_arena, weighted_l2, submessage_arena);
    }
    set_has_weighted_l2();
    _impl_.localization_loss_.weighted_l2_ = weighted_l2;
  }
  // @@protoc_insertion_point(field_set_allocated:second.protos.LocalizationLoss.weighted_l2)
}
void LocalizationLoss::set_allocated_weighted_smooth_l1(::second::protos::WeightedSmoothL1LocalizationLoss* weighted_smooth_l1) {
  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
  clear_localization_loss();
  if (weighted_smooth_l1) {
    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
      ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(weighted_smooth_l1);
    if (message_arena != submessage_arena) {
      weighted_smooth_l1 = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
          message_arena, weighted_smooth_l1, submessage_arena);
    }
    set_has_weighted_smooth_l1();
    _impl_.localization_loss_.weighted_smooth_l1_ = weighted_smooth_l1;
  }
  // @@protoc_insertion_point(field_set_allocated:second.protos.LocalizationLoss.weighted_smooth_l1)
}
LocalizationLoss::LocalizationLoss(::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.LocalizationLoss)
}
LocalizationLoss::LocalizationLoss(const LocalizationLoss& from)
  : ::PROTOBUF_NAMESPACE_ID::Message() {
  LocalizationLoss* const _this = this; (void)_this;
  new (&_impl_) Impl_{
      decltype(_impl_.encode_rad_error_by_sin_){}
    , decltype(_impl_.localization_loss_){}
    , /*decltype(_impl_._cached_size_)*/{}
    , /*decltype(_impl_._oneof_case_)*/{}};

  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
  _this->_impl_.encode_rad_error_by_sin_ = from._impl_.encode_rad_error_by_sin_;
  clear_has_localization_loss();
  switch (from.localization_loss_case()) {
    case kWeightedL2: {
      _this->_internal_mutable_weighted_l2()->::second::protos::WeightedL2LocalizationLoss::MergeFrom(
          from._internal_weighted_l2());
      break;
    }
    case kWeightedSmoothL1: {
      _this->_internal_mutable_weighted_smooth_l1()->::second::protos::WeightedSmoothL1LocalizationLoss::MergeFrom(
          from._internal_weighted_smooth_l1());
      break;
    }
    case LOCALIZATION_LOSS_NOT_SET: {
      break;
    }
  }
  // @@protoc_insertion_point(copy_constructor:second.protos.LocalizationLoss)
}

inline void LocalizationLoss::SharedCtor(
    ::_pb::Arena* arena, bool is_message_owned) {
  (void)arena;
  (void)is_message_owned;
  new (&_impl_) Impl_{
      decltype(_impl_.encode_rad_error_by_sin_){false}
    , decltype(_impl_.localization_loss_){}
    , /*decltype(_impl_._cached_size_)*/{}
    , /*decltype(_impl_._oneof_case_)*/{}
  };
  clear_has_localization_loss();
}

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

inline void LocalizationLoss::SharedDtor() {
  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
  if (has_localization_loss()) {
    clear_localization_loss();
  }
}

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

void LocalizationLoss::clear_localization_loss() {
// @@protoc_insertion_point(one_of_clear_start:second.protos.LocalizationLoss)
  switch (localization_loss_case()) {
    case kWeightedL2: {
      if (GetArenaForAllocation() == nullptr) {
        delete _impl_.localization_loss_.weighted_l2_;
      }
      break;
    }
    case kWeightedSmoothL1: {
      if (GetArenaForAllocation() == nullptr) {
        delete _impl_.localization_loss_.weighted_smooth_l1_;
      }
      break;
    }
    case LOCALIZATION_LOSS_NOT_SET: {
      break;
    }
  }
  _impl_._oneof_case_[0] = LOCALIZATION_LOSS_NOT_SET;
}


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

  _impl_.encode_rad_error_by_sin_ = false;
  clear_localization_loss();
  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
}

const char* LocalizationLoss::_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.WeightedL2LocalizationLoss weighted_l2 = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
          ptr = ctx->ParseMessage(_internal_mutable_weighted_l2(), ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // .second.protos.WeightedSmoothL1LocalizationLoss weighted_smooth_l1 = 2;
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 18)) {
          ptr = ctx->ParseMessage(_internal_mutable_weighted_smooth_l1(), ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // bool encode_rad_error_by_sin = 3;
      case 3:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 24)) {
          _impl_.encode_rad_error_by_sin_ = ::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* LocalizationLoss::_InternalSerialize(
    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:second.protos.LocalizationLoss)
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  // .second.protos.WeightedL2LocalizationLoss weighted_l2 = 1;
  if (_internal_has_weighted_l2()) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(1, _Internal::weighted_l2(this),
        _Internal::weighted_l2(this).GetCachedSize(), target, stream);
  }

  // .second.protos.WeightedSmoothL1LocalizationLoss weighted_smooth_l1 = 2;
  if (_internal_has_weighted_smooth_l1()) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(2, _Internal::weighted_smooth_l1(this),
        _Internal::weighted_smooth_l1(this).GetCachedSize(), target, stream);
  }

  // bool encode_rad_error_by_sin = 3;
  if (this->_internal_encode_rad_error_by_sin() != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteBoolToArray(3, this->_internal_encode_rad_error_by_sin(), 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.LocalizationLoss)
  return target;
}

size_t LocalizationLoss::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:second.protos.LocalizationLoss)
  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 encode_rad_error_by_sin = 3;
  if (this->_internal_encode_rad_error_by_sin() != 0) {
    total_size += 1 + 1;
  }

  switch (localization_loss_case()) {
    // .second.protos.WeightedL2LocalizationLoss weighted_l2 = 1;
    case kWeightedL2: {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          *_impl_.localization_loss_.weighted_l2_);
      break;
    }
    // .second.protos.WeightedSmoothL1LocalizationLoss weighted_smooth_l1 = 2;
    case kWeightedSmoothL1: {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          *_impl_.localization_loss_.weighted_smooth_l1_);
      break;
    }
    case LOCALIZATION_LOSS_NOT_SET: {
      break;
    }
  }
  return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_);
}

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


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

  if (from._internal_encode_rad_error_by_sin() != 0) {
    _this->_internal_set_encode_rad_error_by_sin(from._internal_encode_rad_error_by_sin());
  }
  switch (from.localization_loss_case()) {
    case kWeightedL2: {
      _this->_internal_mutable_weighted_l2()->::second::protos::WeightedL2LocalizationLoss::MergeFrom(
          from._internal_weighted_l2());
      break;
    }
    case kWeightedSmoothL1: {
      _this->_internal_mutable_weighted_smooth_l1()->::second::protos::WeightedSmoothL1LocalizationLoss::MergeFrom(
          from._internal_weighted_smooth_l1());
      break;
    }
    case LOCALIZATION_LOSS_NOT_SET: {
      break;
    }
  }
  _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
}

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

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

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

::PROTOBUF_NAMESPACE_ID::Metadata LocalizationLoss::GetMetadata() const {
  return ::_pbi::AssignDescriptors(
      &descriptor_table_second_2fprotos_2flosses_2eproto_getter, &descriptor_table_second_2fprotos_2flosses_2eproto_once,
      file_level_metadata_second_2fprotos_2flosses_2eproto[1]);
}

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

class WeightedL2LocalizationLoss::_Internal {
 public:
};

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

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

inline void WeightedL2LocalizationLoss::SharedCtor(
    ::_pb::Arena* arena, bool is_message_owned) {
  (void)arena;
  (void)is_message_owned;
  new (&_impl_) Impl_{
      decltype(_impl_.code_weight_){arena}
    , decltype(_impl_.anchorwise_output_){false}
    , /*decltype(_impl_._cached_size_)*/{}
  };
}

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

inline void WeightedL2LocalizationLoss::SharedDtor() {
  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
  _impl_.code_weight_.~RepeatedField();
}

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

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

  _impl_.code_weight_.Clear();
  _impl_.anchorwise_output_ = false;
  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
}

const char* WeightedL2LocalizationLoss::_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) {
      // bool anchorwise_output = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
          _impl_.anchorwise_output_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // repeated float code_weight = 2;
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 18)) {
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedFloatParser(_internal_mutable_code_weight(), ptr, ctx);
          CHK_(ptr);
        } else if (static_cast<uint8_t>(tag) == 21) {
          _internal_add_code_weight(::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr));
          ptr += sizeof(float);
        } else
          goto handle_unusual;
        continue;
      default:
        goto handle_unusual;
    }  // switch
  handle_unusual:
    if ((tag == 0) || ((tag & 7) == 4)) {
      CHK_(ptr);
      ctx->SetLastTag(tag);
      goto message_done;
    }
    ptr = UnknownFieldParse(
        tag,
        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
        ptr, ctx);
    CHK_(ptr != nullptr);
  }  // while
message_done:
  return ptr;
failure:
  ptr = nullptr;
  goto message_done;
#undef CHK_
}

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

  // bool anchorwise_output = 1;
  if (this->_internal_anchorwise_output() != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteBoolToArray(1, this->_internal_anchorwise_output(), target);
  }

  // repeated float code_weight = 2;
  if (this->_internal_code_weight_size() > 0) {
    target = stream->WriteFixedPacked(2, _internal_code_weight(), target);
  }

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray(
        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
  }
  // @@protoc_insertion_point(serialize_to_array_end:second.protos.WeightedL2LocalizationLoss)
  return target;
}

size_t WeightedL2LocalizationLoss::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:second.protos.WeightedL2LocalizationLoss)
  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 float code_weight = 2;
  {
    unsigned int count = static_cast<unsigned int>(this->_internal_code_weight_size());
    size_t data_size = 4UL * count;
    if (data_size > 0) {
      total_size += 1 +
        ::_pbi::WireFormatLite::Int32Size(static_cast<int32_t>(data_size));
    }
    total_size += data_size;
  }

  // bool anchorwise_output = 1;
  if (this->_internal_anchorwise_output() != 0) {
    total_size += 1 + 1;
  }

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

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


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

  _this->_impl_.code_weight_.MergeFrom(from._impl_.code_weight_);
  if (from._internal_anchorwise_output() != 0) {
    _this->_internal_set_anchorwise_output(from._internal_anchorwise_output());
  }
  _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
}

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

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

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

::PROTOBUF_NAMESPACE_ID::Metadata WeightedL2LocalizationLoss::GetMetadata() const {
  return ::_pbi::AssignDescriptors(
      &descriptor_table_second_2fprotos_2flosses_2eproto_getter, &descriptor_table_second_2fprotos_2flosses_2eproto_once,
      file_level_metadata_second_2fprotos_2flosses_2eproto[2]);
}

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

class WeightedSmoothL1LocalizationLoss::_Internal {
 public:
};

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

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

inline void WeightedSmoothL1LocalizationLoss::SharedCtor(
    ::_pb::Arena* arena, bool is_message_owned) {
  (void)arena;
  (void)is_message_owned;
  new (&_impl_) Impl_{
      decltype(_impl_.code_weight_){arena}
    , decltype(_impl_.anchorwise_output_){false}
    , decltype(_impl_.sigma_){0}
    , /*decltype(_impl_._cached_size_)*/{}
  };
}

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

inline void WeightedSmoothL1LocalizationLoss::SharedDtor() {
  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
  _impl_.code_weight_.~RepeatedField();
}

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

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

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

const char* WeightedSmoothL1LocalizationLoss::_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) {
      // bool anchorwise_output = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
          _impl_.anchorwise_output_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // float sigma = 2;
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 21)) {
          _impl_.sigma_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
          ptr += sizeof(float);
        } else
          goto handle_unusual;
        continue;
      // repeated float code_weight = 3;
      case 3:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 26)) {
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedFloatParser(_internal_mutable_code_weight(), ptr, ctx);
          CHK_(ptr);
        } else if (static_cast<uint8_t>(tag) == 29) {
          _internal_add_code_weight(::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr));
          ptr += sizeof(float);
        } else
          goto handle_unusual;
        continue;
      default:
        goto handle_unusual;
    }  // switch
  handle_unusual:
    if ((tag == 0) || ((tag & 7) == 4)) {
      CHK_(ptr);
      ctx->SetLastTag(tag);
      goto message_done;
    }
    ptr = UnknownFieldParse(
        tag,
        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
        ptr, ctx);
    CHK_(ptr != nullptr);
  }  // while
message_done:
  return ptr;
failure:
  ptr = nullptr;
  goto message_done;
#undef CHK_
}

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

  // bool anchorwise_output = 1;
  if (this->_internal_anchorwise_output() != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteBoolToArray(1, this->_internal_anchorwise_output(), target);
  }

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

  // repeated float code_weight = 3;
  if (this->_internal_code_weight_size() > 0) {
    target = stream->WriteFixedPacked(3, _internal_code_weight(), target);
  }

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray(
        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
  }
  // @@protoc_insertion_point(serialize_to_array_end:second.protos.WeightedSmoothL1LocalizationLoss)
  return target;
}

size_t WeightedSmoothL1LocalizationLoss::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:second.protos.WeightedSmoothL1LocalizationLoss)
  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 float code_weight = 3;
  {
    unsigned int count = static_cast<unsigned int>(this->_internal_code_weight_size());
    size_t data_size = 4UL * count;
    if (data_size > 0) {
      total_size += 1 +
        ::_pbi::WireFormatLite::Int32Size(static_cast<int32_t>(data_size));
    }
    total_size += data_size;
  }

  // bool anchorwise_output = 1;
  if (this->_internal_anchorwise_output() != 0) {
    total_size += 1 + 1;
  }

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

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

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


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

  _this->_impl_.code_weight_.MergeFrom(from._impl_.code_weight_);
  if (from._internal_anchorwise_output() != 0) {
    _this->_internal_set_anchorwise_output(from._internal_anchorwise_output());
  }
  static_assert(sizeof(uint32_t) == sizeof(float), "Code assumes uint32_t and float are the same size.");
  float tmp_sigma = from._internal_sigma();
  uint32_t raw_sigma;
  memcpy(&raw_sigma, &tmp_sigma, sizeof(tmp_sigma));
  if (raw_sigma != 0) {
    _this->_internal_set_sigma(from._internal_sigma());
  }
  _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
}

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

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

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

::PROTOBUF_NAMESPACE_ID::Metadata WeightedSmoothL1LocalizationLoss::GetMetadata() const {
  return ::_pbi::AssignDescriptors(
      &descriptor_table_second_2fprotos_2flosses_2eproto_getter, &descriptor_table_second_2fprotos_2flosses_2eproto_once,
      file_level_metadata_second_2fprotos_2flosses_2eproto[3]);
}

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

class ClassificationLoss::_Internal {
 public:
  static const ::second::protos::WeightedSigmoidClassificationLoss& weighted_sigmoid(const ClassificationLoss* msg);
  static const ::second::protos::WeightedSoftmaxClassificationLoss& weighted_softmax(const ClassificationLoss* msg);
  static const ::second::protos::BootstrappedSigmoidClassificationLoss& bootstrapped_sigmoid(const ClassificationLoss* msg);
  static const ::second::protos::SigmoidFocalClassificationLoss& weighted_sigmoid_focal(const ClassificationLoss* msg);
  static const ::second::protos::SoftmaxFocalClassificationLoss& weighted_softmax_focal(const ClassificationLoss* msg);
};

const ::second::protos::WeightedSigmoidClassificationLoss&
ClassificationLoss::_Internal::weighted_sigmoid(const ClassificationLoss* msg) {
  return *msg->_impl_.classification_loss_.weighted_sigmoid_;
}
const ::second::protos::WeightedSoftmaxClassificationLoss&
ClassificationLoss::_Internal::weighted_softmax(const ClassificationLoss* msg) {
  return *msg->_impl_.classification_loss_.weighted_softmax_;
}
const ::second::protos::BootstrappedSigmoidClassificationLoss&
ClassificationLoss::_Internal::bootstrapped_sigmoid(const ClassificationLoss* msg) {
  return *msg->_impl_.classification_loss_.bootstrapped_sigmoid_;
}
const ::second::protos::SigmoidFocalClassificationLoss&
ClassificationLoss::_Internal::weighted_sigmoid_focal(const ClassificationLoss* msg) {
  return *msg->_impl_.classification_loss_.weighted_sigmoid_focal_;
}
const ::second::protos::SoftmaxFocalClassificationLoss&
ClassificationLoss::_Internal::weighted_softmax_focal(const ClassificationLoss* msg) {
  return *msg->_impl_.classification_loss_.weighted_softmax_focal_;
}
void ClassificationLoss::set_allocated_weighted_sigmoid(::second::protos::WeightedSigmoidClassificationLoss* weighted_sigmoid) {
  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
  clear_classification_loss();
  if (weighted_sigmoid) {
    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
      ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(weighted_sigmoid);
    if (message_arena != submessage_arena) {
      weighted_sigmoid = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
          message_arena, weighted_sigmoid, submessage_arena);
    }
    set_has_weighted_sigmoid();
    _impl_.classification_loss_.weighted_sigmoid_ = weighted_sigmoid;
  }
  // @@protoc_insertion_point(field_set_allocated:second.protos.ClassificationLoss.weighted_sigmoid)
}
void ClassificationLoss::set_allocated_weighted_softmax(::second::protos::WeightedSoftmaxClassificationLoss* weighted_softmax) {
  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
  clear_classification_loss();
  if (weighted_softmax) {
    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
      ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(weighted_softmax);
    if (message_arena != submessage_arena) {
      weighted_softmax = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
          message_arena, weighted_softmax, submessage_arena);
    }
    set_has_weighted_softmax();
    _impl_.classification_loss_.weighted_softmax_ = weighted_softmax;
  }
  // @@protoc_insertion_point(field_set_allocated:second.protos.ClassificationLoss.weighted_softmax)
}
void ClassificationLoss::set_allocated_bootstrapped_sigmoid(::second::protos::BootstrappedSigmoidClassificationLoss* bootstrapped_sigmoid) {
  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
  clear_classification_loss();
  if (bootstrapped_sigmoid) {
    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
      ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(bootstrapped_sigmoid);
    if (message_arena != submessage_arena) {
      bootstrapped_sigmoid = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
          message_arena, bootstrapped_sigmoid, submessage_arena);
    }
    set_has_bootstrapped_sigmoid();
    _impl_.classification_loss_.bootstrapped_sigmoid_ = bootstrapped_sigmoid;
  }
  // @@protoc_insertion_point(field_set_allocated:second.protos.ClassificationLoss.bootstrapped_sigmoid)
}
void ClassificationLoss::set_allocated_weighted_sigmoid_focal(::second::protos::SigmoidFocalClassificationLoss* weighted_sigmoid_focal) {
  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
  clear_classification_loss();
  if (weighted_sigmoid_focal) {
    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
      ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(weighted_sigmoid_focal);
    if (message_arena != submessage_arena) {
      weighted_sigmoid_focal = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
          message_arena, weighted_sigmoid_focal, submessage_arena);
    }
    set_has_weighted_sigmoid_focal();
    _impl_.classification_loss_.weighted_sigmoid_focal_ = weighted_sigmoid_focal;
  }
  // @@protoc_insertion_point(field_set_allocated:second.protos.ClassificationLoss.weighted_sigmoid_focal)
}
void ClassificationLoss::set_allocated_weighted_softmax_focal(::second::protos::SoftmaxFocalClassificationLoss* weighted_softmax_focal) {
  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
  clear_classification_loss();
  if (weighted_softmax_focal) {
    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
      ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(weighted_softmax_focal);
    if (message_arena != submessage_arena) {
      weighted_softmax_focal = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
          message_arena, weighted_softmax_focal, submessage_arena);
    }
    set_has_weighted_softmax_focal();
    _impl_.classification_loss_.weighted_softmax_focal_ = weighted_softmax_focal;
  }
  // @@protoc_insertion_point(field_set_allocated:second.protos.ClassificationLoss.weighted_softmax_focal)
}
ClassificationLoss::ClassificationLoss(::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.ClassificationLoss)
}
ClassificationLoss::ClassificationLoss(const ClassificationLoss& from)
  : ::PROTOBUF_NAMESPACE_ID::Message() {
  ClassificationLoss* const _this = this; (void)_this;
  new (&_impl_) Impl_{
      decltype(_impl_.classification_loss_){}
    , /*decltype(_impl_._cached_size_)*/{}
    , /*decltype(_impl_._oneof_case_)*/{}};

  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
  clear_has_classification_loss();
  switch (from.classification_loss_case()) {
    case kWeightedSigmoid: {
      _this->_internal_mutable_weighted_sigmoid()->::second::protos::WeightedSigmoidClassificationLoss::MergeFrom(
          from._internal_weighted_sigmoid());
      break;
    }
    case kWeightedSoftmax: {
      _this->_internal_mutable_weighted_softmax()->::second::protos::WeightedSoftmaxClassificationLoss::MergeFrom(
          from._internal_weighted_softmax());
      break;
    }
    case kBootstrappedSigmoid: {
      _this->_internal_mutable_bootstrapped_sigmoid()->::second::protos::BootstrappedSigmoidClassificationLoss::MergeFrom(
          from._internal_bootstrapped_sigmoid());
      break;
    }
    case kWeightedSigmoidFocal: {
      _this->_internal_mutable_weighted_sigmoid_focal()->::second::protos::SigmoidFocalClassificationLoss::MergeFrom(
          from._internal_weighted_sigmoid_focal());
      break;
    }
    case kWeightedSoftmaxFocal: {
      _this->_internal_mutable_weighted_softmax_focal()->::second::protos::SoftmaxFocalClassificationLoss::MergeFrom(
          from._internal_weighted_softmax_focal());
      break;
    }
    case CLASSIFICATION_LOSS_NOT_SET: {
      break;
    }
  }
  // @@protoc_insertion_point(copy_constructor:second.protos.ClassificationLoss)
}

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

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

inline void ClassificationLoss::SharedDtor() {
  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
  if (has_classification_loss()) {
    clear_classification_loss();
  }
}

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

void ClassificationLoss::clear_classification_loss() {
// @@protoc_insertion_point(one_of_clear_start:second.protos.ClassificationLoss)
  switch (classification_loss_case()) {
    case kWeightedSigmoid: {
      if (GetArenaForAllocation() == nullptr) {
        delete _impl_.classification_loss_.weighted_sigmoid_;
      }
      break;
    }
    case kWeightedSoftmax: {
      if (GetArenaForAllocation() == nullptr) {
        delete _impl_.classification_loss_.weighted_softmax_;
      }
      break;
    }
    case kBootstrappedSigmoid: {
      if (GetArenaForAllocation() == nullptr) {
        delete _impl_.classification_loss_.bootstrapped_sigmoid_;
      }
      break;
    }
    case kWeightedSigmoidFocal: {
      if (GetArenaForAllocation() == nullptr) {
        delete _impl_.classification_loss_.weighted_sigmoid_focal_;
      }
      break;
    }
    case kWeightedSoftmaxFocal: {
      if (GetArenaForAllocation() == nullptr) {
        delete _impl_.classification_loss_.weighted_softmax_focal_;
      }
      break;
    }
    case CLASSIFICATION_LOSS_NOT_SET: {
      break;
    }
  }
  _impl_._oneof_case_[0] = CLASSIFICATION_LOSS_NOT_SET;
}


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

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

const char* ClassificationLoss::_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.WeightedSigmoidClassificationLoss weighted_sigmoid = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
          ptr = ctx->ParseMessage(_internal_mutable_weighted_sigmoid(), ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // .second.protos.WeightedSoftmaxClassificationLoss weighted_softmax = 2;
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 18)) {
          ptr = ctx->ParseMessage(_internal_mutable_weighted_softmax(), ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // .second.protos.BootstrappedSigmoidClassificationLoss bootstrapped_sigmoid = 3;
      case 3:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 26)) {
          ptr = ctx->ParseMessage(_internal_mutable_bootstrapped_sigmoid(), ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // .second.protos.SigmoidFocalClassificationLoss weighted_sigmoid_focal = 4;
      case 4:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 34)) {
          ptr = ctx->ParseMessage(_internal_mutable_weighted_sigmoid_focal(), ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // .second.protos.SoftmaxFocalClassificationLoss weighted_softmax_focal = 5;
      case 5:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 42)) {
          ptr = ctx->ParseMessage(_internal_mutable_weighted_softmax_focal(), 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* ClassificationLoss::_InternalSerialize(
    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:second.protos.ClassificationLoss)
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  // .second.protos.WeightedSigmoidClassificationLoss weighted_sigmoid = 1;
  if (_internal_has_weighted_sigmoid()) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(1, _Internal::weighted_sigmoid(this),
        _Internal::weighted_sigmoid(this).GetCachedSize(), target, stream);
  }

  // .second.protos.WeightedSoftmaxClassificationLoss weighted_softmax = 2;
  if (_internal_has_weighted_softmax()) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(2, _Internal::weighted_softmax(this),
        _Internal::weighted_softmax(this).GetCachedSize(), target, stream);
  }

  // .second.protos.BootstrappedSigmoidClassificationLoss bootstrapped_sigmoid = 3;
  if (_internal_has_bootstrapped_sigmoid()) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(3, _Internal::bootstrapped_sigmoid(this),
        _Internal::bootstrapped_sigmoid(this).GetCachedSize(), target, stream);
  }

  // .second.protos.SigmoidFocalClassificationLoss weighted_sigmoid_focal = 4;
  if (_internal_has_weighted_sigmoid_focal()) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(4, _Internal::weighted_sigmoid_focal(this),
        _Internal::weighted_sigmoid_focal(this).GetCachedSize(), target, stream);
  }

  // .second.protos.SoftmaxFocalClassificationLoss weighted_softmax_focal = 5;
  if (_internal_has_weighted_softmax_focal()) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(5, _Internal::weighted_softmax_focal(this),
        _Internal::weighted_softmax_focal(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.ClassificationLoss)
  return target;
}

size_t ClassificationLoss::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:second.protos.ClassificationLoss)
  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 (classification_loss_case()) {
    // .second.protos.WeightedSigmoidClassificationLoss weighted_sigmoid = 1;
    case kWeightedSigmoid: {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          *_impl_.classification_loss_.weighted_sigmoid_);
      break;
    }
    // .second.protos.WeightedSoftmaxClassificationLoss weighted_softmax = 2;
    case kWeightedSoftmax: {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          *_impl_.classification_loss_.weighted_softmax_);
      break;
    }
    // .second.protos.BootstrappedSigmoidClassificationLoss bootstrapped_sigmoid = 3;
    case kBootstrappedSigmoid: {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          *_impl_.classification_loss_.bootstrapped_sigmoid_);
      break;
    }
    // .second.protos.SigmoidFocalClassificationLoss weighted_sigmoid_focal = 4;
    case kWeightedSigmoidFocal: {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          *_impl_.classification_loss_.weighted_sigmoid_focal_);
      break;
    }
    // .second.protos.SoftmaxFocalClassificationLoss weighted_softmax_focal = 5;
    case kWeightedSoftmaxFocal: {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          *_impl_.classification_loss_.weighted_softmax_focal_);
      break;
    }
    case CLASSIFICATION_LOSS_NOT_SET: {
      break;
    }
  }
  return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_);
}

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


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

  switch (from.classification_loss_case()) {
    case kWeightedSigmoid: {
      _this->_internal_mutable_weighted_sigmoid()->::second::protos::WeightedSigmoidClassificationLoss::MergeFrom(
          from._internal_weighted_sigmoid());
      break;
    }
    case kWeightedSoftmax: {
      _this->_internal_mutable_weighted_softmax()->::second::protos::WeightedSoftmaxClassificationLoss::MergeFrom(
          from._internal_weighted_softmax());
      break;
    }
    case kBootstrappedSigmoid: {
      _this->_internal_mutable_bootstrapped_sigmoid()->::second::protos::BootstrappedSigmoidClassificationLoss::MergeFrom(
          from._internal_bootstrapped_sigmoid());
      break;
    }
    case kWeightedSigmoidFocal: {
      _this->_internal_mutable_weighted_sigmoid_focal()->::second::protos::SigmoidFocalClassificationLoss::MergeFrom(
          from._internal_weighted_sigmoid_focal());
      break;
    }
    case kWeightedSoftmaxFocal: {
      _this->_internal_mutable_weighted_softmax_focal()->::second::protos::SoftmaxFocalClassificationLoss::MergeFrom(
          from._internal_weighted_softmax_focal());
      break;
    }
    case CLASSIFICATION_LOSS_NOT_SET: {
      break;
    }
  }
  _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
}

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

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

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

::PROTOBUF_NAMESPACE_ID::Metadata ClassificationLoss::GetMetadata() const {
  return ::_pbi::AssignDescriptors(
      &descriptor_table_second_2fprotos_2flosses_2eproto_getter, &descriptor_table_second_2fprotos_2flosses_2eproto_once,
      file_level_metadata_second_2fprotos_2flosses_2eproto[4]);
}

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

class WeightedSigmoidClassificationLoss::_Internal {
 public:
};

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

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

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

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

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

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

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

  _impl_.anchorwise_output_ = false;
  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
}

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

  // bool anchorwise_output = 1;
  if (this->_internal_anchorwise_output() != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteBoolToArray(1, this->_internal_anchorwise_output(), 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.WeightedSigmoidClassificationLoss)
  return target;
}

size_t WeightedSigmoidClassificationLoss::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:second.protos.WeightedSigmoidClassificationLoss)
  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 anchorwise_output = 1;
  if (this->_internal_anchorwise_output() != 0) {
    total_size += 1 + 1;
  }

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

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


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

  if (from._internal_anchorwise_output() != 0) {
    _this->_internal_set_anchorwise_output(from._internal_anchorwise_output());
  }
  _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
}

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

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

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

::PROTOBUF_NAMESPACE_ID::Metadata WeightedSigmoidClassificationLoss::GetMetadata() const {
  return ::_pbi::AssignDescriptors(
      &descriptor_table_second_2fprotos_2flosses_2eproto_getter, &descriptor_table_second_2fprotos_2flosses_2eproto_once,
      file_level_metadata_second_2fprotos_2flosses_2eproto[5]);
}

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

class SigmoidFocalClassificationLoss::_Internal {
 public:
};

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

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

inline void SigmoidFocalClassificationLoss::SharedCtor(
    ::_pb::Arena* arena, bool is_message_owned) {
  (void)arena;
  (void)is_message_owned;
  new (&_impl_) Impl_{
      decltype(_impl_.anchorwise_output_){false}
    , decltype(_impl_.gamma_){0}
    , decltype(_impl_.alpha_){0}
    , /*decltype(_impl_._cached_size_)*/{}
  };
}

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

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

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

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

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

const char* SigmoidFocalClassificationLoss::_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) {
      // bool anchorwise_output = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
          _impl_.anchorwise_output_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // float gamma = 2;
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 21)) {
          _impl_.gamma_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
          ptr += sizeof(float);
        } else
          goto handle_unusual;
        continue;
      // float alpha = 3;
      case 3:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 29)) {
          _impl_.alpha_ = ::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* SigmoidFocalClassificationLoss::_InternalSerialize(
    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:second.protos.SigmoidFocalClassificationLoss)
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  // bool anchorwise_output = 1;
  if (this->_internal_anchorwise_output() != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteBoolToArray(1, this->_internal_anchorwise_output(), target);
  }

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

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

size_t SigmoidFocalClassificationLoss::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:second.protos.SigmoidFocalClassificationLoss)
  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 anchorwise_output = 1;
  if (this->_internal_anchorwise_output() != 0) {
    total_size += 1 + 1;
  }

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

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

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

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


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

  if (from._internal_anchorwise_output() != 0) {
    _this->_internal_set_anchorwise_output(from._internal_anchorwise_output());
  }
  static_assert(sizeof(uint32_t) == sizeof(float), "Code assumes uint32_t and float are the same size.");
  float tmp_gamma = from._internal_gamma();
  uint32_t raw_gamma;
  memcpy(&raw_gamma, &tmp_gamma, sizeof(tmp_gamma));
  if (raw_gamma != 0) {
    _this->_internal_set_gamma(from._internal_gamma());
  }
  static_assert(sizeof(uint32_t) == sizeof(float), "Code assumes uint32_t and float are the same size.");
  float tmp_alpha = from._internal_alpha();
  uint32_t raw_alpha;
  memcpy(&raw_alpha, &tmp_alpha, sizeof(tmp_alpha));
  if (raw_alpha != 0) {
    _this->_internal_set_alpha(from._internal_alpha());
  }
  _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
}

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

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

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

::PROTOBUF_NAMESPACE_ID::Metadata SigmoidFocalClassificationLoss::GetMetadata() const {
  return ::_pbi::AssignDescriptors(
      &descriptor_table_second_2fprotos_2flosses_2eproto_getter, &descriptor_table_second_2fprotos_2flosses_2eproto_once,
      file_level_metadata_second_2fprotos_2flosses_2eproto[6]);
}

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

class SoftmaxFocalClassificationLoss::_Internal {
 public:
};

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

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

inline void SoftmaxFocalClassificationLoss::SharedCtor(
    ::_pb::Arena* arena, bool is_message_owned) {
  (void)arena;
  (void)is_message_owned;
  new (&_impl_) Impl_{
      decltype(_impl_.anchorwise_output_){false}
    , decltype(_impl_.gamma_){0}
    , decltype(_impl_.alpha_){0}
    , /*decltype(_impl_._cached_size_)*/{}
  };
}

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

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

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

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

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

const char* SoftmaxFocalClassificationLoss::_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) {
      // bool anchorwise_output = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
          _impl_.anchorwise_output_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // float gamma = 2;
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 21)) {
          _impl_.gamma_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
          ptr += sizeof(float);
        } else
          goto handle_unusual;
        continue;
      // float alpha = 3;
      case 3:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 29)) {
          _impl_.alpha_ = ::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* SoftmaxFocalClassificationLoss::_InternalSerialize(
    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:second.protos.SoftmaxFocalClassificationLoss)
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  // bool anchorwise_output = 1;
  if (this->_internal_anchorwise_output() != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteBoolToArray(1, this->_internal_anchorwise_output(), target);
  }

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

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

size_t SoftmaxFocalClassificationLoss::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:second.protos.SoftmaxFocalClassificationLoss)
  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 anchorwise_output = 1;
  if (this->_internal_anchorwise_output() != 0) {
    total_size += 1 + 1;
  }

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

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

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

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


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

  if (from._internal_anchorwise_output() != 0) {
    _this->_internal_set_anchorwise_output(from._internal_anchorwise_output());
  }
  static_assert(sizeof(uint32_t) == sizeof(float), "Code assumes uint32_t and float are the same size.");
  float tmp_gamma = from._internal_gamma();
  uint32_t raw_gamma;
  memcpy(&raw_gamma, &tmp_gamma, sizeof(tmp_gamma));
  if (raw_gamma != 0) {
    _this->_internal_set_gamma(from._internal_gamma());
  }
  static_assert(sizeof(uint32_t) == sizeof(float), "Code assumes uint32_t and float are the same size.");
  float tmp_alpha = from._internal_alpha();
  uint32_t raw_alpha;
  memcpy(&raw_alpha, &tmp_alpha, sizeof(tmp_alpha));
  if (raw_alpha != 0) {
    _this->_internal_set_alpha(from._internal_alpha());
  }
  _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
}

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

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

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

::PROTOBUF_NAMESPACE_ID::Metadata SoftmaxFocalClassificationLoss::GetMetadata() const {
  return ::_pbi::AssignDescriptors(
      &descriptor_table_second_2fprotos_2flosses_2eproto_getter, &descriptor_table_second_2fprotos_2flosses_2eproto_once,
      file_level_metadata_second_2fprotos_2flosses_2eproto[7]);
}

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

class WeightedSoftmaxClassificationLoss::_Internal {
 public:
};

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

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

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

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

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

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

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

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

const char* WeightedSoftmaxClassificationLoss::_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) {
      // bool anchorwise_output = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
          _impl_.anchorwise_output_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // float logit_scale = 2;
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 21)) {
          _impl_.logit_scale_ = ::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* WeightedSoftmaxClassificationLoss::_InternalSerialize(
    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:second.protos.WeightedSoftmaxClassificationLoss)
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  // bool anchorwise_output = 1;
  if (this->_internal_anchorwise_output() != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteBoolToArray(1, this->_internal_anchorwise_output(), target);
  }

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

size_t WeightedSoftmaxClassificationLoss::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:second.protos.WeightedSoftmaxClassificationLoss)
  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 anchorwise_output = 1;
  if (this->_internal_anchorwise_output() != 0) {
    total_size += 1 + 1;
  }

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

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

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


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

  if (from._internal_anchorwise_output() != 0) {
    _this->_internal_set_anchorwise_output(from._internal_anchorwise_output());
  }
  static_assert(sizeof(uint32_t) == sizeof(float), "Code assumes uint32_t and float are the same size.");
  float tmp_logit_scale = from._internal_logit_scale();
  uint32_t raw_logit_scale;
  memcpy(&raw_logit_scale, &tmp_logit_scale, sizeof(tmp_logit_scale));
  if (raw_logit_scale != 0) {
    _this->_internal_set_logit_scale(from._internal_logit_scale());
  }
  _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
}

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

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

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

::PROTOBUF_NAMESPACE_ID::Metadata WeightedSoftmaxClassificationLoss::GetMetadata() const {
  return ::_pbi::AssignDescriptors(
      &descriptor_table_second_2fprotos_2flosses_2eproto_getter, &descriptor_table_second_2fprotos_2flosses_2eproto_once,
      file_level_metadata_second_2fprotos_2flosses_2eproto[8]);
}

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

class BootstrappedSigmoidClassificationLoss::_Internal {
 public:
};

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

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

inline void BootstrappedSigmoidClassificationLoss::SharedCtor(
    ::_pb::Arena* arena, bool is_message_owned) {
  (void)arena;
  (void)is_message_owned;
  new (&_impl_) Impl_{
      decltype(_impl_.alpha_){0}
    , decltype(_impl_.hard_bootstrap_){false}
    , decltype(_impl_.anchorwise_output_){false}
    , /*decltype(_impl_._cached_size_)*/{}
  };
}

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

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

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

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

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

const char* BootstrappedSigmoidClassificationLoss::_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 alpha = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 13)) {
          _impl_.alpha_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
          ptr += sizeof(float);
        } else
          goto handle_unusual;
        continue;
      // bool hard_bootstrap = 2;
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 16)) {
          _impl_.hard_bootstrap_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // bool anchorwise_output = 3;
      case 3:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 24)) {
          _impl_.anchorwise_output_ = ::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* BootstrappedSigmoidClassificationLoss::_InternalSerialize(
    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:second.protos.BootstrappedSigmoidClassificationLoss)
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

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

  // bool hard_bootstrap = 2;
  if (this->_internal_hard_bootstrap() != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteBoolToArray(2, this->_internal_hard_bootstrap(), target);
  }

  // bool anchorwise_output = 3;
  if (this->_internal_anchorwise_output() != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteBoolToArray(3, this->_internal_anchorwise_output(), 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.BootstrappedSigmoidClassificationLoss)
  return target;
}

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

  // bool hard_bootstrap = 2;
  if (this->_internal_hard_bootstrap() != 0) {
    total_size += 1 + 1;
  }

  // bool anchorwise_output = 3;
  if (this->_internal_anchorwise_output() != 0) {
    total_size += 1 + 1;
  }

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

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


void BootstrappedSigmoidClassificationLoss::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) {
  auto* const _this = static_cast<BootstrappedSigmoidClassificationLoss*>(&to_msg);
  auto& from = static_cast<const BootstrappedSigmoidClassificationLoss&>(from_msg);
  // @@protoc_insertion_point(class_specific_merge_from_start:second.protos.BootstrappedSigmoidClassificationLoss)
  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_alpha = from._internal_alpha();
  uint32_t raw_alpha;
  memcpy(&raw_alpha, &tmp_alpha, sizeof(tmp_alpha));
  if (raw_alpha != 0) {
    _this->_internal_set_alpha(from._internal_alpha());
  }
  if (from._internal_hard_bootstrap() != 0) {
    _this->_internal_set_hard_bootstrap(from._internal_hard_bootstrap());
  }
  if (from._internal_anchorwise_output() != 0) {
    _this->_internal_set_anchorwise_output(from._internal_anchorwise_output());
  }
  _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
}

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

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

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

::PROTOBUF_NAMESPACE_ID::Metadata BootstrappedSigmoidClassificationLoss::GetMetadata() const {
  return ::_pbi::AssignDescriptors(
      &descriptor_table_second_2fprotos_2flosses_2eproto_getter, &descriptor_table_second_2fprotos_2flosses_2eproto_once,
      file_level_metadata_second_2fprotos_2flosses_2eproto[9]);
}

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

class HardExampleMiner::_Internal {
 public:
};

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

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

inline void HardExampleMiner::SharedCtor(
    ::_pb::Arena* arena, bool is_message_owned) {
  (void)arena;
  (void)is_message_owned;
  new (&_impl_) Impl_{
      decltype(_impl_.num_hard_examples_){0}
    , decltype(_impl_.iou_threshold_){0}
    , decltype(_impl_.loss_type_){0}
    , decltype(_impl_.max_negatives_per_positive_){0}
    , decltype(_impl_.min_negatives_per_image_){0}
    , /*decltype(_impl_._cached_size_)*/{}
  };
}

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

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

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

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

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

const char* HardExampleMiner::_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) {
      // int32 num_hard_examples = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
          _impl_.num_hard_examples_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // float iou_threshold = 2;
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 21)) {
          _impl_.iou_threshold_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
          ptr += sizeof(float);
        } else
          goto handle_unusual;
        continue;
      // .second.protos.HardExampleMiner.LossType loss_type = 3;
      case 3:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 24)) {
          uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
          _internal_set_loss_type(static_cast<::second::protos::HardExampleMiner_LossType>(val));
        } else
          goto handle_unusual;
        continue;
      // int32 max_negatives_per_positive = 4;
      case 4:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 32)) {
          _impl_.max_negatives_per_positive_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // int32 min_negatives_per_image = 5;
      case 5:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 40)) {
          _impl_.min_negatives_per_image_ = ::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* HardExampleMiner::_InternalSerialize(
    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:second.protos.HardExampleMiner)
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  // int32 num_hard_examples = 1;
  if (this->_internal_num_hard_examples() != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteInt32ToArray(1, this->_internal_num_hard_examples(), target);
  }

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

  // .second.protos.HardExampleMiner.LossType loss_type = 3;
  if (this->_internal_loss_type() != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteEnumToArray(
      3, this->_internal_loss_type(), target);
  }

  // int32 max_negatives_per_positive = 4;
  if (this->_internal_max_negatives_per_positive() != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteInt32ToArray(4, this->_internal_max_negatives_per_positive(), target);
  }

  // int32 min_negatives_per_image = 5;
  if (this->_internal_min_negatives_per_image() != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteInt32ToArray(5, this->_internal_min_negatives_per_image(), 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.HardExampleMiner)
  return target;
}

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

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

  // int32 num_hard_examples = 1;
  if (this->_internal_num_hard_examples() != 0) {
    total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_num_hard_examples());
  }

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

  // .second.protos.HardExampleMiner.LossType loss_type = 3;
  if (this->_internal_loss_type() != 0) {
    total_size += 1 +
      ::_pbi::WireFormatLite::EnumSize(this->_internal_loss_type());
  }

  // int32 max_negatives_per_positive = 4;
  if (this->_internal_max_negatives_per_positive() != 0) {
    total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_max_negatives_per_positive());
  }

  // int32 min_negatives_per_image = 5;
  if (this->_internal_min_negatives_per_image() != 0) {
    total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_min_negatives_per_image());
  }

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

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


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

  if (from._internal_num_hard_examples() != 0) {
    _this->_internal_set_num_hard_examples(from._internal_num_hard_examples());
  }
  static_assert(sizeof(uint32_t) == sizeof(float), "Code assumes uint32_t and float are the same size.");
  float tmp_iou_threshold = from._internal_iou_threshold();
  uint32_t raw_iou_threshold;
  memcpy(&raw_iou_threshold, &tmp_iou_threshold, sizeof(tmp_iou_threshold));
  if (raw_iou_threshold != 0) {
    _this->_internal_set_iou_threshold(from._internal_iou_threshold());
  }
  if (from._internal_loss_type() != 0) {
    _this->_internal_set_loss_type(from._internal_loss_type());
  }
  if (from._internal_max_negatives_per_positive() != 0) {
    _this->_internal_set_max_negatives_per_positive(from._internal_max_negatives_per_positive());
  }
  if (from._internal_min_negatives_per_image() != 0) {
    _this->_internal_set_min_negatives_per_image(from._internal_min_negatives_per_image());
  }
  _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
}

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

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

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

::PROTOBUF_NAMESPACE_ID::Metadata HardExampleMiner::GetMetadata() const {
  return ::_pbi::AssignDescriptors(
      &descriptor_table_second_2fprotos_2flosses_2eproto_getter, &descriptor_table_second_2fprotos_2flosses_2eproto_once,
      file_level_metadata_second_2fprotos_2flosses_2eproto[10]);
}

// @@protoc_insertion_point(namespace_scope)
}  // namespace protos
}  // namespace second
PROTOBUF_NAMESPACE_OPEN
template<> PROTOBUF_NOINLINE ::second::protos::Loss*
Arena::CreateMaybeMessage< ::second::protos::Loss >(Arena* arena) {
  return Arena::CreateMessageInternal< ::second::protos::Loss >(arena);
}
template<> PROTOBUF_NOINLINE ::second::protos::LocalizationLoss*
Arena::CreateMaybeMessage< ::second::protos::LocalizationLoss >(Arena* arena) {
  return Arena::CreateMessageInternal< ::second::protos::LocalizationLoss >(arena);
}
template<> PROTOBUF_NOINLINE ::second::protos::WeightedL2LocalizationLoss*
Arena::CreateMaybeMessage< ::second::protos::WeightedL2LocalizationLoss >(Arena* arena) {
  return Arena::CreateMessageInternal< ::second::protos::WeightedL2LocalizationLoss >(arena);
}
template<> PROTOBUF_NOINLINE ::second::protos::WeightedSmoothL1LocalizationLoss*
Arena::CreateMaybeMessage< ::second::protos::WeightedSmoothL1LocalizationLoss >(Arena* arena) {
  return Arena::CreateMessageInternal< ::second::protos::WeightedSmoothL1LocalizationLoss >(arena);
}
template<> PROTOBUF_NOINLINE ::second::protos::ClassificationLoss*
Arena::CreateMaybeMessage< ::second::protos::ClassificationLoss >(Arena* arena) {
  return Arena::CreateMessageInternal< ::second::protos::ClassificationLoss >(arena);
}
template<> PROTOBUF_NOINLINE ::second::protos::WeightedSigmoidClassificationLoss*
Arena::CreateMaybeMessage< ::second::protos::WeightedSigmoidClassificationLoss >(Arena* arena) {
  return Arena::CreateMessageInternal< ::second::protos::WeightedSigmoidClassificationLoss >(arena);
}
template<> PROTOBUF_NOINLINE ::second::protos::SigmoidFocalClassificationLoss*
Arena::CreateMaybeMessage< ::second::protos::SigmoidFocalClassificationLoss >(Arena* arena) {
  return Arena::CreateMessageInternal< ::second::protos::SigmoidFocalClassificationLoss >(arena);
}
template<> PROTOBUF_NOINLINE ::second::protos::SoftmaxFocalClassificationLoss*
Arena::CreateMaybeMessage< ::second::protos::SoftmaxFocalClassificationLoss >(Arena* arena) {
  return Arena::CreateMessageInternal< ::second::protos::SoftmaxFocalClassificationLoss >(arena);
}
template<> PROTOBUF_NOINLINE ::second::protos::WeightedSoftmaxClassificationLoss*
Arena::CreateMaybeMessage< ::second::protos::WeightedSoftmaxClassificationLoss >(Arena* arena) {
  return Arena::CreateMessageInternal< ::second::protos::WeightedSoftmaxClassificationLoss >(arena);
}
template<> PROTOBUF_NOINLINE ::second::protos::BootstrappedSigmoidClassificationLoss*
Arena::CreateMaybeMessage< ::second::protos::BootstrappedSigmoidClassificationLoss >(Arena* arena) {
  return Arena::CreateMessageInternal< ::second::protos::BootstrappedSigmoidClassificationLoss >(arena);
}
template<> PROTOBUF_NOINLINE ::second::protos::HardExampleMiner*
Arena::CreateMaybeMessage< ::second::protos::HardExampleMiner >(Arena* arena) {
  return Arena::CreateMessageInternal< ::second::protos::HardExampleMiner >(arena);
}
PROTOBUF_NAMESPACE_CLOSE

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