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

#include "tfnetwork.pb.h"

#include <algorithm>

#include <google/protobuf/descriptor.h>
#include <google/protobuf/generated_message_reflection.h>
#include <google/protobuf/io/coded_stream.h>
#include <google/protobuf/reflection_ops.h>
#include <google/protobuf/stubs/common.h>
#include <google/protobuf/stubs/port.h>
#include <google/protobuf/wire_format.h>
#include <google/protobuf/wire_format_lite_inl.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_tensorflow_2fcore_2fframework_2fgraph_2eproto {
extern PROTOBUF_INTERNAL_EXPORT_protobuf_tensorflow_2fcore_2fframework_2fgraph_2eproto ::google::
    protobuf::internal::SCCInfo<3>
        scc_info_GraphDef;
} // namespace protobuf_tensorflow_2fcore_2fframework_2fgraph_2eproto
namespace tesseract {
class TFNetworkModelDefaultTypeInternal {
public:
  ::google::protobuf::internal::ExplicitlyConstructed<TFNetworkModel> _instance;
} _TFNetworkModel_default_instance_;
} // namespace tesseract
namespace protobuf_tfnetwork_2eproto {
static void InitDefaultsTFNetworkModel() {
  GOOGLE_PROTOBUF_VERIFY_VERSION;

  {
    void *ptr = &::tesseract::_TFNetworkModel_default_instance_;
    new (ptr)::tesseract::TFNetworkModel();
    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
  }
  ::tesseract::TFNetworkModel::InitAsDefaultInstance();
}

::google::protobuf::internal::SCCInfo<1> scc_info_TFNetworkModel = {
    {ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1,
     InitDefaultsTFNetworkModel},
    {
        &protobuf_tensorflow_2fcore_2fframework_2fgraph_2eproto::scc_info_GraphDef.base,
    }};

void InitDefaults() {
  ::google::protobuf::internal::InitSCC(&scc_info_TFNetworkModel.base);
}

::google::protobuf::Metadata file_level_metadata[1];

const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(
    protodesc_cold) = {
    ~0u, // no _has_bits_
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::tesseract::TFNetworkModel,
                                                   _internal_metadata_),
    ~0u, // no _extensions_
    ~0u, // no _oneof_case_
    ~0u, // no _weak_field_map_
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::tesseract::TFNetworkModel, graph_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::tesseract::TFNetworkModel, global_step_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::tesseract::TFNetworkModel, spec_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::tesseract::TFNetworkModel, depth_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::tesseract::TFNetworkModel, x_size_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::tesseract::TFNetworkModel, y_size_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::tesseract::TFNetworkModel, batch_size_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::tesseract::TFNetworkModel, num_classes_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::tesseract::TFNetworkModel, using_ctc_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::tesseract::TFNetworkModel, image_input_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::tesseract::TFNetworkModel, image_widths_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::tesseract::TFNetworkModel, image_heights_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::tesseract::TFNetworkModel, output_layer_),
};
static const ::google::protobuf::internal::MigrationSchema
    schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
        {0, -1, sizeof(::tesseract::TFNetworkModel)},
};

static ::google::protobuf::Message const *const file_default_instances[] = {
    reinterpret_cast<const ::google::protobuf::Message *>(
        &::tesseract::_TFNetworkModel_default_instance_),
};

void protobuf_AssignDescriptors() {
  AddDescriptors();
  AssignDescriptors("tfnetwork.proto", schemas, file_default_instances, TableStruct::offsets,
                    file_level_metadata, NULL, 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, 1);
}

