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

#include "caffe2/proto/caffe2.pb.h"

#include <algorithm>

#include <google/protobuf/stubs/common.h>
#include <google/protobuf/stubs/port.h>
#include <google/protobuf/io/coded_stream.h>
#include <google/protobuf/wire_format_lite_inl.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>
// This is a temporary google only hack
#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
#include "third_party/protobuf/version.h"
#endif
// @@protoc_insertion_point(includes)

namespace protobuf_caffe2_2fproto_2fcaffe2_2eproto {
extern PROTOBUF_INTERNAL_EXPORT_protobuf_caffe2_2fproto_2fcaffe2_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_DeviceOption;
extern PROTOBUF_INTERNAL_EXPORT_protobuf_caffe2_2fproto_2fcaffe2_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_ExecutionStep;
extern PROTOBUF_INTERNAL_EXPORT_protobuf_caffe2_2fproto_2fcaffe2_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_ExternalDataProto;
extern PROTOBUF_INTERNAL_EXPORT_protobuf_caffe2_2fproto_2fcaffe2_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_QTensorProto;
extern PROTOBUF_INTERNAL_EXPORT_protobuf_caffe2_2fproto_2fcaffe2_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_TensorProto_Segment;
extern PROTOBUF_INTERNAL_EXPORT_protobuf_caffe2_2fproto_2fcaffe2_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_TensorShape;
extern PROTOBUF_INTERNAL_EXPORT_protobuf_caffe2_2fproto_2fcaffe2_2eproto ::google::protobuf::internal::SCCInfo<3> scc_info_Argument;
extern PROTOBUF_INTERNAL_EXPORT_protobuf_caffe2_2fproto_2fcaffe2_2eproto ::google::protobuf::internal::SCCInfo<3> scc_info_TensorProto;
}  // namespace protobuf_caffe2_2fproto_2fcaffe2_2eproto
namespace caffe2 {
class ExternalDataProtoDefaultTypeInternal {
 public:
  ::google::protobuf::internal::ExplicitlyConstructed<ExternalDataProto>
      _instance;
} _ExternalDataProto_default_instance_;
class TensorProto_SegmentDefaultTypeInternal {
 public:
  ::google::protobuf::internal::ExplicitlyConstructed<TensorProto_Segment>
      _instance;
} _TensorProto_Segment_default_instance_;
class TensorProtoDefaultTypeInternal {
 public:
  ::google::protobuf::internal::ExplicitlyConstructed<TensorProto>
      _instance;
} _TensorProto_default_instance_;
class QTensorProtoDefaultTypeInternal {
 public:
  ::google::protobuf::internal::ExplicitlyConstructed<QTensorProto>
      _instance;
} _QTensorProto_default_instance_;
class TensorProtosDefaultTypeInternal {
 public:
  ::google::protobuf::internal::ExplicitlyConstructed<TensorProtos>
      _instance;
} _TensorProtos_default_instance_;
class TensorShapeDefaultTypeInternal {
 public:
  ::google::protobuf::internal::ExplicitlyConstructed<TensorShape>
      _instance;
} _TensorShape_default_instance_;
class TensorShapesDefaultTypeInternal {
 public:
  ::google::protobuf::internal::ExplicitlyConstructed<TensorShapes>
      _instance;
} _TensorShapes_default_instance_;
class ArgumentDefaultTypeInternal {
 public:
  ::google::protobuf::internal::ExplicitlyConstructed<Argument>
      _instance;
} _Argument_default_instance_;
class DeviceOptionDefaultTypeInternal {
 public:
  ::google::protobuf::internal::ExplicitlyConstructed<DeviceOption>
      _instance;
} _DeviceOption_default_instance_;
class OperatorDefDefaultTypeInternal {
 public:
  ::google::protobuf::internal::ExplicitlyConstructed<OperatorDef>
      _instance;
} _OperatorDef_default_instance_;
class NetDefDefaultTypeInternal {
 public:
  ::google::protobuf::internal::ExplicitlyConstructed<NetDef>
      _instance;
} _NetDef_default_instance_;
class ExecutionStepDefaultTypeInternal {
 public:
  ::google::protobuf::internal::ExplicitlyConstructed<ExecutionStep>
      _instance;
} _ExecutionStep_default_instance_;
class PlanDefDefaultTypeInternal {
 public:
  ::google::protobuf::internal::ExplicitlyConstructed<PlanDef>
      _instance;
} _PlanDef_default_instance_;
class BlobProtoDefaultTypeInternal {
 public:
  ::google::protobuf::internal::ExplicitlyConstructed<BlobProto>
      _instance;
} _BlobProto_default_instance_;
class DBReaderProtoDefaultTypeInternal {
 public:
  ::google::protobuf::internal::ExplicitlyConstructed<DBReaderProto>
      _instance;
} _DBReaderProto_default_instance_;
}  // namespace caffe2
namespace protobuf_caffe2_2fproto_2fcaffe2_2eproto {
static void InitDefaultsExternalDataProto() {
  GOOGLE_PROTOBUF_VERIFY_VERSION;

  {
    void* ptr = &::caffe2::_ExternalDataProto_default_instance_;
    new (ptr) ::caffe2::ExternalDataProto();
    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
  }
  ::caffe2::ExternalDataProto::InitAsDefaultInstance();
}

CAFFE2_API ::google::protobuf::internal::SCCInfo<0> scc_info_ExternalDataProto =
    {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsExternalDataProto}, {}};

static void InitDefaultsTensorProto_Segment() {
  GOOGLE_PROTOBUF_VERIFY_VERSION;

  {
    void* ptr = &::caffe2::_TensorProto_Segment_default_instance_;
    new (ptr) ::caffe2::TensorProto_Segment();
    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
  }
  ::caffe2::TensorProto_Segment::InitAsDefaultInstance();
}

CAFFE2_API ::google::protobuf::internal::SCCInfo<0> scc_info_TensorProto_Segment =
    {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsTensorProto_Segment}, {}};

static void InitDefaultsTensorProto() {
  GOOGLE_PROTOBUF_VERIFY_VERSION;

  {
    void* ptr = &::caffe2::_TensorProto_default_instance_;
    new (ptr) ::caffe2::TensorProto();
    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
  }
  ::caffe2::TensorProto::InitAsDefaultInstance();
}

CAFFE2_API ::google::protobuf::internal::SCCInfo<3> scc_info_TensorProto =
    {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 3, InitDefaultsTensorProto}, {
      &protobuf_caffe2_2fproto_2fcaffe2_2eproto::scc_info_ExternalDataProto.base,
      &protobuf_caffe2_2fproto_2fcaffe2_2eproto::scc_info_DeviceOption.base,
      &protobuf_caffe2_2fproto_2fcaffe2_2eproto::scc_info_TensorProto_Segment.base,}};

static void InitDefaultsQTensorProto() {
  GOOGLE_PROTOBUF_VERIFY_VERSION;

  {
    void* ptr = &::caffe2::_QTensorProto_default_instance_;
    new (ptr) ::caffe2::QTensorProto();
    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
  }
  ::caffe2::QTensorProto::InitAsDefaultInstance();
}

CAFFE2_API ::google::protobuf::internal::SCCInfo<0> scc_info_QTensorProto =
    {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsQTensorProto}, {}};

static void InitDefaultsTensorProtos() {
  GOOGLE_PROTOBUF_VERIFY_VERSION;

  {
    void* ptr = &::caffe2::_TensorProtos_default_instance_;
    new (ptr) ::caffe2::TensorProtos();
    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
  }
  ::caffe2::TensorProtos::InitAsDefaultInstance();
}

CAFFE2_API ::google::protobuf::internal::SCCInfo<1> scc_info_TensorProtos =
    {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsTensorProtos}, {
      &protobuf_caffe2_2fproto_2fcaffe2_2eproto::scc_info_TensorProto.base,}};

static void InitDefaultsTensorShape() {
  GOOGLE_PROTOBUF_VERIFY_VERSION;

  {
    void* ptr = &::caffe2::_TensorShape_default_instance_;
    new (ptr) ::caffe2::TensorShape();
    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
  }
  ::caffe2::TensorShape::InitAsDefaultInstance();
}

CAFFE2_API ::google::protobuf::internal::SCCInfo<0> scc_info_TensorShape =
    {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsTensorShape}, {}};

static void InitDefaultsTensorShapes() {
  GOOGLE_PROTOBUF_VERIFY_VERSION;

  {
    void* ptr = &::caffe2::_TensorShapes_default_instance_;
    new (ptr) ::caffe2::TensorShapes();
    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
  }
  ::caffe2::TensorShapes::InitAsDefaultInstance();
}

CAFFE2_API ::google::protobuf::internal::SCCInfo<1> scc_info_TensorShapes =
    {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsTensorShapes}, {
      &protobuf_caffe2_2fproto_2fcaffe2_2eproto::scc_info_TensorShape.base,}};

static void InitDefaultsArgument() {
  GOOGLE_PROTOBUF_VERIFY_VERSION;

  {
    void* ptr = &::caffe2::_Argument_default_instance_;
    new (ptr) ::caffe2::Argument();
    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
  }
  {
    void* ptr = &::caffe2::_OperatorDef_default_instance_;
    new (ptr) ::caffe2::OperatorDef();
    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
  }
  {
    void* ptr = &::caffe2::_NetDef_default_instance_;
    new (ptr) ::caffe2::NetDef();
    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
  }
  ::caffe2::Argument::InitAsDefaultInstance();
  ::caffe2::OperatorDef::InitAsDefaultInstance();
  ::caffe2::NetDef::InitAsDefaultInstance();
}

CAFFE2_API ::google::protobuf::internal::SCCInfo<3> scc_info_Argument =
    {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 3, InitDefaultsArgument}, {
      &protobuf_caffe2_2fproto_2fcaffe2_2eproto::scc_info_TensorProto.base,
      &protobuf_caffe2_2fproto_2fcaffe2_2eproto::scc_info_QTensorProto.base,
      &protobuf_caffe2_2fproto_2fcaffe2_2eproto::scc_info_DeviceOption.base,}};

static void InitDefaultsDeviceOption() {
  GOOGLE_PROTOBUF_VERIFY_VERSION;

  {
    void* ptr = &::caffe2::_DeviceOption_default_instance_;
    new (ptr) ::caffe2::DeviceOption();
    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
  }
  ::caffe2::DeviceOption::InitAsDefaultInstance();
}

CAFFE2_API ::google::protobuf::internal::SCCInfo<0> scc_info_DeviceOption =
    {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsDeviceOption}, {}};

static void InitDefaultsExecutionStep() {
  GOOGLE_PROTOBUF_VERIFY_VERSION;

  {
    void* ptr = &::caffe2::_ExecutionStep_default_instance_;
    new (ptr) ::caffe2::ExecutionStep();
    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
  }
  ::caffe2::ExecutionStep::InitAsDefaultInstance();
}

CAFFE2_API ::google::protobuf::internal::SCCInfo<0> scc_info_ExecutionStep =
    {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsExecutionStep}, {}};

static void InitDefaultsPlanDef() {
  GOOGLE_PROTOBUF_VERIFY_VERSION;

  {
    void* ptr = &::caffe2::_PlanDef_default_instance_;
    new (ptr) ::caffe2::PlanDef();
    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
  }
  ::caffe2::PlanDef::InitAsDefaultInstance();
}

CAFFE2_API ::google::protobuf::internal::SCCInfo<2> scc_info_PlanDef =
    {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 2, InitDefaultsPlanDef}, {
      &protobuf_caffe2_2fproto_2fcaffe2_2eproto::scc_info_Argument.base,
      &protobuf_caffe2_2fproto_2fcaffe2_2eproto::scc_info_ExecutionStep.base,}};

static void InitDefaultsBlobProto() {
  GOOGLE_PROTOBUF_VERIFY_VERSION;

  {
    void* ptr = &::caffe2::_BlobProto_default_instance_;
    new (ptr) ::caffe2::BlobProto();
    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
  }
  ::caffe2::BlobProto::InitAsDefaultInstance();
}

CAFFE2_API ::google::protobuf::internal::SCCInfo<2> scc_info_BlobProto =
    {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 2, InitDefaultsBlobProto}, {
      &protobuf_caffe2_2fproto_2fcaffe2_2eproto::scc_info_TensorProto.base,
      &protobuf_caffe2_2fproto_2fcaffe2_2eproto::scc_info_QTensorProto.base,}};

static void InitDefaultsDBReaderProto() {
  GOOGLE_PROTOBUF_VERIFY_VERSION;

  {
    void* ptr = &::caffe2::_DBReaderProto_default_instance_;
    new (ptr) ::caffe2::DBReaderProto();
    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
  }
  ::caffe2::DBReaderProto::InitAsDefaultInstance();
}

CAFFE2_API ::google::protobuf::internal::SCCInfo<0> scc_info_DBReaderProto =
    {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsDBReaderProto}, {}};

void InitDefaults() {
  ::google::protobuf::internal::InitSCC(&scc_info_ExternalDataProto.base);
  ::google::protobuf::internal::InitSCC(&scc_info_TensorProto_Segment.base);
  ::google::protobuf::internal::InitSCC(&scc_info_TensorProto.base);
  ::google::protobuf::internal::InitSCC(&scc_info_QTensorProto.base);
  ::google::protobuf::internal::InitSCC(&scc_info_TensorProtos.base);
  ::google::protobuf::internal::InitSCC(&scc_info_TensorShape.base);
  ::google::protobuf::internal::InitSCC(&scc_info_TensorShapes.base);
  ::google::protobuf::internal::InitSCC(&scc_info_Argument.base);
  ::google::protobuf::internal::InitSCC(&scc_info_DeviceOption.base);
  ::google::protobuf::internal::InitSCC(&scc_info_ExecutionStep.base);
  ::google::protobuf::internal::InitSCC(&scc_info_PlanDef.base);
  ::google::protobuf::internal::InitSCC(&scc_info_BlobProto.base);
  ::google::protobuf::internal::InitSCC(&scc_info_DBReaderProto.base);
}

::google::protobuf::Metadata file_level_metadata[15];
const ::google::protobuf::EnumDescriptor* file_level_enum_descriptors[4];

const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::caffe2::ExternalDataProto, _has_bits_),
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::caffe2::ExternalDataProto, _internal_metadata_),
  ~0u,  // no _extensions_
  ~0u,  // no _oneof_case_
  ~0u,  // no _weak_field_map_
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::caffe2::ExternalDataProto, source_type_),
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::caffe2::ExternalDataProto, record_id_),
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::caffe2::ExternalDataProto, record_size_),
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::caffe2::ExternalDataProto, offset_),
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::caffe2::ExternalDataProto, strides_),
  3,
  0,
  2,
  1,
  ~0u,
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::caffe2::TensorProto_Segment, _has_bits_),
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::caffe2::TensorProto_Segment, _internal_metadata_),
  ~0u,  // no _extensions_
  ~0u,  // no _oneof_case_
  ~0u,  // no _weak_field_map_
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::caffe2::TensorProto_Segment, begin_),
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::caffe2::TensorProto_Segment, end_),
  0,
  1,
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::caffe2::TensorProto, _has_bits_),
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::caffe2::TensorProto, _internal_metadata_),
  ~0u,  // no _extensions_
  ~0u,  // no _oneof_case_
  ~0u,  // no _weak_field_map_
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::caffe2::TensorProto, dims_),
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::caffe2::TensorProto, data_type_),
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::caffe2::TensorProto, storage_type_),
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::caffe2::TensorProto, float_data_),
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::caffe2::TensorProto, int32_data_),
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::caffe2::TensorProto, byte_data_),
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::caffe2::TensorProto, string_data_),
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::caffe2::TensorProto, double_data_),
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::caffe2::TensorProto, int64_data_),
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::caffe2::TensorProto, raw_data_),
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::caffe2::TensorProto, external_data_),
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::caffe2::TensorProto, name_),
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::caffe2::TensorProto, device_detail_),
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::caffe2::TensorProto, segment_),
  ~0u,
  6,
  7,
  ~0u,
  ~0u,
  0,
  ~0u,
  ~0u,
  ~0u,
  2,
  5,
  1,
  3,
  4,
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::caffe2::QTensorProto, _has_bits_),
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::caffe2::QTensorProto, _internal_metadata_),
  ~0u,  // no _extensions_
  ~0u,  // no _oneof_case_
  ~0u,  // no _weak_field_map_
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::caffe2::QTensorProto, dims_),
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::caffe2::QTensorProto, precision_),
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::caffe2::QTensorProto, scale_),
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::caffe2::QTensorProto, bias_),
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::caffe2::QTensorProto, is_signed_),
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::caffe2::QTensorProto, data_),
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::caffe2::QTensorProto, name_),
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::caffe2::QTensorProto, data_type_),
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::caffe2::QTensorProto, scales_),
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::caffe2::QTensorProto, biases_),
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::caffe2::QTensorProto, axis_),
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::caffe2::QTensorProto, is_multiparam_),
  ~0u,
  3,
  1,
  2,
  4,
  ~0u,
  0,
  7,
  ~0u,
  ~0u,
  6,
  5,
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::caffe2::TensorProtos, _has_bits_),
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::caffe2::TensorProtos, _internal_metadata_),
  ~0u,  // no _extensions_
  ~0u,  // no _oneof_case_
  ~0u,  // no _weak_field_map_
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::caffe2::TensorProtos, protos_),
  ~0u,
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::caffe2::TensorShape, _has_bits_),
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::caffe2::TensorShape, _internal_metadata_),
  ~0u,  // no _extensions_
  ~0u,  // no _oneof_case_
  ~0u,  // no _weak_field_map_
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::caffe2::TensorShape, dims_),
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::caffe2::TensorShape, data_type_),
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::caffe2::TensorShape, unknown_dims_),
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::caffe2::TensorShape, unknown_shape_),
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::caffe2::TensorShape, name_),
  ~0u,
  2,
  ~0u,
  1,
  0,
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::caffe2::TensorShapes, _has_bits_),
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::caffe2::TensorShapes, _internal_metadata_),
  ~0u,  // no _extensions_
  ~0u,  // no _oneof_case_
  ~0u,  // no _weak_field_map_
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::caffe2::TensorShapes, shapes_),
  ~0u,
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::caffe2::Argument, _has_bits_),
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::caffe2::Argument, _internal_metadata_),
  ~0u,  // no _extensions_
  ~0u,  // no _oneof_case_
  ~0u,  // no _weak_field_map_
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::caffe2::Argument, name_),
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::caffe2::Argument, f_),
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::caffe2::Argument, i_),
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::caffe2::Argument, s_),
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::caffe2::Argument, t_),
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::caffe2::Argument, n_),
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::caffe2::Argument, floats_),
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::caffe2::Argument, ints_),
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::caffe2::Argument, strings_),
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::caffe2::Argument, tensors_),
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::caffe2::Argument, nets_),
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::caffe2::Argument, qtensors_),
  0,
  5,
  4,
  1,
  3,
  2,
  ~0u,
  ~0u,
  ~0u,
  ~0u,
  ~0u,
  ~0u,
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::caffe2::DeviceOption, _has_bits_),
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::caffe2::DeviceOption, _internal_metadata_),
  ~0u,  // no _extensions_
  ~0u,  // no _oneof_case_
  ~0u,  // no _weak_field_map_
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::caffe2::DeviceOption, device_type_),
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::caffe2::DeviceOption, device_id_),
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::caffe2::DeviceOption, random_seed_),
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::caffe2::DeviceOption, node_name_),
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::caffe2::DeviceOption, numa_node_id_),
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::caffe2::DeviceOption, extra_info_),
  1,
  2,
  3,
  0,
  4,
  ~0u,
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::caffe2::OperatorDef, _has_bits_),
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::caffe2::OperatorDef, _internal_metadata_),
  ~0u,  // no _extensions_
  ~0u,  // no _oneof_case_
  ~0u,  // no _weak_field_map_
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::caffe2::OperatorDef, input_),
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::caffe2::OperatorDef, output_),
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::caffe2::OperatorDef, name_),
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::caffe2::OperatorDef, type_),
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::caffe2::OperatorDef, arg_),
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::caffe2::OperatorDef, device_option_),
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::caffe2::OperatorDef, engine_),
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::caffe2::OperatorDef, control_input_),
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::caffe2::OperatorDef, is_gradient_op_),
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::caffe2::OperatorDef, debug_info_),
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::caffe2::OperatorDef, domain_),
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::caffe2::OperatorDef, op_version_),
  ~0u,
  ~0u,
  0,
  1,
  ~0u,
  5,
  2,
  ~0u,
  7,
  3,
  4,
  6,
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::caffe2::NetDef, _has_bits_),
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::caffe2::NetDef, _internal_metadata_),
  ~0u,  // no _extensions_
  ~0u,  // no _oneof_case_
  ~0u,  // no _weak_field_map_
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::caffe2::NetDef, name_),
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::caffe2::NetDef, op_),
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::caffe2::NetDef, type_),
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::caffe2::NetDef, num_workers_),
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::caffe2::NetDef, device_option_),
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::caffe2::NetDef, arg_),
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::caffe2::NetDef, external_input_),
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::caffe2::NetDef, external_output_),
  0,
  ~0u,
  1,
  3,
  2,
  ~0u,
  ~0u,
  ~0u,
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::caffe2::ExecutionStep, _has_bits_),
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::caffe2::ExecutionStep, _internal_metadata_),
  ~0u,  // no _extensions_
  ~0u,  // no _oneof_case_
  ~0u,  // no _weak_field_map_
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::caffe2::ExecutionStep, name_),
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::caffe2::ExecutionStep, substep_),
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::caffe2::ExecutionStep, network_),
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::caffe2::ExecutionStep, num_iter_),
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::caffe2::ExecutionStep, criteria_network_),
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::caffe2::ExecutionStep, report_net_),
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::caffe2::ExecutionStep, report_interval_),
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::caffe2::ExecutionStep, run_every_ms_),
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::caffe2::ExecutionStep, concurrent_substeps_),
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::caffe2::ExecutionStep, should_stop_blob_),
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::caffe2::ExecutionStep, only_once_),
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::caffe2::ExecutionStep, create_workspace_),
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::caffe2::ExecutionStep, num_concurrent_instances_),
  0,
  ~0u,
  ~0u,
  4,
  1,
  2,
  5,
  9,
  6,
  3,
  7,
  8,
  10,
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::caffe2::PlanDef, _has_bits_),
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::caffe2::PlanDef, _internal_metadata_),
  ~0u,  // no _extensions_
  ~0u,  // no _oneof_case_
  ~0u,  // no _weak_field_map_
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::caffe2::PlanDef, name_),
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::caffe2::PlanDef, network_),
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::caffe2::PlanDef, execution_step_),
  0,
  ~0u,
  ~0u,
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::caffe2::BlobProto, _has_bits_),
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::caffe2::BlobProto, _internal_metadata_),
  ~0u,  // no _extensions_
  ~0u,  // no _oneof_case_
  ~0u,  // no _weak_field_map_
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::caffe2::BlobProto, name_),
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::caffe2::BlobProto, type_),
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::caffe2::BlobProto, tensor_),
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::caffe2::BlobProto, content_),
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::caffe2::BlobProto, qtensor_),
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::caffe2::BlobProto, content_num_chunks_),
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::caffe2::BlobProto, content_chunk_id_),
  0,
  1,
  3,
  2,
  4,
  5,
  6,
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::caffe2::DBReaderProto, _has_bits_),
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::caffe2::DBReaderProto, _internal_metadata_),
  ~0u,  // no _extensions_
  ~0u,  // no _oneof_case_
  ~0u,  // no _weak_field_map_
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::caffe2::DBReaderProto, name_),
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::caffe2::DBReaderProto, source_),
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::caffe2::DBReaderProto, db_type_),
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::caffe2::DBReaderProto, key_),
  0,
  1,
  2,
  3,
};
static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
  { 0, 10, sizeof(::caffe2::ExternalDataProto)},
  { 15, 22, sizeof(::caffe2::TensorProto_Segment)},
  { 24, 43, sizeof(::caffe2::TensorProto)},
  { 57, 74, sizeof(::caffe2::QTensorProto)},
  { 86, 92, sizeof(::caffe2::TensorProtos)},
  { 93, 103, sizeof(::caffe2::TensorShape)},
  { 108, 114, sizeof(::caffe2::TensorShapes)},
  { 115, 132, sizeof(::caffe2::Argument)},
  { 144, 155, sizeof(::caffe2::DeviceOption)},
  { 161, 178, sizeof(::caffe2::OperatorDef)},
  { 190, 203, sizeof(::caffe2::NetDef)},
  { 211, 229, sizeof(::caffe2::ExecutionStep)},
  { 242, 250, sizeof(::caffe2::PlanDef)},
  { 253, 265, sizeof(::caffe2::BlobProto)},
  { 272, 281, sizeof(::caffe2::DBReaderProto)},
};

static ::google::protobuf::Message const * const file_default_instances[] = {
  reinterpret_cast<const ::google::protobuf::Message*>(&::caffe2::_ExternalDataProto_default_instance_),
  reinterpret_cast<const ::google::protobuf::Message*>(&::caffe2::_TensorProto_Segment_default_instance_),
  reinterpret_cast<const ::google::protobuf::Message*>(&::caffe2::_TensorProto_default_instance_),
  reinterpret_cast<const ::google::protobuf::Message*>(&::caffe2::_QTensorProto_default_instance_),
  reinterpret_cast<const ::google::protobuf::Message*>(&::caffe2::_TensorProtos_default_instance_),
  reinterpret_cast<const ::google::protobuf::Message*>(&::caffe2::_TensorShape_default_instance_),
  reinterpret_cast<const ::google::protobuf::Message*>(&::caffe2::_TensorShapes_default_instance_),
  reinterpret_cast<const ::google::protobuf::Message*>(&::caffe2::_Argument_default_instance_),
  reinterpret_cast<const ::google::protobuf::Message*>(&::caffe2::_DeviceOption_default_instance_),
  reinterpret_cast<const ::google::protobuf::Message*>(&::caffe2::_OperatorDef_default_instance_),
  reinterpret_cast<const ::google::protobuf::Message*>(&::caffe2::_NetDef_default_instance_),
  reinterpret_cast<const ::google::protobuf::Message*>(&::caffe2::_ExecutionStep_default_instance_),
  reinterpret_cast<const ::google::protobuf::Message*>(&::caffe2::_PlanDef_default_instance_),
  reinterpret_cast<const ::google::protobuf::Message*>(&::caffe2::_BlobProto_default_instance_),
  reinterpret_cast<const ::google::protobuf::Message*>(&::caffe2::_DBReaderProto_default_instance_),
};

void protobuf_AssignDescriptors() {
  AddDescriptors();
  AssignDescriptors(
      "caffe2/proto/caffe2.proto", schemas, file_default_instances, TableStruct::offsets,
      file_level_metadata, file_level_enum_descriptors, NULL);
}

void protobuf_AssignDescriptorsOnce() {
  static ::google::protobuf::internal::once_flag once;
  ::google::protobuf::internal::call_once(once, protobuf_AssignDescriptors);
}

void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD;
void protobuf_RegisterTypes(const ::std::string&) {
  protobuf_AssignDescriptorsOnce();
  ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 15);
}

void AddDescriptorsImpl() {
  InitDefaults();
  static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
      "\n\031caffe2/proto/caffe2.proto\022\006caffe2\"\341\001\n\021"
      "ExternalDataProto\022K\n\013source_type\030\001 \001(\0162$"
      ".caffe2.ExternalDataProto.SourceType:\020IN"
      "LINE_CONTAINER\022\021\n\trecord_id\030\002 \001(\t\022\023\n\013rec"
      "ord_size\030\005 \001(\004\022\021\n\006offset\030\003 \001(\003:\0010\022\017\n\007str"
      "ides\030\004 \003(\003\"3\n\nSourceType\022\024\n\020INLINE_CONTA"
      "INER\020\000\022\017\n\013SIMPLE_FILE\020\001\"\321\005\n\013TensorProto\022"
      "\014\n\004dims\030\001 \003(\003\0226\n\tdata_type\030\002 \001(\0162\034.caffe"
      "2.TensorProto.DataType:\005FLOAT\022<\n\014storage"
      "_type\030\014 \001(\0162\037.caffe2.TensorProto.Storage"
      "Type:\005TYPED\022\026\n\nfloat_data\030\003 \003(\002B\002\020\001\022\026\n\ni"
      "nt32_data\030\004 \003(\005B\002\020\001\022\021\n\tbyte_data\030\005 \001(\014\022\023"
      "\n\013string_data\030\006 \003(\014\022\027\n\013double_data\030\t \003(\001"
      "B\002\020\001\022\026\n\nint64_data\030\n \003(\003B\002\020\001\022\020\n\010raw_data"
      "\030\r \001(\014\0220\n\rexternal_data\030\016 \001(\0132\031.caffe2.E"
      "xternalDataProto\022\014\n\004name\030\007 \001(\t\022+\n\rdevice"
      "_detail\030\010 \001(\0132\024.caffe2.DeviceOption\022,\n\007s"
      "egment\030\013 \001(\0132\033.caffe2.TensorProto.Segmen"
      "t\032%\n\007Segment\022\r\n\005begin\030\001 \002(\003\022\013\n\003end\030\002 \002(\003"
      "\"\237\001\n\010DataType\022\r\n\tUNDEFINED\020\000\022\t\n\005FLOAT\020\001\022"
      "\t\n\005INT32\020\002\022\010\n\004BYTE\020\003\022\n\n\006STRING\020\004\022\010\n\004BOOL"
      "\020\005\022\t\n\005UINT8\020\006\022\010\n\004INT8\020\007\022\n\n\006UINT16\020\010\022\t\n\005I"
      "NT16\020\t\022\t\n\005INT64\020\n\022\013\n\007FLOAT16\020\014\022\n\n\006DOUBLE"
      "\020\r\"\?\n\013StorageType\022\t\n\005TYPED\020\001\022\007\n\003RAW\020\002\022\014\n"
      "\010EXTERNAL\020\003\022\016\n\nNO_CONTENT\020\004\"\203\002\n\014QTensorP"
      "roto\022\014\n\004dims\030\001 \003(\003\022\021\n\tprecision\030\002 \002(\005\022\r\n"
      "\005scale\030\003 \002(\001\022\014\n\004bias\030\004 \002(\001\022\021\n\tis_signed\030"
      "\005 \002(\010\022\020\n\004data\030\006 \003(\005B\002\020\001\022\014\n\004name\030\007 \001(\t\0226\n"
      "\tdata_type\030\010 \001(\0162\034.caffe2.TensorProto.Da"
      "taType:\005INT32\022\016\n\006scales\030\t \003(\001\022\016\n\006biases\030"
      "\n \003(\001\022\014\n\004axis\030\013 \001(\005\022\034\n\ris_multiparam\030\014 \001"
      "(\010:\005false\"3\n\014TensorProtos\022#\n\006protos\030\001 \003("
      "\0132\023.caffe2.TensorProto\"\225\001\n\013TensorShape\022\014"
      "\n\004dims\030\001 \003(\003\0226\n\tdata_type\030\002 \001(\0162\034.caffe2"
      ".TensorProto.DataType:\005FLOAT\022\024\n\014unknown_"
      "dims\030\003 \003(\005\022\034\n\runknown_shape\030\004 \001(\010:\005false"
      "\022\014\n\004name\030\005 \001(\t\"3\n\014TensorShapes\022#\n\006shapes"
      "\030\001 \003(\0132\023.caffe2.TensorShape\"\217\002\n\010Argument"
      "\022\014\n\004name\030\001 \001(\t\022\t\n\001f\030\002 \001(\002\022\t\n\001i\030\003 \001(\003\022\t\n\001"
      "s\030\004 \001(\014\022\036\n\001t\030\n \001(\0132\023.caffe2.TensorProto\022"
      "\031\n\001n\030\010 \001(\0132\016.caffe2.NetDef\022\016\n\006floats\030\005 \003"
      "(\002\022\014\n\004ints\030\006 \003(\003\022\017\n\007strings\030\007 \003(\014\022$\n\007ten"
      "sors\030\013 \003(\0132\023.caffe2.TensorProto\022\034\n\004nets\030"
      "\t \003(\0132\016.caffe2.NetDef\022&\n\010qtensors\030\014 \003(\0132"
      "\024.caffe2.QTensorProto\"\213\001\n\014DeviceOption\022\026"
      "\n\013device_type\030\001 \001(\005:\0010\022\021\n\tdevice_id\030\002 \001("
      "\005\022\023\n\013random_seed\030\003 \001(\r\022\021\n\tnode_name\030\004 \001("
      "\t\022\024\n\014numa_node_id\030\005 \001(\005\022\022\n\nextra_info\030\006 "
      "\003(\t\"\222\002\n\013OperatorDef\022\r\n\005input\030\001 \003(\t\022\016\n\006ou"
      "tput\030\002 \003(\t\022\014\n\004name\030\003 \001(\t\022\014\n\004type\030\004 \001(\t\022\035"
      "\n\003arg\030\005 \003(\0132\020.caffe2.Argument\022+\n\rdevice_"
      "option\030\006 \001(\0132\024.caffe2.DeviceOption\022\016\n\006en"
      "gine\030\007 \001(\t\022\025\n\rcontrol_input\030\010 \003(\t\022\035\n\016is_"
      "gradient_op\030\t \001(\010:\005false\022\022\n\ndebug_info\030\n"
      " \001(\t\022\016\n\006domain\030\013 \001(\t\022\022\n\nop_version\030\014 \001(\003"
      "\"\333\001\n\006NetDef\022\014\n\004name\030\001 \001(\t\022\037\n\002op\030\002 \003(\0132\023."
      "caffe2.OperatorDef\022\014\n\004type\030\003 \001(\t\022\027\n\013num_"
      "workers\030\004 \001(\005B\002\030\001\022+\n\rdevice_option\030\005 \001(\013"
      "2\024.caffe2.DeviceOption\022\035\n\003arg\030\006 \003(\0132\020.ca"
      "ffe2.Argument\022\026\n\016external_input\030\007 \003(\t\022\027\n"
      "\017external_output\030\010 \003(\t\"\317\002\n\rExecutionStep"
      "\022\014\n\004name\030\001 \001(\t\022&\n\007substep\030\002 \003(\0132\025.caffe2"
      ".ExecutionStep\022\017\n\007network\030\003 \003(\t\022\020\n\010num_i"
      "ter\030\004 \001(\003\022\034\n\020criteria_network\030\005 \001(\tB\002\030\001\022"
      "\022\n\nreport_net\030\007 \001(\t\022\027\n\017report_interval\030\010"
      " \001(\005\022\024\n\014run_every_ms\030\013 \001(\003\022\033\n\023concurrent"
      "_substeps\030\006 \001(\010\022\030\n\020should_stop_blob\030\t \001("
      "\t\022\021\n\tonly_once\030\n \001(\010\022\030\n\020create_workspace"
      "\030\014 \001(\010\022 \n\030num_concurrent_instances\030\r \001(\005"
      "\"g\n\007PlanDef\022\014\n\004name\030\001 \001(\t\022\037\n\007network\030\002 \003"
      "(\0132\016.caffe2.NetDef\022-\n\016execution_step\030\003 \003"
      "(\0132\025.caffe2.ExecutionStep\"\272\001\n\tBlobProto\022"
      "\014\n\004name\030\001 \001(\t\022\014\n\004type\030\002 \001(\t\022#\n\006tensor\030\003 "
      "\001(\0132\023.caffe2.TensorProto\022\017\n\007content\030\004 \001("
      "\014\022%\n\007qtensor\030\005 \001(\0132\024.caffe2.QTensorProto"
      "\022\032\n\022content_num_chunks\030\006 \001(\005\022\030\n\020content_"
      "chunk_id\030\007 \001(\005\"K\n\rDBReaderProto\022\014\n\004name\030"
      "\001 \001(\t\022\016\n\006source\030\002 \001(\t\022\017\n\007db_type\030\003 \001(\t\022\013"
      "\n\003key\030\004 \001(\t*\372\001\n\017DeviceTypeProto\022\r\n\tPROTO"
      "_CPU\020\000\022\016\n\nPROTO_CUDA\020\001\022\020\n\014PROTO_MKLDNN\020\002"
      "\022\020\n\014PROTO_OPENGL\020\003\022\020\n\014PROTO_OPENCL\020\004\022\017\n\013"
      "PROTO_IDEEP\020\005\022\r\n\tPROTO_HIP\020\006\022\016\n\nPROTO_FP"
      "GA\020\007\022\017\n\013PROTO_MSNPU\020\010\022\r\n\tPROTO_XLA\020\t\022\'\n#"
      "PROTO_COMPILE_TIME_MAX_DEVICE_TYPES\020\n\022\031\n"
      "\023PROTO_ONLY_FOR_TEST\020\245\243\001"
  };
  ::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
      descriptor, 3384);
  ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
    "caffe2/proto/caffe2.proto", &protobuf_RegisterTypes);
}

