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

#include "tensor.pb.h"

#include <algorithm>

#include <google/protobuf/io/coded_stream.h>
#include <google/protobuf/extension_set.h>
#include <google/protobuf/wire_format_lite.h>
#include <google/protobuf/descriptor.h>
#include <google/protobuf/generated_message_reflection.h>
#include <google/protobuf/reflection_ops.h>
#include <google/protobuf/wire_format.h>
// @@protoc_insertion_point(includes)
#include <google/protobuf/port_def.inc>

PROTOBUF_PRAGMA_INIT_SEG
namespace tensorflow {
constexpr TensorProto::TensorProto(
  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
  : float_val_()
  , double_val_()
  , int_val_()
  , _int_val_cached_byte_size_(0)
  , string_val_()
  , scomplex_val_()
  , int64_val_()
  , _int64_val_cached_byte_size_(0)
  , bool_val_()
  , dcomplex_val_()
  , half_val_()
  , _half_val_cached_byte_size_(0)
  , resource_handle_val_()
  , variant_val_()
  , tensor_content_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
  , tensor_shape_(nullptr)
  , dtype_(0)

  , version_number_(0){}
struct TensorProtoDefaultTypeInternal {
  constexpr TensorProtoDefaultTypeInternal()
    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
  ~TensorProtoDefaultTypeInternal() {}
  union {
    TensorProto _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT TensorProtoDefaultTypeInternal _TensorProto_default_instance_;
constexpr VariantTensorDataProto::VariantTensorDataProto(
  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
  : tensors_()
  , type_name_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
  , metadata_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string){}
struct VariantTensorDataProtoDefaultTypeInternal {
  constexpr VariantTensorDataProtoDefaultTypeInternal()
    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
  ~VariantTensorDataProtoDefaultTypeInternal() {}
  union {
    VariantTensorDataProto _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT VariantTensorDataProtoDefaultTypeInternal _VariantTensorDataProto_default_instance_;
}  // namespace tensorflow
static ::PROTOBUF_NAMESPACE_ID::Metadata file_level_metadata_tensor_2eproto[2];
static constexpr ::PROTOBUF_NAMESPACE_ID::EnumDescriptor const** file_level_enum_descriptors_tensor_2eproto = nullptr;
static constexpr ::PROTOBUF_NAMESPACE_ID::ServiceDescriptor const** file_level_service_descriptors_tensor_2eproto = nullptr;

const uint32_t TableStruct_tensor_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
  ~0u,  // no _has_bits_
  PROTOBUF_FIELD_OFFSET(::tensorflow::TensorProto, _internal_metadata_),
  ~0u,  // no _extensions_
  ~0u,  // no _oneof_case_
  ~0u,  // no _weak_field_map_
  ~0u,  // no _inlined_string_donated_
  PROTOBUF_FIELD_OFFSET(::tensorflow::TensorProto, dtype_),
  PROTOBUF_FIELD_OFFSET(::tensorflow::TensorProto, tensor_shape_),
  PROTOBUF_FIELD_OFFSET(::tensorflow::TensorProto, version_number_),
  PROTOBUF_FIELD_OFFSET(::tensorflow::TensorProto, tensor_content_),
  PROTOBUF_FIELD_OFFSET(::tensorflow::TensorProto, half_val_),
  PROTOBUF_FIELD_OFFSET(::tensorflow::TensorProto, float_val_),
  PROTOBUF_FIELD_OFFSET(::tensorflow::TensorProto, double_val_),
  PROTOBUF_FIELD_OFFSET(::tensorflow::TensorProto, int_val_),
  PROTOBUF_FIELD_OFFSET(::tensorflow::TensorProto, string_val_),
  PROTOBUF_FIELD_OFFSET(::tensorflow::TensorProto, scomplex_val_),
  PROTOBUF_FIELD_OFFSET(::tensorflow::TensorProto, int64_val_),
  PROTOBUF_FIELD_OFFSET(::tensorflow::TensorProto, bool_val_),
  PROTOBUF_FIELD_OFFSET(::tensorflow::TensorProto, dcomplex_val_),
  PROTOBUF_FIELD_OFFSET(::tensorflow::TensorProto, resource_handle_val_),
  PROTOBUF_FIELD_OFFSET(::tensorflow::TensorProto, variant_val_),
  ~0u,  // no _has_bits_
  PROTOBUF_FIELD_OFFSET(::tensorflow::VariantTensorDataProto, _internal_metadata_),
  ~0u,  // no _extensions_
  ~0u,  // no _oneof_case_
  ~0u,  // no _weak_field_map_
  ~0u,  // no _inlined_string_donated_
  PROTOBUF_FIELD_OFFSET(::tensorflow::VariantTensorDataProto, type_name_),
  PROTOBUF_FIELD_OFFSET(::tensorflow::VariantTensorDataProto, metadata_),
  PROTOBUF_FIELD_OFFSET(::tensorflow::VariantTensorDataProto, tensors_),
};
static const ::PROTOBUF_NAMESPACE_ID::internal::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
  { 0, -1, -1, sizeof(::tensorflow::TensorProto)},
  { 21, -1, -1, sizeof(::tensorflow::VariantTensorDataProto)},
};

static ::PROTOBUF_NAMESPACE_ID::Message const * const file_default_instances[] = {
  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::tensorflow::_TensorProto_default_instance_),
  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::tensorflow::_VariantTensorDataProto_default_instance_),
};

const char descriptor_table_protodef_tensor_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) =
  "\n\014tensor.proto\022\ntensorflow\032\025resource_han"
  "dle.proto\032\022tensor_shape.proto\032\013types.pro"
  "to\"\334\003\n\013TensorProto\022#\n\005dtype\030\001 \001(\0162\024.tens"
  "orflow.DataType\0222\n\014tensor_shape\030\002 \001(\0132\034."
  "tensorflow.TensorShapeProto\022\026\n\016version_n"
  "umber\030\003 \001(\005\022\026\n\016tensor_content\030\004 \001(\014\022\024\n\010h"
  "alf_val\030\r \003(\005B\002\020\001\022\025\n\tfloat_val\030\005 \003(\002B\002\020\001"
  "\022\026\n\ndouble_val\030\006 \003(\001B\002\020\001\022\023\n\007int_val\030\007 \003("
  "\005B\002\020\001\022\022\n\nstring_val\030\010 \003(\014\022\030\n\014scomplex_va"
  "l\030\t \003(\002B\002\020\001\022\025\n\tint64_val\030\n \003(\003B\002\020\001\022\024\n\010bo"
  "ol_val\030\013 \003(\010B\002\020\001\022\030\n\014dcomplex_val\030\014 \003(\001B\002"
  "\020\001\022<\n\023resource_handle_val\030\016 \003(\0132\037.tensor"
  "flow.ResourceHandleProto\0227\n\013variant_val\030"
  "\017 \003(\0132\".tensorflow.VariantTensorDataProt"
  "o\"g\n\026VariantTensorDataProto\022\021\n\ttype_name"
  "\030\001 \001(\t\022\020\n\010metadata\030\002 \001(\014\022(\n\007tensors\030\003 \003("
  "\0132\027.tensorflow.TensorProtoB-\n\030org.tensor"
  "flow.frameworkB\014TensorProtosP\001\370\001\001b\006proto"
  "3"
  ;