void AddDescriptorsImpl() {
  InitDefaults();
  static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
      "\n\017tfnetwork.proto\022\ttesseract\032%tensorflow"
      "/core/framework/graph.proto\"\233\002\n\016TFNetwor"
      "kModel\022#\n\005graph\030\001 \001(\0132\024.tensorflow.Graph"
      "Def\022\023\n\013global_step\030\002 \001(\003\022\014\n\004spec\030\003 \001(\t\022\r"
      "\n\005depth\030\004 \001(\005\022\016\n\006x_size\030\005 \001(\005\022\016\n\006y_size\030"
      "\006 \001(\005\022\022\n\nbatch_size\030\010 \001(\005\022\023\n\013num_classes"
      "\030\t \001(\005\022\021\n\tusing_ctc\030\n \001(\010\022\023\n\013image_input"
      "\030\013 \001(\t\022\024\n\014image_widths\030\014 \001(\t\022\025\n\rimage_he"
      "ights\030\r \001(\t\022\024\n\014output_layer\030\016 \001(\tb\006proto"
      "3"};
  ::google::protobuf::DescriptorPool::InternalAddGeneratedFile(descriptor, 361);
  ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile("tfnetwork.proto",
                                                                    &protobuf_RegisterTypes);
  ::protobuf_tensorflow_2fcore_2fframework_2fgraph_2eproto::AddDescriptors();
}

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_tfnetwork_2eproto
namespace tesseract {

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

void TFNetworkModel::InitAsDefaultInstance() {
  ::tesseract::_TFNetworkModel_default_instance_._instance.get_mutable()->graph_ =
      const_cast<::tensorflow::GraphDef *>(::tensorflow::GraphDef::internal_default_instance());
}
void TFNetworkModel::clear_graph() {
  if (GetArenaNoVirtual() == NULL && graph_ != NULL) {
    delete graph_;
  }
  graph_ = NULL;
}
#if !defined(_MSC_VER) || _MSC_VER >= 1900
const int TFNetworkModel::kGraphFieldNumber;
const int TFNetworkModel::kGlobalStepFieldNumber;
const int TFNetworkModel::kSpecFieldNumber;
const int TFNetworkModel::kDepthFieldNumber;
const int TFNetworkModel::kXSizeFieldNumber;
const int TFNetworkModel::kYSizeFieldNumber;
const int TFNetworkModel::kBatchSizeFieldNumber;
const int TFNetworkModel::kNumClassesFieldNumber;
const int TFNetworkModel::kUsingCtcFieldNumber;
const int TFNetworkModel::kImageInputFieldNumber;
const int TFNetworkModel::kImageWidthsFieldNumber;
const int TFNetworkModel::kImageHeightsFieldNumber;
const int TFNetworkModel::kOutputLayerFieldNumber;
#endif // !defined(_MSC_VER) || _MSC_VER >= 1900

TFNetworkModel::TFNetworkModel() : ::google::protobuf::Message(), _internal_metadata_(NULL) {
  ::google::protobuf::internal::InitSCC(&protobuf_tfnetwork_2eproto::scc_info_TFNetworkModel.base);
  SharedCtor();
  // @@protoc_insertion_point(constructor:tesseract.TFNetworkModel)
}
TFNetworkModel::TFNetworkModel(const TFNetworkModel &from)
    : ::google::protobuf::Message(), _internal_metadata_(NULL) {
  _internal_metadata_.MergeFrom(from._internal_metadata_);
  spec_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  if (from.spec().size() > 0) {
    spec_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
                            from.spec_);
  }
  image_input_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  if (from.image_input().size() > 0) {
    image_input_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
                                   from.image_input_);
  }
  image_widths_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  if (from.image_widths().size() > 0) {
    image_widths_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
                                    from.image_widths_);
  }
  image_heights_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  if (from.image_heights().size() > 0) {
    image_heights_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
                                     from.image_heights_);
  }
  output_layer_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  if (from.output_layer().size() > 0) {
    output_layer_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
                                    from.output_layer_);
  }
  if (from.has_graph()) {
    graph_ = new ::tensorflow::GraphDef(*from.graph_);
  } else {
    graph_ = NULL;
  }
  ::memcpy(&global_step_, &from.global_step_,
           static_cast<size_t>(reinterpret_cast<char *>(&using_ctc_) -
                               reinterpret_cast<char *>(&global_step_)) +
               sizeof(using_ctc_));
  // @@protoc_insertion_point(copy_constructor:tesseract.TFNetworkModel)
}