void AddDescriptors() {
  static ::google::protobuf::internal::once_flag once;
  ::google::protobuf::internal::call_once(once, AddDescriptorsImpl);
}
// Force AddDescriptors() to be called at dynamic initialization time.
struct StaticDescriptorInitializer {
  StaticDescriptorInitializer() {
    AddDescriptors();
  }
} static_descriptor_initializer;
}  // namespace protobuf_caffe2_2fproto_2fcaffe2_2eproto
namespace caffe2 {
const ::google::protobuf::EnumDescriptor* ExternalDataProto_SourceType_descriptor() {
  protobuf_caffe2_2fproto_2fcaffe2_2eproto::protobuf_AssignDescriptorsOnce();
  return protobuf_caffe2_2fproto_2fcaffe2_2eproto::file_level_enum_descriptors[0];
}
bool ExternalDataProto_SourceType_IsValid(int value) {
  switch (value) {
    case 0:
    case 1:
      return true;
    default:
      return false;
  }
}

#if !defined(_MSC_VER) || _MSC_VER >= 1900
const ExternalDataProto_SourceType ExternalDataProto::INLINE_CONTAINER;
const ExternalDataProto_SourceType ExternalDataProto::SIMPLE_FILE;
const ExternalDataProto_SourceType ExternalDataProto::SourceType_MIN;
const ExternalDataProto_SourceType ExternalDataProto::SourceType_MAX;
const int ExternalDataProto::SourceType_ARRAYSIZE;
#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
const ::google::protobuf::EnumDescriptor* TensorProto_DataType_descriptor() {
  protobuf_caffe2_2fproto_2fcaffe2_2eproto::protobuf_AssignDescriptorsOnce();
  return protobuf_caffe2_2fproto_2fcaffe2_2eproto::file_level_enum_descriptors[1];
}
bool TensorProto_DataType_IsValid(int value) {
  switch (value) {
    case 0:
    case 1:
    case 2:
    case 3:
    case 4:
    case 5:
    case 6:
    case 7:
    case 8:
    case 9:
    case 10:
    case 12:
    case 13:
      return true;
    default:
      return false;
  }
}

#if !defined(_MSC_VER) || _MSC_VER >= 1900
const TensorProto_DataType TensorProto::UNDEFINED;
const TensorProto_DataType TensorProto::FLOAT;
const TensorProto_DataType TensorProto::INT32;
const TensorProto_DataType TensorProto::BYTE;
const TensorProto_DataType TensorProto::STRING;
const TensorProto_DataType TensorProto::BOOL;
const TensorProto_DataType TensorProto::UINT8;
const TensorProto_DataType TensorProto::INT8;
const TensorProto_DataType TensorProto::UINT16;
const TensorProto_DataType TensorProto::INT16;
const TensorProto_DataType TensorProto::INT64;
const TensorProto_DataType TensorProto::FLOAT16;
const TensorProto_DataType TensorProto::DOUBLE;
const TensorProto_DataType TensorProto::DataType_MIN;
const TensorProto_DataType TensorProto::DataType_MAX;
const int TensorProto::DataType_ARRAYSIZE;
#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
const ::google::protobuf::EnumDescriptor* TensorProto_StorageType_descriptor() {
  protobuf_caffe2_2fproto_2fcaffe2_2eproto::protobuf_AssignDescriptorsOnce();
  return protobuf_caffe2_2fproto_2fcaffe2_2eproto::file_level_enum_descriptors[2];
}
bool TensorProto_StorageType_IsValid(int value) {
  switch (value) {
    case 1:
    case 2:
    case 3:
    case 4:
      return true;
    default:
      return false;
  }
}

#if !defined(_MSC_VER) || _MSC_VER >= 1900
const TensorProto_StorageType TensorProto::TYPED;
const TensorProto_StorageType TensorProto::RAW;
const TensorProto_StorageType TensorProto::EXTERNAL;
const TensorProto_StorageType TensorProto::NO_CONTENT;
const TensorProto_StorageType TensorProto::StorageType_MIN;
const TensorProto_StorageType TensorProto::StorageType_MAX;
const int TensorProto::StorageType_ARRAYSIZE;
#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
const ::google::protobuf::EnumDescriptor* DeviceTypeProto_descriptor() {
  protobuf_caffe2_2fproto_2fcaffe2_2eproto::protobuf_AssignDescriptorsOnce();
  return protobuf_caffe2_2fproto_2fcaffe2_2eproto::file_level_enum_descriptors[3];
}
bool DeviceTypeProto_IsValid(int value) {
  switch (value) {
    case 0:
    case 1:
    case 2:
    case 3:
    case 4:
    case 5:
    case 6:
    case 7:
    case 8:
    case 9:
    case 10:
    case 20901:
      return true;
    default:
      return false;
  }
}


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

void ExternalDataProto::InitAsDefaultInstance() {
}
#if !defined(_MSC_VER) || _MSC_VER >= 1900
const int ExternalDataProto::kSourceTypeFieldNumber;
const int ExternalDataProto::kRecordIdFieldNumber;
const int ExternalDataProto::kRecordSizeFieldNumber;
const int ExternalDataProto::kOffsetFieldNumber;
const int ExternalDataProto::kStridesFieldNumber;
#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900

ExternalDataProto::ExternalDataProto()
  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
  ::google::protobuf::internal::InitSCC(
      &protobuf_caffe2_2fproto_2fcaffe2_2eproto::scc_info_ExternalDataProto.base);
  SharedCtor();
  // @@protoc_insertion_point(constructor:caffe2.ExternalDataProto)
}
ExternalDataProto::ExternalDataProto(const ExternalDataProto& from)
  : ::google::protobuf::Message(),
      _internal_metadata_(NULL),
      _has_bits_(from._has_bits_),
      strides_(from.strides_) {
  _internal_metadata_.MergeFrom(from._internal_metadata_);
  record_id_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  if (from.has_record_id()) {
    record_id_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.record_id_);
  }
  ::memcpy(&offset_, &from.offset_,
    static_cast<size_t>(reinterpret_cast<char*>(&source_type_) -
    reinterpret_cast<char*>(&offset_)) + sizeof(source_type_));
  // @@protoc_insertion_point(copy_constructor:caffe2.ExternalDataProto)
}

void ExternalDataProto::SharedCtor() {
  record_id_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  ::memset(&offset_, 0, static_cast<size_t>(
      reinterpret_cast<char*>(&source_type_) -
      reinterpret_cast<char*>(&offset_)) + sizeof(source_type_));
}

ExternalDataProto::~ExternalDataProto() {
  // @@protoc_insertion_point(destructor:caffe2.ExternalDataProto)
  SharedDtor();
}

void ExternalDataProto::SharedDtor() {
  record_id_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}

void ExternalDataProto::SetCachedSize(int size) const {
  _cached_size_.Set(size);
}
const ::google::protobuf::Descriptor* ExternalDataProto::descriptor() {
  ::protobuf_caffe2_2fproto_2fcaffe2_2eproto::protobuf_AssignDescriptorsOnce();
  return ::protobuf_caffe2_2fproto_2fcaffe2_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
}

const ExternalDataProto& ExternalDataProto::default_instance() {
  ::google::protobuf::internal::InitSCC(&protobuf_caffe2_2fproto_2fcaffe2_2eproto::scc_info_ExternalDataProto.base);
  return *internal_default_instance();
}


void ExternalDataProto::Clear() {
// @@protoc_insertion_point(message_clear_start:caffe2.ExternalDataProto)
  ::google::protobuf::uint32 cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  strides_.Clear();
  cached_has_bits = _has_bits_[0];
  if (cached_has_bits & 0x00000001u) {
    record_id_.ClearNonDefaultToEmptyNoArena();
  }
  if (cached_has_bits & 14u) {
    ::memset(&offset_, 0, static_cast<size_t>(
        reinterpret_cast<char*>(&source_type_) -
        reinterpret_cast<char*>(&offset_)) + sizeof(source_type_));
  }
  _has_bits_.Clear();
  _internal_metadata_.Clear();
}

bool ExternalDataProto::MergePartialFromCodedStream(
    ::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
  ::google::protobuf::uint32 tag;
  // @@protoc_insertion_point(parse_start:caffe2.ExternalDataProto)
  for (;;) {
    ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
    tag = p.first;
    if (!p.second) goto handle_unusual;
    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
      // optional .caffe2.ExternalDataProto.SourceType source_type = 1 [default = INLINE_CONTAINER];
      case 1: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) {
          int value;
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
                 input, &value)));
          if (::caffe2::ExternalDataProto_SourceType_IsValid(value)) {
            set_source_type(static_cast< ::caffe2::ExternalDataProto_SourceType >(value));
          } else {
            mutable_unknown_fields()->AddVarint(
                1, static_cast< ::google::protobuf::uint64>(value));
          }
        } else {
          goto handle_unusual;
        }
        break;
      }

      // optional string record_id = 2;
      case 2: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) {
          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
                input, this->mutable_record_id()));
          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
            this->record_id().data(), static_cast<int>(this->record_id().length()),
            ::google::protobuf::internal::WireFormat::PARSE,
            "caffe2.ExternalDataProto.record_id");
        } else {
          goto handle_unusual;
        }
        break;
      }

      // optional int64 offset = 3 [default = 0];
      case 3: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) {
          set_has_offset();
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>(
                 input, &offset_)));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // repeated int64 strides = 4;
      case 4: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(32u /* 32 & 0xFF */)) {
          DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive<
                   ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>(
                 1, 32u, input, this->mutable_strides())));
        } else if (
            static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) {
          DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline<
                   ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>(
                 input, this->mutable_strides())));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // optional uint64 record_size = 5;
      case 5: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(40u /* 40 & 0xFF */)) {
          set_has_record_size();
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_UINT64>(
                 input, &record_size_)));
        } else {
          goto handle_unusual;
        }
        break;
      }

      default: {
      handle_unusual:
        if (tag == 0) {
          goto success;
        }
        DO_(::google::protobuf::internal::WireFormat::SkipField(
              input, tag, _internal_metadata_.mutable_unknown_fields()));
        break;
      }
    }
  }
success:
  // @@protoc_insertion_point(parse_success:caffe2.ExternalDataProto)
  return true;
failure:
  // @@protoc_insertion_point(parse_failure:caffe2.ExternalDataProto)
  return false;
#undef DO_
}

void ExternalDataProto::SerializeWithCachedSizes(
    ::google::protobuf::io::CodedOutputStream* output) const {
  // @@protoc_insertion_point(serialize_start:caffe2.ExternalDataProto)
  ::google::protobuf::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  cached_has_bits = _has_bits_[0];
  // optional .caffe2.ExternalDataProto.SourceType source_type = 1 [default = INLINE_CONTAINER];
  if (cached_has_bits & 0x00000008u) {
    ::google::protobuf::internal::WireFormatLite::WriteEnum(
      1, this->source_type(), output);
  }

  // optional string record_id = 2;
  if (cached_has_bits & 0x00000001u) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->record_id().data(), static_cast<int>(this->record_id().length()),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "caffe2.ExternalDataProto.record_id");
    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
      2, this->record_id(), output);
  }

  // optional int64 offset = 3 [default = 0];
  if (cached_has_bits & 0x00000002u) {
    ::google::protobuf::internal::WireFormatLite::WriteInt64(3, this->offset(), output);
  }

  // repeated int64 strides = 4;
  for (int i = 0, n = this->strides_size(); i < n; i++) {
    ::google::protobuf::internal::WireFormatLite::WriteInt64(
      4, this->strides(i), output);
  }

  // optional uint64 record_size = 5;
  if (cached_has_bits & 0x00000004u) {
    ::google::protobuf::internal::WireFormatLite::WriteUInt64(5, this->record_size(), output);
  }

  if (_internal_metadata_.have_unknown_fields()) {
    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
        _internal_metadata_.unknown_fields(), output);
  }
  // @@protoc_insertion_point(serialize_end:caffe2.ExternalDataProto)
}

::google::protobuf::uint8* ExternalDataProto::InternalSerializeWithCachedSizesToArray(
    bool deterministic, ::google::protobuf::uint8* target) const {
  (void)deterministic; // Unused
  // @@protoc_insertion_point(serialize_to_array_start:caffe2.ExternalDataProto)
  ::google::protobuf::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  cached_has_bits = _has_bits_[0];
  // optional .caffe2.ExternalDataProto.SourceType source_type = 1 [default = INLINE_CONTAINER];
  if (cached_has_bits & 0x00000008u) {
    target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
      1, this->source_type(), target);
  }

  // optional string record_id = 2;
  if (cached_has_bits & 0x00000001u) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->record_id().data(), static_cast<int>(this->record_id().length()),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "caffe2.ExternalDataProto.record_id");
    target =
      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
        2, this->record_id(), target);
  }

  // optional int64 offset = 3 [default = 0];
  if (cached_has_bits & 0x00000002u) {
    target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(3, this->offset(), target);
  }

  // repeated int64 strides = 4;
  target = ::google::protobuf::internal::WireFormatLite::
    WriteInt64ToArray(4, this->strides_, target);

  // optional uint64 record_size = 5;
  if (cached_has_bits & 0x00000004u) {
    target = ::google::protobuf::internal::WireFormatLite::WriteUInt64ToArray(5, this->record_size(), target);
  }

  if (_internal_metadata_.have_unknown_fields()) {
    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
        _internal_metadata_.unknown_fields(), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:caffe2.ExternalDataProto)
  return target;
}

size_t ExternalDataProto::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:caffe2.ExternalDataProto)
  size_t total_size = 0;

  if (_internal_metadata_.have_unknown_fields()) {
    total_size +=
      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
        _internal_metadata_.unknown_fields());
  }
  // repeated int64 strides = 4;
  {
    size_t data_size = ::google::protobuf::internal::WireFormatLite::
      Int64Size(this->strides_);
    total_size += 1 *
                  ::google::protobuf::internal::FromIntSize(this->strides_size());
    total_size += data_size;
  }

  if (_has_bits_[0 / 32] & 15u) {
    // optional string record_id = 2;
    if (has_record_id()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::StringSize(
          this->record_id());
    }

    // optional int64 offset = 3 [default = 0];
    if (has_offset()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::Int64Size(
          this->offset());
    }

    // optional uint64 record_size = 5;
    if (has_record_size()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::UInt64Size(
          this->record_size());
    }

    // optional .caffe2.ExternalDataProto.SourceType source_type = 1 [default = INLINE_CONTAINER];
    if (has_source_type()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::EnumSize(this->source_type());
    }

  }
  int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
  SetCachedSize(cached_size);
  return total_size;
}

void ExternalDataProto::MergeFrom(const ::google::protobuf::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:caffe2.ExternalDataProto)
  GOOGLE_DCHECK_NE(&from, this);
  const ExternalDataProto* source =
      ::google::protobuf::internal::DynamicCastToGenerated<const ExternalDataProto>(
          &from);
  if (source == NULL) {
  // @@protoc_insertion_point(generalized_merge_from_cast_fail:caffe2.ExternalDataProto)
    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  } else {
  // @@protoc_insertion_point(generalized_merge_from_cast_success:caffe2.ExternalDataProto)
    MergeFrom(*source);
  }
}

void ExternalDataProto::MergeFrom(const ExternalDataProto& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:caffe2.ExternalDataProto)
  GOOGLE_DCHECK_NE(&from, this);
  _internal_metadata_.MergeFrom(from._internal_metadata_);
  ::google::protobuf::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  strides_.MergeFrom(from.strides_);
  cached_has_bits = from._has_bits_[0];
  if (cached_has_bits & 15u) {
    if (cached_has_bits & 0x00000001u) {
      set_has_record_id();
      record_id_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.record_id_);
    }
    if (cached_has_bits & 0x00000002u) {
      offset_ = from.offset_;
    }
    if (cached_has_bits & 0x00000004u) {
      record_size_ = from.record_size_;
    }
    if (cached_has_bits & 0x00000008u) {
      source_type_ = from.source_type_;
    }
    _has_bits_[0] |= cached_has_bits;
  }
}

void ExternalDataProto::CopyFrom(const ::google::protobuf::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:caffe2.ExternalDataProto)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

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

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

void ExternalDataProto::Swap(ExternalDataProto* other) {
  if (other == this) return;
  InternalSwap(other);
}
void ExternalDataProto::InternalSwap(ExternalDataProto* other) {
  using std::swap;
  strides_.InternalSwap(&other->strides_);
  record_id_.Swap(&other->record_id_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(),
    GetArenaNoVirtual());
  swap(offset_, other->offset_);
  swap(record_size_, other->record_size_);
  swap(source_type_, other->source_type_);
  swap(_has_bits_[0], other->_has_bits_[0]);
  _internal_metadata_.Swap(&other->_internal_metadata_);
}

::google::protobuf::Metadata ExternalDataProto::GetMetadata() const {
  protobuf_caffe2_2fproto_2fcaffe2_2eproto::protobuf_AssignDescriptorsOnce();
  return ::protobuf_caffe2_2fproto_2fcaffe2_2eproto::file_level_metadata[kIndexInFileMessages];
}


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

void TensorProto_Segment::InitAsDefaultInstance() {
}
#if !defined(_MSC_VER) || _MSC_VER >= 1900
const int TensorProto_Segment::kBeginFieldNumber;
const int TensorProto_Segment::kEndFieldNumber;
#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900

TensorProto_Segment::TensorProto_Segment()
  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
  ::google::protobuf::internal::InitSCC(
      &protobuf_caffe2_2fproto_2fcaffe2_2eproto::scc_info_TensorProto_Segment.base);
  SharedCtor();
  // @@protoc_insertion_point(constructor:caffe2.TensorProto.Segment)
}
TensorProto_Segment::TensorProto_Segment(const TensorProto_Segment& from)
  : ::google::protobuf::Message(),
      _internal_metadata_(NULL),
      _has_bits_(from._has_bits_) {
  _internal_metadata_.MergeFrom(from._internal_metadata_);
  ::memcpy(&begin_, &from.begin_,
    static_cast<size_t>(reinterpret_cast<char*>(&end_) -
    reinterpret_cast<char*>(&begin_)) + sizeof(end_));
  // @@protoc_insertion_point(copy_constructor:caffe2.TensorProto.Segment)
}

void TensorProto_Segment::SharedCtor() {
  ::memset(&begin_, 0, static_cast<size_t>(
      reinterpret_cast<char*>(&end_) -
      reinterpret_cast<char*>(&begin_)) + sizeof(end_));
}

TensorProto_Segment::~TensorProto_Segment() {
  // @@protoc_insertion_point(destructor:caffe2.TensorProto.Segment)
  SharedDtor();
}

void TensorProto_Segment::SharedDtor() {
}

void TensorProto_Segment::SetCachedSize(int size) const {
  _cached_size_.Set(size);
}
const ::google::protobuf::Descriptor* TensorProto_Segment::descriptor() {
  ::protobuf_caffe2_2fproto_2fcaffe2_2eproto::protobuf_AssignDescriptorsOnce();
  return ::protobuf_caffe2_2fproto_2fcaffe2_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
}

const TensorProto_Segment& TensorProto_Segment::default_instance() {
  ::google::protobuf::internal::InitSCC(&protobuf_caffe2_2fproto_2fcaffe2_2eproto::scc_info_TensorProto_Segment.base);
  return *internal_default_instance();
}


void TensorProto_Segment::Clear() {
// @@protoc_insertion_point(message_clear_start:caffe2.TensorProto.Segment)
  ::google::protobuf::uint32 cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  cached_has_bits = _has_bits_[0];
  if (cached_has_bits & 3u) {
    ::memset(&begin_, 0, static_cast<size_t>(
        reinterpret_cast<char*>(&end_) -
        reinterpret_cast<char*>(&begin_)) + sizeof(end_));
  }
  _has_bits_.Clear();
  _internal_metadata_.Clear();
}

bool TensorProto_Segment::MergePartialFromCodedStream(
    ::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
  ::google::protobuf::uint32 tag;
  // @@protoc_insertion_point(parse_start:caffe2.TensorProto.Segment)
  for (;;) {
    ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
    tag = p.first;
    if (!p.second) goto handle_unusual;
    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
      // required int64 begin = 1;
      case 1: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) {
          set_has_begin();
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>(
                 input, &begin_)));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // required int64 end = 2;
      case 2: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) {
          set_has_end();
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>(
                 input, &end_)));
        } else {
          goto handle_unusual;
        }
        break;
      }

      default: {
      handle_unusual:
        if (tag == 0) {
          goto success;
        }
        DO_(::google::protobuf::internal::WireFormat::SkipField(
              input, tag, _internal_metadata_.mutable_unknown_fields()));
        break;
      }
    }
  }
success:
  // @@protoc_insertion_point(parse_success:caffe2.TensorProto.Segment)
  return true;
failure:
  // @@protoc_insertion_point(parse_failure:caffe2.TensorProto.Segment)
  return false;
#undef DO_
}

void TensorProto_Segment::SerializeWithCachedSizes(
    ::google::protobuf::io::CodedOutputStream* output) const {
  // @@protoc_insertion_point(serialize_start:caffe2.TensorProto.Segment)
  ::google::protobuf::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  cached_has_bits = _has_bits_[0];
  // required int64 begin = 1;
  if (cached_has_bits & 0x00000001u) {
    ::google::protobuf::internal::WireFormatLite::WriteInt64(1, this->begin(), output);
  }

  // required int64 end = 2;
  if (cached_has_bits & 0x00000002u) {
    ::google::protobuf::internal::WireFormatLite::WriteInt64(2, this->end(), output);
  }

  if (_internal_metadata_.have_unknown_fields()) {
    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
        _internal_metadata_.unknown_fields(), output);
  }
  // @@protoc_insertion_point(serialize_end:caffe2.TensorProto.Segment)
}

::google::protobuf::uint8* TensorProto_Segment::InternalSerializeWithCachedSizesToArray(
    bool deterministic, ::google::protobuf::uint8* target) const {
  (void)deterministic; // Unused
  // @@protoc_insertion_point(serialize_to_array_start:caffe2.TensorProto.Segment)
  ::google::protobuf::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  cached_has_bits = _has_bits_[0];
  // required int64 begin = 1;
  if (cached_has_bits & 0x00000001u) {
    target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(1, this->begin(), target);
  }

  // required int64 end = 2;
  if (cached_has_bits & 0x00000002u) {
    target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(2, this->end(), target);
  }

  if (_internal_metadata_.have_unknown_fields()) {
    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
        _internal_metadata_.unknown_fields(), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:caffe2.TensorProto.Segment)
  return target;
}

size_t TensorProto_Segment::RequiredFieldsByteSizeFallback() const {
// @@protoc_insertion_point(required_fields_byte_size_fallback_start:caffe2.TensorProto.Segment)
  size_t total_size = 0;

  if (has_begin()) {
    // required int64 begin = 1;
    total_size += 1 +
      ::google::protobuf::internal::WireFormatLite::Int64Size(
        this->begin());
  }

  if (has_end()) {
    // required int64 end = 2;
    total_size += 1 +
      ::google::protobuf::internal::WireFormatLite::Int64Size(
        this->end());
  }

  return total_size;
}
size_t TensorProto_Segment::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:caffe2.TensorProto.Segment)
  size_t total_size = 0;

  if (_internal_metadata_.have_unknown_fields()) {
    total_size +=
      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
        _internal_metadata_.unknown_fields());
  }
  if (((_has_bits_[0] & 0x00000003) ^ 0x00000003) == 0) {  // All required fields are present.
    // required int64 begin = 1;
    total_size += 1 +
      ::google::protobuf::internal::WireFormatLite::Int64Size(
        this->begin());

    // required int64 end = 2;
    total_size += 1 +
      ::google::protobuf::internal::WireFormatLite::Int64Size(
        this->end());

  } else {
    total_size += RequiredFieldsByteSizeFallback();
  }
  int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
  SetCachedSize(cached_size);
  return total_size;
}

void TensorProto_Segment::MergeFrom(const ::google::protobuf::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:caffe2.TensorProto.Segment)
  GOOGLE_DCHECK_NE(&from, this);
  const TensorProto_Segment* source =
      ::google::protobuf::internal::DynamicCastToGenerated<const TensorProto_Segment>(
          &from);
  if (source == NULL) {
  // @@protoc_insertion_point(generalized_merge_from_cast_fail:caffe2.TensorProto.Segment)
    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  } else {
  // @@protoc_insertion_point(generalized_merge_from_cast_success:caffe2.TensorProto.Segment)
    MergeFrom(*source);
  }
}

void TensorProto_Segment::MergeFrom(const TensorProto_Segment& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:caffe2.TensorProto.Segment)
  GOOGLE_DCHECK_NE(&from, this);
  _internal_metadata_.MergeFrom(from._internal_metadata_);
  ::google::protobuf::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  cached_has_bits = from._has_bits_[0];
  if (cached_has_bits & 3u) {
    if (cached_has_bits & 0x00000001u) {
      begin_ = from.begin_;
    }
    if (cached_has_bits & 0x00000002u) {
      end_ = from.end_;
    }
    _has_bits_[0] |= cached_has_bits;
  }
}

void TensorProto_Segment::CopyFrom(const ::google::protobuf::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:caffe2.TensorProto.Segment)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

void TensorProto_Segment::CopyFrom(const TensorProto_Segment& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:caffe2.TensorProto.Segment)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool TensorProto_Segment::IsInitialized() const {
  if ((_has_bits_[0] & 0x00000003) != 0x00000003) return false;
  return true;
}

void TensorProto_Segment::Swap(TensorProto_Segment* other) {
  if (other == this) return;
  InternalSwap(other);
}
void TensorProto_Segment::InternalSwap(TensorProto_Segment* other) {
  using std::swap;
  swap(begin_, other->begin_);
  swap(end_, other->end_);
  swap(_has_bits_[0], other->_has_bits_[0]);
  _internal_metadata_.Swap(&other->_internal_metadata_);
}

::google::protobuf::Metadata TensorProto_Segment::GetMetadata() const {
  protobuf_caffe2_2fproto_2fcaffe2_2eproto::protobuf_AssignDescriptorsOnce();
  return ::protobuf_caffe2_2fproto_2fcaffe2_2eproto::file_level_metadata[kIndexInFileMessages];
}


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

void TensorProto::InitAsDefaultInstance() {
  ::caffe2::_TensorProto_default_instance_._instance.get_mutable()->external_data_ = const_cast< ::caffe2::ExternalDataProto*>(
      ::caffe2::ExternalDataProto::internal_default_instance());
  ::caffe2::_TensorProto_default_instance_._instance.get_mutable()->device_detail_ = const_cast< ::caffe2::DeviceOption*>(
      ::caffe2::DeviceOption::internal_default_instance());
  ::caffe2::_TensorProto_default_instance_._instance.get_mutable()->segment_ = const_cast< ::caffe2::TensorProto_Segment*>(
      ::caffe2::TensorProto_Segment::internal_default_instance());
}
#if !defined(_MSC_VER) || _MSC_VER >= 1900
const int TensorProto::kDimsFieldNumber;
const int TensorProto::kDataTypeFieldNumber;
const int TensorProto::kStorageTypeFieldNumber;
const int TensorProto::kFloatDataFieldNumber;
const int TensorProto::kInt32DataFieldNumber;
const int TensorProto::kByteDataFieldNumber;
const int TensorProto::kStringDataFieldNumber;
const int TensorProto::kDoubleDataFieldNumber;
const int TensorProto::kInt64DataFieldNumber;
const int TensorProto::kRawDataFieldNumber;
const int TensorProto::kExternalDataFieldNumber;
const int TensorProto::kNameFieldNumber;
const int TensorProto::kDeviceDetailFieldNumber;
const int TensorProto::kSegmentFieldNumber;
#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900

TensorProto::TensorProto()
  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
  ::google::protobuf::internal::InitSCC(
      &protobuf_caffe2_2fproto_2fcaffe2_2eproto::scc_info_TensorProto.base);
  SharedCtor();
  // @@protoc_insertion_point(constructor:caffe2.TensorProto)
}
TensorProto::TensorProto(const TensorProto& from)
  : ::google::protobuf::Message(),
      _internal_metadata_(NULL),
      _has_bits_(from._has_bits_),
      dims_(from.dims_),
      float_data_(from.float_data_),
      int32_data_(from.int32_data_),
      string_data_(from.string_data_),
      double_data_(from.double_data_),
      int64_data_(from.int64_data_) {
  _internal_metadata_.MergeFrom(from._internal_metadata_);
  byte_data_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  if (from.has_byte_data()) {
    byte_data_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.byte_data_);
  }
  name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  if (from.has_name()) {
    name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name_);
  }
  raw_data_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  if (from.has_raw_data()) {
    raw_data_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.raw_data_);
  }
  if (from.has_device_detail()) {
    device_detail_ = new ::caffe2::DeviceOption(*from.device_detail_);
  } else {
    device_detail_ = NULL;
  }
  if (from.has_segment()) {
    segment_ = new ::caffe2::TensorProto_Segment(*from.segment_);
  } else {
    segment_ = NULL;
  }
  if (from.has_external_data()) {
    external_data_ = new ::caffe2::ExternalDataProto(*from.external_data_);
  } else {
    external_data_ = NULL;
  }
  ::memcpy(&data_type_, &from.data_type_,
    static_cast<size_t>(reinterpret_cast<char*>(&storage_type_) -
    reinterpret_cast<char*>(&data_type_)) + sizeof(storage_type_));
  // @@protoc_insertion_point(copy_constructor:caffe2.TensorProto)
}

void TensorProto::SharedCtor() {
  byte_data_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  raw_data_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  ::memset(&device_detail_, 0, static_cast<size_t>(
      reinterpret_cast<char*>(&external_data_) -
      reinterpret_cast<char*>(&device_detail_)) + sizeof(external_data_));
  data_type_ = 1;
  storage_type_ = 1;
}

TensorProto::~TensorProto() {
  // @@protoc_insertion_point(destructor:caffe2.TensorProto)
  SharedDtor();
}

void TensorProto::SharedDtor() {
  byte_data_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  raw_data_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  if (this != internal_default_instance()) delete device_detail_;
  if (this != internal_default_instance()) delete segment_;
  if (this != internal_default_instance()) delete external_data_;
}

void TensorProto::SetCachedSize(int size) const {
  _cached_size_.Set(size);
}
const ::google::protobuf::Descriptor* TensorProto::descriptor() {
  ::protobuf_caffe2_2fproto_2fcaffe2_2eproto::protobuf_AssignDescriptorsOnce();
  return ::protobuf_caffe2_2fproto_2fcaffe2_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
}