static const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable*const descriptor_table_tensor_2eproto_deps[3] = {
  &::descriptor_table_resource_5fhandle_2eproto,
  &::descriptor_table_tensor_5fshape_2eproto,
  &::descriptor_table_types_2eproto,
};
static ::PROTOBUF_NAMESPACE_ID::internal::once_flag descriptor_table_tensor_2eproto_once;
const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_tensor_2eproto = {
  false, false, 721, descriptor_table_protodef_tensor_2eproto, "tensor.proto", 
  &descriptor_table_tensor_2eproto_once, descriptor_table_tensor_2eproto_deps, 3, 2,
  schemas, file_default_instances, TableStruct_tensor_2eproto::offsets,
  file_level_metadata_tensor_2eproto, file_level_enum_descriptors_tensor_2eproto, file_level_service_descriptors_tensor_2eproto,
};
PROTOBUF_ATTRIBUTE_WEAK const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable* descriptor_table_tensor_2eproto_getter() {
  return &descriptor_table_tensor_2eproto;
}

// Force running AddDescriptors() at dynamic initialization time.
PROTOBUF_ATTRIBUTE_INIT_PRIORITY static ::PROTOBUF_NAMESPACE_ID::internal::AddDescriptorsRunner dynamic_init_dummy_tensor_2eproto(&descriptor_table_tensor_2eproto);
namespace tensorflow {

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

class TensorProto::_Internal {
 public:
  static const ::tensorflow::TensorShapeProto& tensor_shape(const TensorProto* msg);
};

const ::tensorflow::TensorShapeProto&
TensorProto::_Internal::tensor_shape(const TensorProto* msg) {
  return *msg->tensor_shape_;
}
void TensorProto::clear_tensor_shape() {
  if (GetArenaForAllocation() == nullptr && tensor_shape_ != nullptr) {
    delete tensor_shape_;
  }
  tensor_shape_ = nullptr;
}
void TensorProto::clear_resource_handle_val() {
  resource_handle_val_.Clear();
}
TensorProto::TensorProto(::PROTOBUF_NAMESPACE_ID::Arena* arena,
                         bool is_message_owned)
  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned),
  float_val_(arena),
  double_val_(arena),
  int_val_(arena),
  string_val_(arena),
  scomplex_val_(arena),
  int64_val_(arena),
  bool_val_(arena),
  dcomplex_val_(arena),
  half_val_(arena),
  resource_handle_val_(arena),
  variant_val_(arena) {
  SharedCtor();
  if (!is_message_owned) {
    RegisterArenaDtor(arena);
  }
  // @@protoc_insertion_point(arena_constructor:tensorflow.TensorProto)
}
TensorProto::TensorProto(const TensorProto& from)
  : ::PROTOBUF_NAMESPACE_ID::Message(),
      float_val_(from.float_val_),
      double_val_(from.double_val_),
      int_val_(from.int_val_),
      string_val_(from.string_val_),
      scomplex_val_(from.scomplex_val_),
      int64_val_(from.int64_val_),
      bool_val_(from.bool_val_),
      dcomplex_val_(from.dcomplex_val_),
      half_val_(from.half_val_),
      resource_handle_val_(from.resource_handle_val_),
      variant_val_(from.variant_val_) {
  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
  tensor_content_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
    tensor_content_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  if (!from._internal_tensor_content().empty()) {
    tensor_content_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_tensor_content(), 
      GetArenaForAllocation());
  }
  if (from._internal_has_tensor_shape()) {
    tensor_shape_ = new ::tensorflow::TensorShapeProto(*from.tensor_shape_);
  } else {
    tensor_shape_ = nullptr;
  }
  ::memcpy(&dtype_, &from.dtype_,
    static_cast<size_t>(reinterpret_cast<char*>(&version_number_) -
    reinterpret_cast<char*>(&dtype_)) + sizeof(version_number_));
  // @@protoc_insertion_point(copy_constructor:tensorflow.TensorProto)
}