void TFNetworkModel::SharedCtor() {
  spec_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  image_input_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  image_widths_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  image_heights_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  output_layer_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  ::memset(&graph_, 0,
           static_cast<size_t>(reinterpret_cast<char *>(&using_ctc_) -
                               reinterpret_cast<char *>(&graph_)) +
               sizeof(using_ctc_));
}

TFNetworkModel::~TFNetworkModel() {
  // @@protoc_insertion_point(destructor:tesseract.TFNetworkModel)
  SharedDtor();
}

void TFNetworkModel::SharedDtor() {
  spec_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  image_input_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  image_widths_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  image_heights_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  output_layer_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  if (this != internal_default_instance())
    delete graph_;
}

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

const TFNetworkModel &TFNetworkModel::default_instance() {
  ::google::protobuf::internal::InitSCC(&protobuf_tfnetwork_2eproto::scc_info_TFNetworkModel.base);
  return *internal_default_instance();
}

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

  spec_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  image_input_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  image_widths_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  image_heights_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  output_layer_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  if (GetArenaNoVirtual() == NULL && graph_ != NULL) {
    delete graph_;
  }
  graph_ = NULL;
  ::memset(&global_step_, 0,
           static_cast<size_t>(reinterpret_cast<char *>(&using_ctc_) -
                               reinterpret_cast<char *>(&global_step_)) +
               sizeof(using_ctc_));
  _internal_metadata_.Clear();
}

bool TFNetworkModel::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:tesseract.TFNetworkModel)
  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)) {
      // .tensorflow.GraphDef graph = 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, mutable_graph()));
        } else {
          goto handle_unusual;
        }
        break;
      }

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

      // string spec = 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_spec()));
          DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
              this->spec().data(), static_cast<int>(this->spec().length()),
              ::google::protobuf::internal::WireFormatLite::PARSE,
              "tesseract.TFNetworkModel.spec"));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // int32 depth = 4;
      case 4: {
        if (static_cast<::google::protobuf::uint8>(tag) ==
            static_cast<::google::protobuf::uint8>(32u /* 32 & 0xFF */)) {
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
               ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
              input, &depth_)));
        } else {
          goto handle_unusual;
        }
        break;
      }

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

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

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

      // int32 num_classes = 9;
      case 9: {
        if (static_cast<::google::protobuf::uint8>(tag) ==
            static_cast<::google::protobuf::uint8>(72u /* 72 & 0xFF */)) {
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
               ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
              input, &num_classes_)));
        } else {
          goto handle_unusual;
        }
        break;
      }

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

      // string image_input = 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_image_input()));
          DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
              this->image_input().data(), static_cast<int>(this->image_input().length()),
              ::google::protobuf::internal::WireFormatLite::PARSE,
              "tesseract.TFNetworkModel.image_input"));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // string image_widths = 12;
      case 12: {
        if (static_cast<::google::protobuf::uint8>(tag) ==
            static_cast<::google::protobuf::uint8>(98u /* 98 & 0xFF */)) {
          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
              input, this->mutable_image_widths()));
          DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
              this->image_widths().data(), static_cast<int>(this->image_widths().length()),
              ::google::protobuf::internal::WireFormatLite::PARSE,
              "tesseract.TFNetworkModel.image_widths"));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // string image_heights = 13;
      case 13: {
        if (static_cast<::google::protobuf::uint8>(tag) ==
            static_cast<::google::protobuf::uint8>(106u /* 106 & 0xFF */)) {
          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
              input, this->mutable_image_heights()));
          DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
              this->image_heights().data(), static_cast<int>(this->image_heights().length()),
              ::google::protobuf::internal::WireFormatLite::PARSE,
              "tesseract.TFNetworkModel.image_heights"));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // string output_layer = 14;
      case 14: {
        if (static_cast<::google::protobuf::uint8>(tag) ==
            static_cast<::google::protobuf::uint8>(114u /* 114 & 0xFF */)) {
          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
              input, this->mutable_output_layer()));
          DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
              this->output_layer().data(), static_cast<int>(this->output_layer().length()),
              ::google::protobuf::internal::WireFormatLite::PARSE,
              "tesseract.TFNetworkModel.output_layer"));
        } 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:tesseract.TFNetworkModel)
  return true;