const TensorProto& TensorProto::default_instance() {
  ::google::protobuf::internal::InitSCC(&protobuf_caffe2_2fproto_2fcaffe2_2eproto::scc_info_TensorProto.base);
  return *internal_default_instance();
}


void TensorProto::Clear() {
// @@protoc_insertion_point(message_clear_start:caffe2.TensorProto)
  ::google::protobuf::uint32 cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  dims_.Clear();
  float_data_.Clear();
  int32_data_.Clear();
  string_data_.Clear();
  double_data_.Clear();
  int64_data_.Clear();
  cached_has_bits = _has_bits_[0];
  if (cached_has_bits & 255u) {
    if (cached_has_bits & 0x00000001u) {
      byte_data_.ClearNonDefaultToEmptyNoArena();
    }
    if (cached_has_bits & 0x00000002u) {
      name_.ClearNonDefaultToEmptyNoArena();
    }
    if (cached_has_bits & 0x00000004u) {
      raw_data_.ClearNonDefaultToEmptyNoArena();
    }
    if (cached_has_bits & 0x00000008u) {
      GOOGLE_DCHECK(device_detail_ != NULL);
      device_detail_->Clear();
    }
    if (cached_has_bits & 0x00000010u) {
      GOOGLE_DCHECK(segment_ != NULL);
      segment_->Clear();
    }
    if (cached_has_bits & 0x00000020u) {
      GOOGLE_DCHECK(external_data_ != NULL);
      external_data_->Clear();
    }
    data_type_ = 1;
    storage_type_ = 1;
  }
  _has_bits_.Clear();
  _internal_metadata_.Clear();
}

bool TensorProto::MergePartialFromCodedStream(
    ::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
  ::google::protobuf::uint32 tag;
  // @@protoc_insertion_point(parse_start:caffe2.TensorProto)
  for (;;) {
    ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
    tag = p.first;
    if (!p.second) goto handle_unusual;
    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
      // repeated int64 dims = 1;
      case 1: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) {
          DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive<
                   ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>(
                 1, 8u, input, this->mutable_dims())));
        } else if (
            static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
          DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline<
                   ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>(
                 input, this->mutable_dims())));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // optional .caffe2.TensorProto.DataType data_type = 2 [default = FLOAT];
      case 2: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) {
          int value;
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
                 input, &value)));
          if (::caffe2::TensorProto_DataType_IsValid(value)) {
            set_data_type(static_cast< ::caffe2::TensorProto_DataType >(value));
          } else {
            mutable_unknown_fields()->AddVarint(
                2, static_cast< ::google::protobuf::uint64>(value));
          }
        } else {
          goto handle_unusual;
        }
        break;
      }

      // repeated float float_data = 3 [packed = true];
      case 3: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) {
          DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive<
                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
                 input, this->mutable_float_data())));
        } else if (
            static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(29u /* 29 & 0xFF */)) {
          DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline<
                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
                 1, 26u, input, this->mutable_float_data())));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // repeated int32 int32_data = 4 [packed = true];
      case 4: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) {
          DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive<
                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
                 input, this->mutable_int32_data())));
        } else if (
            static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(32u /* 32 & 0xFF */)) {
          DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline<
                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
                 1, 34u, input, this->mutable_int32_data())));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // optional bytes byte_data = 5;
      case 5: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(42u /* 42 & 0xFF */)) {
          DO_(::google::protobuf::internal::WireFormatLite::ReadBytes(
                input, this->mutable_byte_data()));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // repeated bytes string_data = 6;
      case 6: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(50u /* 50 & 0xFF */)) {
          DO_(::google::protobuf::internal::WireFormatLite::ReadBytes(
                input, this->add_string_data()));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // optional string name = 7;
      case 7: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(58u /* 58 & 0xFF */)) {
          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
                input, this->mutable_name()));
          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
            this->name().data(), static_cast<int>(this->name().length()),
            ::google::protobuf::internal::WireFormat::PARSE,
            "caffe2.TensorProto.name");
        } else {
          goto handle_unusual;
        }
        break;
      }

      // optional .caffe2.DeviceOption device_detail = 8;
      case 8: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(66u /* 66 & 0xFF */)) {
          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
               input, mutable_device_detail()));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // repeated double double_data = 9 [packed = true];
      case 9: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(74u /* 74 & 0xFF */)) {
          DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive<
                   double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>(
                 input, this->mutable_double_data())));
        } else if (
            static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(73u /* 73 & 0xFF */)) {
          DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline<
                   double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>(
                 1, 74u, input, this->mutable_double_data())));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // repeated int64 int64_data = 10 [packed = true];
      case 10: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(82u /* 82 & 0xFF */)) {
          DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive<
                   ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>(
                 input, this->mutable_int64_data())));
        } else if (
            static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(80u /* 80 & 0xFF */)) {
          DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline<
                   ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>(
                 1, 82u, input, this->mutable_int64_data())));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // optional .caffe2.TensorProto.Segment segment = 11;
      case 11: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(90u /* 90 & 0xFF */)) {
          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
               input, mutable_segment()));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // optional .caffe2.TensorProto.StorageType storage_type = 12 [default = TYPED];
      case 12: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(96u /* 96 & 0xFF */)) {
          int value;
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
                 input, &value)));
          if (::caffe2::TensorProto_StorageType_IsValid(value)) {
            set_storage_type(static_cast< ::caffe2::TensorProto_StorageType >(value));
          } else {
            mutable_unknown_fields()->AddVarint(
                12, static_cast< ::google::protobuf::uint64>(value));
          }
        } else {
          goto handle_unusual;
        }
        break;
      }

      // optional bytes raw_data = 13;
      case 13: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(106u /* 106 & 0xFF */)) {
          DO_(::google::protobuf::internal::WireFormatLite::ReadBytes(
                input, this->mutable_raw_data()));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // optional .caffe2.ExternalDataProto external_data = 14;
      case 14: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(114u /* 114 & 0xFF */)) {
          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
               input, mutable_external_data()));
        } else {
          goto handle_unusual;
        }
        break;
      }

      default: {
      handle_unusual:
        if (tag == 0) {
          goto success;
        }
        DO_(::google::protobuf::internal::WireFormat::SkipField(
              input, tag, _internal_metadata_.mutable_unknown_fields()));
        break;
      }
    }
  }
success:
  // @@protoc_insertion_point(parse_success:caffe2.TensorProto)
  return true;
failure:
  // @@protoc_insertion_point(parse_failure:caffe2.TensorProto)
  return false;
#undef DO_
}

void TensorProto::SerializeWithCachedSizes(
    ::google::protobuf::io::CodedOutputStream* output) const {
  // @@protoc_insertion_point(serialize_start:caffe2.TensorProto)
  ::google::protobuf::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  // repeated int64 dims = 1;
  for (int i = 0, n = this->dims_size(); i < n; i++) {
    ::google::protobuf::internal::WireFormatLite::WriteInt64(
      1, this->dims(i), output);
  }

  cached_has_bits = _has_bits_[0];
  // optional .caffe2.TensorProto.DataType data_type = 2 [default = FLOAT];
  if (cached_has_bits & 0x00000040u) {
    ::google::protobuf::internal::WireFormatLite::WriteEnum(
      2, this->data_type(), output);
  }

  // repeated float float_data = 3 [packed = true];
  if (this->float_data_size() > 0) {
    ::google::protobuf::internal::WireFormatLite::WriteTag(3, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output);
    output->WriteVarint32(static_cast< ::google::protobuf::uint32>(
        _float_data_cached_byte_size_));
    ::google::protobuf::internal::WireFormatLite::WriteFloatArray(
      this->float_data().data(), this->float_data_size(), output);
  }

  // repeated int32 int32_data = 4 [packed = true];
  if (this->int32_data_size() > 0) {
    ::google::protobuf::internal::WireFormatLite::WriteTag(4, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output);
    output->WriteVarint32(static_cast< ::google::protobuf::uint32>(
        _int32_data_cached_byte_size_));
  }
  for (int i = 0, n = this->int32_data_size(); i < n; i++) {
    ::google::protobuf::internal::WireFormatLite::WriteInt32NoTag(
      this->int32_data(i), output);
  }

  // optional bytes byte_data = 5;
  if (cached_has_bits & 0x00000001u) {
    ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased(
      5, this->byte_data(), output);
  }

  // repeated bytes string_data = 6;
  for (int i = 0, n = this->string_data_size(); i < n; i++) {
    ::google::protobuf::internal::WireFormatLite::WriteBytes(
      6, this->string_data(i), output);
  }

  // optional string name = 7;
  if (cached_has_bits & 0x00000002u) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->name().data(), static_cast<int>(this->name().length()),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "caffe2.TensorProto.name");
    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
      7, this->name(), output);
  }

  // optional .caffe2.DeviceOption device_detail = 8;
  if (cached_has_bits & 0x00000008u) {
    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
      8, this->_internal_device_detail(), output);
  }

  // repeated double double_data = 9 [packed = true];
  if (this->double_data_size() > 0) {
    ::google::protobuf::internal::WireFormatLite::WriteTag(9, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output);
    output->WriteVarint32(static_cast< ::google::protobuf::uint32>(
        _double_data_cached_byte_size_));
    ::google::protobuf::internal::WireFormatLite::WriteDoubleArray(
      this->double_data().data(), this->double_data_size(), output);
  }

  // repeated int64 int64_data = 10 [packed = true];
  if (this->int64_data_size() > 0) {
    ::google::protobuf::internal::WireFormatLite::WriteTag(10, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output);
    output->WriteVarint32(static_cast< ::google::protobuf::uint32>(
        _int64_data_cached_byte_size_));
  }
  for (int i = 0, n = this->int64_data_size(); i < n; i++) {
    ::google::protobuf::internal::WireFormatLite::WriteInt64NoTag(
      this->int64_data(i), output);
  }

  // optional .caffe2.TensorProto.Segment segment = 11;
  if (cached_has_bits & 0x00000010u) {
    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
      11, this->_internal_segment(), output);
  }

  // optional .caffe2.TensorProto.StorageType storage_type = 12 [default = TYPED];
  if (cached_has_bits & 0x00000080u) {
    ::google::protobuf::internal::WireFormatLite::WriteEnum(
      12, this->storage_type(), output);
  }

  // optional bytes raw_data = 13;
  if (cached_has_bits & 0x00000004u) {
    ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased(
      13, this->raw_data(), output);
  }

  // optional .caffe2.ExternalDataProto external_data = 14;
  if (cached_has_bits & 0x00000020u) {
    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
      14, this->_internal_external_data(), output);
  }

  if (_internal_metadata_.have_unknown_fields()) {
    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
        _internal_metadata_.unknown_fields(), output);
  }
  // @@protoc_insertion_point(serialize_end:caffe2.TensorProto)
}

::google::protobuf::uint8* TensorProto::InternalSerializeWithCachedSizesToArray(
    bool deterministic, ::google::protobuf::uint8* target) const {
  (void)deterministic; // Unused
  // @@protoc_insertion_point(serialize_to_array_start:caffe2.TensorProto)
  ::google::protobuf::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  // repeated int64 dims = 1;
  target = ::google::protobuf::internal::WireFormatLite::
    WriteInt64ToArray(1, this->dims_, target);

  cached_has_bits = _has_bits_[0];
  // optional .caffe2.TensorProto.DataType data_type = 2 [default = FLOAT];
  if (cached_has_bits & 0x00000040u) {
    target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
      2, this->data_type(), target);
  }

  // repeated float float_data = 3 [packed = true];
  if (this->float_data_size() > 0) {
    target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray(
      3,
      ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED,
      target);
    target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray(
        static_cast< ::google::protobuf::int32>(
            _float_data_cached_byte_size_), target);
    target = ::google::protobuf::internal::WireFormatLite::
      WriteFloatNoTagToArray(this->float_data_, target);
  }

  // repeated int32 int32_data = 4 [packed = true];
  if (this->int32_data_size() > 0) {
    target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray(
      4,
      ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED,
      target);
    target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray(
        static_cast< ::google::protobuf::int32>(
            _int32_data_cached_byte_size_), target);
    target = ::google::protobuf::internal::WireFormatLite::
      WriteInt32NoTagToArray(this->int32_data_, target);
  }

  // optional bytes byte_data = 5;
  if (cached_has_bits & 0x00000001u) {
    target =
      ::google::protobuf::internal::WireFormatLite::WriteBytesToArray(
        5, this->byte_data(), target);
  }

  // repeated bytes string_data = 6;
  for (int i = 0, n = this->string_data_size(); i < n; i++) {
    target = ::google::protobuf::internal::WireFormatLite::
      WriteBytesToArray(6, this->string_data(i), target);
  }

  // optional string name = 7;
  if (cached_has_bits & 0x00000002u) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->name().data(), static_cast<int>(this->name().length()),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "caffe2.TensorProto.name");
    target =
      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
        7, this->name(), target);
  }

  // optional .caffe2.DeviceOption device_detail = 8;
  if (cached_has_bits & 0x00000008u) {
    target = ::google::protobuf::internal::WireFormatLite::
      InternalWriteMessageToArray(
        8, this->_internal_device_detail(), deterministic, target);
  }

  // repeated double double_data = 9 [packed = true];
  if (this->double_data_size() > 0) {
    target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray(
      9,
      ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED,
      target);
    target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray(
        static_cast< ::google::protobuf::int32>(
            _double_data_cached_byte_size_), target);
    target = ::google::protobuf::internal::WireFormatLite::
      WriteDoubleNoTagToArray(this->double_data_, target);
  }

  // repeated int64 int64_data = 10 [packed = true];
  if (this->int64_data_size() > 0) {
    target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray(
      10,
      ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED,
      target);
    target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray(
        static_cast< ::google::protobuf::int32>(
            _int64_data_cached_byte_size_), target);
    target = ::google::protobuf::internal::WireFormatLite::
      WriteInt64NoTagToArray(this->int64_data_, target);
  }

  // optional .caffe2.TensorProto.Segment segment = 11;
  if (cached_has_bits & 0x00000010u) {
    target = ::google::protobuf::internal::WireFormatLite::
      InternalWriteMessageToArray(
        11, this->_internal_segment(), deterministic, target);
  }

  // optional .caffe2.TensorProto.StorageType storage_type = 12 [default = TYPED];
  if (cached_has_bits & 0x00000080u) {
    target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
      12, this->storage_type(), target);
  }

  // optional bytes raw_data = 13;
  if (cached_has_bits & 0x00000004u) {
    target =
      ::google::protobuf::internal::WireFormatLite::WriteBytesToArray(
        13, this->raw_data(), target);
  }

  // optional .caffe2.ExternalDataProto external_data = 14;
  if (cached_has_bits & 0x00000020u) {
    target = ::google::protobuf::internal::WireFormatLite::
      InternalWriteMessageToArray(
        14, this->_internal_external_data(), deterministic, target);
  }

  if (_internal_metadata_.have_unknown_fields()) {
    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
        _internal_metadata_.unknown_fields(), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:caffe2.TensorProto)
  return target;
}

size_t TensorProto::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:caffe2.TensorProto)
  size_t total_size = 0;

  if (_internal_metadata_.have_unknown_fields()) {
    total_size +=
      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
        _internal_metadata_.unknown_fields());
  }
  // repeated int64 dims = 1;
  {
    size_t data_size = ::google::protobuf::internal::WireFormatLite::
      Int64Size(this->dims_);
    total_size += 1 *
                  ::google::protobuf::internal::FromIntSize(this->dims_size());
    total_size += data_size;
  }

  // repeated float float_data = 3 [packed = true];
  {
    unsigned int count = static_cast<unsigned int>(this->float_data_size());
    size_t data_size = 4UL * count;
    if (data_size > 0) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::Int32Size(
            static_cast< ::google::protobuf::int32>(data_size));
    }
    int cached_size = ::google::protobuf::internal::ToCachedSize(data_size);
    GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
    _float_data_cached_byte_size_ = cached_size;
    GOOGLE_SAFE_CONCURRENT_WRITES_END();
    total_size += data_size;
  }

  // repeated int32 int32_data = 4 [packed = true];
  {
    size_t data_size = ::google::protobuf::internal::WireFormatLite::
      Int32Size(this->int32_data_);
    if (data_size > 0) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::Int32Size(
            static_cast< ::google::protobuf::int32>(data_size));
    }
    int cached_size = ::google::protobuf::internal::ToCachedSize(data_size);
    GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
    _int32_data_cached_byte_size_ = cached_size;
    GOOGLE_SAFE_CONCURRENT_WRITES_END();
    total_size += data_size;
  }

  // repeated bytes string_data = 6;
  total_size += 1 *
      ::google::protobuf::internal::FromIntSize(this->string_data_size());
  for (int i = 0, n = this->string_data_size(); i < n; i++) {
    total_size += ::google::protobuf::internal::WireFormatLite::BytesSize(
      this->string_data(i));
  }

  // repeated double double_data = 9 [packed = true];
  {
    unsigned int count = static_cast<unsigned int>(this->double_data_size());
    size_t data_size = 8UL * count;
    if (data_size > 0) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::Int32Size(
            static_cast< ::google::protobuf::int32>(data_size));
    }
    int cached_size = ::google::protobuf::internal::ToCachedSize(data_size);
    GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
    _double_data_cached_byte_size_ = cached_size;
    GOOGLE_SAFE_CONCURRENT_WRITES_END();
    total_size += data_size;
  }

  // repeated int64 int64_data = 10 [packed = true];
  {
    size_t data_size = ::google::protobuf::internal::WireFormatLite::
      Int64Size(this->int64_data_);
    if (data_size > 0) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::Int32Size(
            static_cast< ::google::protobuf::int32>(data_size));
    }
    int cached_size = ::google::protobuf::internal::ToCachedSize(data_size);
    GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
    _int64_data_cached_byte_size_ = cached_size;
    GOOGLE_SAFE_CONCURRENT_WRITES_END();
    total_size += data_size;
  }

  if (_has_bits_[0 / 32] & 255u) {
    // optional bytes byte_data = 5;
    if (has_byte_data()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::BytesSize(
          this->byte_data());
    }

    // optional string name = 7;
    if (has_name()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::StringSize(
          this->name());
    }

    // optional bytes raw_data = 13;
    if (has_raw_data()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::BytesSize(
          this->raw_data());
    }

    // optional .caffe2.DeviceOption device_detail = 8;
    if (has_device_detail()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::MessageSize(
          *device_detail_);
    }

    // optional .caffe2.TensorProto.Segment segment = 11;
    if (has_segment()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::MessageSize(
          *segment_);
    }

    // optional .caffe2.ExternalDataProto external_data = 14;
    if (has_external_data()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::MessageSize(
          *external_data_);
    }

    // optional .caffe2.TensorProto.DataType data_type = 2 [default = FLOAT];
    if (has_data_type()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::EnumSize(this->data_type());
    }

    // optional .caffe2.TensorProto.StorageType storage_type = 12 [default = TYPED];
    if (has_storage_type()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::EnumSize(this->storage_type());
    }

  }
  int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
  SetCachedSize(cached_size);
  return total_size;
}

void TensorProto::MergeFrom(const ::google::protobuf::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:caffe2.TensorProto)
  GOOGLE_DCHECK_NE(&from, this);
  const TensorProto* source =
      ::google::protobuf::internal::DynamicCastToGenerated<const TensorProto>(
          &from);
  if (source == NULL) {
  // @@protoc_insertion_point(generalized_merge_from_cast_fail:caffe2.TensorProto)
    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  } else {
  // @@protoc_insertion_point(generalized_merge_from_cast_success:caffe2.TensorProto)
    MergeFrom(*source);
  }
}

void TensorProto::MergeFrom(const TensorProto& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:caffe2.TensorProto)
  GOOGLE_DCHECK_NE(&from, this);
  _internal_metadata_.MergeFrom(from._internal_metadata_);
  ::google::protobuf::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  dims_.MergeFrom(from.dims_);
  float_data_.MergeFrom(from.float_data_);
  int32_data_.MergeFrom(from.int32_data_);
  string_data_.MergeFrom(from.string_data_);
  double_data_.MergeFrom(from.double_data_);
  int64_data_.MergeFrom(from.int64_data_);
  cached_has_bits = from._has_bits_[0];
  if (cached_has_bits & 255u) {
    if (cached_has_bits & 0x00000001u) {
      set_has_byte_data();
      byte_data_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.byte_data_);
    }
    if (cached_has_bits & 0x00000002u) {
      set_has_name();
      name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name_);
    }
    if (cached_has_bits & 0x00000004u) {
      set_has_raw_data();
      raw_data_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.raw_data_);
    }
    if (cached_has_bits & 0x00000008u) {
      mutable_device_detail()->::caffe2::DeviceOption::MergeFrom(from.device_detail());
    }
    if (cached_has_bits & 0x00000010u) {
      mutable_segment()->::caffe2::TensorProto_Segment::MergeFrom(from.segment());
    }
    if (cached_has_bits & 0x00000020u) {
      mutable_external_data()->::caffe2::ExternalDataProto::MergeFrom(from.external_data());
    }
    if (cached_has_bits & 0x00000040u) {
      data_type_ = from.data_type_;
    }
    if (cached_has_bits & 0x00000080u) {
      storage_type_ = from.storage_type_;
    }
    _has_bits_[0] |= cached_has_bits;
  }
}

void TensorProto::CopyFrom(const ::google::protobuf::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:caffe2.TensorProto)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

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

bool TensorProto::IsInitialized() const {
  if (has_segment()) {
    if (!this->segment_->IsInitialized()) return false;
  }
  return true;
}

void TensorProto::Swap(TensorProto* other) {
  if (other == this) return;
  InternalSwap(other);
}
void TensorProto::InternalSwap(TensorProto* other) {
  using std::swap;
  dims_.InternalSwap(&other->dims_);
  float_data_.InternalSwap(&other->float_data_);
  int32_data_.InternalSwap(&other->int32_data_);
  string_data_.InternalSwap(CastToBase(&other->string_data_));
  double_data_.InternalSwap(&other->double_data_);
  int64_data_.InternalSwap(&other->int64_data_);
  byte_data_.Swap(&other->byte_data_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(),
    GetArenaNoVirtual());
  name_.Swap(&other->name_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(),
    GetArenaNoVirtual());
  raw_data_.Swap(&other->raw_data_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(),
    GetArenaNoVirtual());
  swap(device_detail_, other->device_detail_);
  swap(segment_, other->segment_);
  swap(external_data_, other->external_data_);
  swap(data_type_, other->data_type_);
  swap(storage_type_, other->storage_type_);
  swap(_has_bits_[0], other->_has_bits_[0]);
  _internal_metadata_.Swap(&other->_internal_metadata_);
}

::google::protobuf::Metadata TensorProto::GetMetadata() const {
  protobuf_caffe2_2fproto_2fcaffe2_2eproto::protobuf_AssignDescriptorsOnce();
  return ::protobuf_caffe2_2fproto_2fcaffe2_2eproto::file_level_metadata[kIndexInFileMessages];
}


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

void QTensorProto::InitAsDefaultInstance() {
}
#if !defined(_MSC_VER) || _MSC_VER >= 1900
const int QTensorProto::kDimsFieldNumber;
const int QTensorProto::kPrecisionFieldNumber;
const int QTensorProto::kScaleFieldNumber;
const int QTensorProto::kBiasFieldNumber;
const int QTensorProto::kIsSignedFieldNumber;
const int QTensorProto::kDataFieldNumber;
const int QTensorProto::kNameFieldNumber;
const int QTensorProto::kDataTypeFieldNumber;
const int QTensorProto::kScalesFieldNumber;
const int QTensorProto::kBiasesFieldNumber;
const int QTensorProto::kAxisFieldNumber;
const int QTensorProto::kIsMultiparamFieldNumber;
#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900

QTensorProto::QTensorProto()
  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
  ::google::protobuf::internal::InitSCC(
      &protobuf_caffe2_2fproto_2fcaffe2_2eproto::scc_info_QTensorProto.base);
  SharedCtor();
  // @@protoc_insertion_point(constructor:caffe2.QTensorProto)
}
QTensorProto::QTensorProto(const QTensorProto& from)
  : ::google::protobuf::Message(),
      _internal_metadata_(NULL),
      _has_bits_(from._has_bits_),
      dims_(from.dims_),
      data_(from.data_),
      scales_(from.scales_),
      biases_(from.biases_) {
  _internal_metadata_.MergeFrom(from._internal_metadata_);
  name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  if (from.has_name()) {
    name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name_);
  }
  ::memcpy(&scale_, &from.scale_,
    static_cast<size_t>(reinterpret_cast<char*>(&data_type_) -
    reinterpret_cast<char*>(&scale_)) + sizeof(data_type_));
  // @@protoc_insertion_point(copy_constructor:caffe2.QTensorProto)
}

void QTensorProto::SharedCtor() {
  name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  ::memset(&scale_, 0, static_cast<size_t>(
      reinterpret_cast<char*>(&axis_) -
      reinterpret_cast<char*>(&scale_)) + sizeof(axis_));
  data_type_ = 2;
}

QTensorProto::~QTensorProto() {
  // @@protoc_insertion_point(destructor:caffe2.QTensorProto)
  SharedDtor();
}

void QTensorProto::SharedDtor() {
  name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}

void QTensorProto::SetCachedSize(int size) const {
  _cached_size_.Set(size);
}
const ::google::protobuf::Descriptor* QTensorProto::descriptor() {
  ::protobuf_caffe2_2fproto_2fcaffe2_2eproto::protobuf_AssignDescriptorsOnce();
  return ::protobuf_caffe2_2fproto_2fcaffe2_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
}

const QTensorProto& QTensorProto::default_instance() {
  ::google::protobuf::internal::InitSCC(&protobuf_caffe2_2fproto_2fcaffe2_2eproto::scc_info_QTensorProto.base);
  return *internal_default_instance();
}


void QTensorProto::Clear() {
// @@protoc_insertion_point(message_clear_start:caffe2.QTensorProto)
  ::google::protobuf::uint32 cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  dims_.Clear();
  data_.Clear();
  scales_.Clear();
  biases_.Clear();
  cached_has_bits = _has_bits_[0];
  if (cached_has_bits & 0x00000001u) {
    name_.ClearNonDefaultToEmptyNoArena();
  }
  if (cached_has_bits & 254u) {
    ::memset(&scale_, 0, static_cast<size_t>(
        reinterpret_cast<char*>(&axis_) -
        reinterpret_cast<char*>(&scale_)) + sizeof(axis_));
    data_type_ = 2;
  }
  _has_bits_.Clear();
  _internal_metadata_.Clear();
}

bool QTensorProto::MergePartialFromCodedStream(
    ::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
  ::google::protobuf::uint32 tag;
  // @@protoc_insertion_point(parse_start:caffe2.QTensorProto)
  for (;;) {
    ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
    tag = p.first;
    if (!p.second) goto handle_unusual;
    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
      // repeated int64 dims = 1;
      case 1: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) {
          DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive<
                   ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>(
                 1, 8u, input, this->mutable_dims())));
        } else if (
            static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
          DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline<
                   ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>(
                 input, this->mutable_dims())));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // required int32 precision = 2;
      case 2: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) {
          set_has_precision();
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
                 input, &precision_)));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // required double scale = 3;
      case 3: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(25u /* 25 & 0xFF */)) {
          set_has_scale();
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>(
                 input, &scale_)));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // required double bias = 4;
      case 4: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(33u /* 33 & 0xFF */)) {
          set_has_bias();
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>(
                 input, &bias_)));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // required bool is_signed = 5;
      case 5: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(40u /* 40 & 0xFF */)) {
          set_has_is_signed();
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
                 input, &is_signed_)));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // repeated int32 data = 6 [packed = true];
      case 6: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(50u /* 50 & 0xFF */)) {
          DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive<
                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
                 input, this->mutable_data())));
        } else if (
            static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(48u /* 48 & 0xFF */)) {
          DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline<
                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
                 1, 50u, input, this->mutable_data())));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // optional string name = 7;
      case 7: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(58u /* 58 & 0xFF */)) {
          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
                input, this->mutable_name()));
          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
            this->name().data(), static_cast<int>(this->name().length()),
            ::google::protobuf::internal::WireFormat::PARSE,
            "caffe2.QTensorProto.name");
        } else {
          goto handle_unusual;
        }
        break;
      }

      // optional .caffe2.TensorProto.DataType data_type = 8 [default = INT32];
      case 8: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(64u /* 64 & 0xFF */)) {
          int value;
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
                 input, &value)));
          if (::caffe2::TensorProto_DataType_IsValid(value)) {
            set_data_type(static_cast< ::caffe2::TensorProto_DataType >(value));
          } else {
            mutable_unknown_fields()->AddVarint(
                8, static_cast< ::google::protobuf::uint64>(value));
          }
        } else {
          goto handle_unusual;
        }
        break;
      }

      // repeated double scales = 9;
      case 9: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(73u /* 73 & 0xFF */)) {
          DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive<
                   double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>(
                 1, 73u, input, this->mutable_scales())));
        } else if (
            static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(74u /* 74 & 0xFF */)) {
          DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline<
                   double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>(
                 input, this->mutable_scales())));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // repeated double biases = 10;
      case 10: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(81u /* 81 & 0xFF */)) {
          DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive<
                   double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>(
                 1, 81u, input, this->mutable_biases())));
        } else if (
            static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(82u /* 82 & 0xFF */)) {
          DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline<
                   double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>(
                 input, this->mutable_biases())));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // optional int32 axis = 11;
      case 11: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(88u /* 88 & 0xFF */)) {
          set_has_axis();
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
                 input, &axis_)));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // optional bool is_multiparam = 12 [default = false];
      case 12: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(96u /* 96 & 0xFF */)) {
          set_has_is_multiparam();
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
                 input, &is_multiparam_)));
        } else {
          goto handle_unusual;
        }
        break;
      }

      default: {
      handle_unusual:
        if (tag == 0) {
          goto success;
        }
        DO_(::google::protobuf::internal::WireFormat::SkipField(
              input, tag, _internal_metadata_.mutable_unknown_fields()));
        break;
      }
    }
  }
success:
  // @@protoc_insertion_point(parse_success:caffe2.QTensorProto)
  return true;
failure:
  // @@protoc_insertion_point(parse_failure:caffe2.QTensorProto)
  return false;
#undef DO_
}

void QTensorProto::SerializeWithCachedSizes(
    ::google::protobuf::io::CodedOutputStream* output) const {
  // @@protoc_insertion_point(serialize_start:caffe2.QTensorProto)
  ::google::protobuf::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  // repeated int64 dims = 1;
  for (int i = 0, n = this->dims_size(); i < n; i++) {
    ::google::protobuf::internal::WireFormatLite::WriteInt64(
      1, this->dims(i), output);
  }

  cached_has_bits = _has_bits_[0];
  // required int32 precision = 2;
  if (cached_has_bits & 0x00000008u) {
    ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->precision(), output);
  }

  // required double scale = 3;
  if (cached_has_bits & 0x00000002u) {
    ::google::protobuf::internal::WireFormatLite::WriteDouble(3, this->scale(), output);
  }

  // required double bias = 4;
  if (cached_has_bits & 0x00000004u) {
    ::google::protobuf::internal::WireFormatLite::WriteDouble(4, this->bias(), output);
  }

  // required bool is_signed = 5;
  if (cached_has_bits & 0x00000010u) {
    ::google::protobuf::internal::WireFormatLite::WriteBool(5, this->is_signed(), output);
  }

  // repeated int32 data = 6 [packed = true];
  if (this->data_size() > 0) {
    ::google::protobuf::internal::WireFormatLite::WriteTag(6, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output);
    output->WriteVarint32(static_cast< ::google::protobuf::uint32>(
        _data_cached_byte_size_));
  }
  for (int i = 0, n = this->data_size(); i < n; i++) {
    ::google::protobuf::internal::WireFormatLite::WriteInt32NoTag(
      this->data(i), output);
  }

  // optional string name = 7;
  if (cached_has_bits & 0x00000001u) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->name().data(), static_cast<int>(this->name().length()),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "caffe2.QTensorProto.name");
    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
      7, this->name(), output);
  }

  // optional .caffe2.TensorProto.DataType data_type = 8 [default = INT32];
  if (cached_has_bits & 0x00000080u) {
    ::google::protobuf::internal::WireFormatLite::WriteEnum(
      8, this->data_type(), output);
  }

  // repeated double scales = 9;
  for (int i = 0, n = this->scales_size(); i < n; i++) {
    ::google::protobuf::internal::WireFormatLite::WriteDouble(
      9, this->scales(i), output);
  }

  // repeated double biases = 10;
  for (int i = 0, n = this->biases_size(); i < n; i++) {
    ::google::protobuf::internal::WireFormatLite::WriteDouble(
      10, this->biases(i), output);
  }

  // optional int32 axis = 11;
  if (cached_has_bits & 0x00000040u) {
    ::google::protobuf::internal::WireFormatLite::WriteInt32(11, this->axis(), output);
  }

  // optional bool is_multiparam = 12 [default = false];
  if (cached_has_bits & 0x00000020u) {
    ::google::protobuf::internal::WireFormatLite::WriteBool(12, this->is_multiparam(), output);
  }

  if (_internal_metadata_.have_unknown_fields()) {
    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
        _internal_metadata_.unknown_fields(), output);
  }
  // @@protoc_insertion_point(serialize_end:caffe2.QTensorProto)
}