inline void TensorProto::SharedCtor() {
tensor_content_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
  tensor_content_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
::memset(reinterpret_cast<char*>(this) + static_cast<size_t>(
    reinterpret_cast<char*>(&tensor_shape_) - reinterpret_cast<char*>(this)),
    0, static_cast<size_t>(reinterpret_cast<char*>(&version_number_) -
    reinterpret_cast<char*>(&tensor_shape_)) + sizeof(version_number_));
}

TensorProto::~TensorProto() {
  // @@protoc_insertion_point(destructor:tensorflow.TensorProto)
  if (GetArenaForAllocation() != nullptr) return;
  SharedDtor();
  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
}

inline void TensorProto::SharedDtor() {
  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
  tensor_content_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  if (this != internal_default_instance()) delete tensor_shape_;
}

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

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

  float_val_.Clear();
  double_val_.Clear();
  int_val_.Clear();
  string_val_.Clear();
  scomplex_val_.Clear();
  int64_val_.Clear();
  bool_val_.Clear();
  dcomplex_val_.Clear();
  half_val_.Clear();
  resource_handle_val_.Clear();
  variant_val_.Clear();
  tensor_content_.ClearToEmpty();
  if (GetArenaForAllocation() == nullptr && tensor_shape_ != nullptr) {
    delete tensor_shape_;
  }
  tensor_shape_ = nullptr;
  ::memset(&dtype_, 0, static_cast<size_t>(
      reinterpret_cast<char*>(&version_number_) -
      reinterpret_cast<char*>(&dtype_)) + sizeof(version_number_));
  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
}