failure:
  // @@protoc_insertion_point(parse_failure:tesseract.TFNetworkModel)
  return false;
#undef DO_
}

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

  // .tensorflow.GraphDef graph = 1;
  if (this->has_graph()) {
    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
        1, this->_internal_graph(), output);
  }

  // int64 global_step = 2;
  if (this->global_step() != 0) {
    ::google::protobuf::internal::WireFormatLite::WriteInt64(2, this->global_step(), output);
  }

  // string spec = 3;
  if (this->spec().size() > 0) {
    ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
        this->spec().data(), static_cast<int>(this->spec().length()),
        ::google::protobuf::internal::WireFormatLite::SERIALIZE, "tesseract.TFNetworkModel.spec");
    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(3, this->spec(), output);
  }

  // int32 depth = 4;
  if (this->depth() != 0) {
    ::google::protobuf::internal::WireFormatLite::WriteInt32(4, this->depth(), output);
  }

  // int32 x_size = 5;
  if (this->x_size() != 0) {
    ::google::protobuf::internal::WireFormatLite::WriteInt32(5, this->x_size(), output);
  }

  // int32 y_size = 6;
  if (this->y_size() != 0) {
    ::google::protobuf::internal::WireFormatLite::WriteInt32(6, this->y_size(), output);
  }

  // int32 batch_size = 8;
  if (this->batch_size() != 0) {
    ::google::protobuf::internal::WireFormatLite::WriteInt32(8, this->batch_size(), output);
  }

  // int32 num_classes = 9;
  if (this->num_classes() != 0) {
    ::google::protobuf::internal::WireFormatLite::WriteInt32(9, this->num_classes(), output);
  }

  // bool using_ctc = 10;
  if (this->using_ctc() != 0) {
    ::google::protobuf::internal::WireFormatLite::WriteBool(10, this->using_ctc(), output);
  }

  // string image_input = 11;
  if (this->image_input().size() > 0) {
    ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
        this->image_input().data(), static_cast<int>(this->image_input().length()),
        ::google::protobuf::internal::WireFormatLite::SERIALIZE,
        "tesseract.TFNetworkModel.image_input");
    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(11, this->image_input(),
                                                                          output);
  }

  // string image_widths = 12;
  if (this->image_widths().size() > 0) {
    ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
        this->image_widths().data(), static_cast<int>(this->image_widths().length()),
        ::google::protobuf::internal::WireFormatLite::SERIALIZE,
        "tesseract.TFNetworkModel.image_widths");
    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(12, this->image_widths(),
                                                                          output);
  }

  // string image_heights = 13;
  if (this->image_heights().size() > 0) {
    ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
        this->image_heights().data(), static_cast<int>(this->image_heights().length()),
        ::google::protobuf::internal::WireFormatLite::SERIALIZE,
        "tesseract.TFNetworkModel.image_heights");
    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(13, this->image_heights(),
                                                                          output);
  }

  // string output_layer = 14;
  if (this->output_layer().size() > 0) {
    ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
        this->output_layer().data(), static_cast<int>(this->output_layer().length()),
        ::google::protobuf::internal::WireFormatLite::SERIALIZE,
        "tesseract.TFNetworkModel.output_layer");
    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(14, this->output_layer(),
                                                                          output);
  }

  if ((_internal_metadata_.have_unknown_fields() &&
       ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()
             ? _internal_metadata_.unknown_fields()
             : _internal_metadata_.default_instance()),
        output);
  }
  // @@protoc_insertion_point(serialize_end:tesseract.TFNetworkModel)
}

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

  // .tensorflow.GraphDef graph = 1;
  if (this->has_graph()) {
    target = ::google::protobuf::internal::WireFormatLite::InternalWriteMessageToArray(
        1, this->_internal_graph(), deterministic, target);
  }

  // int64 global_step = 2;
  if (this->global_step() != 0) {
    target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(2, this->global_step(),
                                                                             target);
  }

  // string spec = 3;
  if (this->spec().size() > 0) {
    ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
        this->spec().data(), static_cast<int>(this->spec().length()),
        ::google::protobuf::internal::WireFormatLite::SERIALIZE, "tesseract.TFNetworkModel.spec");
    target =
        ::google::protobuf::internal::WireFormatLite::WriteStringToArray(3, this->spec(), target);
  }

  // int32 depth = 4;
  if (this->depth() != 0) {
    target =
        ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(4, this->depth(), target);
  }

  // int32 x_size = 5;
  if (this->x_size() != 0) {
    target =
        ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(5, this->x_size(), target);
  }

  // int32 y_size = 6;
  if (this->y_size() != 0) {
    target =
        ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(6, this->y_size(), target);
  }

  // int32 batch_size = 8;
  if (this->batch_size() != 0) {
    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(8, this->batch_size(),
                                                                             target);
  }

  // int32 num_classes = 9;
  if (this->num_classes() != 0) {
    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(9, this->num_classes(),
                                                                             target);
  }

  // bool using_ctc = 10;
  if (this->using_ctc() != 0) {
    target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(10, this->using_ctc(),
                                                                            target);
  }

  // string image_input = 11;
  if (this->image_input().size() > 0) {
    ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
        this->image_input().data(), static_cast<int>(this->image_input().length()),
        ::google::protobuf::internal::WireFormatLite::SERIALIZE,
        "tesseract.TFNetworkModel.image_input");
    target = ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
        11, this->image_input(), target);
  }

  // string image_widths = 12;
  if (this->image_widths().size() > 0) {
    ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
        this->image_widths().data(), static_cast<int>(this->image_widths().length()),
        ::google::protobuf::internal::WireFormatLite::SERIALIZE,
        "tesseract.TFNetworkModel.image_widths");
    target = ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
        12, this->image_widths(), target);
  }

  // string image_heights = 13;
  if (this->image_heights().size() > 0) {
    ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
        this->image_heights().data(), static_cast<int>(this->image_heights().length()),
        ::google::protobuf::internal::WireFormatLite::SERIALIZE,
        "tesseract.TFNetworkModel.image_heights");
    target = ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
        13, this->image_heights(), target);
  }

  // string output_layer = 14;
  if (this->output_layer().size() > 0) {
    ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
        this->output_layer().data(), static_cast<int>(this->output_layer().length()),
        ::google::protobuf::internal::WireFormatLite::SERIALIZE,
        "tesseract.TFNetworkModel.output_layer");
    target = ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
        14, this->output_layer(), target);
  }

  if ((_internal_metadata_.have_unknown_fields() &&
       ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()
             ? _internal_metadata_.unknown_fields()
             : _internal_metadata_.default_instance()),
        target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:tesseract.TFNetworkModel)
  return target;
}

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

  if ((_internal_metadata_.have_unknown_fields() &&
       ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
    total_size += ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()
             ? _internal_metadata_.unknown_fields()
             : _internal_metadata_.default_instance()));
  }
  // string spec = 3;
  if (this->spec().size() > 0) {
    total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize(this->spec());
  }

  // string image_input = 11;
  if (this->image_input().size() > 0) {
    total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize(this->image_input());
  }

  // string image_widths = 12;
  if (this->image_widths().size() > 0) {
    total_size +=
        1 + ::google::protobuf::internal::WireFormatLite::StringSize(this->image_widths());
  }

  // string image_heights = 13;
  if (this->image_heights().size() > 0) {
    total_size +=
        1 + ::google::protobuf::internal::WireFormatLite::StringSize(this->image_heights());
  }

  // string output_layer = 14;
  if (this->output_layer().size() > 0) {
    total_size +=
        1 + ::google::protobuf::internal::WireFormatLite::StringSize(this->output_layer());
  }

  // .tensorflow.GraphDef graph = 1;
  if (this->has_graph()) {
    total_size += 1 + ::google::protobuf::internal::WireFormatLite::MessageSize(*graph_);
  }

  // int64 global_step = 2;
  if (this->global_step() != 0) {
    total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int64Size(this->global_step());
  }

  // int32 depth = 4;
  if (this->depth() != 0) {
    total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size(this->depth());
  }

  // int32 x_size = 5;
  if (this->x_size() != 0) {
    total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size(this->x_size());
  }

  // int32 y_size = 6;
  if (this->y_size() != 0) {
    total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size(this->y_size());
  }

  // int32 batch_size = 8;
  if (this->batch_size() != 0) {
    total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size(this->batch_size());
  }

  // int32 num_classes = 9;
  if (this->num_classes() != 0) {
    total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size(this->num_classes());
  }

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

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

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

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

  if (from.spec().size() > 0) {
    spec_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
                            from.spec_);
  }
  if (from.image_input().size() > 0) {
    image_input_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
                                   from.image_input_);
  }
  if (from.image_widths().size() > 0) {
    image_widths_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
                                    from.image_widths_);
  }
  if (from.image_heights().size() > 0) {
    image_heights_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
                                     from.image_heights_);
  }
  if (from.output_layer().size() > 0) {
    output_layer_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
                                    from.output_layer_);
  }
  if (from.has_graph()) {
    mutable_graph()->::tensorflow::GraphDef::MergeFrom(from.graph());
  }
  if (from.global_step() != 0) {
    set_global_step(from.global_step());
  }
  if (from.depth() != 0) {
    set_depth(from.depth());
  }
  if (from.x_size() != 0) {
    set_x_size(from.x_size());
  }
  if (from.y_size() != 0) {
    set_y_size(from.y_size());
  }
  if (from.batch_size() != 0) {
    set_batch_size(from.batch_size());
  }
  if (from.num_classes() != 0) {
    set_num_classes(from.num_classes());
  }
  if (from.using_ctc() != 0) {
    set_using_ctc(from.using_ctc());
  }
}

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

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

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