::google::protobuf::uint8* QTensorProto::InternalSerializeWithCachedSizesToArray(
    bool deterministic, ::google::protobuf::uint8* target) const {
  (void)deterministic; // Unused
  // @@protoc_insertion_point(serialize_to_array_start:caffe2.QTensorProto)
  ::google::protobuf::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  // repeated int64 dims = 1;
  target = ::google::protobuf::internal::WireFormatLite::
    WriteInt64ToArray(1, this->dims_, target);

  cached_has_bits = _has_bits_[0];
  // required int32 precision = 2;
  if (cached_has_bits & 0x00000008u) {
    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->precision(), target);
  }

  // required double scale = 3;
  if (cached_has_bits & 0x00000002u) {
    target = ::google::protobuf::internal::WireFormatLite::WriteDoubleToArray(3, this->scale(), target);
  }

  // required double bias = 4;
  if (cached_has_bits & 0x00000004u) {
    target = ::google::protobuf::internal::WireFormatLite::WriteDoubleToArray(4, this->bias(), target);
  }

  // required bool is_signed = 5;
  if (cached_has_bits & 0x00000010u) {
    target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(5, this->is_signed(), target);
  }

  // repeated int32 data = 6 [packed = true];
  if (this->data_size() > 0) {
    target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray(
      6,
      ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED,
      target);
    target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray(
        static_cast< ::google::protobuf::int32>(
            _data_cached_byte_size_), target);
    target = ::google::protobuf::internal::WireFormatLite::
      WriteInt32NoTagToArray(this->data_, target);
  }

  // optional string name = 7;
  if (cached_has_bits & 0x00000001u) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->name().data(), static_cast<int>(this->name().length()),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "caffe2.QTensorProto.name");
    target =
      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
        7, this->name(), target);
  }

  // optional .caffe2.TensorProto.DataType data_type = 8 [default = INT32];
  if (cached_has_bits & 0x00000080u) {
    target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
      8, this->data_type(), target);
  }

  // repeated double scales = 9;
  target = ::google::protobuf::internal::WireFormatLite::
    WriteDoubleToArray(9, this->scales_, target);

  // repeated double biases = 10;
  target = ::google::protobuf::internal::WireFormatLite::
    WriteDoubleToArray(10, this->biases_, target);

  // optional int32 axis = 11;
  if (cached_has_bits & 0x00000040u) {
    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(11, this->axis(), target);
  }

  // optional bool is_multiparam = 12 [default = false];
  if (cached_has_bits & 0x00000020u) {
    target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(12, this->is_multiparam(), target);
  }

  if (_internal_metadata_.have_unknown_fields()) {
    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
        _internal_metadata_.unknown_fields(), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:caffe2.QTensorProto)
  return target;
}

size_t QTensorProto::RequiredFieldsByteSizeFallback() const {
// @@protoc_insertion_point(required_fields_byte_size_fallback_start:caffe2.QTensorProto)
  size_t total_size = 0;

  if (has_scale()) {
    // required double scale = 3;
    total_size += 1 + 8;
  }

  if (has_bias()) {
    // required double bias = 4;
    total_size += 1 + 8;
  }

  if (has_precision()) {
    // required int32 precision = 2;
    total_size += 1 +
      ::google::protobuf::internal::WireFormatLite::Int32Size(
        this->precision());
  }

  if (has_is_signed()) {
    // required bool is_signed = 5;
    total_size += 1 + 1;
  }

  return total_size;
}
size_t QTensorProto::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:caffe2.QTensorProto)
  size_t total_size = 0;

  if (_internal_metadata_.have_unknown_fields()) {
    total_size +=
      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
        _internal_metadata_.unknown_fields());
  }
  if (((_has_bits_[0] & 0x0000001e) ^ 0x0000001e) == 0) {  // All required fields are present.
    // required double scale = 3;
    total_size += 1 + 8;

    // required double bias = 4;
    total_size += 1 + 8;

    // required int32 precision = 2;
    total_size += 1 +
      ::google::protobuf::internal::WireFormatLite::Int32Size(
        this->precision());

    // required bool is_signed = 5;
    total_size += 1 + 1;

  } else {
    total_size += RequiredFieldsByteSizeFallback();
  }
  // repeated int64 dims = 1;
  {
    size_t data_size = ::google::protobuf::internal::WireFormatLite::
      Int64Size(this->dims_);
    total_size += 1 *
                  ::google::protobuf::internal::FromIntSize(this->dims_size());
    total_size += data_size;
  }

  // repeated int32 data = 6 [packed = true];
  {
    size_t data_size = ::google::protobuf::internal::WireFormatLite::
      Int32Size(this->data_);
    if (data_size > 0) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::Int32Size(
            static_cast< ::google::protobuf::int32>(data_size));
    }
    int cached_size = ::google::protobuf::internal::ToCachedSize(data_size);
    GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
    _data_cached_byte_size_ = cached_size;
    GOOGLE_SAFE_CONCURRENT_WRITES_END();
    total_size += data_size;
  }

  // repeated double scales = 9;
  {
    unsigned int count = static_cast<unsigned int>(this->scales_size());
    size_t data_size = 8UL * count;
    total_size += 1 *
                  ::google::protobuf::internal::FromIntSize(this->scales_size());
    total_size += data_size;
  }

  // repeated double biases = 10;
  {
    unsigned int count = static_cast<unsigned int>(this->biases_size());
    size_t data_size = 8UL * count;
    total_size += 1 *
                  ::google::protobuf::internal::FromIntSize(this->biases_size());
    total_size += data_size;
  }

  // optional string name = 7;
  if (has_name()) {
    total_size += 1 +
      ::google::protobuf::internal::WireFormatLite::StringSize(
        this->name());
  }

  if (_has_bits_[0 / 32] & 224u) {
    // optional bool is_multiparam = 12 [default = false];
    if (has_is_multiparam()) {
      total_size += 1 + 1;
    }

    // optional int32 axis = 11;
    if (has_axis()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::Int32Size(
          this->axis());
    }

    // optional .caffe2.TensorProto.DataType data_type = 8 [default = INT32];
    if (has_data_type()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::EnumSize(this->data_type());
    }

  }
  int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
  SetCachedSize(cached_size);
  return total_size;
}

void QTensorProto::MergeFrom(const ::google::protobuf::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:caffe2.QTensorProto)
  GOOGLE_DCHECK_NE(&from, this);
  const QTensorProto* source =
      ::google::protobuf::internal::DynamicCastToGenerated<const QTensorProto>(
          &from);
  if (source == NULL) {
  // @@protoc_insertion_point(generalized_merge_from_cast_fail:caffe2.QTensorProto)
    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  } else {
  // @@protoc_insertion_point(generalized_merge_from_cast_success:caffe2.QTensorProto)
    MergeFrom(*source);
  }
}

void QTensorProto::MergeFrom(const QTensorProto& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:caffe2.QTensorProto)
  GOOGLE_DCHECK_NE(&from, this);
  _internal_metadata_.MergeFrom(from._internal_metadata_);
  ::google::protobuf::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  dims_.MergeFrom(from.dims_);
  data_.MergeFrom(from.data_);
  scales_.MergeFrom(from.scales_);
  biases_.MergeFrom(from.biases_);
  cached_has_bits = from._has_bits_[0];
  if (cached_has_bits & 255u) {
    if (cached_has_bits & 0x00000001u) {
      set_has_name();
      name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name_);
    }
    if (cached_has_bits & 0x00000002u) {
      scale_ = from.scale_;
    }
    if (cached_has_bits & 0x00000004u) {
      bias_ = from.bias_;
    }
    if (cached_has_bits & 0x00000008u) {
      precision_ = from.precision_;
    }
    if (cached_has_bits & 0x00000010u) {
      is_signed_ = from.is_signed_;
    }
    if (cached_has_bits & 0x00000020u) {
      is_multiparam_ = from.is_multiparam_;
    }
    if (cached_has_bits & 0x00000040u) {
      axis_ = from.axis_;
    }
    if (cached_has_bits & 0x00000080u) {
      data_type_ = from.data_type_;
    }
    _has_bits_[0] |= cached_has_bits;
  }
}

void QTensorProto::CopyFrom(const ::google::protobuf::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:caffe2.QTensorProto)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

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

bool QTensorProto::IsInitialized() const {
  if ((_has_bits_[0] & 0x0000001e) != 0x0000001e) return false;
  return true;
}

void QTensorProto::Swap(QTensorProto* other) {
  if (other == this) return;
  InternalSwap(other);
}
void QTensorProto::InternalSwap(QTensorProto* other) {
  using std::swap;
  dims_.InternalSwap(&other->dims_);
  data_.InternalSwap(&other->data_);
  scales_.InternalSwap(&other->scales_);
  biases_.InternalSwap(&other->biases_);
  name_.Swap(&other->name_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(),
    GetArenaNoVirtual());
  swap(scale_, other->scale_);
  swap(bias_, other->bias_);
  swap(precision_, other->precision_);
  swap(is_signed_, other->is_signed_);
  swap(is_multiparam_, other->is_multiparam_);
  swap(axis_, other->axis_);
  swap(data_type_, other->data_type_);
  swap(_has_bits_[0], other->_has_bits_[0]);
  _internal_metadata_.Swap(&other->_internal_metadata_);
}

::google::protobuf::Metadata QTensorProto::GetMetadata() const {
  protobuf_caffe2_2fproto_2fcaffe2_2eproto::protobuf_AssignDescriptorsOnce();
  return ::protobuf_caffe2_2fproto_2fcaffe2_2eproto::file_level_metadata[kIndexInFileMessages];
}


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

void TensorProtos::InitAsDefaultInstance() {
}
#if !defined(_MSC_VER) || _MSC_VER >= 1900
const int TensorProtos::kProtosFieldNumber;
#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900

TensorProtos::TensorProtos()
  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
  ::google::protobuf::internal::InitSCC(
      &protobuf_caffe2_2fproto_2fcaffe2_2eproto::scc_info_TensorProtos.base);
  SharedCtor();
  // @@protoc_insertion_point(constructor:caffe2.TensorProtos)
}
TensorProtos::TensorProtos(const TensorProtos& from)
  : ::google::protobuf::Message(),
      _internal_metadata_(NULL),
      _has_bits_(from._has_bits_),
      protos_(from.protos_) {
  _internal_metadata_.MergeFrom(from._internal_metadata_);
  // @@protoc_insertion_point(copy_constructor:caffe2.TensorProtos)
}

void TensorProtos::SharedCtor() {
}

TensorProtos::~TensorProtos() {
  // @@protoc_insertion_point(destructor:caffe2.TensorProtos)
  SharedDtor();
}

void TensorProtos::SharedDtor() {
}

void TensorProtos::SetCachedSize(int size) const {
  _cached_size_.Set(size);
}
const ::google::protobuf::Descriptor* TensorProtos::descriptor() {
  ::protobuf_caffe2_2fproto_2fcaffe2_2eproto::protobuf_AssignDescriptorsOnce();
  return ::protobuf_caffe2_2fproto_2fcaffe2_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
}

const TensorProtos& TensorProtos::default_instance() {
  ::google::protobuf::internal::InitSCC(&protobuf_caffe2_2fproto_2fcaffe2_2eproto::scc_info_TensorProtos.base);
  return *internal_default_instance();
}


void TensorProtos::Clear() {
// @@protoc_insertion_point(message_clear_start:caffe2.TensorProtos)
  ::google::protobuf::uint32 cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  protos_.Clear();
  _has_bits_.Clear();
  _internal_metadata_.Clear();
}

bool TensorProtos::MergePartialFromCodedStream(
    ::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
  ::google::protobuf::uint32 tag;
  // @@protoc_insertion_point(parse_start:caffe2.TensorProtos)
  for (;;) {
    ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
    tag = p.first;
    if (!p.second) goto handle_unusual;
    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
      // repeated .caffe2.TensorProto protos = 1;
      case 1: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
                input, add_protos()));
        } else {
          goto handle_unusual;
        }
        break;
      }

      default: {
      handle_unusual:
        if (tag == 0) {
          goto success;
        }
        DO_(::google::protobuf::internal::WireFormat::SkipField(
              input, tag, _internal_metadata_.mutable_unknown_fields()));
        break;
      }
    }
  }
success:
  // @@protoc_insertion_point(parse_success:caffe2.TensorProtos)
  return true;
failure:
  // @@protoc_insertion_point(parse_failure:caffe2.TensorProtos)
  return false;
#undef DO_
}

void TensorProtos::SerializeWithCachedSizes(
    ::google::protobuf::io::CodedOutputStream* output) const {
  // @@protoc_insertion_point(serialize_start:caffe2.TensorProtos)
  ::google::protobuf::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  // repeated .caffe2.TensorProto protos = 1;
  for (unsigned int i = 0,
      n = static_cast<unsigned int>(this->protos_size()); i < n; i++) {
    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
      1,
      this->protos(static_cast<int>(i)),
      output);
  }

  if (_internal_metadata_.have_unknown_fields()) {
    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
        _internal_metadata_.unknown_fields(), output);
  }
  // @@protoc_insertion_point(serialize_end:caffe2.TensorProtos)
}

::google::protobuf::uint8* TensorProtos::InternalSerializeWithCachedSizesToArray(
    bool deterministic, ::google::protobuf::uint8* target) const {
  (void)deterministic; // Unused
  // @@protoc_insertion_point(serialize_to_array_start:caffe2.TensorProtos)
  ::google::protobuf::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  // repeated .caffe2.TensorProto protos = 1;
  for (unsigned int i = 0,
      n = static_cast<unsigned int>(this->protos_size()); i < n; i++) {
    target = ::google::protobuf::internal::WireFormatLite::
      InternalWriteMessageToArray(
        1, this->protos(static_cast<int>(i)), deterministic, target);
  }

  if (_internal_metadata_.have_unknown_fields()) {
    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
        _internal_metadata_.unknown_fields(), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:caffe2.TensorProtos)
  return target;
}

size_t TensorProtos::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:caffe2.TensorProtos)
  size_t total_size = 0;

  if (_internal_metadata_.have_unknown_fields()) {
    total_size +=
      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
        _internal_metadata_.unknown_fields());
  }
  // repeated .caffe2.TensorProto protos = 1;
  {
    unsigned int count = static_cast<unsigned int>(this->protos_size());
    total_size += 1UL * count;
    for (unsigned int i = 0; i < count; i++) {
      total_size +=
        ::google::protobuf::internal::WireFormatLite::MessageSize(
          this->protos(static_cast<int>(i)));
    }
  }

  int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
  SetCachedSize(cached_size);
  return total_size;
}

void TensorProtos::MergeFrom(const ::google::protobuf::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:caffe2.TensorProtos)
  GOOGLE_DCHECK_NE(&from, this);
  const TensorProtos* source =
      ::google::protobuf::internal::DynamicCastToGenerated<const TensorProtos>(
          &from);
  if (source == NULL) {
  // @@protoc_insertion_point(generalized_merge_from_cast_fail:caffe2.TensorProtos)
    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  } else {
  // @@protoc_insertion_point(generalized_merge_from_cast_success:caffe2.TensorProtos)
    MergeFrom(*source);
  }
}

void TensorProtos::MergeFrom(const TensorProtos& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:caffe2.TensorProtos)
  GOOGLE_DCHECK_NE(&from, this);
  _internal_metadata_.MergeFrom(from._internal_metadata_);
  ::google::protobuf::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  protos_.MergeFrom(from.protos_);
}

void TensorProtos::CopyFrom(const ::google::protobuf::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:caffe2.TensorProtos)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

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

bool TensorProtos::IsInitialized() const {
  if (!::google::protobuf::internal::AllAreInitialized(this->protos())) return false;
  return true;
}

void TensorProtos::Swap(TensorProtos* other) {
  if (other == this) return;
  InternalSwap(other);
}
void TensorProtos::InternalSwap(TensorProtos* other) {
  using std::swap;
  CastToBase(&protos_)->InternalSwap(CastToBase(&other->protos_));
  swap(_has_bits_[0], other->_has_bits_[0]);
  _internal_metadata_.Swap(&other->_internal_metadata_);
}

::google::protobuf::Metadata TensorProtos::GetMetadata() const {
  protobuf_caffe2_2fproto_2fcaffe2_2eproto::protobuf_AssignDescriptorsOnce();
  return ::protobuf_caffe2_2fproto_2fcaffe2_2eproto::file_level_metadata[kIndexInFileMessages];
}


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

void TensorShape::InitAsDefaultInstance() {
}
#if !defined(_MSC_VER) || _MSC_VER >= 1900
const int TensorShape::kDimsFieldNumber;
const int TensorShape::kDataTypeFieldNumber;
const int TensorShape::kUnknownDimsFieldNumber;
const int TensorShape::kUnknownShapeFieldNumber;
const int TensorShape::kNameFieldNumber;
#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900

TensorShape::TensorShape()
  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
  ::google::protobuf::internal::InitSCC(
      &protobuf_caffe2_2fproto_2fcaffe2_2eproto::scc_info_TensorShape.base);
  SharedCtor();
  // @@protoc_insertion_point(constructor:caffe2.TensorShape)
}
TensorShape::TensorShape(const TensorShape& from)
  : ::google::protobuf::Message(),
      _internal_metadata_(NULL),
      _has_bits_(from._has_bits_),
      dims_(from.dims_),
      unknown_dims_(from.unknown_dims_) {
  _internal_metadata_.MergeFrom(from._internal_metadata_);
  name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  if (from.has_name()) {
    name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name_);
  }
  ::memcpy(&unknown_shape_, &from.unknown_shape_,
    static_cast<size_t>(reinterpret_cast<char*>(&data_type_) -
    reinterpret_cast<char*>(&unknown_shape_)) + sizeof(data_type_));
  // @@protoc_insertion_point(copy_constructor:caffe2.TensorShape)
}

void TensorShape::SharedCtor() {
  name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  unknown_shape_ = false;
  data_type_ = 1;
}

TensorShape::~TensorShape() {
  // @@protoc_insertion_point(destructor:caffe2.TensorShape)
  SharedDtor();
}

void TensorShape::SharedDtor() {
  name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}

void TensorShape::SetCachedSize(int size) const {
  _cached_size_.Set(size);
}
const ::google::protobuf::Descriptor* TensorShape::descriptor() {
  ::protobuf_caffe2_2fproto_2fcaffe2_2eproto::protobuf_AssignDescriptorsOnce();
  return ::protobuf_caffe2_2fproto_2fcaffe2_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
}

const TensorShape& TensorShape::default_instance() {
  ::google::protobuf::internal::InitSCC(&protobuf_caffe2_2fproto_2fcaffe2_2eproto::scc_info_TensorShape.base);
  return *internal_default_instance();
}


void TensorShape::Clear() {
// @@protoc_insertion_point(message_clear_start:caffe2.TensorShape)
  ::google::protobuf::uint32 cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  dims_.Clear();
  unknown_dims_.Clear();
  cached_has_bits = _has_bits_[0];
  if (cached_has_bits & 0x00000001u) {
    name_.ClearNonDefaultToEmptyNoArena();
  }
  if (cached_has_bits & 6u) {
    unknown_shape_ = false;
    data_type_ = 1;
  }
  _has_bits_.Clear();
  _internal_metadata_.Clear();
}

bool TensorShape::MergePartialFromCodedStream(
    ::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
  ::google::protobuf::uint32 tag;
  // @@protoc_insertion_point(parse_start:caffe2.TensorShape)
  for (;;) {
    ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
    tag = p.first;
    if (!p.second) goto handle_unusual;
    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
      // repeated int64 dims = 1;
      case 1: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) {
          DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive<
                   ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>(
                 1, 8u, input, this->mutable_dims())));
        } else if (
            static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
          DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline<
                   ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>(
                 input, this->mutable_dims())));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // optional .caffe2.TensorProto.DataType data_type = 2 [default = FLOAT];
      case 2: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) {
          int value;
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
                 input, &value)));
          if (::caffe2::TensorProto_DataType_IsValid(value)) {
            set_data_type(static_cast< ::caffe2::TensorProto_DataType >(value));
          } else {
            mutable_unknown_fields()->AddVarint(
                2, static_cast< ::google::protobuf::uint64>(value));
          }
        } else {
          goto handle_unusual;
        }
        break;
      }

      // repeated int32 unknown_dims = 3;
      case 3: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) {
          DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive<
                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
                 1, 24u, input, this->mutable_unknown_dims())));
        } else if (
            static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) {
          DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline<
                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
                 input, this->mutable_unknown_dims())));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // optional bool unknown_shape = 4 [default = false];
      case 4: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(32u /* 32 & 0xFF */)) {
          set_has_unknown_shape();
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
                 input, &unknown_shape_)));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // optional string name = 5;
      case 5: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(42u /* 42 & 0xFF */)) {
          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
                input, this->mutable_name()));
          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
            this->name().data(), static_cast<int>(this->name().length()),
            ::google::protobuf::internal::WireFormat::PARSE,
            "caffe2.TensorShape.name");
        } else {
          goto handle_unusual;
        }
        break;
      }

      default: {
      handle_unusual:
        if (tag == 0) {
          goto success;
        }
        DO_(::google::protobuf::internal::WireFormat::SkipField(
              input, tag, _internal_metadata_.mutable_unknown_fields()));
        break;
      }
    }
  }
success:
  // @@protoc_insertion_point(parse_success:caffe2.TensorShape)
  return true;
failure:
  // @@protoc_insertion_point(parse_failure:caffe2.TensorShape)
  return false;
#undef DO_
}

void TensorShape::SerializeWithCachedSizes(
    ::google::protobuf::io::CodedOutputStream* output) const {
  // @@protoc_insertion_point(serialize_start:caffe2.TensorShape)
  ::google::protobuf::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  // repeated int64 dims = 1;
  for (int i = 0, n = this->dims_size(); i < n; i++) {
    ::google::protobuf::internal::WireFormatLite::WriteInt64(
      1, this->dims(i), output);
  }

  cached_has_bits = _has_bits_[0];
  // optional .caffe2.TensorProto.DataType data_type = 2 [default = FLOAT];
  if (cached_has_bits & 0x00000004u) {
    ::google::protobuf::internal::WireFormatLite::WriteEnum(
      2, this->data_type(), output);
  }

  // repeated int32 unknown_dims = 3;
  for (int i = 0, n = this->unknown_dims_size(); i < n; i++) {
    ::google::protobuf::internal::WireFormatLite::WriteInt32(
      3, this->unknown_dims(i), output);
  }

  // optional bool unknown_shape = 4 [default = false];
  if (cached_has_bits & 0x00000002u) {
    ::google::protobuf::internal::WireFormatLite::WriteBool(4, this->unknown_shape(), output);
  }

  // optional string name = 5;
  if (cached_has_bits & 0x00000001u) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->name().data(), static_cast<int>(this->name().length()),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "caffe2.TensorShape.name");
    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
      5, this->name(), output);
  }

  if (_internal_metadata_.have_unknown_fields()) {
    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
        _internal_metadata_.unknown_fields(), output);
  }
  // @@protoc_insertion_point(serialize_end:caffe2.TensorShape)
}

::google::protobuf::uint8* TensorShape::InternalSerializeWithCachedSizesToArray(
    bool deterministic, ::google::protobuf::uint8* target) const {
  (void)deterministic; // Unused
  // @@protoc_insertion_point(serialize_to_array_start:caffe2.TensorShape)
  ::google::protobuf::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  // repeated int64 dims = 1;
  target = ::google::protobuf::internal::WireFormatLite::
    WriteInt64ToArray(1, this->dims_, target);

  cached_has_bits = _has_bits_[0];
  // optional .caffe2.TensorProto.DataType data_type = 2 [default = FLOAT];
  if (cached_has_bits & 0x00000004u) {
    target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
      2, this->data_type(), target);
  }

  // repeated int32 unknown_dims = 3;
  target = ::google::protobuf::internal::WireFormatLite::
    WriteInt32ToArray(3, this->unknown_dims_, target);

  // optional bool unknown_shape = 4 [default = false];
  if (cached_has_bits & 0x00000002u) {
    target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(4, this->unknown_shape(), target);
  }

  // optional string name = 5;
  if (cached_has_bits & 0x00000001u) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->name().data(), static_cast<int>(this->name().length()),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "caffe2.TensorShape.name");
    target =
      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
        5, this->name(), target);
  }

  if (_internal_metadata_.have_unknown_fields()) {
    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
        _internal_metadata_.unknown_fields(), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:caffe2.TensorShape)
  return target;
}

size_t TensorShape::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:caffe2.TensorShape)
  size_t total_size = 0;

  if (_internal_metadata_.have_unknown_fields()) {
    total_size +=
      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
        _internal_metadata_.unknown_fields());
  }
  // repeated int64 dims = 1;
  {
    size_t data_size = ::google::protobuf::internal::WireFormatLite::
      Int64Size(this->dims_);
    total_size += 1 *
                  ::google::protobuf::internal::FromIntSize(this->dims_size());
    total_size += data_size;
  }

  // repeated int32 unknown_dims = 3;
  {
    size_t data_size = ::google::protobuf::internal::WireFormatLite::
      Int32Size(this->unknown_dims_);
    total_size += 1 *
                  ::google::protobuf::internal::FromIntSize(this->unknown_dims_size());
    total_size += data_size;
  }

  if (_has_bits_[0 / 32] & 7u) {
    // optional string name = 5;
    if (has_name()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::StringSize(
          this->name());
    }

    // optional bool unknown_shape = 4 [default = false];
    if (has_unknown_shape()) {
      total_size += 1 + 1;
    }

    // optional .caffe2.TensorProto.DataType data_type = 2 [default = FLOAT];
    if (has_data_type()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::EnumSize(this->data_type());
    }

  }
  int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
  SetCachedSize(cached_size);
  return total_size;
}

void TensorShape::MergeFrom(const ::google::protobuf::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:caffe2.TensorShape)
  GOOGLE_DCHECK_NE(&from, this);
  const TensorShape* source =
      ::google::protobuf::internal::DynamicCastToGenerated<const TensorShape>(
          &from);
  if (source == NULL) {
  // @@protoc_insertion_point(generalized_merge_from_cast_fail:caffe2.TensorShape)
    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  } else {
  // @@protoc_insertion_point(generalized_merge_from_cast_success:caffe2.TensorShape)
    MergeFrom(*source);
  }
}

void TensorShape::MergeFrom(const TensorShape& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:caffe2.TensorShape)
  GOOGLE_DCHECK_NE(&from, this);
  _internal_metadata_.MergeFrom(from._internal_metadata_);
  ::google::protobuf::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  dims_.MergeFrom(from.dims_);
  unknown_dims_.MergeFrom(from.unknown_dims_);
  cached_has_bits = from._has_bits_[0];
  if (cached_has_bits & 7u) {
    if (cached_has_bits & 0x00000001u) {
      set_has_name();
      name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name_);
    }
    if (cached_has_bits & 0x00000002u) {
      unknown_shape_ = from.unknown_shape_;
    }
    if (cached_has_bits & 0x00000004u) {
      data_type_ = from.data_type_;
    }
    _has_bits_[0] |= cached_has_bits;
  }
}

void TensorShape::CopyFrom(const ::google::protobuf::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:caffe2.TensorShape)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

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

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

void TensorShape::Swap(TensorShape* other) {
  if (other == this) return;
  InternalSwap(other);
}
void TensorShape::InternalSwap(TensorShape* other) {
  using std::swap;
  dims_.InternalSwap(&other->dims_);
  unknown_dims_.InternalSwap(&other->unknown_dims_);
  name_.Swap(&other->name_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(),
    GetArenaNoVirtual());
  swap(unknown_shape_, other->unknown_shape_);
  swap(data_type_, other->data_type_);
  swap(_has_bits_[0], other->_has_bits_[0]);
  _internal_metadata_.Swap(&other->_internal_metadata_);
}

::google::protobuf::Metadata TensorShape::GetMetadata() const {
  protobuf_caffe2_2fproto_2fcaffe2_2eproto::protobuf_AssignDescriptorsOnce();
  return ::protobuf_caffe2_2fproto_2fcaffe2_2eproto::file_level_metadata[kIndexInFileMessages];
}


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

void TensorShapes::InitAsDefaultInstance() {
}
#if !defined(_MSC_VER) || _MSC_VER >= 1900
const int TensorShapes::kShapesFieldNumber;
#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900

TensorShapes::TensorShapes()
  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
  ::google::protobuf::internal::InitSCC(
      &protobuf_caffe2_2fproto_2fcaffe2_2eproto::scc_info_TensorShapes.base);
  SharedCtor();
  // @@protoc_insertion_point(constructor:caffe2.TensorShapes)
}
TensorShapes::TensorShapes(const TensorShapes& from)
  : ::google::protobuf::Message(),
      _internal_metadata_(NULL),
      _has_bits_(from._has_bits_),
      shapes_(from.shapes_) {
  _internal_metadata_.MergeFrom(from._internal_metadata_);
  // @@protoc_insertion_point(copy_constructor:caffe2.TensorShapes)
}

void TensorShapes::SharedCtor() {
}

TensorShapes::~TensorShapes() {
  // @@protoc_insertion_point(destructor:caffe2.TensorShapes)
  SharedDtor();
}

void TensorShapes::SharedDtor() {
}

void TensorShapes::SetCachedSize(int size) const {
  _cached_size_.Set(size);
}
const ::google::protobuf::Descriptor* TensorShapes::descriptor() {
  ::protobuf_caffe2_2fproto_2fcaffe2_2eproto::protobuf_AssignDescriptorsOnce();
  return ::protobuf_caffe2_2fproto_2fcaffe2_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
}

const TensorShapes& TensorShapes::default_instance() {
  ::google::protobuf::internal::InitSCC(&protobuf_caffe2_2fproto_2fcaffe2_2eproto::scc_info_TensorShapes.base);
  return *internal_default_instance();
}


void TensorShapes::Clear() {
// @@protoc_insertion_point(message_clear_start:caffe2.TensorShapes)
  ::google::protobuf::uint32 cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  shapes_.Clear();
  _has_bits_.Clear();
  _internal_metadata_.Clear();
}

bool TensorShapes::MergePartialFromCodedStream(
    ::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
  ::google::protobuf::uint32 tag;
  // @@protoc_insertion_point(parse_start:caffe2.TensorShapes)
  for (;;) {
    ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
    tag = p.first;
    if (!p.second) goto handle_unusual;
    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
      // repeated .caffe2.TensorShape shapes = 1;
      case 1: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
                input, add_shapes()));
        } else {
          goto handle_unusual;
        }
        break;
      }

      default: {
      handle_unusual:
        if (tag == 0) {
          goto success;
        }
        DO_(::google::protobuf::internal::WireFormat::SkipField(
              input, tag, _internal_metadata_.mutable_unknown_fields()));
        break;
      }
    }
  }
success:
  // @@protoc_insertion_point(parse_success:caffe2.TensorShapes)
  return true;
failure:
  // @@protoc_insertion_point(parse_failure:caffe2.TensorShapes)
  return false;
#undef DO_
}

void TensorShapes::SerializeWithCachedSizes(
    ::google::protobuf::io::CodedOutputStream* output) const {
  // @@protoc_insertion_point(serialize_start:caffe2.TensorShapes)
  ::google::protobuf::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  // repeated .caffe2.TensorShape shapes = 1;
  for (unsigned int i = 0,
      n = static_cast<unsigned int>(this->shapes_size()); i < n; i++) {
    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
      1,
      this->shapes(static_cast<int>(i)),
      output);
  }

  if (_internal_metadata_.have_unknown_fields()) {
    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
        _internal_metadata_.unknown_fields(), output);
  }
  // @@protoc_insertion_point(serialize_end:caffe2.TensorShapes)
}

::google::protobuf::uint8* TensorShapes::InternalSerializeWithCachedSizesToArray(
    bool deterministic, ::google::protobuf::uint8* target) const {
  (void)deterministic; // Unused
  // @@protoc_insertion_point(serialize_to_array_start:caffe2.TensorShapes)
  ::google::protobuf::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  // repeated .caffe2.TensorShape shapes = 1;
  for (unsigned int i = 0,
      n = static_cast<unsigned int>(this->shapes_size()); i < n; i++) {
    target = ::google::protobuf::internal::WireFormatLite::
      InternalWriteMessageToArray(
        1, this->shapes(static_cast<int>(i)), deterministic, target);
  }

  if (_internal_metadata_.have_unknown_fields()) {
    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
        _internal_metadata_.unknown_fields(), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:caffe2.TensorShapes)
  return target;
}

size_t TensorShapes::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:caffe2.TensorShapes)
  size_t total_size = 0;

  if (_internal_metadata_.have_unknown_fields()) {
    total_size +=
      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
        _internal_metadata_.unknown_fields());
  }
  // repeated .caffe2.TensorShape shapes = 1;
  {
    unsigned int count = static_cast<unsigned int>(this->shapes_size());
    total_size += 1UL * count;
    for (unsigned int i = 0; i < count; i++) {
      total_size +=
        ::google::protobuf::internal::WireFormatLite::MessageSize(
          this->shapes(static_cast<int>(i)));
    }
  }

  int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
  SetCachedSize(cached_size);
  return total_size;
}

void TensorShapes::MergeFrom(const ::google::protobuf::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:caffe2.TensorShapes)
  GOOGLE_DCHECK_NE(&from, this);
  const TensorShapes* source =
      ::google::protobuf::internal::DynamicCastToGenerated<const TensorShapes>(
          &from);
  if (source == NULL) {
  // @@protoc_insertion_point(generalized_merge_from_cast_fail:caffe2.TensorShapes)
    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  } else {
  // @@protoc_insertion_point(generalized_merge_from_cast_success:caffe2.TensorShapes)
    MergeFrom(*source);
  }
}