const char* TensorProto::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  while (!ctx->Done(&ptr)) {
    uint32_t tag;
    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
    switch (tag >> 3) {
      // .tensorflow.DataType dtype = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
          uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
          _internal_set_dtype(static_cast<::tensorflow::DataType>(val));
        } else
          goto handle_unusual;
        continue;
      // .tensorflow.TensorShapeProto tensor_shape = 2;
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 18)) {
          ptr = ctx->ParseMessage(_internal_mutable_tensor_shape(), ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // int32 version_number = 3;
      case 3:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 24)) {
          version_number_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // bytes tensor_content = 4;
      case 4:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 34)) {
          auto str = _internal_mutable_tensor_content();
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // repeated float float_val = 5 [packed = true];
      case 5:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 42)) {
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedFloatParser(_internal_mutable_float_val(), ptr, ctx);
          CHK_(ptr);
        } else if (static_cast<uint8_t>(tag) == 45) {
          _internal_add_float_val(::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr));
          ptr += sizeof(float);
        } else
          goto handle_unusual;
        continue;
      // repeated double double_val = 6 [packed = true];
      case 6:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 50)) {
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedDoubleParser(_internal_mutable_double_val(), ptr, ctx);
          CHK_(ptr);
        } else if (static_cast<uint8_t>(tag) == 49) {
          _internal_add_double_val(::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<double>(ptr));
          ptr += sizeof(double);
        } else
          goto handle_unusual;
        continue;
      // repeated int32 int_val = 7 [packed = true];
      case 7:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 58)) {
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedInt32Parser(_internal_mutable_int_val(), ptr, ctx);
          CHK_(ptr);
        } else if (static_cast<uint8_t>(tag) == 56) {
          _internal_add_int_val(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr));
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // repeated bytes string_val = 8;
      case 8:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 66)) {
          ptr -= 1;
          do {
            ptr += 1;
            auto str = _internal_add_string_val();
            ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
            CHK_(ptr);
            if (!ctx->DataAvailable(ptr)) break;
          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<66>(ptr));
        } else
          goto handle_unusual;
        continue;
      // repeated float scomplex_val = 9 [packed = true];
      case 9:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 74)) {
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedFloatParser(_internal_mutable_scomplex_val(), ptr, ctx);
          CHK_(ptr);
        } else if (static_cast<uint8_t>(tag) == 77) {
          _internal_add_scomplex_val(::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr));
          ptr += sizeof(float);
        } else
          goto handle_unusual;
        continue;
      // repeated int64 int64_val = 10 [packed = true];
      case 10:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 82)) {
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedInt64Parser(_internal_mutable_int64_val(), ptr, ctx);
          CHK_(ptr);
        } else if (static_cast<uint8_t>(tag) == 80) {
          _internal_add_int64_val(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr));
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // repeated bool bool_val = 11 [packed = true];
      case 11:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 90)) {
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedBoolParser(_internal_mutable_bool_val(), ptr, ctx);
          CHK_(ptr);
        } else if (static_cast<uint8_t>(tag) == 88) {
          _internal_add_bool_val(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr));
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // repeated double dcomplex_val = 12 [packed = true];
      case 12:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 98)) {
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedDoubleParser(_internal_mutable_dcomplex_val(), ptr, ctx);
          CHK_(ptr);
        } else if (static_cast<uint8_t>(tag) == 97) {
          _internal_add_dcomplex_val(::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<double>(ptr));
          ptr += sizeof(double);
        } else
          goto handle_unusual;
        continue;
      // repeated int32 half_val = 13 [packed = true];
      case 13:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 106)) {
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedInt32Parser(_internal_mutable_half_val(), ptr, ctx);
          CHK_(ptr);
        } else if (static_cast<uint8_t>(tag) == 104) {
          _internal_add_half_val(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr));
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // repeated .tensorflow.ResourceHandleProto resource_handle_val = 14;
      case 14:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 114)) {
          ptr -= 1;
          do {
            ptr += 1;
            ptr = ctx->ParseMessage(_internal_add_resource_handle_val(), ptr);
            CHK_(ptr);
            if (!ctx->DataAvailable(ptr)) break;
          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<114>(ptr));
        } else
          goto handle_unusual;
        continue;
      // repeated .tensorflow.VariantTensorDataProto variant_val = 15;
      case 15:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 122)) {
          ptr -= 1;
          do {
            ptr += 1;
            ptr = ctx->ParseMessage(_internal_add_variant_val(), ptr);
            CHK_(ptr);
            if (!ctx->DataAvailable(ptr)) break;
          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<122>(ptr));
        } else
          goto handle_unusual;
        continue;
      default:
        goto handle_unusual;
    }  // switch
  handle_unusual:
    if ((tag == 0) || ((tag & 7) == 4)) {
      CHK_(ptr);
      ctx->SetLastTag(tag);
      goto message_done;
    }
    ptr = UnknownFieldParse(
        tag,
        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
        ptr, ctx);
    CHK_(ptr != nullptr);
  }  // while