void TFNetworkModel::Swap(TFNetworkModel *other) {
  if (other == this)
    return;
  InternalSwap(other);
}
void TFNetworkModel::InternalSwap(TFNetworkModel *other) {
  using std::swap;
  spec_.Swap(&other->spec_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(),
             GetArenaNoVirtual());
  image_input_.Swap(&other->image_input_,
                    &::google::protobuf::internal::GetEmptyStringAlreadyInited(),
                    GetArenaNoVirtual());
  image_widths_.Swap(&other->image_widths_,
                     &::google::protobuf::internal::GetEmptyStringAlreadyInited(),
                     GetArenaNoVirtual());
  image_heights_.Swap(&other->image_heights_,
                      &::google::protobuf::internal::GetEmptyStringAlreadyInited(),
                      GetArenaNoVirtual());
  output_layer_.Swap(&other->output_layer_,
                     &::google::protobuf::internal::GetEmptyStringAlreadyInited(),
                     GetArenaNoVirtual());
  swap(graph_, other->graph_);
  swap(global_step_, other->global_step_);
  swap(depth_, other->depth_);
  swap(x_size_, other->x_size_);
  swap(y_size_, other->y_size_);
  swap(batch_size_, other->batch_size_);
  swap(num_classes_, other->num_classes_);
  swap(using_ctc_, other->using_ctc_);
  _internal_metadata_.Swap(&other->_internal_metadata_);
}

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

// @@protoc_insertion_point(namespace_scope)
} // namespace tesseract
namespace google {
namespace protobuf {
template <>
GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::tesseract::TFNetworkModel *
Arena::CreateMaybeMessage<::tesseract::TFNetworkModel>(Arena *arena) {
  return Arena::CreateInternal<::tesseract::TFNetworkModel>(arena);
}
} // namespace protobuf
} // namespace google

// @@protoc_insertion_point(global_scope)