void TensorShapes::MergeFrom(const TensorShapes& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:caffe2.TensorShapes)
  GOOGLE_DCHECK_NE(&from, this);
  _internal_metadata_.MergeFrom(from._internal_metadata_);
  ::google::protobuf::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  shapes_.MergeFrom(from.shapes_);
}

void TensorShapes::CopyFrom(const ::google::protobuf::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:caffe2.TensorShapes)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

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

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

void TensorShapes::Swap(TensorShapes* other) {
  if (other == this) return;
  InternalSwap(other);
}
void TensorShapes::InternalSwap(TensorShapes* other) {
  using std::swap;
  CastToBase(&shapes_)->InternalSwap(CastToBase(&other->shapes_));
  swap(_has_bits_[0], other->_has_bits_[0]);
  _internal_metadata_.Swap(&other->_internal_metadata_);
}

::google::protobuf::Metadata TensorShapes::GetMetadata() const {
  protobuf_caffe2_2fproto_2fcaffe2_2eproto::protobuf_AssignDescriptorsOnce();
  return ::protobuf_caffe2_2fproto_2fcaffe2_2eproto::file_level_metadata[kIndexInFileMessages];
}


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

void Argument::InitAsDefaultInstance() {
  ::caffe2::_Argument_default_instance_._instance.get_mutable()->t_ = const_cast< ::caffe2::TensorProto*>(
      ::caffe2::TensorProto::internal_default_instance());
  ::caffe2::_Argument_default_instance_._instance.get_mutable()->n_ = const_cast< ::caffe2::NetDef*>(
      ::caffe2::NetDef::internal_default_instance());
}
#if !defined(_MSC_VER) || _MSC_VER >= 1900
const int Argument::kNameFieldNumber;
const int Argument::kFFieldNumber;
const int Argument::kIFieldNumber;
const int Argument::kSFieldNumber;
const int Argument::kTFieldNumber;
const int Argument::kNFieldNumber;
const int Argument::kFloatsFieldNumber;
const int Argument::kIntsFieldNumber;
const int Argument::kStringsFieldNumber;
const int Argument::kTensorsFieldNumber;
const int Argument::kNetsFieldNumber;
const int Argument::kQtensorsFieldNumber;
#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900

Argument::Argument()
  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
  ::google::protobuf::internal::InitSCC(
      &protobuf_caffe2_2fproto_2fcaffe2_2eproto::scc_info_Argument.base);
  SharedCtor();
  // @@protoc_insertion_point(constructor:caffe2.Argument)
}
Argument::Argument(const Argument& from)
  : ::google::protobuf::Message(),
      _internal_metadata_(NULL),
      _has_bits_(from._has_bits_),
      floats_(from.floats_),
      ints_(from.ints_),
      strings_(from.strings_),
      nets_(from.nets_),
      tensors_(from.tensors_),
      qtensors_(from.qtensors_) {
  _internal_metadata_.MergeFrom(from._internal_metadata_);
  name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  if (from.has_name()) {
    name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name_);
  }
  s_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  if (from.has_s()) {
    s_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.s_);
  }
  if (from.has_n()) {
    n_ = new ::caffe2::NetDef(*from.n_);
  } else {
    n_ = NULL;
  }
  if (from.has_t()) {
    t_ = new ::caffe2::TensorProto(*from.t_);
  } else {
    t_ = NULL;
  }
  ::memcpy(&i_, &from.i_,
    static_cast<size_t>(reinterpret_cast<char*>(&f_) -
    reinterpret_cast<char*>(&i_)) + sizeof(f_));
  // @@protoc_insertion_point(copy_constructor:caffe2.Argument)
}

void Argument::SharedCtor() {
  name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  s_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  ::memset(&n_, 0, static_cast<size_t>(
      reinterpret_cast<char*>(&f_) -
      reinterpret_cast<char*>(&n_)) + sizeof(f_));
}

Argument::~Argument() {
  // @@protoc_insertion_point(destructor:caffe2.Argument)
  SharedDtor();
}

void Argument::SharedDtor() {
  name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  s_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  if (this != internal_default_instance()) delete n_;
  if (this != internal_default_instance()) delete t_;
}

void Argument::SetCachedSize(int size) const {
  _cached_size_.Set(size);
}
const ::google::protobuf::Descriptor* Argument::descriptor() {
  ::protobuf_caffe2_2fproto_2fcaffe2_2eproto::protobuf_AssignDescriptorsOnce();
  return ::protobuf_caffe2_2fproto_2fcaffe2_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
}

const Argument& Argument::default_instance() {
  ::google::protobuf::internal::InitSCC(&protobuf_caffe2_2fproto_2fcaffe2_2eproto::scc_info_Argument.base);
  return *internal_default_instance();
}


void Argument::Clear() {
// @@protoc_insertion_point(message_clear_start:caffe2.Argument)
  ::google::protobuf::uint32 cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  floats_.Clear();
  ints_.Clear();
  strings_.Clear();
  nets_.Clear();
  tensors_.Clear();
  qtensors_.Clear();
  cached_has_bits = _has_bits_[0];
  if (cached_has_bits & 15u) {
    if (cached_has_bits & 0x00000001u) {
      name_.ClearNonDefaultToEmptyNoArena();
    }
    if (cached_has_bits & 0x00000002u) {
      s_.ClearNonDefaultToEmptyNoArena();
    }
    if (cached_has_bits & 0x00000004u) {
      GOOGLE_DCHECK(n_ != NULL);
      n_->Clear();
    }
    if (cached_has_bits & 0x00000008u) {
      GOOGLE_DCHECK(t_ != NULL);
      t_->Clear();
    }
  }
  if (cached_has_bits & 48u) {
    ::memset(&i_, 0, static_cast<size_t>(
        reinterpret_cast<char*>(&f_) -
        reinterpret_cast<char*>(&i_)) + sizeof(f_));
  }
  _has_bits_.Clear();
  _internal_metadata_.Clear();
}

bool Argument::MergePartialFromCodedStream(
    ::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
  ::google::protobuf::uint32 tag;
  // @@protoc_insertion_point(parse_start:caffe2.Argument)
  for (;;) {
    ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
    tag = p.first;
    if (!p.second) goto handle_unusual;
    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
      // optional string name = 1;
      case 1: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
                input, this->mutable_name()));
          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
            this->name().data(), static_cast<int>(this->name().length()),
            ::google::protobuf::internal::WireFormat::PARSE,
            "caffe2.Argument.name");
        } else {
          goto handle_unusual;
        }
        break;
      }

      // optional float f = 2;
      case 2: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(21u /* 21 & 0xFF */)) {
          set_has_f();
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
                 input, &f_)));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // optional int64 i = 3;
      case 3: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) {
          set_has_i();
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>(
                 input, &i_)));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // optional bytes s = 4;
      case 4: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) {
          DO_(::google::protobuf::internal::WireFormatLite::ReadBytes(
                input, this->mutable_s()));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // repeated float floats = 5;
      case 5: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(45u /* 45 & 0xFF */)) {
          DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive<
                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
                 1, 45u, input, this->mutable_floats())));
        } else if (
            static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(42u /* 42 & 0xFF */)) {
          DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline<
                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
                 input, this->mutable_floats())));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // repeated int64 ints = 6;
      case 6: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(48u /* 48 & 0xFF */)) {
          DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive<
                   ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>(
                 1, 48u, input, this->mutable_ints())));
        } else if (
            static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(50u /* 50 & 0xFF */)) {
          DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline<
                   ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>(
                 input, this->mutable_ints())));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // repeated bytes strings = 7;
      case 7: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(58u /* 58 & 0xFF */)) {
          DO_(::google::protobuf::internal::WireFormatLite::ReadBytes(
                input, this->add_strings()));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // optional .caffe2.NetDef n = 8;
      case 8: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(66u /* 66 & 0xFF */)) {
          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
               input, mutable_n()));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // repeated .caffe2.NetDef nets = 9;
      case 9: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(74u /* 74 & 0xFF */)) {
          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
                input, add_nets()));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // optional .caffe2.TensorProto t = 10;
      case 10: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(82u /* 82 & 0xFF */)) {
          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
               input, mutable_t()));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // repeated .caffe2.TensorProto tensors = 11;
      case 11: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(90u /* 90 & 0xFF */)) {
          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
                input, add_tensors()));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // repeated .caffe2.QTensorProto qtensors = 12;
      case 12: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(98u /* 98 & 0xFF */)) {
          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
                input, add_qtensors()));
        } else {
          goto handle_unusual;
        }
        break;
      }

      default: {
      handle_unusual:
        if (tag == 0) {
          goto success;
        }
        DO_(::google::protobuf::internal::WireFormat::SkipField(
              input, tag, _internal_metadata_.mutable_unknown_fields()));
        break;
      }
    }
  }
success:
  // @@protoc_insertion_point(parse_success:caffe2.Argument)
  return true;
failure:
  // @@protoc_insertion_point(parse_failure:caffe2.Argument)
  return false;
#undef DO_
}

void Argument::SerializeWithCachedSizes(
    ::google::protobuf::io::CodedOutputStream* output) const {
  // @@protoc_insertion_point(serialize_start:caffe2.Argument)
  ::google::protobuf::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  cached_has_bits = _has_bits_[0];
  // optional string name = 1;
  if (cached_has_bits & 0x00000001u) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->name().data(), static_cast<int>(this->name().length()),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "caffe2.Argument.name");
    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
      1, this->name(), output);
  }

  // optional float f = 2;
  if (cached_has_bits & 0x00000020u) {
    ::google::protobuf::internal::WireFormatLite::WriteFloat(2, this->f(), output);
  }

  // optional int64 i = 3;
  if (cached_has_bits & 0x00000010u) {
    ::google::protobuf::internal::WireFormatLite::WriteInt64(3, this->i(), output);
  }

  // optional bytes s = 4;
  if (cached_has_bits & 0x00000002u) {
    ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased(
      4, this->s(), output);
  }

  // repeated float floats = 5;
  for (int i = 0, n = this->floats_size(); i < n; i++) {
    ::google::protobuf::internal::WireFormatLite::WriteFloat(
      5, this->floats(i), output);
  }

  // repeated int64 ints = 6;
  for (int i = 0, n = this->ints_size(); i < n; i++) {
    ::google::protobuf::internal::WireFormatLite::WriteInt64(
      6, this->ints(i), output);
  }

  // repeated bytes strings = 7;
  for (int i = 0, n = this->strings_size(); i < n; i++) {
    ::google::protobuf::internal::WireFormatLite::WriteBytes(
      7, this->strings(i), output);
  }

  // optional .caffe2.NetDef n = 8;
  if (cached_has_bits & 0x00000004u) {
    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
      8, this->_internal_n(), output);
  }

  // repeated .caffe2.NetDef nets = 9;
  for (unsigned int i = 0,
      n = static_cast<unsigned int>(this->nets_size()); i < n; i++) {
    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
      9,
      this->nets(static_cast<int>(i)),
      output);
  }

  // optional .caffe2.TensorProto t = 10;
  if (cached_has_bits & 0x00000008u) {
    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
      10, this->_internal_t(), output);
  }

  // repeated .caffe2.TensorProto tensors = 11;
  for (unsigned int i = 0,
      n = static_cast<unsigned int>(this->tensors_size()); i < n; i++) {
    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
      11,
      this->tensors(static_cast<int>(i)),
      output);
  }

  // repeated .caffe2.QTensorProto qtensors = 12;
  for (unsigned int i = 0,
      n = static_cast<unsigned int>(this->qtensors_size()); i < n; i++) {
    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
      12,
      this->qtensors(static_cast<int>(i)),
      output);
  }

  if (_internal_metadata_.have_unknown_fields()) {
    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
        _internal_metadata_.unknown_fields(), output);
  }
  // @@protoc_insertion_point(serialize_end:caffe2.Argument)
}

::google::protobuf::uint8* Argument::InternalSerializeWithCachedSizesToArray(
    bool deterministic, ::google::protobuf::uint8* target) const {
  (void)deterministic; // Unused
  // @@protoc_insertion_point(serialize_to_array_start:caffe2.Argument)
  ::google::protobuf::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  cached_has_bits = _has_bits_[0];
  // optional string name = 1;
  if (cached_has_bits & 0x00000001u) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->name().data(), static_cast<int>(this->name().length()),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "caffe2.Argument.name");
    target =
      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
        1, this->name(), target);
  }

  // optional float f = 2;
  if (cached_has_bits & 0x00000020u) {
    target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(2, this->f(), target);
  }

  // optional int64 i = 3;
  if (cached_has_bits & 0x00000010u) {
    target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(3, this->i(), target);
  }

  // optional bytes s = 4;
  if (cached_has_bits & 0x00000002u) {
    target =
      ::google::protobuf::internal::WireFormatLite::WriteBytesToArray(
        4, this->s(), target);
  }

  // repeated float floats = 5;
  target = ::google::protobuf::internal::WireFormatLite::
    WriteFloatToArray(5, this->floats_, target);

  // repeated int64 ints = 6;
  target = ::google::protobuf::internal::WireFormatLite::
    WriteInt64ToArray(6, this->ints_, target);

  // repeated bytes strings = 7;
  for (int i = 0, n = this->strings_size(); i < n; i++) {
    target = ::google::protobuf::internal::WireFormatLite::
      WriteBytesToArray(7, this->strings(i), target);
  }

  // optional .caffe2.NetDef n = 8;
  if (cached_has_bits & 0x00000004u) {
    target = ::google::protobuf::internal::WireFormatLite::
      InternalWriteMessageToArray(
        8, this->_internal_n(), deterministic, target);
  }

  // repeated .caffe2.NetDef nets = 9;
  for (unsigned int i = 0,
      n = static_cast<unsigned int>(this->nets_size()); i < n; i++) {
    target = ::google::protobuf::internal::WireFormatLite::
      InternalWriteMessageToArray(
        9, this->nets(static_cast<int>(i)), deterministic, target);
  }

  // optional .caffe2.TensorProto t = 10;
  if (cached_has_bits & 0x00000008u) {
    target = ::google::protobuf::internal::WireFormatLite::
      InternalWriteMessageToArray(
        10, this->_internal_t(), deterministic, target);
  }

  // repeated .caffe2.TensorProto tensors = 11;
  for (unsigned int i = 0,
      n = static_cast<unsigned int>(this->tensors_size()); i < n; i++) {
    target = ::google::protobuf::internal::WireFormatLite::
      InternalWriteMessageToArray(
        11, this->tensors(static_cast<int>(i)), deterministic, target);
  }

  // repeated .caffe2.QTensorProto qtensors = 12;
  for (unsigned int i = 0,
      n = static_cast<unsigned int>(this->qtensors_size()); i < n; i++) {
    target = ::google::protobuf::internal::WireFormatLite::
      InternalWriteMessageToArray(
        12, this->qtensors(static_cast<int>(i)), deterministic, target);
  }

  if (_internal_metadata_.have_unknown_fields()) {
    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
        _internal_metadata_.unknown_fields(), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:caffe2.Argument)
  return target;
}

size_t Argument::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:caffe2.Argument)
  size_t total_size = 0;

  if (_internal_metadata_.have_unknown_fields()) {
    total_size +=
      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
        _internal_metadata_.unknown_fields());
  }
  // repeated float floats = 5;
  {
    unsigned int count = static_cast<unsigned int>(this->floats_size());
    size_t data_size = 4UL * count;
    total_size += 1 *
                  ::google::protobuf::internal::FromIntSize(this->floats_size());
    total_size += data_size;
  }

  // repeated int64 ints = 6;
  {
    size_t data_size = ::google::protobuf::internal::WireFormatLite::
      Int64Size(this->ints_);
    total_size += 1 *
                  ::google::protobuf::internal::FromIntSize(this->ints_size());
    total_size += data_size;
  }

  // repeated bytes strings = 7;
  total_size += 1 *
      ::google::protobuf::internal::FromIntSize(this->strings_size());
  for (int i = 0, n = this->strings_size(); i < n; i++) {
    total_size += ::google::protobuf::internal::WireFormatLite::BytesSize(
      this->strings(i));
  }

  // repeated .caffe2.NetDef nets = 9;
  {
    unsigned int count = static_cast<unsigned int>(this->nets_size());
    total_size += 1UL * count;
    for (unsigned int i = 0; i < count; i++) {
      total_size +=
        ::google::protobuf::internal::WireFormatLite::MessageSize(
          this->nets(static_cast<int>(i)));
    }
  }

  // repeated .caffe2.TensorProto tensors = 11;
  {
    unsigned int count = static_cast<unsigned int>(this->tensors_size());
    total_size += 1UL * count;
    for (unsigned int i = 0; i < count; i++) {
      total_size +=
        ::google::protobuf::internal::WireFormatLite::MessageSize(
          this->tensors(static_cast<int>(i)));
    }
  }

  // repeated .caffe2.QTensorProto qtensors = 12;
  {
    unsigned int count = static_cast<unsigned int>(this->qtensors_size());
    total_size += 1UL * count;
    for (unsigned int i = 0; i < count; i++) {
      total_size +=
        ::google::protobuf::internal::WireFormatLite::MessageSize(
          this->qtensors(static_cast<int>(i)));
    }
  }

  if (_has_bits_[0 / 32] & 63u) {
    // optional string name = 1;
    if (has_name()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::StringSize(
          this->name());
    }

    // optional bytes s = 4;
    if (has_s()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::BytesSize(
          this->s());
    }

    // optional .caffe2.NetDef n = 8;
    if (has_n()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::MessageSize(
          *n_);
    }

    // optional .caffe2.TensorProto t = 10;
    if (has_t()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::MessageSize(
          *t_);
    }

    // optional int64 i = 3;
    if (has_i()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::Int64Size(
          this->i());
    }

    // optional float f = 2;
    if (has_f()) {
      total_size += 1 + 4;
    }

  }
  int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
  SetCachedSize(cached_size);
  return total_size;
}

void Argument::MergeFrom(const ::google::protobuf::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:caffe2.Argument)
  GOOGLE_DCHECK_NE(&from, this);
  const Argument* source =
      ::google::protobuf::internal::DynamicCastToGenerated<const Argument>(
          &from);
  if (source == NULL) {
  // @@protoc_insertion_point(generalized_merge_from_cast_fail:caffe2.Argument)
    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  } else {
  // @@protoc_insertion_point(generalized_merge_from_cast_success:caffe2.Argument)
    MergeFrom(*source);
  }
}

void Argument::MergeFrom(const Argument& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:caffe2.Argument)
  GOOGLE_DCHECK_NE(&from, this);
  _internal_metadata_.MergeFrom(from._internal_metadata_);
  ::google::protobuf::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  floats_.MergeFrom(from.floats_);
  ints_.MergeFrom(from.ints_);
  strings_.MergeFrom(from.strings_);
  nets_.MergeFrom(from.nets_);
  tensors_.MergeFrom(from.tensors_);
  qtensors_.MergeFrom(from.qtensors_);
  cached_has_bits = from._has_bits_[0];
  if (cached_has_bits & 63u) {
    if (cached_has_bits & 0x00000001u) {
      set_has_name();
      name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name_);
    }
    if (cached_has_bits & 0x00000002u) {
      set_has_s();
      s_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.s_);
    }
    if (cached_has_bits & 0x00000004u) {
      mutable_n()->::caffe2::NetDef::MergeFrom(from.n());
    }
    if (cached_has_bits & 0x00000008u) {
      mutable_t()->::caffe2::TensorProto::MergeFrom(from.t());
    }
    if (cached_has_bits & 0x00000010u) {
      i_ = from.i_;
    }
    if (cached_has_bits & 0x00000020u) {
      f_ = from.f_;
    }
    _has_bits_[0] |= cached_has_bits;
  }
}

void Argument::CopyFrom(const ::google::protobuf::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:caffe2.Argument)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

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

bool Argument::IsInitialized() const {
  if (!::google::protobuf::internal::AllAreInitialized(this->nets())) return false;
  if (!::google::protobuf::internal::AllAreInitialized(this->tensors())) return false;
  if (!::google::protobuf::internal::AllAreInitialized(this->qtensors())) return false;
  if (has_n()) {
    if (!this->n_->IsInitialized()) return false;
  }
  if (has_t()) {
    if (!this->t_->IsInitialized()) return false;
  }
  return true;
}

void Argument::Swap(Argument* other) {
  if (other == this) return;
  InternalSwap(other);
}
void Argument::InternalSwap(Argument* other) {
  using std::swap;
  floats_.InternalSwap(&other->floats_);
  ints_.InternalSwap(&other->ints_);
  strings_.InternalSwap(CastToBase(&other->strings_));
  CastToBase(&nets_)->InternalSwap(CastToBase(&other->nets_));
  CastToBase(&tensors_)->InternalSwap(CastToBase(&other->tensors_));
  CastToBase(&qtensors_)->InternalSwap(CastToBase(&other->qtensors_));
  name_.Swap(&other->name_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(),
    GetArenaNoVirtual());
  s_.Swap(&other->s_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(),
    GetArenaNoVirtual());
  swap(n_, other->n_);
  swap(t_, other->t_);
  swap(i_, other->i_);
  swap(f_, other->f_);
  swap(_has_bits_[0], other->_has_bits_[0]);
  _internal_metadata_.Swap(&other->_internal_metadata_);
}

::google::protobuf::Metadata Argument::GetMetadata() const {
  protobuf_caffe2_2fproto_2fcaffe2_2eproto::protobuf_AssignDescriptorsOnce();
  return ::protobuf_caffe2_2fproto_2fcaffe2_2eproto::file_level_metadata[kIndexInFileMessages];
}


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

void DeviceOption::InitAsDefaultInstance() {
}
#if !defined(_MSC_VER) || _MSC_VER >= 1900
const int DeviceOption::kDeviceTypeFieldNumber;
const int DeviceOption::kDeviceIdFieldNumber;
const int DeviceOption::kRandomSeedFieldNumber;
const int DeviceOption::kNodeNameFieldNumber;
const int DeviceOption::kNumaNodeIdFieldNumber;
const int DeviceOption::kExtraInfoFieldNumber;
#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900

DeviceOption::DeviceOption()
  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
  ::google::protobuf::internal::InitSCC(
      &protobuf_caffe2_2fproto_2fcaffe2_2eproto::scc_info_DeviceOption.base);
  SharedCtor();
  // @@protoc_insertion_point(constructor:caffe2.DeviceOption)
}
DeviceOption::DeviceOption(const DeviceOption& from)
  : ::google::protobuf::Message(),
      _internal_metadata_(NULL),
      _has_bits_(from._has_bits_),
      extra_info_(from.extra_info_) {
  _internal_metadata_.MergeFrom(from._internal_metadata_);
  node_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  if (from.has_node_name()) {
    node_name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.node_name_);
  }
  ::memcpy(&device_type_, &from.device_type_,
    static_cast<size_t>(reinterpret_cast<char*>(&numa_node_id_) -
    reinterpret_cast<char*>(&device_type_)) + sizeof(numa_node_id_));
  // @@protoc_insertion_point(copy_constructor:caffe2.DeviceOption)
}

void DeviceOption::SharedCtor() {
  node_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  ::memset(&device_type_, 0, static_cast<size_t>(
      reinterpret_cast<char*>(&numa_node_id_) -
      reinterpret_cast<char*>(&device_type_)) + sizeof(numa_node_id_));
}

DeviceOption::~DeviceOption() {
  // @@protoc_insertion_point(destructor:caffe2.DeviceOption)
  SharedDtor();
}

void DeviceOption::SharedDtor() {
  node_name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}

void DeviceOption::SetCachedSize(int size) const {
  _cached_size_.Set(size);
}
const ::google::protobuf::Descriptor* DeviceOption::descriptor() {
  ::protobuf_caffe2_2fproto_2fcaffe2_2eproto::protobuf_AssignDescriptorsOnce();
  return ::protobuf_caffe2_2fproto_2fcaffe2_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
}

const DeviceOption& DeviceOption::default_instance() {
  ::google::protobuf::internal::InitSCC(&protobuf_caffe2_2fproto_2fcaffe2_2eproto::scc_info_DeviceOption.base);
  return *internal_default_instance();
}


void DeviceOption::Clear() {
// @@protoc_insertion_point(message_clear_start:caffe2.DeviceOption)
  ::google::protobuf::uint32 cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  extra_info_.Clear();
  cached_has_bits = _has_bits_[0];
  if (cached_has_bits & 0x00000001u) {
    node_name_.ClearNonDefaultToEmptyNoArena();
  }
  if (cached_has_bits & 30u) {
    ::memset(&device_type_, 0, static_cast<size_t>(
        reinterpret_cast<char*>(&numa_node_id_) -
        reinterpret_cast<char*>(&device_type_)) + sizeof(numa_node_id_));
  }
  _has_bits_.Clear();
  _internal_metadata_.Clear();
}

bool DeviceOption::MergePartialFromCodedStream(
    ::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
  ::google::protobuf::uint32 tag;
  // @@protoc_insertion_point(parse_start:caffe2.DeviceOption)
  for (;;) {
    ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
    tag = p.first;
    if (!p.second) goto handle_unusual;
    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
      // optional int32 device_type = 1 [default = 0];
      case 1: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) {
          set_has_device_type();
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
                 input, &device_type_)));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // optional int32 device_id = 2;
      case 2: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) {
          set_has_device_id();
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
                 input, &device_id_)));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // optional uint32 random_seed = 3;
      case 3: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) {
          set_has_random_seed();
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
                 input, &random_seed_)));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // optional string node_name = 4;
      case 4: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) {
          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
                input, this->mutable_node_name()));
          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
            this->node_name().data(), static_cast<int>(this->node_name().length()),
            ::google::protobuf::internal::WireFormat::PARSE,
            "caffe2.DeviceOption.node_name");
        } else {
          goto handle_unusual;
        }
        break;
      }

      // optional int32 numa_node_id = 5;
      case 5: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(40u /* 40 & 0xFF */)) {
          set_has_numa_node_id();
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
                 input, &numa_node_id_)));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // repeated string extra_info = 6;
      case 6: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(50u /* 50 & 0xFF */)) {
          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
                input, this->add_extra_info()));
          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
            this->extra_info(this->extra_info_size() - 1).data(),
            static_cast<int>(this->extra_info(this->extra_info_size() - 1).length()),
            ::google::protobuf::internal::WireFormat::PARSE,
            "caffe2.DeviceOption.extra_info");
        } else {
          goto handle_unusual;
        }
        break;
      }

      default: {
      handle_unusual:
        if (tag == 0) {
          goto success;
        }
        DO_(::google::protobuf::internal::WireFormat::SkipField(
              input, tag, _internal_metadata_.mutable_unknown_fields()));
        break;
      }
    }
  }
success:
  // @@protoc_insertion_point(parse_success:caffe2.DeviceOption)
  return true;
failure:
  // @@protoc_insertion_point(parse_failure:caffe2.DeviceOption)
  return false;
#undef DO_
}

void DeviceOption::SerializeWithCachedSizes(
    ::google::protobuf::io::CodedOutputStream* output) const {
  // @@protoc_insertion_point(serialize_start:caffe2.DeviceOption)
  ::google::protobuf::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  cached_has_bits = _has_bits_[0];
  // optional int32 device_type = 1 [default = 0];
  if (cached_has_bits & 0x00000002u) {
    ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->device_type(), output);
  }

  // optional int32 device_id = 2;
  if (cached_has_bits & 0x00000004u) {
    ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->device_id(), output);
  }

  // optional uint32 random_seed = 3;
  if (cached_has_bits & 0x00000008u) {
    ::google::protobuf::internal::WireFormatLite::WriteUInt32(3, this->random_seed(), output);
  }

  // optional string node_name = 4;
  if (cached_has_bits & 0x00000001u) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->node_name().data(), static_cast<int>(this->node_name().length()),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "caffe2.DeviceOption.node_name");
    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
      4, this->node_name(), output);
  }

  // optional int32 numa_node_id = 5;
  if (cached_has_bits & 0x00000010u) {
    ::google::protobuf::internal::WireFormatLite::WriteInt32(5, this->numa_node_id(), output);
  }

  // repeated string extra_info = 6;
  for (int i = 0, n = this->extra_info_size(); i < n; i++) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->extra_info(i).data(), static_cast<int>(this->extra_info(i).length()),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "caffe2.DeviceOption.extra_info");
    ::google::protobuf::internal::WireFormatLite::WriteString(
      6, this->extra_info(i), output);
  }

  if (_internal_metadata_.have_unknown_fields()) {
    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
        _internal_metadata_.unknown_fields(), output);
  }
  // @@protoc_insertion_point(serialize_end:caffe2.DeviceOption)
}

::google::protobuf::uint8* DeviceOption::InternalSerializeWithCachedSizesToArray(
    bool deterministic, ::google::protobuf::uint8* target) const {
  (void)deterministic; // Unused
  // @@protoc_insertion_point(serialize_to_array_start:caffe2.DeviceOption)
  ::google::protobuf::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  cached_has_bits = _has_bits_[0];
  // optional int32 device_type = 1 [default = 0];
  if (cached_has_bits & 0x00000002u) {
    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->device_type(), target);
  }

  // optional int32 device_id = 2;
  if (cached_has_bits & 0x00000004u) {
    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->device_id(), target);
  }

  // optional uint32 random_seed = 3;
  if (cached_has_bits & 0x00000008u) {
    target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(3, this->random_seed(), target);
  }

  // optional string node_name = 4;
  if (cached_has_bits & 0x00000001u) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->node_name().data(), static_cast<int>(this->node_name().length()),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "caffe2.DeviceOption.node_name");
    target =
      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
        4, this->node_name(), target);
  }

  // optional int32 numa_node_id = 5;
  if (cached_has_bits & 0x00000010u) {
    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(5, this->numa_node_id(), target);
  }

  // repeated string extra_info = 6;
  for (int i = 0, n = this->extra_info_size(); i < n; i++) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->extra_info(i).data(), static_cast<int>(this->extra_info(i).length()),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "caffe2.DeviceOption.extra_info");
    target = ::google::protobuf::internal::WireFormatLite::
      WriteStringToArray(6, this->extra_info(i), target);
  }

  if (_internal_metadata_.have_unknown_fields()) {
    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
        _internal_metadata_.unknown_fields(), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:caffe2.DeviceOption)
  return target;
}

size_t DeviceOption::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:caffe2.DeviceOption)
  size_t total_size = 0;

  if (_internal_metadata_.have_unknown_fields()) {
    total_size +=
      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
        _internal_metadata_.unknown_fields());
  }
  // repeated string extra_info = 6;
  total_size += 1 *
      ::google::protobuf::internal::FromIntSize(this->extra_info_size());
  for (int i = 0, n = this->extra_info_size(); i < n; i++) {
    total_size += ::google::protobuf::internal::WireFormatLite::StringSize(
      this->extra_info(i));
  }

  if (_has_bits_[0 / 32] & 31u) {
    // optional string node_name = 4;
    if (has_node_name()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::StringSize(
          this->node_name());
    }

    // optional int32 device_type = 1 [default = 0];
    if (has_device_type()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::Int32Size(
          this->device_type());
    }

    // optional int32 device_id = 2;
    if (has_device_id()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::Int32Size(
          this->device_id());
    }

    // optional uint32 random_seed = 3;
    if (has_random_seed()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::UInt32Size(
          this->random_seed());
    }

    // optional int32 numa_node_id = 5;
    if (has_numa_node_id()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::Int32Size(
          this->numa_node_id());
    }

  }
  int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
  SetCachedSize(cached_size);
  return total_size;
}

void DeviceOption::MergeFrom(const ::google::protobuf::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:caffe2.DeviceOption)
  GOOGLE_DCHECK_NE(&from, this);
  const DeviceOption* source =
      ::google::protobuf::internal::DynamicCastToGenerated<const DeviceOption>(
          &from);
  if (source == NULL) {
  // @@protoc_insertion_point(generalized_merge_from_cast_fail:caffe2.DeviceOption)
    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  } else {
  // @@protoc_insertion_point(generalized_merge_from_cast_success:caffe2.DeviceOption)
    MergeFrom(*source);
  }
}

void DeviceOption::MergeFrom(const DeviceOption& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:caffe2.DeviceOption)
  GOOGLE_DCHECK_NE(&from, this);
  _internal_metadata_.MergeFrom(from._internal_metadata_);
  ::google::protobuf::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  extra_info_.MergeFrom(from.extra_info_);
  cached_has_bits = from._has_bits_[0];
  if (cached_has_bits & 31u) {
    if (cached_has_bits & 0x00000001u) {
      set_has_node_name();
      node_name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.node_name_);
    }
    if (cached_has_bits & 0x00000002u) {
      device_type_ = from.device_type_;
    }
    if (cached_has_bits & 0x00000004u) {
      device_id_ = from.device_id_;
    }
    if (cached_has_bits & 0x00000008u) {
      random_seed_ = from.random_seed_;
    }
    if (cached_has_bits & 0x00000010u) {
      numa_node_id_ = from.numa_node_id_;
    }
    _has_bits_[0] |= cached_has_bits;
  }
}

void DeviceOption::CopyFrom(const ::google::protobuf::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:caffe2.DeviceOption)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

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

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

void DeviceOption::Swap(DeviceOption* other) {
  if (other == this) return;
  InternalSwap(other);
}
void DeviceOption::InternalSwap(DeviceOption* other) {
  using std::swap;
  extra_info_.InternalSwap(CastToBase(&other->extra_info_));
  node_name_.Swap(&other->node_name_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(),
    GetArenaNoVirtual());
  swap(device_type_, other->device_type_);
  swap(device_id_, other->device_id_);
  swap(random_seed_, other->random_seed_);
  swap(numa_node_id_, other->numa_node_id_);
  swap(_has_bits_[0], other->_has_bits_[0]);
  _internal_metadata_.Swap(&other->_internal_metadata_);
}