message_done:
  return ptr;
failure:
  ptr = nullptr;
  goto message_done;
#undef CHK_
}

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

  // .tensorflow.DataType dtype = 1;
  if (this->_internal_dtype() != 0) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
      1, this->_internal_dtype(), target);
  }

  // .tensorflow.TensorShapeProto tensor_shape = 2;
  if (this->_internal_has_tensor_shape()) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(
        2, _Internal::tensor_shape(this), target, stream);
  }

  // int32 version_number = 3;
  if (this->_internal_version_number() != 0) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(3, this->_internal_version_number(), target);
  }

  // bytes tensor_content = 4;
  if (!this->_internal_tensor_content().empty()) {
    target = stream->WriteBytesMaybeAliased(
        4, this->_internal_tensor_content(), target);
  }

  // repeated float float_val = 5 [packed = true];
  if (this->_internal_float_val_size() > 0) {
    target = stream->WriteFixedPacked(5, _internal_float_val(), target);
  }

  // repeated double double_val = 6 [packed = true];
  if (this->_internal_double_val_size() > 0) {
    target = stream->WriteFixedPacked(6, _internal_double_val(), target);
  }

  // repeated int32 int_val = 7 [packed = true];
  {
    int byte_size = _int_val_cached_byte_size_.load(std::memory_order_relaxed);
    if (byte_size > 0) {
      target = stream->WriteInt32Packed(
          7, _internal_int_val(), byte_size, target);
    }
  }

  // repeated bytes string_val = 8;
  for (int i = 0, n = this->_internal_string_val_size(); i < n; i++) {
    const auto& s = this->_internal_string_val(i);
    target = stream->WriteBytes(8, s, target);
  }

  // repeated float scomplex_val = 9 [packed = true];
  if (this->_internal_scomplex_val_size() > 0) {
    target = stream->WriteFixedPacked(9, _internal_scomplex_val(), target);
  }

  // repeated int64 int64_val = 10 [packed = true];
  {
    int byte_size = _int64_val_cached_byte_size_.load(std::memory_order_relaxed);
    if (byte_size > 0) {
      target = stream->WriteInt64Packed(
          10, _internal_int64_val(), byte_size, target);
    }
  }

  // repeated bool bool_val = 11 [packed = true];
  if (this->_internal_bool_val_size() > 0) {
    target = stream->WriteFixedPacked(11, _internal_bool_val(), target);
  }

  // repeated double dcomplex_val = 12 [packed = true];
  if (this->_internal_dcomplex_val_size() > 0) {
    target = stream->WriteFixedPacked(12, _internal_dcomplex_val(), target);
  }

  // repeated int32 half_val = 13 [packed = true];
  {
    int byte_size = _half_val_cached_byte_size_.load(std::memory_order_relaxed);
    if (byte_size > 0) {
      target = stream->WriteInt32Packed(
          13, _internal_half_val(), byte_size, target);
    }
  }

  // repeated .tensorflow.ResourceHandleProto resource_handle_val = 14;
  for (unsigned int i = 0,
      n = static_cast<unsigned int>(this->_internal_resource_handle_val_size()); i < n; i++) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(14, this->_internal_resource_handle_val(i), target, stream);
  }

  // repeated .tensorflow.VariantTensorDataProto variant_val = 15;
  for (unsigned int i = 0,
      n = static_cast<unsigned int>(this->_internal_variant_val_size()); i < n; i++) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(15, this->_internal_variant_val(i), target, stream);
  }

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

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

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

  // repeated float float_val = 5 [packed = true];
  {
    unsigned int count = static_cast<unsigned int>(this->_internal_float_val_size());
    size_t data_size = 4UL * count;
    if (data_size > 0) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
            static_cast<int32_t>(data_size));
    }
    total_size += data_size;
  }

  // repeated double double_val = 6 [packed = true];
  {
    unsigned int count = static_cast<unsigned int>(this->_internal_double_val_size());
    size_t data_size = 8UL * count;
    if (data_size > 0) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
            static_cast<int32_t>(data_size));
    }
    total_size += data_size;
  }

  // repeated int32 int_val = 7 [packed = true];
  {
    size_t data_size = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      Int32Size(this->int_val_);
    if (data_size > 0) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
            static_cast<int32_t>(data_size));
    }
    int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(data_size);
    _int_val_cached_byte_size_.store(cached_size,
                                    std::memory_order_relaxed);
    total_size += data_size;
  }

  // repeated bytes string_val = 8;
  total_size += 1 *
      ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(string_val_.size());
  for (int i = 0, n = string_val_.size(); i < n; i++) {
    total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize(
      string_val_.Get(i));
  }

  // repeated float scomplex_val = 9 [packed = true];
  {
    unsigned int count = static_cast<unsigned int>(this->_internal_scomplex_val_size());
    size_t data_size = 4UL * count;
    if (data_size > 0) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
            static_cast<int32_t>(data_size));
    }
    total_size += data_size;
  }

  // repeated int64 int64_val = 10 [packed = true];
  {
    size_t data_size = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      Int64Size(this->int64_val_);
    if (data_size > 0) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
            static_cast<int32_t>(data_size));
    }
    int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(data_size);
    _int64_val_cached_byte_size_.store(cached_size,
                                    std::memory_order_relaxed);
    total_size += data_size;
  }

  // repeated bool bool_val = 11 [packed = true];
  {
    unsigned int count = static_cast<unsigned int>(this->_internal_bool_val_size());
    size_t data_size = 1UL * count;
    if (data_size > 0) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
            static_cast<int32_t>(data_size));
    }
    total_size += data_size;
  }

  // repeated double dcomplex_val = 12 [packed = true];
  {
    unsigned int count = static_cast<unsigned int>(this->_internal_dcomplex_val_size());
    size_t data_size = 8UL * count;
    if (data_size > 0) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
            static_cast<int32_t>(data_size));
    }
    total_size += data_size;
  }

  // repeated int32 half_val = 13 [packed = true];
  {
    size_t data_size = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      Int32Size(this->half_val_);
    if (data_size > 0) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
            static_cast<int32_t>(data_size));
    }
    int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(data_size);
    _half_val_cached_byte_size_.store(cached_size,
                                    std::memory_order_relaxed);
    total_size += data_size;
  }

  // repeated .tensorflow.ResourceHandleProto resource_handle_val = 14;
  total_size += 1UL * this->_internal_resource_handle_val_size();
  for (const auto& msg : this->resource_handle_val_) {
    total_size +=
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
  }

  // repeated .tensorflow.VariantTensorDataProto variant_val = 15;
  total_size += 1UL * this->_internal_variant_val_size();
  for (const auto& msg : this->variant_val_) {
    total_size +=
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
  }

  // bytes tensor_content = 4;
  if (!this->_internal_tensor_content().empty()) {
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize(
        this->_internal_tensor_content());
  }

  // .tensorflow.TensorShapeProto tensor_shape = 2;
  if (this->_internal_has_tensor_shape()) {
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
        *tensor_shape_);
  }

  // .tensorflow.DataType dtype = 1;
  if (this->_internal_dtype() != 0) {
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_dtype());
  }

  // int32 version_number = 3;
  if (this->_internal_version_number() != 0) {
    total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32SizePlusOne(this->_internal_version_number());
  }

  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
}

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