::google::protobuf::Metadata DeviceOption::GetMetadata() const {
  protobuf_caffe2_2fproto_2fcaffe2_2eproto::protobuf_AssignDescriptorsOnce();
  return ::protobuf_caffe2_2fproto_2fcaffe2_2eproto::file_level_metadata[kIndexInFileMessages];
}


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

void OperatorDef::InitAsDefaultInstance() {
  ::caffe2::_OperatorDef_default_instance_._instance.get_mutable()->device_option_ = const_cast< ::caffe2::DeviceOption*>(
      ::caffe2::DeviceOption::internal_default_instance());
}
#if !defined(_MSC_VER) || _MSC_VER >= 1900
const int OperatorDef::kInputFieldNumber;
const int OperatorDef::kOutputFieldNumber;
const int OperatorDef::kNameFieldNumber;
const int OperatorDef::kTypeFieldNumber;
const int OperatorDef::kArgFieldNumber;
const int OperatorDef::kDeviceOptionFieldNumber;
const int OperatorDef::kEngineFieldNumber;
const int OperatorDef::kControlInputFieldNumber;
const int OperatorDef::kIsGradientOpFieldNumber;
const int OperatorDef::kDebugInfoFieldNumber;
const int OperatorDef::kDomainFieldNumber;
const int OperatorDef::kOpVersionFieldNumber;
#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900

OperatorDef::OperatorDef()
  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
  ::google::protobuf::internal::InitSCC(
      &protobuf_caffe2_2fproto_2fcaffe2_2eproto::scc_info_Argument.base);
  SharedCtor();
  // @@protoc_insertion_point(constructor:caffe2.OperatorDef)
}
OperatorDef::OperatorDef(const OperatorDef& from)
  : ::google::protobuf::Message(),
      _internal_metadata_(NULL),
      _has_bits_(from._has_bits_),
      input_(from.input_),
      output_(from.output_),
      arg_(from.arg_),
      control_input_(from.control_input_) {
  _internal_metadata_.MergeFrom(from._internal_metadata_);
  name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  if (from.has_name()) {
    name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name_);
  }
  type_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  if (from.has_type()) {
    type_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.type_);
  }
  engine_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  if (from.has_engine()) {
    engine_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.engine_);
  }
  debug_info_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  if (from.has_debug_info()) {
    debug_info_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.debug_info_);
  }
  domain_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  if (from.has_domain()) {
    domain_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.domain_);
  }
  if (from.has_device_option()) {
    device_option_ = new ::caffe2::DeviceOption(*from.device_option_);
  } else {
    device_option_ = NULL;
  }
  ::memcpy(&op_version_, &from.op_version_,
    static_cast<size_t>(reinterpret_cast<char*>(&is_gradient_op_) -
    reinterpret_cast<char*>(&op_version_)) + sizeof(is_gradient_op_));
  // @@protoc_insertion_point(copy_constructor:caffe2.OperatorDef)
}

void OperatorDef::SharedCtor() {
  name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  type_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  engine_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  debug_info_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  domain_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  ::memset(&device_option_, 0, static_cast<size_t>(
      reinterpret_cast<char*>(&is_gradient_op_) -
      reinterpret_cast<char*>(&device_option_)) + sizeof(is_gradient_op_));
}

OperatorDef::~OperatorDef() {
  // @@protoc_insertion_point(destructor:caffe2.OperatorDef)
  SharedDtor();
}

void OperatorDef::SharedDtor() {
  name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  type_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  engine_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  debug_info_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  domain_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  if (this != internal_default_instance()) delete device_option_;
}

void OperatorDef::SetCachedSize(int size) const {
  _cached_size_.Set(size);
}
const ::google::protobuf::Descriptor* OperatorDef::descriptor() {
  ::protobuf_caffe2_2fproto_2fcaffe2_2eproto::protobuf_AssignDescriptorsOnce();
  return ::protobuf_caffe2_2fproto_2fcaffe2_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
}

const OperatorDef& OperatorDef::default_instance() {
  ::google::protobuf::internal::InitSCC(&protobuf_caffe2_2fproto_2fcaffe2_2eproto::scc_info_Argument.base);
  return *internal_default_instance();
}


void OperatorDef::Clear() {
// @@protoc_insertion_point(message_clear_start:caffe2.OperatorDef)
  ::google::protobuf::uint32 cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  input_.Clear();
  output_.Clear();
  arg_.Clear();
  control_input_.Clear();
  cached_has_bits = _has_bits_[0];
  if (cached_has_bits & 63u) {
    if (cached_has_bits & 0x00000001u) {
      name_.ClearNonDefaultToEmptyNoArena();
    }
    if (cached_has_bits & 0x00000002u) {
      type_.ClearNonDefaultToEmptyNoArena();
    }
    if (cached_has_bits & 0x00000004u) {
      engine_.ClearNonDefaultToEmptyNoArena();
    }
    if (cached_has_bits & 0x00000008u) {
      debug_info_.ClearNonDefaultToEmptyNoArena();
    }
    if (cached_has_bits & 0x00000010u) {
      domain_.ClearNonDefaultToEmptyNoArena();
    }
    if (cached_has_bits & 0x00000020u) {
      GOOGLE_DCHECK(device_option_ != NULL);
      device_option_->Clear();
    }
  }
  if (cached_has_bits & 192u) {
    ::memset(&op_version_, 0, static_cast<size_t>(
        reinterpret_cast<char*>(&is_gradient_op_) -
        reinterpret_cast<char*>(&op_version_)) + sizeof(is_gradient_op_));
  }
  _has_bits_.Clear();
  _internal_metadata_.Clear();
}

bool OperatorDef::MergePartialFromCodedStream(
    ::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
  ::google::protobuf::uint32 tag;
  // @@protoc_insertion_point(parse_start:caffe2.OperatorDef)
  for (;;) {
    ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
    tag = p.first;
    if (!p.second) goto handle_unusual;
    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
      // repeated string input = 1;
      case 1: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
                input, this->add_input()));
          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
            this->input(this->input_size() - 1).data(),
            static_cast<int>(this->input(this->input_size() - 1).length()),
            ::google::protobuf::internal::WireFormat::PARSE,
            "caffe2.OperatorDef.input");
        } else {
          goto handle_unusual;
        }
        break;
      }

      // repeated string output = 2;
      case 2: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) {
          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
                input, this->add_output()));
          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
            this->output(this->output_size() - 1).data(),
            static_cast<int>(this->output(this->output_size() - 1).length()),
            ::google::protobuf::internal::WireFormat::PARSE,
            "caffe2.OperatorDef.output");
        } else {
          goto handle_unusual;
        }
        break;
      }

      // optional string name = 3;
      case 3: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) {
          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
                input, this->mutable_name()));
          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
            this->name().data(), static_cast<int>(this->name().length()),
            ::google::protobuf::internal::WireFormat::PARSE,
            "caffe2.OperatorDef.name");
        } else {
          goto handle_unusual;
        }
        break;
      }

      // optional string type = 4;
      case 4: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) {
          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
                input, this->mutable_type()));
          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
            this->type().data(), static_cast<int>(this->type().length()),
            ::google::protobuf::internal::WireFormat::PARSE,
            "caffe2.OperatorDef.type");
        } else {
          goto handle_unusual;
        }
        break;
      }

      // repeated .caffe2.Argument arg = 5;
      case 5: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(42u /* 42 & 0xFF */)) {
          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
                input, add_arg()));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // optional .caffe2.DeviceOption device_option = 6;
      case 6: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(50u /* 50 & 0xFF */)) {
          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
               input, mutable_device_option()));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // optional string engine = 7;
      case 7: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(58u /* 58 & 0xFF */)) {
          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
                input, this->mutable_engine()));
          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
            this->engine().data(), static_cast<int>(this->engine().length()),
            ::google::protobuf::internal::WireFormat::PARSE,
            "caffe2.OperatorDef.engine");
        } else {
          goto handle_unusual;
        }
        break;
      }

      // repeated string control_input = 8;
      case 8: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(66u /* 66 & 0xFF */)) {
          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
                input, this->add_control_input()));
          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
            this->control_input(this->control_input_size() - 1).data(),
            static_cast<int>(this->control_input(this->control_input_size() - 1).length()),
            ::google::protobuf::internal::WireFormat::PARSE,
            "caffe2.OperatorDef.control_input");
        } else {
          goto handle_unusual;
        }
        break;
      }

      // optional bool is_gradient_op = 9 [default = false];
      case 9: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(72u /* 72 & 0xFF */)) {
          set_has_is_gradient_op();
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
                 input, &is_gradient_op_)));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // optional string debug_info = 10;
      case 10: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(82u /* 82 & 0xFF */)) {
          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
                input, this->mutable_debug_info()));
          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
            this->debug_info().data(), static_cast<int>(this->debug_info().length()),
            ::google::protobuf::internal::WireFormat::PARSE,
            "caffe2.OperatorDef.debug_info");
        } else {
          goto handle_unusual;
        }
        break;
      }

      // optional string domain = 11;
      case 11: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(90u /* 90 & 0xFF */)) {
          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
                input, this->mutable_domain()));
          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
            this->domain().data(), static_cast<int>(this->domain().length()),
            ::google::protobuf::internal::WireFormat::PARSE,
            "caffe2.OperatorDef.domain");
        } else {
          goto handle_unusual;
        }
        break;
      }

      // optional int64 op_version = 12;
      case 12: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(96u /* 96 & 0xFF */)) {
          set_has_op_version();
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>(
                 input, &op_version_)));
        } else {
          goto handle_unusual;
        }
        break;
      }

      default: {
      handle_unusual:
        if (tag == 0) {
          goto success;
        }
        DO_(::google::protobuf::internal::WireFormat::SkipField(
              input, tag, _internal_metadata_.mutable_unknown_fields()));
        break;
      }
    }
  }
success:
  // @@protoc_insertion_point(parse_success:caffe2.OperatorDef)
  return true;
failure:
  // @@protoc_insertion_point(parse_failure:caffe2.OperatorDef)
  return false;
#undef DO_
}

void OperatorDef::SerializeWithCachedSizes(
    ::google::protobuf::io::CodedOutputStream* output) const {
  // @@protoc_insertion_point(serialize_start:caffe2.OperatorDef)
  ::google::protobuf::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  // repeated string input = 1;
  for (int i = 0, n = this->input_size(); i < n; i++) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->input(i).data(), static_cast<int>(this->input(i).length()),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "caffe2.OperatorDef.input");
    ::google::protobuf::internal::WireFormatLite::WriteString(
      1, this->input(i), output);
  }

  // repeated string output = 2;
  for (int i = 0, n = this->output_size(); i < n; i++) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->output(i).data(), static_cast<int>(this->output(i).length()),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "caffe2.OperatorDef.output");
    ::google::protobuf::internal::WireFormatLite::WriteString(
      2, this->output(i), output);
  }

  cached_has_bits = _has_bits_[0];
  // optional string name = 3;
  if (cached_has_bits & 0x00000001u) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->name().data(), static_cast<int>(this->name().length()),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "caffe2.OperatorDef.name");
    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
      3, this->name(), output);
  }

  // optional string type = 4;
  if (cached_has_bits & 0x00000002u) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->type().data(), static_cast<int>(this->type().length()),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "caffe2.OperatorDef.type");
    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
      4, this->type(), output);
  }

  // repeated .caffe2.Argument arg = 5;
  for (unsigned int i = 0,
      n = static_cast<unsigned int>(this->arg_size()); i < n; i++) {
    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
      5,
      this->arg(static_cast<int>(i)),
      output);
  }

  // optional .caffe2.DeviceOption device_option = 6;
  if (cached_has_bits & 0x00000020u) {
    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
      6, this->_internal_device_option(), output);
  }

  // optional string engine = 7;
  if (cached_has_bits & 0x00000004u) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->engine().data(), static_cast<int>(this->engine().length()),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "caffe2.OperatorDef.engine");
    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
      7, this->engine(), output);
  }

  // repeated string control_input = 8;
  for (int i = 0, n = this->control_input_size(); i < n; i++) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->control_input(i).data(), static_cast<int>(this->control_input(i).length()),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "caffe2.OperatorDef.control_input");
    ::google::protobuf::internal::WireFormatLite::WriteString(
      8, this->control_input(i), output);
  }

  // optional bool is_gradient_op = 9 [default = false];
  if (cached_has_bits & 0x00000080u) {
    ::google::protobuf::internal::WireFormatLite::WriteBool(9, this->is_gradient_op(), output);
  }

  // optional string debug_info = 10;
  if (cached_has_bits & 0x00000008u) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->debug_info().data(), static_cast<int>(this->debug_info().length()),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "caffe2.OperatorDef.debug_info");
    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
      10, this->debug_info(), output);
  }

  // optional string domain = 11;
  if (cached_has_bits & 0x00000010u) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->domain().data(), static_cast<int>(this->domain().length()),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "caffe2.OperatorDef.domain");
    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
      11, this->domain(), output);
  }

  // optional int64 op_version = 12;
  if (cached_has_bits & 0x00000040u) {
    ::google::protobuf::internal::WireFormatLite::WriteInt64(12, this->op_version(), output);
  }

  if (_internal_metadata_.have_unknown_fields()) {
    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
        _internal_metadata_.unknown_fields(), output);
  }
  // @@protoc_insertion_point(serialize_end:caffe2.OperatorDef)
}

::google::protobuf::uint8* OperatorDef::InternalSerializeWithCachedSizesToArray(
    bool deterministic, ::google::protobuf::uint8* target) const {
  (void)deterministic; // Unused
  // @@protoc_insertion_point(serialize_to_array_start:caffe2.OperatorDef)
  ::google::protobuf::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  // repeated string input = 1;
  for (int i = 0, n = this->input_size(); i < n; i++) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->input(i).data(), static_cast<int>(this->input(i).length()),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "caffe2.OperatorDef.input");
    target = ::google::protobuf::internal::WireFormatLite::
      WriteStringToArray(1, this->input(i), target);
  }

  // repeated string output = 2;
  for (int i = 0, n = this->output_size(); i < n; i++) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->output(i).data(), static_cast<int>(this->output(i).length()),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "caffe2.OperatorDef.output");
    target = ::google::protobuf::internal::WireFormatLite::
      WriteStringToArray(2, this->output(i), target);
  }

  cached_has_bits = _has_bits_[0];
  // optional string name = 3;
  if (cached_has_bits & 0x00000001u) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->name().data(), static_cast<int>(this->name().length()),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "caffe2.OperatorDef.name");
    target =
      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
        3, this->name(), target);
  }

  // optional string type = 4;
  if (cached_has_bits & 0x00000002u) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->type().data(), static_cast<int>(this->type().length()),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "caffe2.OperatorDef.type");
    target =
      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
        4, this->type(), target);
  }

  // repeated .caffe2.Argument arg = 5;
  for (unsigned int i = 0,
      n = static_cast<unsigned int>(this->arg_size()); i < n; i++) {
    target = ::google::protobuf::internal::WireFormatLite::
      InternalWriteMessageToArray(
        5, this->arg(static_cast<int>(i)), deterministic, target);
  }

  // optional .caffe2.DeviceOption device_option = 6;
  if (cached_has_bits & 0x00000020u) {
    target = ::google::protobuf::internal::WireFormatLite::
      InternalWriteMessageToArray(
        6, this->_internal_device_option(), deterministic, target);
  }

  // optional string engine = 7;
  if (cached_has_bits & 0x00000004u) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->engine().data(), static_cast<int>(this->engine().length()),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "caffe2.OperatorDef.engine");
    target =
      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
        7, this->engine(), target);
  }

  // repeated string control_input = 8;
  for (int i = 0, n = this->control_input_size(); i < n; i++) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->control_input(i).data(), static_cast<int>(this->control_input(i).length()),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "caffe2.OperatorDef.control_input");
    target = ::google::protobuf::internal::WireFormatLite::
      WriteStringToArray(8, this->control_input(i), target);
  }

  // optional bool is_gradient_op = 9 [default = false];
  if (cached_has_bits & 0x00000080u) {
    target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(9, this->is_gradient_op(), target);
  }

  // optional string debug_info = 10;
  if (cached_has_bits & 0x00000008u) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->debug_info().data(), static_cast<int>(this->debug_info().length()),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "caffe2.OperatorDef.debug_info");
    target =
      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
        10, this->debug_info(), target);
  }

  // optional string domain = 11;
  if (cached_has_bits & 0x00000010u) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->domain().data(), static_cast<int>(this->domain().length()),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "caffe2.OperatorDef.domain");
    target =
      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
        11, this->domain(), target);
  }

  // optional int64 op_version = 12;
  if (cached_has_bits & 0x00000040u) {
    target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(12, this->op_version(), target);
  }

  if (_internal_metadata_.have_unknown_fields()) {
    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
        _internal_metadata_.unknown_fields(), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:caffe2.OperatorDef)
  return target;
}

size_t OperatorDef::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:caffe2.OperatorDef)
  size_t total_size = 0;

  if (_internal_metadata_.have_unknown_fields()) {
    total_size +=
      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
        _internal_metadata_.unknown_fields());
  }
  // repeated string input = 1;
  total_size += 1 *
      ::google::protobuf::internal::FromIntSize(this->input_size());
  for (int i = 0, n = this->input_size(); i < n; i++) {
    total_size += ::google::protobuf::internal::WireFormatLite::StringSize(
      this->input(i));
  }

  // repeated string output = 2;
  total_size += 1 *
      ::google::protobuf::internal::FromIntSize(this->output_size());
  for (int i = 0, n = this->output_size(); i < n; i++) {
    total_size += ::google::protobuf::internal::WireFormatLite::StringSize(
      this->output(i));
  }

  // repeated .caffe2.Argument arg = 5;
  {
    unsigned int count = static_cast<unsigned int>(this->arg_size());
    total_size += 1UL * count;
    for (unsigned int i = 0; i < count; i++) {
      total_size +=
        ::google::protobuf::internal::WireFormatLite::MessageSize(
          this->arg(static_cast<int>(i)));
    }
  }

  // repeated string control_input = 8;
  total_size += 1 *
      ::google::protobuf::internal::FromIntSize(this->control_input_size());
  for (int i = 0, n = this->control_input_size(); i < n; i++) {
    total_size += ::google::protobuf::internal::WireFormatLite::StringSize(
      this->control_input(i));
  }

  if (_has_bits_[0 / 32] & 255u) {
    // optional string name = 3;
    if (has_name()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::StringSize(
          this->name());
    }

    // optional string type = 4;
    if (has_type()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::StringSize(
          this->type());
    }

    // optional string engine = 7;
    if (has_engine()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::StringSize(
          this->engine());
    }

    // optional string debug_info = 10;
    if (has_debug_info()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::StringSize(
          this->debug_info());
    }

    // optional string domain = 11;
    if (has_domain()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::StringSize(
          this->domain());
    }

    // optional .caffe2.DeviceOption device_option = 6;
    if (has_device_option()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::MessageSize(
          *device_option_);
    }

    // optional int64 op_version = 12;
    if (has_op_version()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::Int64Size(
          this->op_version());
    }

    // optional bool is_gradient_op = 9 [default = false];
    if (has_is_gradient_op()) {
      total_size += 1 + 1;
    }

  }
  int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
  SetCachedSize(cached_size);
  return total_size;
}

void OperatorDef::MergeFrom(const ::google::protobuf::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:caffe2.OperatorDef)
  GOOGLE_DCHECK_NE(&from, this);
  const OperatorDef* source =
      ::google::protobuf::internal::DynamicCastToGenerated<const OperatorDef>(
          &from);
  if (source == NULL) {
  // @@protoc_insertion_point(generalized_merge_from_cast_fail:caffe2.OperatorDef)
    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  } else {
  // @@protoc_insertion_point(generalized_merge_from_cast_success:caffe2.OperatorDef)
    MergeFrom(*source);
  }
}

void OperatorDef::MergeFrom(const OperatorDef& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:caffe2.OperatorDef)
  GOOGLE_DCHECK_NE(&from, this);
  _internal_metadata_.MergeFrom(from._internal_metadata_);
  ::google::protobuf::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  input_.MergeFrom(from.input_);
  output_.MergeFrom(from.output_);
  arg_.MergeFrom(from.arg_);
  control_input_.MergeFrom(from.control_input_);
  cached_has_bits = from._has_bits_[0];
  if (cached_has_bits & 255u) {
    if (cached_has_bits & 0x00000001u) {
      set_has_name();
      name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name_);
    }
    if (cached_has_bits & 0x00000002u) {
      set_has_type();
      type_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.type_);
    }
    if (cached_has_bits & 0x00000004u) {
      set_has_engine();
      engine_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.engine_);
    }
    if (cached_has_bits & 0x00000008u) {
      set_has_debug_info();
      debug_info_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.debug_info_);
    }
    if (cached_has_bits & 0x00000010u) {
      set_has_domain();
      domain_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.domain_);
    }
    if (cached_has_bits & 0x00000020u) {
      mutable_device_option()->::caffe2::DeviceOption::MergeFrom(from.device_option());
    }
    if (cached_has_bits & 0x00000040u) {
      op_version_ = from.op_version_;
    }
    if (cached_has_bits & 0x00000080u) {
      is_gradient_op_ = from.is_gradient_op_;
    }
    _has_bits_[0] |= cached_has_bits;
  }
}

void OperatorDef::CopyFrom(const ::google::protobuf::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:caffe2.OperatorDef)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

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

bool OperatorDef::IsInitialized() const {
  if (!::google::protobuf::internal::AllAreInitialized(this->arg())) return false;
  return true;
}

void OperatorDef::Swap(OperatorDef* other) {
  if (other == this) return;
  InternalSwap(other);
}
void OperatorDef::InternalSwap(OperatorDef* other) {
  using std::swap;
  input_.InternalSwap(CastToBase(&other->input_));
  output_.InternalSwap(CastToBase(&other->output_));
  CastToBase(&arg_)->InternalSwap(CastToBase(&other->arg_));
  control_input_.InternalSwap(CastToBase(&other->control_input_));
  name_.Swap(&other->name_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(),
    GetArenaNoVirtual());
  type_.Swap(&other->type_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(),
    GetArenaNoVirtual());
  engine_.Swap(&other->engine_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(),
    GetArenaNoVirtual());
  debug_info_.Swap(&other->debug_info_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(),
    GetArenaNoVirtual());
  domain_.Swap(&other->domain_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(),
    GetArenaNoVirtual());
  swap(device_option_, other->device_option_);
  swap(op_version_, other->op_version_);
  swap(is_gradient_op_, other->is_gradient_op_);
  swap(_has_bits_[0], other->_has_bits_[0]);
  _internal_metadata_.Swap(&other->_internal_metadata_);
}

::google::protobuf::Metadata OperatorDef::GetMetadata() const {
  protobuf_caffe2_2fproto_2fcaffe2_2eproto::protobuf_AssignDescriptorsOnce();
  return ::protobuf_caffe2_2fproto_2fcaffe2_2eproto::file_level_metadata[kIndexInFileMessages];
}


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

void NetDef::InitAsDefaultInstance() {
  ::caffe2::_NetDef_default_instance_._instance.get_mutable()->device_option_ = const_cast< ::caffe2::DeviceOption*>(
      ::caffe2::DeviceOption::internal_default_instance());
}
#if !defined(_MSC_VER) || _MSC_VER >= 1900
const int NetDef::kNameFieldNumber;
const int NetDef::kOpFieldNumber;
const int NetDef::kTypeFieldNumber;
const int NetDef::kNumWorkersFieldNumber;
const int NetDef::kDeviceOptionFieldNumber;
const int NetDef::kArgFieldNumber;
const int NetDef::kExternalInputFieldNumber;
const int NetDef::kExternalOutputFieldNumber;
#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900

NetDef::NetDef()
  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
  ::google::protobuf::internal::InitSCC(
      &protobuf_caffe2_2fproto_2fcaffe2_2eproto::scc_info_Argument.base);
  SharedCtor();
  // @@protoc_insertion_point(constructor:caffe2.NetDef)
}
NetDef::NetDef(const NetDef& from)
  : ::google::protobuf::Message(),
      _internal_metadata_(NULL),
      _has_bits_(from._has_bits_),
      op_(from.op_),
      arg_(from.arg_),
      external_input_(from.external_input_),
      external_output_(from.external_output_) {
  _internal_metadata_.MergeFrom(from._internal_metadata_);
  name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  if (from.has_name()) {
    name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name_);
  }
  type_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  if (from.has_type()) {
    type_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.type_);
  }
  if (from.has_device_option()) {
    device_option_ = new ::caffe2::DeviceOption(*from.device_option_);
  } else {
    device_option_ = NULL;
  }
  num_workers_ = from.num_workers_;
  // @@protoc_insertion_point(copy_constructor:caffe2.NetDef)
}

void NetDef::SharedCtor() {
  name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  type_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  ::memset(&device_option_, 0, static_cast<size_t>(
      reinterpret_cast<char*>(&num_workers_) -
      reinterpret_cast<char*>(&device_option_)) + sizeof(num_workers_));
}

NetDef::~NetDef() {
  // @@protoc_insertion_point(destructor:caffe2.NetDef)
  SharedDtor();
}

void NetDef::SharedDtor() {
  name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  type_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  if (this != internal_default_instance()) delete device_option_;
}

void NetDef::SetCachedSize(int size) const {
  _cached_size_.Set(size);
}
const ::google::protobuf::Descriptor* NetDef::descriptor() {
  ::protobuf_caffe2_2fproto_2fcaffe2_2eproto::protobuf_AssignDescriptorsOnce();
  return ::protobuf_caffe2_2fproto_2fcaffe2_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
}

const NetDef& NetDef::default_instance() {
  ::google::protobuf::internal::InitSCC(&protobuf_caffe2_2fproto_2fcaffe2_2eproto::scc_info_Argument.base);
  return *internal_default_instance();
}


void NetDef::Clear() {
// @@protoc_insertion_point(message_clear_start:caffe2.NetDef)
  ::google::protobuf::uint32 cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  op_.Clear();
  arg_.Clear();
  external_input_.Clear();
  external_output_.Clear();
  cached_has_bits = _has_bits_[0];
  if (cached_has_bits & 7u) {
    if (cached_has_bits & 0x00000001u) {
      name_.ClearNonDefaultToEmptyNoArena();
    }
    if (cached_has_bits & 0x00000002u) {
      type_.ClearNonDefaultToEmptyNoArena();
    }
    if (cached_has_bits & 0x00000004u) {
      GOOGLE_DCHECK(device_option_ != NULL);
      device_option_->Clear();
    }
  }
  num_workers_ = 0;
  _has_bits_.Clear();
  _internal_metadata_.Clear();
}

bool NetDef::MergePartialFromCodedStream(
    ::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
  ::google::protobuf::uint32 tag;
  // @@protoc_insertion_point(parse_start:caffe2.NetDef)
  for (;;) {
    ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
    tag = p.first;
    if (!p.second) goto handle_unusual;
    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
      // optional string name = 1;
      case 1: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
                input, this->mutable_name()));
          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
            this->name().data(), static_cast<int>(this->name().length()),
            ::google::protobuf::internal::WireFormat::PARSE,
            "caffe2.NetDef.name");
        } else {
          goto handle_unusual;
        }
        break;
      }

      // repeated .caffe2.OperatorDef op = 2;
      case 2: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) {
          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
                input, add_op()));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // optional string type = 3;
      case 3: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) {
          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
                input, this->mutable_type()));
          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
            this->type().data(), static_cast<int>(this->type().length()),
            ::google::protobuf::internal::WireFormat::PARSE,
            "caffe2.NetDef.type");
        } else {
          goto handle_unusual;
        }
        break;
      }

      // optional int32 num_workers = 4 [deprecated = true];
      case 4: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(32u /* 32 & 0xFF */)) {
          set_has_num_workers();
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
                 input, &num_workers_)));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // optional .caffe2.DeviceOption device_option = 5;
      case 5: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(42u /* 42 & 0xFF */)) {
          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
               input, mutable_device_option()));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // repeated .caffe2.Argument arg = 6;
      case 6: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(50u /* 50 & 0xFF */)) {
          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
                input, add_arg()));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // repeated string external_input = 7;
      case 7: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(58u /* 58 & 0xFF */)) {
          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
                input, this->add_external_input()));
          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
            this->external_input(this->external_input_size() - 1).data(),
            static_cast<int>(this->external_input(this->external_input_size() - 1).length()),
            ::google::protobuf::internal::WireFormat::PARSE,
            "caffe2.NetDef.external_input");
        } else {
          goto handle_unusual;
        }
        break;
      }

      // repeated string external_output = 8;
      case 8: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(66u /* 66 & 0xFF */)) {
          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
                input, this->add_external_output()));
          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
            this->external_output(this->external_output_size() - 1).data(),
            static_cast<int>(this->external_output(this->external_output_size() - 1).length()),
            ::google::protobuf::internal::WireFormat::PARSE,
            "caffe2.NetDef.external_output");
        } else {
          goto handle_unusual;
        }
        break;
      }

      default: {
      handle_unusual:
        if (tag == 0) {
          goto success;
        }
        DO_(::google::protobuf::internal::WireFormat::SkipField(
              input, tag, _internal_metadata_.mutable_unknown_fields()));
        break;
      }
    }
  }
success:
  // @@protoc_insertion_point(parse_success:caffe2.NetDef)
  return true;
failure:
  // @@protoc_insertion_point(parse_failure:caffe2.NetDef)
  return false;
#undef DO_
}

void NetDef::SerializeWithCachedSizes(
    ::google::protobuf::io::CodedOutputStream* output) const {
  // @@protoc_insertion_point(serialize_start:caffe2.NetDef)
  ::google::protobuf::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  cached_has_bits = _has_bits_[0];
  // optional string name = 1;
  if (cached_has_bits & 0x00000001u) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->name().data(), static_cast<int>(this->name().length()),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "caffe2.NetDef.name");
    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
      1, this->name(), output);
  }

  // repeated .caffe2.OperatorDef op = 2;
  for (unsigned int i = 0,
      n = static_cast<unsigned int>(this->op_size()); i < n; i++) {
    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
      2,
      this->op(static_cast<int>(i)),
      output);
  }

  // optional string type = 3;
  if (cached_has_bits & 0x00000002u) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->type().data(), static_cast<int>(this->type().length()),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "caffe2.NetDef.type");
    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
      3, this->type(), output);
  }

  // optional int32 num_workers = 4 [deprecated = true];
  if (cached_has_bits & 0x00000008u) {
    ::google::protobuf::internal::WireFormatLite::WriteInt32(4, this->num_workers(), output);
  }

  // optional .caffe2.DeviceOption device_option = 5;
  if (cached_has_bits & 0x00000004u) {
    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
      5, this->_internal_device_option(), output);
  }

  // repeated .caffe2.Argument arg = 6;
  for (unsigned int i = 0,
      n = static_cast<unsigned int>(this->arg_size()); i < n; i++) {
    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
      6,
      this->arg(static_cast<int>(i)),
      output);
  }

  // repeated string external_input = 7;
  for (int i = 0, n = this->external_input_size(); i < n; i++) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->external_input(i).data(), static_cast<int>(this->external_input(i).length()),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "caffe2.NetDef.external_input");
    ::google::protobuf::internal::WireFormatLite::WriteString(
      7, this->external_input(i), output);
  }

  // repeated string external_output = 8;
  for (int i = 0, n = this->external_output_size(); i < n; i++) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->external_output(i).data(), static_cast<int>(this->external_output(i).length()),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "caffe2.NetDef.external_output");
    ::google::protobuf::internal::WireFormatLite::WriteString(
      8, this->external_output(i), output);
  }

  if (_internal_metadata_.have_unknown_fields()) {
    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
        _internal_metadata_.unknown_fields(), output);
  }
  // @@protoc_insertion_point(serialize_end:caffe2.NetDef)
}

::google::protobuf::uint8* NetDef::InternalSerializeWithCachedSizesToArray(
    bool deterministic, ::google::protobuf::uint8* target) const {
  (void)deterministic; // Unused
  // @@protoc_insertion_point(serialize_to_array_start:caffe2.NetDef)
  ::google::protobuf::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  cached_has_bits = _has_bits_[0];
  // optional string name = 1;
  if (cached_has_bits & 0x00000001u) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->name().data(), static_cast<int>(this->name().length()),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "caffe2.NetDef.name");
    target =
      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
        1, this->name(), target);
  }

  // repeated .caffe2.OperatorDef op = 2;
  for (unsigned int i = 0,
      n = static_cast<unsigned int>(this->op_size()); i < n; i++) {
    target = ::google::protobuf::internal::WireFormatLite::
      InternalWriteMessageToArray(
        2, this->op(static_cast<int>(i)), deterministic, target);
  }

  // optional string type = 3;
  if (cached_has_bits & 0x00000002u) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->type().data(), static_cast<int>(this->type().length()),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "caffe2.NetDef.type");
    target =
      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
        3, this->type(), target);
  }

  // optional int32 num_workers = 4 [deprecated = true];
  if (cached_has_bits & 0x00000008u) {
    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(4, this->num_workers(), target);
  }

  // optional .caffe2.DeviceOption device_option = 5;
  if (cached_has_bits & 0x00000004u) {
    target = ::google::protobuf::internal::WireFormatLite::
      InternalWriteMessageToArray(
        5, this->_internal_device_option(), deterministic, target);
  }

  // repeated .caffe2.Argument arg = 6;
  for (unsigned int i = 0,
      n = static_cast<unsigned int>(this->arg_size()); i < n; i++) {
    target = ::google::protobuf::internal::WireFormatLite::
      InternalWriteMessageToArray(
        6, this->arg(static_cast<int>(i)), deterministic, target);
  }

  // repeated string external_input = 7;
  for (int i = 0, n = this->external_input_size(); i < n; i++) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->external_input(i).data(), static_cast<int>(this->external_input(i).length()),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "caffe2.NetDef.external_input");
    target = ::google::protobuf::internal::WireFormatLite::
      WriteStringToArray(7, this->external_input(i), target);
  }

  // repeated string external_output = 8;
  for (int i = 0, n = this->external_output_size(); i < n; i++) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->external_output(i).data(), static_cast<int>(this->external_output(i).length()),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "caffe2.NetDef.external_output");
    target = ::google::protobuf::internal::WireFormatLite::
      WriteStringToArray(8, this->external_output(i), target);
  }

  if (_internal_metadata_.have_unknown_fields()) {
    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
        _internal_metadata_.unknown_fields(), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:caffe2.NetDef)
  return target;
}

size_t NetDef::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:caffe2.NetDef)
  size_t total_size = 0;

  if (_internal_metadata_.have_unknown_fields()) {
    total_size +=
      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
        _internal_metadata_.unknown_fields());
  }
  // repeated .caffe2.OperatorDef op = 2;
  {
    unsigned int count = static_cast<unsigned int>(this->op_size());
    total_size += 1UL * count;
    for (unsigned int i = 0; i < count; i++) {
      total_size +=
        ::google::protobuf::internal::WireFormatLite::MessageSize(
          this->op(static_cast<int>(i)));
    }
  }

  // repeated .caffe2.Argument arg = 6;
  {
    unsigned int count = static_cast<unsigned int>(this->arg_size());
    total_size += 1UL * count;
    for (unsigned int i = 0; i < count; i++) {
      total_size +=
        ::google::protobuf::internal::WireFormatLite::MessageSize(
          this->arg(static_cast<int>(i)));
    }
  }

  // repeated string external_input = 7;
  total_size += 1 *
      ::google::protobuf::internal::FromIntSize(this->external_input_size());
  for (int i = 0, n = this->external_input_size(); i < n; i++) {
    total_size += ::google::protobuf::internal::WireFormatLite::StringSize(
      this->external_input(i));
  }

  // repeated string external_output = 8;
  total_size += 1 *
      ::google::protobuf::internal::FromIntSize(this->external_output_size());
  for (int i = 0, n = this->external_output_size(); i < n; i++) {
    total_size += ::google::protobuf::internal::WireFormatLite::StringSize(
      this->external_output(i));
  }

  if (_has_bits_[0 / 32] & 15u) {
    // optional string name = 1;
    if (has_name()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::StringSize(
          this->name());
    }

    // optional string type = 3;
    if (has_type()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::StringSize(
          this->type());
    }

    // optional .caffe2.DeviceOption device_option = 5;
    if (has_device_option()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::MessageSize(
          *device_option_);
    }

    // optional int32 num_workers = 4 [deprecated = true];
    if (has_num_workers()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::Int32Size(
          this->num_workers());
    }

  }
  int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
  SetCachedSize(cached_size);
  return total_size;
}

void NetDef::MergeFrom(const ::google::protobuf::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:caffe2.NetDef)
  GOOGLE_DCHECK_NE(&from, this);
  const NetDef* source =
      ::google::protobuf::internal::DynamicCastToGenerated<const NetDef>(
          &from);
  if (source == NULL) {
  // @@protoc_insertion_point(generalized_merge_from_cast_fail:caffe2.NetDef)
    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  } else {
  // @@protoc_insertion_point(generalized_merge_from_cast_success:caffe2.NetDef)
    MergeFrom(*source);
  }
}

void NetDef::MergeFrom(const NetDef& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:caffe2.NetDef)
  GOOGLE_DCHECK_NE(&from, this);
  _internal_metadata_.MergeFrom(from._internal_metadata_);
  ::google::protobuf::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  op_.MergeFrom(from.op_);
  arg_.MergeFrom(from.arg_);
  external_input_.MergeFrom(from.external_input_);
  external_output_.MergeFrom(from.external_output_);
  cached_has_bits = from._has_bits_[0];
  if (cached_has_bits & 15u) {
    if (cached_has_bits & 0x00000001u) {
      set_has_name();
      name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name_);
    }
    if (cached_has_bits & 0x00000002u) {
      set_has_type();
      type_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.type_);
    }
    if (cached_has_bits & 0x00000004u) {
      mutable_device_option()->::caffe2::DeviceOption::MergeFrom(from.device_option());
    }
    if (cached_has_bits & 0x00000008u) {
      num_workers_ = from.num_workers_;
    }
    _has_bits_[0] |= cached_has_bits;
  }
}

void NetDef::CopyFrom(const ::google::protobuf::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:caffe2.NetDef)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

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

bool NetDef::IsInitialized() const {
  if (!::google::protobuf::internal::AllAreInitialized(this->op())) return false;
  if (!::google::protobuf::internal::AllAreInitialized(this->arg())) return false;
  return true;
}

void NetDef::Swap(NetDef* other) {
  if (other == this) return;
  InternalSwap(other);
}
void NetDef::InternalSwap(NetDef* other) {
  using std::swap;
  CastToBase(&op_)->InternalSwap(CastToBase(&other->op_));
  CastToBase(&arg_)->InternalSwap(CastToBase(&other->arg_));
  external_input_.InternalSwap(CastToBase(&other->external_input_));
  external_output_.InternalSwap(CastToBase(&other->external_output_));
  name_.Swap(&other->name_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(),
    GetArenaNoVirtual());
  type_.Swap(&other->type_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(),
    GetArenaNoVirtual());
  swap(device_option_, other->device_option_);
  swap(num_workers_, other->num_workers_);
  swap(_has_bits_[0], other->_has_bits_[0]);
  _internal_metadata_.Swap(&other->_internal_metadata_);
}

::google::protobuf::Metadata NetDef::GetMetadata() const {
  protobuf_caffe2_2fproto_2fcaffe2_2eproto::protobuf_AssignDescriptorsOnce();
  return ::protobuf_caffe2_2fproto_2fcaffe2_2eproto::file_level_metadata[kIndexInFileMessages];
}


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

void ExecutionStep::InitAsDefaultInstance() {
}
#if !defined(_MSC_VER) || _MSC_VER >= 1900
const int ExecutionStep::kNameFieldNumber;
const int ExecutionStep::kSubstepFieldNumber;
const int ExecutionStep::kNetworkFieldNumber;
const int ExecutionStep::kNumIterFieldNumber;
const int ExecutionStep::kCriteriaNetworkFieldNumber;
const int ExecutionStep::kReportNetFieldNumber;
const int ExecutionStep::kReportIntervalFieldNumber;
const int ExecutionStep::kRunEveryMsFieldNumber;
const int ExecutionStep::kConcurrentSubstepsFieldNumber;
const int ExecutionStep::kShouldStopBlobFieldNumber;
const int ExecutionStep::kOnlyOnceFieldNumber;
const int ExecutionStep::kCreateWorkspaceFieldNumber;
const int ExecutionStep::kNumConcurrentInstancesFieldNumber;
#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900

ExecutionStep::ExecutionStep()
  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
  ::google::protobuf::internal::InitSCC(
      &protobuf_caffe2_2fproto_2fcaffe2_2eproto::scc_info_ExecutionStep.base);
  SharedCtor();
  // @@protoc_insertion_point(constructor:caffe2.ExecutionStep)
}
ExecutionStep::ExecutionStep(const ExecutionStep& from)
  : ::google::protobuf::Message(),
      _internal_metadata_(NULL),
      _has_bits_(from._has_bits_),
      substep_(from.substep_),
      network_(from.network_) {
  _internal_metadata_.MergeFrom(from._internal_metadata_);
  name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  if (from.has_name()) {
    name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name_);
  }
  criteria_network_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  if (from.has_criteria_network()) {
    criteria_network_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.criteria_network_);
  }
  report_net_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  if (from.has_report_net()) {
    report_net_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.report_net_);
  }
  should_stop_blob_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  if (from.has_should_stop_blob()) {
    should_stop_blob_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.should_stop_blob_);
  }
  ::memcpy(&num_iter_, &from.num_iter_,
    static_cast<size_t>(reinterpret_cast<char*>(&num_concurrent_instances_) -
    reinterpret_cast<char*>(&num_iter_)) + sizeof(num_concurrent_instances_));
  // @@protoc_insertion_point(copy_constructor:caffe2.ExecutionStep)
}

void ExecutionStep::SharedCtor() {
  name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  criteria_network_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  report_net_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  should_stop_blob_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  ::memset(&num_iter_, 0, static_cast<size_t>(
      reinterpret_cast<char*>(&num_concurrent_instances_) -
      reinterpret_cast<char*>(&num_iter_)) + sizeof(num_concurrent_instances_));
}

ExecutionStep::~ExecutionStep() {
  // @@protoc_insertion_point(destructor:caffe2.ExecutionStep)
  SharedDtor();
}

void ExecutionStep::SharedDtor() {
  name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  criteria_network_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  report_net_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  should_stop_blob_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}

void ExecutionStep::SetCachedSize(int size) const {
  _cached_size_.Set(size);
}
const ::google::protobuf::Descriptor* ExecutionStep::descriptor() {
  ::protobuf_caffe2_2fproto_2fcaffe2_2eproto::protobuf_AssignDescriptorsOnce();
  return ::protobuf_caffe2_2fproto_2fcaffe2_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
}

const ExecutionStep& ExecutionStep::default_instance() {
  ::google::protobuf::internal::InitSCC(&protobuf_caffe2_2fproto_2fcaffe2_2eproto::scc_info_ExecutionStep.base);
  return *internal_default_instance();
}


void ExecutionStep::Clear() {
// @@protoc_insertion_point(message_clear_start:caffe2.ExecutionStep)
  ::google::protobuf::uint32 cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  substep_.Clear();
  network_.Clear();
  cached_has_bits = _has_bits_[0];
  if (cached_has_bits & 15u) {
    if (cached_has_bits & 0x00000001u) {
      name_.ClearNonDefaultToEmptyNoArena();
    }
    if (cached_has_bits & 0x00000002u) {
      criteria_network_.ClearNonDefaultToEmptyNoArena();
    }
    if (cached_has_bits & 0x00000004u) {
      report_net_.ClearNonDefaultToEmptyNoArena();
    }
    if (cached_has_bits & 0x00000008u) {
      should_stop_blob_.ClearNonDefaultToEmptyNoArena();
    }
  }
  if (cached_has_bits & 240u) {
    ::memset(&num_iter_, 0, static_cast<size_t>(
        reinterpret_cast<char*>(&only_once_) -
        reinterpret_cast<char*>(&num_iter_)) + sizeof(only_once_));
  }
  if (cached_has_bits & 1792u) {
    ::memset(&create_workspace_, 0, static_cast<size_t>(
        reinterpret_cast<char*>(&num_concurrent_instances_) -
        reinterpret_cast<char*>(&create_workspace_)) + sizeof(num_concurrent_instances_));
  }
  _has_bits_.Clear();
  _internal_metadata_.Clear();
}

bool ExecutionStep::MergePartialFromCodedStream(
    ::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
  ::google::protobuf::uint32 tag;
  // @@protoc_insertion_point(parse_start:caffe2.ExecutionStep)
  for (;;) {
    ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
    tag = p.first;
    if (!p.second) goto handle_unusual;
    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
      // optional string name = 1;
      case 1: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
                input, this->mutable_name()));
          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
            this->name().data(), static_cast<int>(this->name().length()),
            ::google::protobuf::internal::WireFormat::PARSE,
            "caffe2.ExecutionStep.name");
        } else {
          goto handle_unusual;
        }
        break;
      }

      // repeated .caffe2.ExecutionStep substep = 2;
      case 2: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) {
          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
                input, add_substep()));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // repeated string network = 3;
      case 3: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) {
          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
                input, this->add_network()));
          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
            this->network(this->network_size() - 1).data(),
            static_cast<int>(this->network(this->network_size() - 1).length()),
            ::google::protobuf::internal::WireFormat::PARSE,
            "caffe2.ExecutionStep.network");
        } else {
          goto handle_unusual;
        }
        break;
      }

      // optional int64 num_iter = 4;
      case 4: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(32u /* 32 & 0xFF */)) {
          set_has_num_iter();
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>(
                 input, &num_iter_)));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // optional string criteria_network = 5 [deprecated = true];
      case 5: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(42u /* 42 & 0xFF */)) {
          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
                input, this->mutable_criteria_network()));
          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
            this->criteria_network().data(), static_cast<int>(this->criteria_network().length()),
            ::google::protobuf::internal::WireFormat::PARSE,
            "caffe2.ExecutionStep.criteria_network");
        } else {
          goto handle_unusual;
        }
        break;
      }

      // optional bool concurrent_substeps = 6;
      case 6: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(48u /* 48 & 0xFF */)) {
          set_has_concurrent_substeps();
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
                 input, &concurrent_substeps_)));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // optional string report_net = 7;
      case 7: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(58u /* 58 & 0xFF */)) {
          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
                input, this->mutable_report_net()));
          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
            this->report_net().data(), static_cast<int>(this->report_net().length()),
            ::google::protobuf::internal::WireFormat::PARSE,
            "caffe2.ExecutionStep.report_net");
        } else {
          goto handle_unusual;
        }
        break;
      }

      // optional int32 report_interval = 8;
      case 8: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(64u /* 64 & 0xFF */)) {
          set_has_report_interval();
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
                 input, &report_interval_)));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // optional string should_stop_blob = 9;
      case 9: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(74u /* 74 & 0xFF */)) {
          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
                input, this->mutable_should_stop_blob()));
          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
            this->should_stop_blob().data(), static_cast<int>(this->should_stop_blob().length()),
            ::google::protobuf::internal::WireFormat::PARSE,
            "caffe2.ExecutionStep.should_stop_blob");
        } else {
          goto handle_unusual;
        }
        break;
      }

      // optional bool only_once = 10;
      case 10: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(80u /* 80 & 0xFF */)) {
          set_has_only_once();
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
                 input, &only_once_)));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // optional int64 run_every_ms = 11;
      case 11: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(88u /* 88 & 0xFF */)) {
          set_has_run_every_ms();
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>(
                 input, &run_every_ms_)));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // optional bool create_workspace = 12;
      case 12: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(96u /* 96 & 0xFF */)) {
          set_has_create_workspace();
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
                 input, &create_workspace_)));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // optional int32 num_concurrent_instances = 13;
      case 13: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(104u /* 104 & 0xFF */)) {
          set_has_num_concurrent_instances();
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
                 input, &num_concurrent_instances_)));
        } else {
          goto handle_unusual;
        }
        break;
      }

      default: {
      handle_unusual:
        if (tag == 0) {
          goto success;
        }
        DO_(::google::protobuf::internal::WireFormat::SkipField(
              input, tag, _internal_metadata_.mutable_unknown_fields()));
        break;
      }
    }
  }
success:
  // @@protoc_insertion_point(parse_success:caffe2.ExecutionStep)
  return true;
failure:
  // @@protoc_insertion_point(parse_failure:caffe2.ExecutionStep)
  return false;
#undef DO_
}

void ExecutionStep::SerializeWithCachedSizes(
    ::google::protobuf::io::CodedOutputStream* output) const {
  // @@protoc_insertion_point(serialize_start:caffe2.ExecutionStep)
  ::google::protobuf::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  cached_has_bits = _has_bits_[0];
  // optional string name = 1;
  if (cached_has_bits & 0x00000001u) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->name().data(), static_cast<int>(this->name().length()),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "caffe2.ExecutionStep.name");
    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
      1, this->name(), output);
  }

  // repeated .caffe2.ExecutionStep substep = 2;
  for (unsigned int i = 0,
      n = static_cast<unsigned int>(this->substep_size()); i < n; i++) {
    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
      2,
      this->substep(static_cast<int>(i)),
      output);
  }

  // repeated string network = 3;
  for (int i = 0, n = this->network_size(); i < n; i++) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->network(i).data(), static_cast<int>(this->network(i).length()),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "caffe2.ExecutionStep.network");
    ::google::protobuf::internal::WireFormatLite::WriteString(
      3, this->network(i), output);
  }

  // optional int64 num_iter = 4;
  if (cached_has_bits & 0x00000010u) {
    ::google::protobuf::internal::WireFormatLite::WriteInt64(4, this->num_iter(), output);
  }

  // optional string criteria_network = 5 [deprecated = true];
  if (cached_has_bits & 0x00000002u) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->criteria_network().data(), static_cast<int>(this->criteria_network().length()),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "caffe2.ExecutionStep.criteria_network");
    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
      5, this->criteria_network(), output);
  }

  // optional bool concurrent_substeps = 6;
  if (cached_has_bits & 0x00000040u) {
    ::google::protobuf::internal::WireFormatLite::WriteBool(6, this->concurrent_substeps(), output);
  }

  // optional string report_net = 7;
  if (cached_has_bits & 0x00000004u) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->report_net().data(), static_cast<int>(this->report_net().length()),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "caffe2.ExecutionStep.report_net");
    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
      7, this->report_net(), output);
  }

  // optional int32 report_interval = 8;
  if (cached_has_bits & 0x00000020u) {
    ::google::protobuf::internal::WireFormatLite::WriteInt32(8, this->report_interval(), output);
  }

  // optional string should_stop_blob = 9;
  if (cached_has_bits & 0x00000008u) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->should_stop_blob().data(), static_cast<int>(this->should_stop_blob().length()),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "caffe2.ExecutionStep.should_stop_blob");
    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
      9, this->should_stop_blob(), output);
  }

  // optional bool only_once = 10;
  if (cached_has_bits & 0x00000080u) {
    ::google::protobuf::internal::WireFormatLite::WriteBool(10, this->only_once(), output);
  }

  // optional int64 run_every_ms = 11;
  if (cached_has_bits & 0x00000200u) {
    ::google::protobuf::internal::WireFormatLite::WriteInt64(11, this->run_every_ms(), output);
  }

  // optional bool create_workspace = 12;
  if (cached_has_bits & 0x00000100u) {
    ::google::protobuf::internal::WireFormatLite::WriteBool(12, this->create_workspace(), output);
  }

  // optional int32 num_concurrent_instances = 13;
  if (cached_has_bits & 0x00000400u) {
    ::google::protobuf::internal::WireFormatLite::WriteInt32(13, this->num_concurrent_instances(), output);
  }

  if (_internal_metadata_.have_unknown_fields()) {
    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
        _internal_metadata_.unknown_fields(), output);
  }
  // @@protoc_insertion_point(serialize_end:caffe2.ExecutionStep)
}

::google::protobuf::uint8* ExecutionStep::InternalSerializeWithCachedSizesToArray(
    bool deterministic, ::google::protobuf::uint8* target) const {
  (void)deterministic; // Unused
  // @@protoc_insertion_point(serialize_to_array_start:caffe2.ExecutionStep)
  ::google::protobuf::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  cached_has_bits = _has_bits_[0];
  // optional string name = 1;
  if (cached_has_bits & 0x00000001u) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->name().data(), static_cast<int>(this->name().length()),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "caffe2.ExecutionStep.name");
    target =
      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
        1, this->name(), target);
  }

  // repeated .caffe2.ExecutionStep substep = 2;
  for (unsigned int i = 0,
      n = static_cast<unsigned int>(this->substep_size()); i < n; i++) {
    target = ::google::protobuf::internal::WireFormatLite::
      InternalWriteMessageToArray(
        2, this->substep(static_cast<int>(i)), deterministic, target);
  }

  // repeated string network = 3;
  for (int i = 0, n = this->network_size(); i < n; i++) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->network(i).data(), static_cast<int>(this->network(i).length()),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "caffe2.ExecutionStep.network");
    target = ::google::protobuf::internal::WireFormatLite::
      WriteStringToArray(3, this->network(i), target);
  }

  // optional int64 num_iter = 4;
  if (cached_has_bits & 0x00000010u) {
    target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(4, this->num_iter(), target);
  }

  // optional string criteria_network = 5 [deprecated = true];
  if (cached_has_bits & 0x00000002u) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->criteria_network().data(), static_cast<int>(this->criteria_network().length()),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "caffe2.ExecutionStep.criteria_network");
    target =
      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
        5, this->criteria_network(), target);
  }

  // optional bool concurrent_substeps = 6;
  if (cached_has_bits & 0x00000040u) {
    target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(6, this->concurrent_substeps(), target);
  }

  // optional string report_net = 7;
  if (cached_has_bits & 0x00000004u) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->report_net().data(), static_cast<int>(this->report_net().length()),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "caffe2.ExecutionStep.report_net");
    target =
      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
        7, this->report_net(), target);
  }

  // optional int32 report_interval = 8;
  if (cached_has_bits & 0x00000020u) {
    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(8, this->report_interval(), target);
  }

  // optional string should_stop_blob = 9;
  if (cached_has_bits & 0x00000008u) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->should_stop_blob().data(), static_cast<int>(this->should_stop_blob().length()),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "caffe2.ExecutionStep.should_stop_blob");
    target =
      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
        9, this->should_stop_blob(), target);
  }

  // optional bool only_once = 10;
  if (cached_has_bits & 0x00000080u) {
    target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(10, this->only_once(), target);
  }

  // optional int64 run_every_ms = 11;
  if (cached_has_bits & 0x00000200u) {
    target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(11, this->run_every_ms(), target);
  }

  // optional bool create_workspace = 12;
  if (cached_has_bits & 0x00000100u) {
    target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(12, this->create_workspace(), target);
  }

  // optional int32 num_concurrent_instances = 13;
  if (cached_has_bits & 0x00000400u) {
    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(13, this->num_concurrent_instances(), target);
  }

  if (_internal_metadata_.have_unknown_fields()) {
    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
        _internal_metadata_.unknown_fields(), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:caffe2.ExecutionStep)
  return target;
}

size_t ExecutionStep::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:caffe2.ExecutionStep)
  size_t total_size = 0;

  if (_internal_metadata_.have_unknown_fields()) {
    total_size +=
      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
        _internal_metadata_.unknown_fields());
  }
  // repeated .caffe2.ExecutionStep substep = 2;
  {
    unsigned int count = static_cast<unsigned int>(this->substep_size());
    total_size += 1UL * count;
    for (unsigned int i = 0; i < count; i++) {
      total_size +=
        ::google::protobuf::internal::WireFormatLite::MessageSize(
          this->substep(static_cast<int>(i)));
    }
  }

  // repeated string network = 3;
  total_size += 1 *
      ::google::protobuf::internal::FromIntSize(this->network_size());
  for (int i = 0, n = this->network_size(); i < n; i++) {
    total_size += ::google::protobuf::internal::WireFormatLite::StringSize(
      this->network(i));
  }

  if (_has_bits_[0 / 32] & 255u) {
    // optional string name = 1;
    if (has_name()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::StringSize(
          this->name());
    }

    // optional string criteria_network = 5 [deprecated = true];
    if (has_criteria_network()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::StringSize(
          this->criteria_network());
    }

    // optional string report_net = 7;
    if (has_report_net()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::StringSize(
          this->report_net());
    }

    // optional string should_stop_blob = 9;
    if (has_should_stop_blob()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::StringSize(
          this->should_stop_blob());
    }

    // optional int64 num_iter = 4;
    if (has_num_iter()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::Int64Size(
          this->num_iter());
    }

    // optional int32 report_interval = 8;
    if (has_report_interval()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::Int32Size(
          this->report_interval());
    }

    // optional bool concurrent_substeps = 6;
    if (has_concurrent_substeps()) {
      total_size += 1 + 1;
    }

    // optional bool only_once = 10;
    if (has_only_once()) {
      total_size += 1 + 1;
    }

  }
  if (_has_bits_[8 / 32] & 1792u) {
    // optional bool create_workspace = 12;
    if (has_create_workspace()) {
      total_size += 1 + 1;
    }

    // optional int64 run_every_ms = 11;
    if (has_run_every_ms()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::Int64Size(
          this->run_every_ms());
    }

    // optional int32 num_concurrent_instances = 13;
    if (has_num_concurrent_instances()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::Int32Size(
          this->num_concurrent_instances());
    }

  }
  int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
  SetCachedSize(cached_size);
  return total_size;
}

void ExecutionStep::MergeFrom(const ::google::protobuf::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:caffe2.ExecutionStep)
  GOOGLE_DCHECK_NE(&from, this);
  const ExecutionStep* source =
      ::google::protobuf::internal::DynamicCastToGenerated<const ExecutionStep>(
          &from);
  if (source == NULL) {
  // @@protoc_insertion_point(generalized_merge_from_cast_fail:caffe2.ExecutionStep)
    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  } else {
  // @@protoc_insertion_point(generalized_merge_from_cast_success:caffe2.ExecutionStep)
    MergeFrom(*source);
  }
}

void ExecutionStep::MergeFrom(const ExecutionStep& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:caffe2.ExecutionStep)
  GOOGLE_DCHECK_NE(&from, this);
  _internal_metadata_.MergeFrom(from._internal_metadata_);
  ::google::protobuf::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  substep_.MergeFrom(from.substep_);
  network_.MergeFrom(from.network_);
  cached_has_bits = from._has_bits_[0];
  if (cached_has_bits & 255u) {
    if (cached_has_bits & 0x00000001u) {
      set_has_name();
      name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name_);
    }
    if (cached_has_bits & 0x00000002u) {
      set_has_criteria_network();
      criteria_network_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.criteria_network_);
    }
    if (cached_has_bits & 0x00000004u) {
      set_has_report_net();
      report_net_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.report_net_);
    }
    if (cached_has_bits & 0x00000008u) {
      set_has_should_stop_blob();
      should_stop_blob_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.should_stop_blob_);
    }
    if (cached_has_bits & 0x00000010u) {
      num_iter_ = from.num_iter_;
    }
    if (cached_has_bits & 0x00000020u) {
      report_interval_ = from.report_interval_;
    }
    if (cached_has_bits & 0x00000040u) {
      concurrent_substeps_ = from.concurrent_substeps_;
    }
    if (cached_has_bits & 0x00000080u) {
      only_once_ = from.only_once_;
    }
    _has_bits_[0] |= cached_has_bits;
  }
  if (cached_has_bits & 1792u) {
    if (cached_has_bits & 0x00000100u) {
      create_workspace_ = from.create_workspace_;
    }
    if (cached_has_bits & 0x00000200u) {
      run_every_ms_ = from.run_every_ms_;
    }
    if (cached_has_bits & 0x00000400u) {
      num_concurrent_instances_ = from.num_concurrent_instances_;
    }
    _has_bits_[0] |= cached_has_bits;
  }
}

void ExecutionStep::CopyFrom(const ::google::protobuf::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:caffe2.ExecutionStep)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

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

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

void ExecutionStep::Swap(ExecutionStep* other) {
  if (other == this) return;
  InternalSwap(other);
}
void ExecutionStep::InternalSwap(ExecutionStep* other) {
  using std::swap;
  CastToBase(&substep_)->InternalSwap(CastToBase(&other->substep_));
  network_.InternalSwap(CastToBase(&other->network_));
  name_.Swap(&other->name_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(),
    GetArenaNoVirtual());
  criteria_network_.Swap(&other->criteria_network_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(),
    GetArenaNoVirtual());
  report_net_.Swap(&other->report_net_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(),
    GetArenaNoVirtual());
  should_stop_blob_.Swap(&other->should_stop_blob_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(),
    GetArenaNoVirtual());
  swap(num_iter_, other->num_iter_);
  swap(report_interval_, other->report_interval_);
  swap(concurrent_substeps_, other->concurrent_substeps_);
  swap(only_once_, other->only_once_);
  swap(create_workspace_, other->create_workspace_);
  swap(run_every_ms_, other->run_every_ms_);
  swap(num_concurrent_instances_, other->num_concurrent_instances_);
  swap(_has_bits_[0], other->_has_bits_[0]);
  _internal_metadata_.Swap(&other->_internal_metadata_);
}

::google::protobuf::Metadata ExecutionStep::GetMetadata() const {
  protobuf_caffe2_2fproto_2fcaffe2_2eproto::protobuf_AssignDescriptorsOnce();
  return ::protobuf_caffe2_2fproto_2fcaffe2_2eproto::file_level_metadata[kIndexInFileMessages];
}


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

void PlanDef::InitAsDefaultInstance() {
}
#if !defined(_MSC_VER) || _MSC_VER >= 1900
const int PlanDef::kNameFieldNumber;
const int PlanDef::kNetworkFieldNumber;
const int PlanDef::kExecutionStepFieldNumber;
#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900

PlanDef::PlanDef()
  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
  ::google::protobuf::internal::InitSCC(
      &protobuf_caffe2_2fproto_2fcaffe2_2eproto::scc_info_PlanDef.base);
  SharedCtor();
  // @@protoc_insertion_point(constructor:caffe2.PlanDef)
}
PlanDef::PlanDef(const PlanDef& from)
  : ::google::protobuf::Message(),
      _internal_metadata_(NULL),
      _has_bits_(from._has_bits_),
      network_(from.network_),
      execution_step_(from.execution_step_) {
  _internal_metadata_.MergeFrom(from._internal_metadata_);
  name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  if (from.has_name()) {
    name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name_);
  }
  // @@protoc_insertion_point(copy_constructor:caffe2.PlanDef)
}

void PlanDef::SharedCtor() {
  name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}

PlanDef::~PlanDef() {
  // @@protoc_insertion_point(destructor:caffe2.PlanDef)
  SharedDtor();
}

void PlanDef::SharedDtor() {
  name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}

void PlanDef::SetCachedSize(int size) const {
  _cached_size_.Set(size);
}
const ::google::protobuf::Descriptor* PlanDef::descriptor() {
  ::protobuf_caffe2_2fproto_2fcaffe2_2eproto::protobuf_AssignDescriptorsOnce();
  return ::protobuf_caffe2_2fproto_2fcaffe2_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
}

const PlanDef& PlanDef::default_instance() {
  ::google::protobuf::internal::InitSCC(&protobuf_caffe2_2fproto_2fcaffe2_2eproto::scc_info_PlanDef.base);
  return *internal_default_instance();
}


void PlanDef::Clear() {
// @@protoc_insertion_point(message_clear_start:caffe2.PlanDef)
  ::google::protobuf::uint32 cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  network_.Clear();
  execution_step_.Clear();
  cached_has_bits = _has_bits_[0];
  if (cached_has_bits & 0x00000001u) {
    name_.ClearNonDefaultToEmptyNoArena();
  }
  _has_bits_.Clear();
  _internal_metadata_.Clear();
}

bool PlanDef::MergePartialFromCodedStream(
    ::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
  ::google::protobuf::uint32 tag;
  // @@protoc_insertion_point(parse_start:caffe2.PlanDef)
  for (;;) {
    ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
    tag = p.first;
    if (!p.second) goto handle_unusual;
    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
      // optional string name = 1;
      case 1: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
                input, this->mutable_name()));
          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
            this->name().data(), static_cast<int>(this->name().length()),
            ::google::protobuf::internal::WireFormat::PARSE,
            "caffe2.PlanDef.name");
        } else {
          goto handle_unusual;
        }
        break;
      }

      // repeated .caffe2.NetDef network = 2;
      case 2: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) {
          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
                input, add_network()));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // repeated .caffe2.ExecutionStep execution_step = 3;
      case 3: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) {
          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
                input, add_execution_step()));
        } else {
          goto handle_unusual;
        }
        break;
      }

      default: {
      handle_unusual:
        if (tag == 0) {
          goto success;
        }
        DO_(::google::protobuf::internal::WireFormat::SkipField(
              input, tag, _internal_metadata_.mutable_unknown_fields()));
        break;
      }
    }
  }
success:
  // @@protoc_insertion_point(parse_success:caffe2.PlanDef)
  return true;
failure:
  // @@protoc_insertion_point(parse_failure:caffe2.PlanDef)
  return false;
#undef DO_
}

void PlanDef::SerializeWithCachedSizes(
    ::google::protobuf::io::CodedOutputStream* output) const {
  // @@protoc_insertion_point(serialize_start:caffe2.PlanDef)
  ::google::protobuf::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  cached_has_bits = _has_bits_[0];
  // optional string name = 1;
  if (cached_has_bits & 0x00000001u) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->name().data(), static_cast<int>(this->name().length()),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "caffe2.PlanDef.name");
    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
      1, this->name(), output);
  }

  // repeated .caffe2.NetDef network = 2;
  for (unsigned int i = 0,
      n = static_cast<unsigned int>(this->network_size()); i < n; i++) {
    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
      2,
      this->network(static_cast<int>(i)),
      output);
  }

  // repeated .caffe2.ExecutionStep execution_step = 3;
  for (unsigned int i = 0,
      n = static_cast<unsigned int>(this->execution_step_size()); i < n; i++) {
    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
      3,
      this->execution_step(static_cast<int>(i)),
      output);
  }

  if (_internal_metadata_.have_unknown_fields()) {
    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
        _internal_metadata_.unknown_fields(), output);
  }
  // @@protoc_insertion_point(serialize_end:caffe2.PlanDef)
}