void TensorProto::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
  static_cast<TensorProto *>(to)->MergeFrom(
      static_cast<const TensorProto &>(from));
}


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

  float_val_.MergeFrom(from.float_val_);
  double_val_.MergeFrom(from.double_val_);
  int_val_.MergeFrom(from.int_val_);
  string_val_.MergeFrom(from.string_val_);
  scomplex_val_.MergeFrom(from.scomplex_val_);
  int64_val_.MergeFrom(from.int64_val_);
  bool_val_.MergeFrom(from.bool_val_);
  dcomplex_val_.MergeFrom(from.dcomplex_val_);
  half_val_.MergeFrom(from.half_val_);
  resource_handle_val_.MergeFrom(from.resource_handle_val_);
  variant_val_.MergeFrom(from.variant_val_);
  if (!from._internal_tensor_content().empty()) {
    _internal_set_tensor_content(from._internal_tensor_content());
  }
  if (from._internal_has_tensor_shape()) {
    _internal_mutable_tensor_shape()->::tensorflow::TensorShapeProto::MergeFrom(from._internal_tensor_shape());
  }
  if (from._internal_dtype() != 0) {
    _internal_set_dtype(from._internal_dtype());
  }
  if (from._internal_version_number() != 0) {
    _internal_set_version_number(from._internal_version_number());
  }
  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
}

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

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