::google::protobuf::uint8* PlanDef::InternalSerializeWithCachedSizesToArray(
    bool deterministic, ::google::protobuf::uint8* target) const {
  (void)deterministic; // Unused
  // @@protoc_insertion_point(serialize_to_array_start:caffe2.PlanDef)
  ::google::protobuf::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  cached_has_bits = _has_bits_[0];
  // optional string name = 1;
  if (cached_has_bits & 0x00000001u) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->name().data(), static_cast<int>(this->name().length()),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "caffe2.PlanDef.name");
    target =
      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
        1, this->name(), target);
  }

  // repeated .caffe2.NetDef network = 2;
  for (unsigned int i = 0,
      n = static_cast<unsigned int>(this->network_size()); i < n; i++) {
    target = ::google::protobuf::internal::WireFormatLite::
      InternalWriteMessageToArray(
        2, this->network(static_cast<int>(i)), deterministic, target);
  }

  // repeated .caffe2.ExecutionStep execution_step = 3;
  for (unsigned int i = 0,
      n = static_cast<unsigned int>(this->execution_step_size()); i < n; i++) {
    target = ::google::protobuf::internal::WireFormatLite::
      InternalWriteMessageToArray(
        3, this->execution_step(static_cast<int>(i)), deterministic, target);
  }

  if (_internal_metadata_.have_unknown_fields()) {
    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
        _internal_metadata_.unknown_fields(), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:caffe2.PlanDef)
  return target;
}

size_t PlanDef::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:caffe2.PlanDef)
  size_t total_size = 0;

  if (_internal_metadata_.have_unknown_fields()) {
    total_size +=
      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
        _internal_metadata_.unknown_fields());
  }
  // repeated .caffe2.NetDef network = 2;
  {
    unsigned int count = static_cast<unsigned int>(this->network_size());
    total_size += 1UL * count;
    for (unsigned int i = 0; i < count; i++) {
      total_size +=
        ::google::protobuf::internal::WireFormatLite::MessageSize(
          this->network(static_cast<int>(i)));
    }
  }

  // repeated .caffe2.ExecutionStep execution_step = 3;
  {
    unsigned int count = static_cast<unsigned int>(this->execution_step_size());
    total_size += 1UL * count;
    for (unsigned int i = 0; i < count; i++) {
      total_size +=
        ::google::protobuf::internal::WireFormatLite::MessageSize(
          this->execution_step(static_cast<int>(i)));
    }
  }

  // optional string name = 1;
  if (has_name()) {
    total_size += 1 +
      ::google::protobuf::internal::WireFormatLite::StringSize(
        this->name());
  }

  int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
  SetCachedSize(cached_size);
  return total_size;
}

void PlanDef::MergeFrom(const ::google::protobuf::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:caffe2.PlanDef)
  GOOGLE_DCHECK_NE(&from, this);
  const PlanDef* source =
      ::google::protobuf::internal::DynamicCastToGenerated<const PlanDef>(
          &from);
  if (source == NULL) {
  // @@protoc_insertion_point(generalized_merge_from_cast_fail:caffe2.PlanDef)
    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  } else {
  // @@protoc_insertion_point(generalized_merge_from_cast_success:caffe2.PlanDef)
    MergeFrom(*source);
  }
}

void PlanDef::MergeFrom(const PlanDef& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:caffe2.PlanDef)
  GOOGLE_DCHECK_NE(&from, this);
  _internal_metadata_.MergeFrom(from._internal_metadata_);
  ::google::protobuf::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  network_.MergeFrom(from.network_);
  execution_step_.MergeFrom(from.execution_step_);
  if (from.has_name()) {
    set_has_name();
    name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name_);
  }
}

void PlanDef::CopyFrom(const ::google::protobuf::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:caffe2.PlanDef)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

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

bool PlanDef::IsInitialized() const {
  if (!::google::protobuf::internal::AllAreInitialized(this->network())) return false;
  return true;
}

void PlanDef::Swap(PlanDef* other) {
  if (other == this) return;
  InternalSwap(other);
}
void PlanDef::InternalSwap(PlanDef* other) {
  using std::swap;
  CastToBase(&network_)->InternalSwap(CastToBase(&other->network_));
  CastToBase(&execution_step_)->InternalSwap(CastToBase(&other->execution_step_));
  name_.Swap(&other->name_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(),
    GetArenaNoVirtual());
  swap(_has_bits_[0], other->_has_bits_[0]);
  _internal_metadata_.Swap(&other->_internal_metadata_);
}

::google::protobuf::Metadata PlanDef::GetMetadata() const {
  protobuf_caffe2_2fproto_2fcaffe2_2eproto::protobuf_AssignDescriptorsOnce();
  return ::protobuf_caffe2_2fproto_2fcaffe2_2eproto::file_level_metadata[kIndexInFileMessages];
}


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

void BlobProto::InitAsDefaultInstance() {
  ::caffe2::_BlobProto_default_instance_._instance.get_mutable()->tensor_ = const_cast< ::caffe2::TensorProto*>(
      ::caffe2::TensorProto::internal_default_instance());
  ::caffe2::_BlobProto_default_instance_._instance.get_mutable()->qtensor_ = const_cast< ::caffe2::QTensorProto*>(
      ::caffe2::QTensorProto::internal_default_instance());
}
#if !defined(_MSC_VER) || _MSC_VER >= 1900
const int BlobProto::kNameFieldNumber;
const int BlobProto::kTypeFieldNumber;
const int BlobProto::kTensorFieldNumber;
const int BlobProto::kContentFieldNumber;
const int BlobProto::kQtensorFieldNumber;
const int BlobProto::kContentNumChunksFieldNumber;
const int BlobProto::kContentChunkIdFieldNumber;
#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900

BlobProto::BlobProto()
  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
  ::google::protobuf::internal::InitSCC(
      &protobuf_caffe2_2fproto_2fcaffe2_2eproto::scc_info_BlobProto.base);
  SharedCtor();
  // @@protoc_insertion_point(constructor:caffe2.BlobProto)
}
BlobProto::BlobProto(const BlobProto& from)
  : ::google::protobuf::Message(),
      _internal_metadata_(NULL),
      _has_bits_(from._has_bits_) {
  _internal_metadata_.MergeFrom(from._internal_metadata_);
  name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  if (from.has_name()) {
    name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name_);
  }
  type_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  if (from.has_type()) {
    type_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.type_);
  }
  content_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  if (from.has_content()) {
    content_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.content_);
  }
  if (from.has_tensor()) {
    tensor_ = new ::caffe2::TensorProto(*from.tensor_);
  } else {
    tensor_ = NULL;
  }
  if (from.has_qtensor()) {
    qtensor_ = new ::caffe2::QTensorProto(*from.qtensor_);
  } else {
    qtensor_ = NULL;
  }
  ::memcpy(&content_num_chunks_, &from.content_num_chunks_,
    static_cast<size_t>(reinterpret_cast<char*>(&content_chunk_id_) -
    reinterpret_cast<char*>(&content_num_chunks_)) + sizeof(content_chunk_id_));
  // @@protoc_insertion_point(copy_constructor:caffe2.BlobProto)
}

void BlobProto::SharedCtor() {
  name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  type_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  content_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  ::memset(&tensor_, 0, static_cast<size_t>(
      reinterpret_cast<char*>(&content_chunk_id_) -
      reinterpret_cast<char*>(&tensor_)) + sizeof(content_chunk_id_));
}

BlobProto::~BlobProto() {
  // @@protoc_insertion_point(destructor:caffe2.BlobProto)
  SharedDtor();
}

void BlobProto::SharedDtor() {
  name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  type_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  content_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  if (this != internal_default_instance()) delete tensor_;
  if (this != internal_default_instance()) delete qtensor_;
}

void BlobProto::SetCachedSize(int size) const {
  _cached_size_.Set(size);
}
const ::google::protobuf::Descriptor* BlobProto::descriptor() {
  ::protobuf_caffe2_2fproto_2fcaffe2_2eproto::protobuf_AssignDescriptorsOnce();
  return ::protobuf_caffe2_2fproto_2fcaffe2_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
}

const BlobProto& BlobProto::default_instance() {
  ::google::protobuf::internal::InitSCC(&protobuf_caffe2_2fproto_2fcaffe2_2eproto::scc_info_BlobProto.base);
  return *internal_default_instance();
}


void BlobProto::Clear() {
// @@protoc_insertion_point(message_clear_start:caffe2.BlobProto)
  ::google::protobuf::uint32 cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  cached_has_bits = _has_bits_[0];
  if (cached_has_bits & 31u) {
    if (cached_has_bits & 0x00000001u) {
      name_.ClearNonDefaultToEmptyNoArena();
    }
    if (cached_has_bits & 0x00000002u) {
      type_.ClearNonDefaultToEmptyNoArena();
    }
    if (cached_has_bits & 0x00000004u) {
      content_.ClearNonDefaultToEmptyNoArena();
    }
    if (cached_has_bits & 0x00000008u) {
      GOOGLE_DCHECK(tensor_ != NULL);
      tensor_->Clear();
    }
    if (cached_has_bits & 0x00000010u) {
      GOOGLE_DCHECK(qtensor_ != NULL);
      qtensor_->Clear();
    }
  }
  if (cached_has_bits & 96u) {
    ::memset(&content_num_chunks_, 0, static_cast<size_t>(
        reinterpret_cast<char*>(&content_chunk_id_) -
        reinterpret_cast<char*>(&content_num_chunks_)) + sizeof(content_chunk_id_));
  }
  _has_bits_.Clear();
  _internal_metadata_.Clear();
}

bool BlobProto::MergePartialFromCodedStream(
    ::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
  ::google::protobuf::uint32 tag;
  // @@protoc_insertion_point(parse_start:caffe2.BlobProto)
  for (;;) {
    ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
    tag = p.first;
    if (!p.second) goto handle_unusual;
    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
      // optional string name = 1;
      case 1: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
                input, this->mutable_name()));
          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
            this->name().data(), static_cast<int>(this->name().length()),
            ::google::protobuf::internal::WireFormat::PARSE,
            "caffe2.BlobProto.name");
        } else {
          goto handle_unusual;
        }
        break;
      }

      // optional string type = 2;
      case 2: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) {
          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
                input, this->mutable_type()));
          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
            this->type().data(), static_cast<int>(this->type().length()),
            ::google::protobuf::internal::WireFormat::PARSE,
            "caffe2.BlobProto.type");
        } else {
          goto handle_unusual;
        }
        break;
      }

      // optional .caffe2.TensorProto tensor = 3;
      case 3: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) {
          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
               input, mutable_tensor()));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // optional bytes content = 4;
      case 4: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) {
          DO_(::google::protobuf::internal::WireFormatLite::ReadBytes(
                input, this->mutable_content()));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // optional .caffe2.QTensorProto qtensor = 5;
      case 5: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(42u /* 42 & 0xFF */)) {
          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
               input, mutable_qtensor()));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // optional int32 content_num_chunks = 6;
      case 6: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(48u /* 48 & 0xFF */)) {
          set_has_content_num_chunks();
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
                 input, &content_num_chunks_)));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // optional int32 content_chunk_id = 7;
      case 7: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(56u /* 56 & 0xFF */)) {
          set_has_content_chunk_id();
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
                 input, &content_chunk_id_)));
        } else {
          goto handle_unusual;
        }
        break;
      }

      default: {
      handle_unusual:
        if (tag == 0) {
          goto success;
        }
        DO_(::google::protobuf::internal::WireFormat::SkipField(
              input, tag, _internal_metadata_.mutable_unknown_fields()));
        break;
      }
    }
  }
success:
  // @@protoc_insertion_point(parse_success:caffe2.BlobProto)
  return true;
failure:
  // @@protoc_insertion_point(parse_failure:caffe2.BlobProto)
  return false;
#undef DO_
}

void BlobProto::SerializeWithCachedSizes(
    ::google::protobuf::io::CodedOutputStream* output) const {
  // @@protoc_insertion_point(serialize_start:caffe2.BlobProto)
  ::google::protobuf::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  cached_has_bits = _has_bits_[0];
  // optional string name = 1;
  if (cached_has_bits & 0x00000001u) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->name().data(), static_cast<int>(this->name().length()),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "caffe2.BlobProto.name");
    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
      1, this->name(), output);
  }

  // optional string type = 2;
  if (cached_has_bits & 0x00000002u) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->type().data(), static_cast<int>(this->type().length()),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "caffe2.BlobProto.type");
    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
      2, this->type(), output);
  }

  // optional .caffe2.TensorProto tensor = 3;
  if (cached_has_bits & 0x00000008u) {
    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
      3, this->_internal_tensor(), output);
  }

  // optional bytes content = 4;
  if (cached_has_bits & 0x00000004u) {
    ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased(
      4, this->content(), output);
  }

  // optional .caffe2.QTensorProto qtensor = 5;
  if (cached_has_bits & 0x00000010u) {
    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
      5, this->_internal_qtensor(), output);
  }

  // optional int32 content_num_chunks = 6;
  if (cached_has_bits & 0x00000020u) {
    ::google::protobuf::internal::WireFormatLite::WriteInt32(6, this->content_num_chunks(), output);
  }

  // optional int32 content_chunk_id = 7;
  if (cached_has_bits & 0x00000040u) {
    ::google::protobuf::internal::WireFormatLite::WriteInt32(7, this->content_chunk_id(), output);
  }

  if (_internal_metadata_.have_unknown_fields()) {
    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
        _internal_metadata_.unknown_fields(), output);
  }
  // @@protoc_insertion_point(serialize_end:caffe2.BlobProto)
}

::google::protobuf::uint8* BlobProto::InternalSerializeWithCachedSizesToArray(
    bool deterministic, ::google::protobuf::uint8* target) const {
  (void)deterministic; // Unused
  // @@protoc_insertion_point(serialize_to_array_start:caffe2.BlobProto)
  ::google::protobuf::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  cached_has_bits = _has_bits_[0];
  // optional string name = 1;
  if (cached_has_bits & 0x00000001u) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->name().data(), static_cast<int>(this->name().length()),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "caffe2.BlobProto.name");
    target =
      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
        1, this->name(), target);
  }

  // optional string type = 2;
  if (cached_has_bits & 0x00000002u) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->type().data(), static_cast<int>(this->type().length()),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "caffe2.BlobProto.type");
    target =
      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
        2, this->type(), target);
  }

  // optional .caffe2.TensorProto tensor = 3;
  if (cached_has_bits & 0x00000008u) {
    target = ::google::protobuf::internal::WireFormatLite::
      InternalWriteMessageToArray(
        3, this->_internal_tensor(), deterministic, target);
  }

  // optional bytes content = 4;
  if (cached_has_bits & 0x00000004u) {
    target =
      ::google::protobuf::internal::WireFormatLite::WriteBytesToArray(
        4, this->content(), target);
  }

  // optional .caffe2.QTensorProto qtensor = 5;
  if (cached_has_bits & 0x00000010u) {
    target = ::google::protobuf::internal::WireFormatLite::
      InternalWriteMessageToArray(
        5, this->_internal_qtensor(), deterministic, target);
  }

  // optional int32 content_num_chunks = 6;
  if (cached_has_bits & 0x00000020u) {
    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(6, this->content_num_chunks(), target);
  }

  // optional int32 content_chunk_id = 7;
  if (cached_has_bits & 0x00000040u) {
    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(7, this->content_chunk_id(), target);
  }

  if (_internal_metadata_.have_unknown_fields()) {
    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
        _internal_metadata_.unknown_fields(), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:caffe2.BlobProto)
  return target;
}

size_t BlobProto::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:caffe2.BlobProto)
  size_t total_size = 0;

  if (_internal_metadata_.have_unknown_fields()) {
    total_size +=
      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
        _internal_metadata_.unknown_fields());
  }
  if (_has_bits_[0 / 32] & 127u) {
    // optional string name = 1;
    if (has_name()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::StringSize(
          this->name());
    }

    // optional string type = 2;
    if (has_type()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::StringSize(
          this->type());
    }

    // optional bytes content = 4;
    if (has_content()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::BytesSize(
          this->content());
    }

    // optional .caffe2.TensorProto tensor = 3;
    if (has_tensor()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::MessageSize(
          *tensor_);
    }

    // optional .caffe2.QTensorProto qtensor = 5;
    if (has_qtensor()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::MessageSize(
          *qtensor_);
    }

    // optional int32 content_num_chunks = 6;
    if (has_content_num_chunks()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::Int32Size(
          this->content_num_chunks());
    }

    // optional int32 content_chunk_id = 7;
    if (has_content_chunk_id()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::Int32Size(
          this->content_chunk_id());
    }

  }
  int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
  SetCachedSize(cached_size);
  return total_size;
}

void BlobProto::MergeFrom(const ::google::protobuf::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:caffe2.BlobProto)
  GOOGLE_DCHECK_NE(&from, this);
  const BlobProto* source =
      ::google::protobuf::internal::DynamicCastToGenerated<const BlobProto>(
          &from);
  if (source == NULL) {
  // @@protoc_insertion_point(generalized_merge_from_cast_fail:caffe2.BlobProto)
    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  } else {
  // @@protoc_insertion_point(generalized_merge_from_cast_success:caffe2.BlobProto)
    MergeFrom(*source);
  }
}

void BlobProto::MergeFrom(const BlobProto& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:caffe2.BlobProto)
  GOOGLE_DCHECK_NE(&from, this);
  _internal_metadata_.MergeFrom(from._internal_metadata_);
  ::google::protobuf::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  cached_has_bits = from._has_bits_[0];
  if (cached_has_bits & 127u) {
    if (cached_has_bits & 0x00000001u) {
      set_has_name();
      name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name_);
    }
    if (cached_has_bits & 0x00000002u) {
      set_has_type();
      type_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.type_);
    }
    if (cached_has_bits & 0x00000004u) {
      set_has_content();
      content_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.content_);
    }
    if (cached_has_bits & 0x00000008u) {
      mutable_tensor()->::caffe2::TensorProto::MergeFrom(from.tensor());
    }
    if (cached_has_bits & 0x00000010u) {
      mutable_qtensor()->::caffe2::QTensorProto::MergeFrom(from.qtensor());
    }
    if (cached_has_bits & 0x00000020u) {
      content_num_chunks_ = from.content_num_chunks_;
    }
    if (cached_has_bits & 0x00000040u) {
      content_chunk_id_ = from.content_chunk_id_;
    }
    _has_bits_[0] |= cached_has_bits;
  }
}

void BlobProto::CopyFrom(const ::google::protobuf::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:caffe2.BlobProto)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

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

bool BlobProto::IsInitialized() const {
  if (has_tensor()) {
    if (!this->tensor_->IsInitialized()) return false;
  }
  if (has_qtensor()) {
    if (!this->qtensor_->IsInitialized()) return false;
  }
  return true;
}

void BlobProto::Swap(BlobProto* other) {
  if (other == this) return;
  InternalSwap(other);
}
void BlobProto::InternalSwap(BlobProto* other) {
  using std::swap;
  name_.Swap(&other->name_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(),
    GetArenaNoVirtual());
  type_.Swap(&other->type_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(),
    GetArenaNoVirtual());
  content_.Swap(&other->content_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(),
    GetArenaNoVirtual());
  swap(tensor_, other->tensor_);
  swap(qtensor_, other->qtensor_);
  swap(content_num_chunks_, other->content_num_chunks_);
  swap(content_chunk_id_, other->content_chunk_id_);
  swap(_has_bits_[0], other->_has_bits_[0]);
  _internal_metadata_.Swap(&other->_internal_metadata_);
}

::google::protobuf::Metadata BlobProto::GetMetadata() const {
  protobuf_caffe2_2fproto_2fcaffe2_2eproto::protobuf_AssignDescriptorsOnce();
  return ::protobuf_caffe2_2fproto_2fcaffe2_2eproto::file_level_metadata[kIndexInFileMessages];
}


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

void DBReaderProto::InitAsDefaultInstance() {
}
#if !defined(_MSC_VER) || _MSC_VER >= 1900
const int DBReaderProto::kNameFieldNumber;
const int DBReaderProto::kSourceFieldNumber;
const int DBReaderProto::kDbTypeFieldNumber;
const int DBReaderProto::kKeyFieldNumber;
#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900

DBReaderProto::DBReaderProto()
  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
  ::google::protobuf::internal::InitSCC(
      &protobuf_caffe2_2fproto_2fcaffe2_2eproto::scc_info_DBReaderProto.base);
  SharedCtor();
  // @@protoc_insertion_point(constructor:caffe2.DBReaderProto)
}
DBReaderProto::DBReaderProto(const DBReaderProto& from)
  : ::google::protobuf::Message(),
      _internal_metadata_(NULL),
      _has_bits_(from._has_bits_) {
  _internal_metadata_.MergeFrom(from._internal_metadata_);
  name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  if (from.has_name()) {
    name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name_);
  }
  source_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  if (from.has_source()) {
    source_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.source_);
  }
  db_type_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  if (from.has_db_type()) {
    db_type_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.db_type_);
  }
  key_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  if (from.has_key()) {
    key_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.key_);
  }
  // @@protoc_insertion_point(copy_constructor:caffe2.DBReaderProto)
}

void DBReaderProto::SharedCtor() {
  name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  source_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  db_type_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  key_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}

DBReaderProto::~DBReaderProto() {
  // @@protoc_insertion_point(destructor:caffe2.DBReaderProto)
  SharedDtor();
}

void DBReaderProto::SharedDtor() {
  name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  source_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  db_type_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  key_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}

void DBReaderProto::SetCachedSize(int size) const {
  _cached_size_.Set(size);
}
const ::google::protobuf::Descriptor* DBReaderProto::descriptor() {
  ::protobuf_caffe2_2fproto_2fcaffe2_2eproto::protobuf_AssignDescriptorsOnce();
  return ::protobuf_caffe2_2fproto_2fcaffe2_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
}

const DBReaderProto& DBReaderProto::default_instance() {
  ::google::protobuf::internal::InitSCC(&protobuf_caffe2_2fproto_2fcaffe2_2eproto::scc_info_DBReaderProto.base);
  return *internal_default_instance();
}


void DBReaderProto::Clear() {
// @@protoc_insertion_point(message_clear_start:caffe2.DBReaderProto)
  ::google::protobuf::uint32 cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  cached_has_bits = _has_bits_[0];
  if (cached_has_bits & 15u) {
    if (cached_has_bits & 0x00000001u) {
      name_.ClearNonDefaultToEmptyNoArena();
    }
    if (cached_has_bits & 0x00000002u) {
      source_.ClearNonDefaultToEmptyNoArena();
    }
    if (cached_has_bits & 0x00000004u) {
      db_type_.ClearNonDefaultToEmptyNoArena();
    }
    if (cached_has_bits & 0x00000008u) {
      key_.ClearNonDefaultToEmptyNoArena();
    }
  }
  _has_bits_.Clear();
  _internal_metadata_.Clear();
}

bool DBReaderProto::MergePartialFromCodedStream(
    ::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
  ::google::protobuf::uint32 tag;
  // @@protoc_insertion_point(parse_start:caffe2.DBReaderProto)
  for (;;) {
    ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
    tag = p.first;
    if (!p.second) goto handle_unusual;
    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
      // optional string name = 1;
      case 1: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
                input, this->mutable_name()));
          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
            this->name().data(), static_cast<int>(this->name().length()),
            ::google::protobuf::internal::WireFormat::PARSE,
            "caffe2.DBReaderProto.name");
        } else {
          goto handle_unusual;
        }
        break;
      }

      // optional string source = 2;
      case 2: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) {
          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
                input, this->mutable_source()));
          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
            this->source().data(), static_cast<int>(this->source().length()),
            ::google::protobuf::internal::WireFormat::PARSE,
            "caffe2.DBReaderProto.source");
        } else {
          goto handle_unusual;
        }
        break;
      }

      // optional string db_type = 3;
      case 3: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) {
          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
                input, this->mutable_db_type()));
          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
            this->db_type().data(), static_cast<int>(this->db_type().length()),
            ::google::protobuf::internal::WireFormat::PARSE,
            "caffe2.DBReaderProto.db_type");
        } else {
          goto handle_unusual;
        }
        break;
      }

      // optional string key = 4;
      case 4: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) {
          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
                input, this->mutable_key()));
          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
            this->key().data(), static_cast<int>(this->key().length()),
            ::google::protobuf::internal::WireFormat::PARSE,
            "caffe2.DBReaderProto.key");
        } else {
          goto handle_unusual;
        }
        break;
      }

      default: {
      handle_unusual:
        if (tag == 0) {
          goto success;
        }
        DO_(::google::protobuf::internal::WireFormat::SkipField(
              input, tag, _internal_metadata_.mutable_unknown_fields()));
        break;
      }
    }
  }
success:
  // @@protoc_insertion_point(parse_success:caffe2.DBReaderProto)
  return true;
failure:
  // @@protoc_insertion_point(parse_failure:caffe2.DBReaderProto)
  return false;
#undef DO_
}

void DBReaderProto::SerializeWithCachedSizes(
    ::google::protobuf::io::CodedOutputStream* output) const {
  // @@protoc_insertion_point(serialize_start:caffe2.DBReaderProto)
  ::google::protobuf::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  cached_has_bits = _has_bits_[0];
  // optional string name = 1;
  if (cached_has_bits & 0x00000001u) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->name().data(), static_cast<int>(this->name().length()),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "caffe2.DBReaderProto.name");
    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
      1, this->name(), output);
  }

  // optional string source = 2;
  if (cached_has_bits & 0x00000002u) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->source().data(), static_cast<int>(this->source().length()),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "caffe2.DBReaderProto.source");
    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
      2, this->source(), output);
  }

  // optional string db_type = 3;
  if (cached_has_bits & 0x00000004u) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->db_type().data(), static_cast<int>(this->db_type().length()),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "caffe2.DBReaderProto.db_type");
    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
      3, this->db_type(), output);
  }

  // optional string key = 4;
  if (cached_has_bits & 0x00000008u) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->key().data(), static_cast<int>(this->key().length()),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "caffe2.DBReaderProto.key");
    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
      4, this->key(), output);
  }

  if (_internal_metadata_.have_unknown_fields()) {
    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
        _internal_metadata_.unknown_fields(), output);
  }
  // @@protoc_insertion_point(serialize_end:caffe2.DBReaderProto)
}

::google::protobuf::uint8* DBReaderProto::InternalSerializeWithCachedSizesToArray(
    bool deterministic, ::google::protobuf::uint8* target) const {
  (void)deterministic; // Unused
  // @@protoc_insertion_point(serialize_to_array_start:caffe2.DBReaderProto)
  ::google::protobuf::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  cached_has_bits = _has_bits_[0];
  // optional string name = 1;
  if (cached_has_bits & 0x00000001u) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->name().data(), static_cast<int>(this->name().length()),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "caffe2.DBReaderProto.name");
    target =
      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
        1, this->name(), target);
  }

  // optional string source = 2;
  if (cached_has_bits & 0x00000002u) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->source().data(), static_cast<int>(this->source().length()),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "caffe2.DBReaderProto.source");
    target =
      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
        2, this->source(), target);
  }

  // optional string db_type = 3;
  if (cached_has_bits & 0x00000004u) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->db_type().data(), static_cast<int>(this->db_type().length()),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "caffe2.DBReaderProto.db_type");
    target =
      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
        3, this->db_type(), target);
  }

  // optional string key = 4;
  if (cached_has_bits & 0x00000008u) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->key().data(), static_cast<int>(this->key().length()),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "caffe2.DBReaderProto.key");
    target =
      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
        4, this->key(), target);
  }

  if (_internal_metadata_.have_unknown_fields()) {
    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
        _internal_metadata_.unknown_fields(), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:caffe2.DBReaderProto)
  return target;
}

size_t DBReaderProto::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:caffe2.DBReaderProto)
  size_t total_size = 0;

  if (_internal_metadata_.have_unknown_fields()) {
    total_size +=
      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
        _internal_metadata_.unknown_fields());
  }
  if (_has_bits_[0 / 32] & 15u) {
    // optional string name = 1;
    if (has_name()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::StringSize(
          this->name());
    }

    // optional string source = 2;
    if (has_source()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::StringSize(
          this->source());
    }

    // optional string db_type = 3;
    if (has_db_type()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::StringSize(
          this->db_type());
    }

    // optional string key = 4;
    if (has_key()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::StringSize(
          this->key());
    }

  }
  int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
  SetCachedSize(cached_size);
  return total_size;
}

void DBReaderProto::MergeFrom(const ::google::protobuf::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:caffe2.DBReaderProto)
  GOOGLE_DCHECK_NE(&from, this);
  const DBReaderProto* source =
      ::google::protobuf::internal::DynamicCastToGenerated<const DBReaderProto>(
          &from);
  if (source == NULL) {
  // @@protoc_insertion_point(generalized_merge_from_cast_fail:caffe2.DBReaderProto)
    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  } else {
  // @@protoc_insertion_point(generalized_merge_from_cast_success:caffe2.DBReaderProto)
    MergeFrom(*source);
  }
}

void DBReaderProto::MergeFrom(const DBReaderProto& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:caffe2.DBReaderProto)
  GOOGLE_DCHECK_NE(&from, this);
  _internal_metadata_.MergeFrom(from._internal_metadata_);
  ::google::protobuf::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  cached_has_bits = from._has_bits_[0];
  if (cached_has_bits & 15u) {
    if (cached_has_bits & 0x00000001u) {
      set_has_name();
      name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name_);
    }
    if (cached_has_bits & 0x00000002u) {
      set_has_source();
      source_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.source_);
    }
    if (cached_has_bits & 0x00000004u) {
      set_has_db_type();
      db_type_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.db_type_);
    }
    if (cached_has_bits & 0x00000008u) {
      set_has_key();
      key_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.key_);
    }
  }
}

void DBReaderProto::CopyFrom(const ::google::protobuf::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:caffe2.DBReaderProto)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

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

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

void DBReaderProto::Swap(DBReaderProto* other) {
  if (other == this) return;
  InternalSwap(other);
}
void DBReaderProto::InternalSwap(DBReaderProto* other) {
  using std::swap;
  name_.Swap(&other->name_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(),
    GetArenaNoVirtual());
  source_.Swap(&other->source_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(),
    GetArenaNoVirtual());
  db_type_.Swap(&other->db_type_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(),
    GetArenaNoVirtual());
  key_.Swap(&other->key_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(),
    GetArenaNoVirtual());
  swap(_has_bits_[0], other->_has_bits_[0]);
  _internal_metadata_.Swap(&other->_internal_metadata_);
}

::google::protobuf::Metadata DBReaderProto::GetMetadata() const {
  protobuf_caffe2_2fproto_2fcaffe2_2eproto::protobuf_AssignDescriptorsOnce();
  return ::protobuf_caffe2_2fproto_2fcaffe2_2eproto::file_level_metadata[kIndexInFileMessages];
}


// @@protoc_insertion_point(namespace_scope)
}  // namespace caffe2
namespace google {
namespace protobuf {
template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::caffe2::ExternalDataProto* Arena::CreateMaybeMessage< ::caffe2::ExternalDataProto >(Arena* arena) {
  return Arena::CreateInternal< ::caffe2::ExternalDataProto >(arena);
}
template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::caffe2::TensorProto_Segment* Arena::CreateMaybeMessage< ::caffe2::TensorProto_Segment >(Arena* arena) {
  return Arena::CreateInternal< ::caffe2::TensorProto_Segment >(arena);
}
template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::caffe2::TensorProto* Arena::CreateMaybeMessage< ::caffe2::TensorProto >(Arena* arena) {
  return Arena::CreateInternal< ::caffe2::TensorProto >(arena);
}
template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::caffe2::QTensorProto* Arena::CreateMaybeMessage< ::caffe2::QTensorProto >(Arena* arena) {
  return Arena::CreateInternal< ::caffe2::QTensorProto >(arena);
}
template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::caffe2::TensorProtos* Arena::CreateMaybeMessage< ::caffe2::TensorProtos >(Arena* arena) {
  return Arena::CreateInternal< ::caffe2::TensorProtos >(arena);
}
template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::caffe2::TensorShape* Arena::CreateMaybeMessage< ::caffe2::TensorShape >(Arena* arena) {
  return Arena::CreateInternal< ::caffe2::TensorShape >(arena);
}
template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::caffe2::TensorShapes* Arena::CreateMaybeMessage< ::caffe2::TensorShapes >(Arena* arena) {
  return Arena::CreateInternal< ::caffe2::TensorShapes >(arena);
}
template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::caffe2::Argument* Arena::CreateMaybeMessage< ::caffe2::Argument >(Arena* arena) {
  return Arena::CreateInternal< ::caffe2::Argument >(arena);
}
template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::caffe2::DeviceOption* Arena::CreateMaybeMessage< ::caffe2::DeviceOption >(Arena* arena) {
  return Arena::CreateInternal< ::caffe2::DeviceOption >(arena);
}
template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::caffe2::OperatorDef* Arena::CreateMaybeMessage< ::caffe2::OperatorDef >(Arena* arena) {
  return Arena::CreateInternal< ::caffe2::OperatorDef >(arena);
}
template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::caffe2::NetDef* Arena::CreateMaybeMessage< ::caffe2::NetDef >(Arena* arena) {
  return Arena::CreateInternal< ::caffe2::NetDef >(arena);
}
template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::caffe2::ExecutionStep* Arena::CreateMaybeMessage< ::caffe2::ExecutionStep >(Arena* arena) {
  return Arena::CreateInternal< ::caffe2::ExecutionStep >(arena);
}
template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::caffe2::PlanDef* Arena::CreateMaybeMessage< ::caffe2::PlanDef >(Arena* arena) {
  return Arena::CreateInternal< ::caffe2::PlanDef >(arena);
}
template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::caffe2::BlobProto* Arena::CreateMaybeMessage< ::caffe2::BlobProto >(Arena* arena) {
  return Arena::CreateInternal< ::caffe2::BlobProto >(arena);
}
template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::caffe2::DBReaderProto* Arena::CreateMaybeMessage< ::caffe2::DBReaderProto >(Arena* arena) {
  return Arena::CreateInternal< ::caffe2::DBReaderProto >(arena);
}
}  // namespace protobuf
}  // namespace google

// @@protoc_insertion_point(global_scope)