void TensorProto::InternalSwap(TensorProto* other) {
  using std::swap;
  auto* lhs_arena = GetArenaForAllocation();
  auto* rhs_arena = other->GetArenaForAllocation();
  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
  float_val_.InternalSwap(&other->float_val_);
  double_val_.InternalSwap(&other->double_val_);
  int_val_.InternalSwap(&other->int_val_);
  string_val_.InternalSwap(&other->string_val_);
  scomplex_val_.InternalSwap(&other->scomplex_val_);
  int64_val_.InternalSwap(&other->int64_val_);
  bool_val_.InternalSwap(&other->bool_val_);
  dcomplex_val_.InternalSwap(&other->dcomplex_val_);
  half_val_.InternalSwap(&other->half_val_);
  resource_handle_val_.InternalSwap(&other->resource_handle_val_);
  variant_val_.InternalSwap(&other->variant_val_);
  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
      &tensor_content_, lhs_arena,
      &other->tensor_content_, rhs_arena
  );
  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
      PROTOBUF_FIELD_OFFSET(TensorProto, version_number_)
      + sizeof(TensorProto::version_number_)
      - PROTOBUF_FIELD_OFFSET(TensorProto, tensor_shape_)>(
          reinterpret_cast<char*>(&tensor_shape_),
          reinterpret_cast<char*>(&other->tensor_shape_));
}

::PROTOBUF_NAMESPACE_ID::Metadata TensorProto::GetMetadata() const {
  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
      &descriptor_table_tensor_2eproto_getter, &descriptor_table_tensor_2eproto_once,
      file_level_metadata_tensor_2eproto[0]);
}

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

class VariantTensorDataProto::_Internal {
 public:
};

VariantTensorDataProto::VariantTensorDataProto(::PROTOBUF_NAMESPACE_ID::Arena* arena,
                         bool is_message_owned)
  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned),
  tensors_(arena) {
  SharedCtor();
  if (!is_message_owned) {
    RegisterArenaDtor(arena);
  }
  // @@protoc_insertion_point(arena_constructor:tensorflow.VariantTensorDataProto)
}
VariantTensorDataProto::VariantTensorDataProto(const VariantTensorDataProto& from)
  : ::PROTOBUF_NAMESPACE_ID::Message(),
      tensors_(from.tensors_) {
  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
  type_name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
    type_name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  if (!from._internal_type_name().empty()) {
    type_name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_type_name(), 
      GetArenaForAllocation());
  }
  metadata_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
    metadata_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  if (!from._internal_metadata().empty()) {
    metadata_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_metadata(), 
      GetArenaForAllocation());
  }
  // @@protoc_insertion_point(copy_constructor:tensorflow.VariantTensorDataProto)
}

inline void VariantTensorDataProto::SharedCtor() {
type_name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
  type_name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
metadata_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
  metadata_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
}

VariantTensorDataProto::~VariantTensorDataProto() {
  // @@protoc_insertion_point(destructor:tensorflow.VariantTensorDataProto)
  if (GetArenaForAllocation() != nullptr) return;
  SharedDtor();
  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
}

inline void VariantTensorDataProto::SharedDtor() {
  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
  type_name_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  metadata_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
}

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

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

  tensors_.Clear();
  type_name_.ClearToEmpty();
  metadata_.ClearToEmpty();
  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
}

const char* VariantTensorDataProto::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  while (!ctx->Done(&ptr)) {
    uint32_t tag;
    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
    switch (tag >> 3) {
      // string type_name = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
          auto str = _internal_mutable_type_name();
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
          CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "tensorflow.VariantTensorDataProto.type_name"));
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // bytes metadata = 2;
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 18)) {
          auto str = _internal_mutable_metadata();
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // repeated .tensorflow.TensorProto tensors = 3;
      case 3:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 26)) {
          ptr -= 1;
          do {
            ptr += 1;
            ptr = ctx->ParseMessage(_internal_add_tensors(), ptr);
            CHK_(ptr);
            if (!ctx->DataAvailable(ptr)) break;
          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<26>(ptr));
        } else
          goto handle_unusual;
        continue;
      default:
        goto handle_unusual;
    }  // switch
  handle_unusual:
    if ((tag == 0) || ((tag & 7) == 4)) {
      CHK_(ptr);
      ctx->SetLastTag(tag);
      goto message_done;
    }
    ptr = UnknownFieldParse(
        tag,
        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
        ptr, ctx);
    CHK_(ptr != nullptr);
  }  // while
message_done:
  return ptr;
failure:
  ptr = nullptr;
  goto message_done;
#undef CHK_
}

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

  // string type_name = 1;
  if (!this->_internal_type_name().empty()) {
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
      this->_internal_type_name().data(), static_cast<int>(this->_internal_type_name().length()),
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
      "tensorflow.VariantTensorDataProto.type_name");
    target = stream->WriteStringMaybeAliased(
        1, this->_internal_type_name(), target);
  }

  // bytes metadata = 2;
  if (!this->_internal_metadata().empty()) {
    target = stream->WriteBytesMaybeAliased(
        2, this->_internal_metadata(), target);
  }

  // repeated .tensorflow.TensorProto tensors = 3;
  for (unsigned int i = 0,
      n = static_cast<unsigned int>(this->_internal_tensors_size()); i < n; i++) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(3, this->_internal_tensors(i), target, stream);
  }

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

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

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

  // repeated .tensorflow.TensorProto tensors = 3;
  total_size += 1UL * this->_internal_tensors_size();
  for (const auto& msg : this->tensors_) {
    total_size +=
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
  }

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

  // bytes metadata = 2;
  if (!this->_internal_metadata().empty()) {
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize(
        this->_internal_metadata());
  }

  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
}

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

void VariantTensorDataProto::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
  static_cast<VariantTensorDataProto *>(to)->MergeFrom(
      static_cast<const VariantTensorDataProto &>(from));
}


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

  tensors_.MergeFrom(from.tensors_);
  if (!from._internal_type_name().empty()) {
    _internal_set_type_name(from._internal_type_name());
  }
  if (!from._internal_metadata().empty()) {
    _internal_set_metadata(from._internal_metadata());
  }
  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
}

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

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

void VariantTensorDataProto::InternalSwap(VariantTensorDataProto* other) {
  using std::swap;
  auto* lhs_arena = GetArenaForAllocation();
  auto* rhs_arena = other->GetArenaForAllocation();
  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
  tensors_.InternalSwap(&other->tensors_);
  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
      &type_name_, lhs_arena,
      &other->type_name_, rhs_arena
  );
  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
      &metadata_, lhs_arena,
      &other->metadata_, rhs_arena
  );
}

::PROTOBUF_NAMESPACE_ID::Metadata VariantTensorDataProto::GetMetadata() const {
  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
      &descriptor_table_tensor_2eproto_getter, &descriptor_table_tensor_2eproto_once,
      file_level_metadata_tensor_2eproto[1]);
}

// @@protoc_insertion_point(namespace_scope)
}  // namespace tensorflow
PROTOBUF_NAMESPACE_OPEN
template<> PROTOBUF_NOINLINE ::tensorflow::TensorProto* Arena::CreateMaybeMessage< ::tensorflow::TensorProto >(Arena* arena) {
  return Arena::CreateMessageInternal< ::tensorflow::TensorProto >(arena);
}
template<> PROTOBUF_NOINLINE ::tensorflow::VariantTensorDataProto* Arena::CreateMaybeMessage< ::tensorflow::VariantTensorDataProto >(Arena* arena) {
  return Arena::CreateMessageInternal< ::tensorflow::VariantTensorDataProto >(arena);
}
PROTOBUF_NAMESPACE_CLOSE

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