"Fossies" - the Fresh Open Source Software Archive

Member "tesseract-5.2.0/src/lstm/tfnetwork.pb.cc" (6 Jul 2022, 37967 Bytes) of package /linux/misc/tesseract-5.2.0.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. See also the last Fossies "Diffs" side-by-side code changes report for "tfnetwork.pb.cc": 4.1.3_vs_5.0.0.

    1 // Generated by the protocol buffer compiler.  DO NOT EDIT!
    2 // source: tfnetwork.proto
    3 
    4 #include "tfnetwork.pb.h"
    5 
    6 #include <algorithm>
    7 
    8 #include <google/protobuf/descriptor.h>
    9 #include <google/protobuf/generated_message_reflection.h>
   10 #include <google/protobuf/io/coded_stream.h>
   11 #include <google/protobuf/reflection_ops.h>
   12 #include <google/protobuf/stubs/common.h>
   13 #include <google/protobuf/stubs/port.h>
   14 #include <google/protobuf/wire_format.h>
   15 #include <google/protobuf/wire_format_lite_inl.h>
   16 // This is a temporary google only hack
   17 #ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
   18 #  include "third_party/protobuf/version.h"
   19 #endif
   20 // @@protoc_insertion_point(includes)
   21 
   22 namespace protobuf_tensorflow_2fcore_2fframework_2fgraph_2eproto {
   23 extern PROTOBUF_INTERNAL_EXPORT_protobuf_tensorflow_2fcore_2fframework_2fgraph_2eproto ::google::
   24     protobuf::internal::SCCInfo<3>
   25         scc_info_GraphDef;
   26 } // namespace protobuf_tensorflow_2fcore_2fframework_2fgraph_2eproto
   27 namespace tesseract {
   28 class TFNetworkModelDefaultTypeInternal {
   29 public:
   30   ::google::protobuf::internal::ExplicitlyConstructed<TFNetworkModel> _instance;
   31 } _TFNetworkModel_default_instance_;
   32 } // namespace tesseract
   33 namespace protobuf_tfnetwork_2eproto {
   34 static void InitDefaultsTFNetworkModel() {
   35   GOOGLE_PROTOBUF_VERIFY_VERSION;
   36 
   37   {
   38     void *ptr = &::tesseract::_TFNetworkModel_default_instance_;
   39     new (ptr)::tesseract::TFNetworkModel();
   40     ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
   41   }
   42   ::tesseract::TFNetworkModel::InitAsDefaultInstance();
   43 }
   44 
   45 ::google::protobuf::internal::SCCInfo<1> scc_info_TFNetworkModel = {
   46     {ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1,
   47      InitDefaultsTFNetworkModel},
   48     {
   49         &protobuf_tensorflow_2fcore_2fframework_2fgraph_2eproto::scc_info_GraphDef.base,
   50     }};
   51 
   52 void InitDefaults() {
   53   ::google::protobuf::internal::InitSCC(&scc_info_TFNetworkModel.base);
   54 }
   55 
   56 ::google::protobuf::Metadata file_level_metadata[1];
   57 
   58 const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(
   59     protodesc_cold) = {
   60     ~0u, // no _has_bits_
   61     GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::tesseract::TFNetworkModel,
   62                                                    _internal_metadata_),
   63     ~0u, // no _extensions_
   64     ~0u, // no _oneof_case_
   65     ~0u, // no _weak_field_map_
   66     GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::tesseract::TFNetworkModel, graph_),
   67     GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::tesseract::TFNetworkModel, global_step_),
   68     GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::tesseract::TFNetworkModel, spec_),
   69     GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::tesseract::TFNetworkModel, depth_),
   70     GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::tesseract::TFNetworkModel, x_size_),
   71     GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::tesseract::TFNetworkModel, y_size_),
   72     GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::tesseract::TFNetworkModel, batch_size_),
   73     GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::tesseract::TFNetworkModel, num_classes_),
   74     GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::tesseract::TFNetworkModel, using_ctc_),
   75     GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::tesseract::TFNetworkModel, image_input_),
   76     GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::tesseract::TFNetworkModel, image_widths_),
   77     GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::tesseract::TFNetworkModel, image_heights_),
   78     GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::tesseract::TFNetworkModel, output_layer_),
   79 };
   80 static const ::google::protobuf::internal::MigrationSchema
   81     schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
   82         {0, -1, sizeof(::tesseract::TFNetworkModel)},
   83 };
   84 
   85 static ::google::protobuf::Message const *const file_default_instances[] = {
   86     reinterpret_cast<const ::google::protobuf::Message *>(
   87         &::tesseract::_TFNetworkModel_default_instance_),
   88 };
   89 
   90 void protobuf_AssignDescriptors() {
   91   AddDescriptors();
   92   AssignDescriptors("tfnetwork.proto", schemas, file_default_instances, TableStruct::offsets,
   93                     file_level_metadata, NULL, NULL);
   94 }
   95 
   96 void protobuf_AssignDescriptorsOnce() {
   97   static ::google::protobuf::internal::once_flag once;
   98   ::google::protobuf::internal::call_once(once, protobuf_AssignDescriptors);
   99 }
  100 
  101 void protobuf_RegisterTypes(const ::std::string &) GOOGLE_PROTOBUF_ATTRIBUTE_COLD;
  102 void protobuf_RegisterTypes(const ::std::string &) {
  103   protobuf_AssignDescriptorsOnce();
  104   ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 1);
  105 }
  106 
  107 void AddDescriptorsImpl() {
  108   InitDefaults();
  109   static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
  110       "\n\017tfnetwork.proto\022\ttesseract\032%tensorflow"
  111       "/core/framework/graph.proto\"\233\002\n\016TFNetwor"
  112       "kModel\022#\n\005graph\030\001 \001(\0132\024.tensorflow.Graph"
  113       "Def\022\023\n\013global_step\030\002 \001(\003\022\014\n\004spec\030\003 \001(\t\022\r"
  114       "\n\005depth\030\004 \001(\005\022\016\n\006x_size\030\005 \001(\005\022\016\n\006y_size\030"
  115       "\006 \001(\005\022\022\n\nbatch_size\030\010 \001(\005\022\023\n\013num_classes"
  116       "\030\t \001(\005\022\021\n\tusing_ctc\030\n \001(\010\022\023\n\013image_input"
  117       "\030\013 \001(\t\022\024\n\014image_widths\030\014 \001(\t\022\025\n\rimage_he"
  118       "ights\030\r \001(\t\022\024\n\014output_layer\030\016 \001(\tb\006proto"
  119       "3"};
  120   ::google::protobuf::DescriptorPool::InternalAddGeneratedFile(descriptor, 361);
  121   ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile("tfnetwork.proto",
  122                                                                     &protobuf_RegisterTypes);
  123   ::protobuf_tensorflow_2fcore_2fframework_2fgraph_2eproto::AddDescriptors();
  124 }
  125 
  126 void AddDescriptors() {
  127   static ::google::protobuf::internal::once_flag once;
  128   ::google::protobuf::internal::call_once(once, AddDescriptorsImpl);
  129 }
  130 // Force AddDescriptors() to be called at dynamic initialization time.
  131 struct StaticDescriptorInitializer {
  132   StaticDescriptorInitializer() {
  133     AddDescriptors();
  134   }
  135 } static_descriptor_initializer;
  136 } // namespace protobuf_tfnetwork_2eproto
  137 namespace tesseract {
  138 
  139 // ===================================================================
  140 
  141 void TFNetworkModel::InitAsDefaultInstance() {
  142   ::tesseract::_TFNetworkModel_default_instance_._instance.get_mutable()->graph_ =
  143       const_cast<::tensorflow::GraphDef *>(::tensorflow::GraphDef::internal_default_instance());
  144 }
  145 void TFNetworkModel::clear_graph() {
  146   if (GetArenaNoVirtual() == NULL && graph_ != NULL) {
  147     delete graph_;
  148   }
  149   graph_ = NULL;
  150 }
  151 #if !defined(_MSC_VER) || _MSC_VER >= 1900
  152 const int TFNetworkModel::kGraphFieldNumber;
  153 const int TFNetworkModel::kGlobalStepFieldNumber;
  154 const int TFNetworkModel::kSpecFieldNumber;
  155 const int TFNetworkModel::kDepthFieldNumber;
  156 const int TFNetworkModel::kXSizeFieldNumber;
  157 const int TFNetworkModel::kYSizeFieldNumber;
  158 const int TFNetworkModel::kBatchSizeFieldNumber;
  159 const int TFNetworkModel::kNumClassesFieldNumber;
  160 const int TFNetworkModel::kUsingCtcFieldNumber;
  161 const int TFNetworkModel::kImageInputFieldNumber;
  162 const int TFNetworkModel::kImageWidthsFieldNumber;
  163 const int TFNetworkModel::kImageHeightsFieldNumber;
  164 const int TFNetworkModel::kOutputLayerFieldNumber;
  165 #endif // !defined(_MSC_VER) || _MSC_VER >= 1900
  166 
  167 TFNetworkModel::TFNetworkModel() : ::google::protobuf::Message(), _internal_metadata_(NULL) {
  168   ::google::protobuf::internal::InitSCC(&protobuf_tfnetwork_2eproto::scc_info_TFNetworkModel.base);
  169   SharedCtor();
  170   // @@protoc_insertion_point(constructor:tesseract.TFNetworkModel)
  171 }
  172 TFNetworkModel::TFNetworkModel(const TFNetworkModel &from)
  173     : ::google::protobuf::Message(), _internal_metadata_(NULL) {
  174   _internal_metadata_.MergeFrom(from._internal_metadata_);
  175   spec_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  176   if (from.spec().size() > 0) {
  177     spec_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
  178                             from.spec_);
  179   }
  180   image_input_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  181   if (from.image_input().size() > 0) {
  182     image_input_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
  183                                    from.image_input_);
  184   }
  185   image_widths_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  186   if (from.image_widths().size() > 0) {
  187     image_widths_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
  188                                     from.image_widths_);
  189   }
  190   image_heights_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  191   if (from.image_heights().size() > 0) {
  192     image_heights_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
  193                                      from.image_heights_);
  194   }
  195   output_layer_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  196   if (from.output_layer().size() > 0) {
  197     output_layer_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
  198                                     from.output_layer_);
  199   }
  200   if (from.has_graph()) {
  201     graph_ = new ::tensorflow::GraphDef(*from.graph_);
  202   } else {
  203     graph_ = NULL;
  204   }
  205   ::memcpy(&global_step_, &from.global_step_,
  206            static_cast<size_t>(reinterpret_cast<char *>(&using_ctc_) -
  207                                reinterpret_cast<char *>(&global_step_)) +
  208                sizeof(using_ctc_));
  209   // @@protoc_insertion_point(copy_constructor:tesseract.TFNetworkModel)
  210 }
  211 
  212 void TFNetworkModel::SharedCtor() {
  213   spec_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  214   image_input_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  215   image_widths_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  216   image_heights_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  217   output_layer_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  218   ::memset(&graph_, 0,
  219            static_cast<size_t>(reinterpret_cast<char *>(&using_ctc_) -
  220                                reinterpret_cast<char *>(&graph_)) +
  221                sizeof(using_ctc_));
  222 }
  223 
  224 TFNetworkModel::~TFNetworkModel() {
  225   // @@protoc_insertion_point(destructor:tesseract.TFNetworkModel)
  226   SharedDtor();
  227 }
  228 
  229 void TFNetworkModel::SharedDtor() {
  230   spec_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  231   image_input_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  232   image_widths_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  233   image_heights_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  234   output_layer_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  235   if (this != internal_default_instance())
  236     delete graph_;
  237 }
  238 
  239 void TFNetworkModel::SetCachedSize(int size) const {
  240   _cached_size_.Set(size);
  241 }
  242 const ::google::protobuf::Descriptor *TFNetworkModel::descriptor() {
  243   ::protobuf_tfnetwork_2eproto::protobuf_AssignDescriptorsOnce();
  244   return ::protobuf_tfnetwork_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
  245 }
  246 
  247 const TFNetworkModel &TFNetworkModel::default_instance() {
  248   ::google::protobuf::internal::InitSCC(&protobuf_tfnetwork_2eproto::scc_info_TFNetworkModel.base);
  249   return *internal_default_instance();
  250 }
  251 
  252 void TFNetworkModel::Clear() {
  253   // @@protoc_insertion_point(message_clear_start:tesseract.TFNetworkModel)
  254   ::google::protobuf::uint32 cached_has_bits = 0;
  255   // Prevent compiler warnings about cached_has_bits being unused
  256   (void)cached_has_bits;
  257 
  258   spec_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  259   image_input_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  260   image_widths_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  261   image_heights_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  262   output_layer_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  263   if (GetArenaNoVirtual() == NULL && graph_ != NULL) {
  264     delete graph_;
  265   }
  266   graph_ = NULL;
  267   ::memset(&global_step_, 0,
  268            static_cast<size_t>(reinterpret_cast<char *>(&using_ctc_) -
  269                                reinterpret_cast<char *>(&global_step_)) +
  270                sizeof(using_ctc_));
  271   _internal_metadata_.Clear();
  272 }
  273 
  274 bool TFNetworkModel::MergePartialFromCodedStream(::google::protobuf::io::CodedInputStream *input) {
  275 #define DO_(EXPRESSION)                 \
  276   if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) \
  277   goto failure
  278   ::google::protobuf::uint32 tag;
  279   // @@protoc_insertion_point(parse_start:tesseract.TFNetworkModel)
  280   for (;;) {
  281     ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
  282     tag = p.first;
  283     if (!p.second)
  284       goto handle_unusual;
  285     switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
  286       // .tensorflow.GraphDef graph = 1;
  287       case 1: {
  288         if (static_cast<::google::protobuf::uint8>(tag) ==
  289             static_cast<::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
  290           DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(input, mutable_graph()));
  291         } else {
  292           goto handle_unusual;
  293         }
  294         break;
  295       }
  296 
  297       // int64 global_step = 2;
  298       case 2: {
  299         if (static_cast<::google::protobuf::uint8>(tag) ==
  300             static_cast<::google::protobuf::uint8>(16u /* 16 & 0xFF */)) {
  301           DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
  302                ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>(
  303               input, &global_step_)));
  304         } else {
  305           goto handle_unusual;
  306         }
  307         break;
  308       }
  309 
  310       // string spec = 3;
  311       case 3: {
  312         if (static_cast<::google::protobuf::uint8>(tag) ==
  313             static_cast<::google::protobuf::uint8>(26u /* 26 & 0xFF */)) {
  314           DO_(::google::protobuf::internal::WireFormatLite::ReadString(input,
  315                                                                        this->mutable_spec()));
  316           DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
  317               this->spec().data(), static_cast<int>(this->spec().length()),
  318               ::google::protobuf::internal::WireFormatLite::PARSE,
  319               "tesseract.TFNetworkModel.spec"));
  320         } else {
  321           goto handle_unusual;
  322         }
  323         break;
  324       }
  325 
  326       // int32 depth = 4;
  327       case 4: {
  328         if (static_cast<::google::protobuf::uint8>(tag) ==
  329             static_cast<::google::protobuf::uint8>(32u /* 32 & 0xFF */)) {
  330           DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
  331                ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
  332               input, &depth_)));
  333         } else {
  334           goto handle_unusual;
  335         }
  336         break;
  337       }
  338 
  339       // int32 x_size = 5;
  340       case 5: {
  341         if (static_cast<::google::protobuf::uint8>(tag) ==
  342             static_cast<::google::protobuf::uint8>(40u /* 40 & 0xFF */)) {
  343           DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
  344                ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
  345               input, &x_size_)));
  346         } else {
  347           goto handle_unusual;
  348         }
  349         break;
  350       }
  351 
  352       // int32 y_size = 6;
  353       case 6: {
  354         if (static_cast<::google::protobuf::uint8>(tag) ==
  355             static_cast<::google::protobuf::uint8>(48u /* 48 & 0xFF */)) {
  356           DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
  357                ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
  358               input, &y_size_)));
  359         } else {
  360           goto handle_unusual;
  361         }
  362         break;
  363       }
  364 
  365       // int32 batch_size = 8;
  366       case 8: {
  367         if (static_cast<::google::protobuf::uint8>(tag) ==
  368             static_cast<::google::protobuf::uint8>(64u /* 64 & 0xFF */)) {
  369           DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
  370                ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
  371               input, &batch_size_)));
  372         } else {
  373           goto handle_unusual;
  374         }
  375         break;
  376       }
  377 
  378       // int32 num_classes = 9;
  379       case 9: {
  380         if (static_cast<::google::protobuf::uint8>(tag) ==
  381             static_cast<::google::protobuf::uint8>(72u /* 72 & 0xFF */)) {
  382           DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
  383                ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
  384               input, &num_classes_)));
  385         } else {
  386           goto handle_unusual;
  387         }
  388         break;
  389       }
  390 
  391       // bool using_ctc = 10;
  392       case 10: {
  393         if (static_cast<::google::protobuf::uint8>(tag) ==
  394             static_cast<::google::protobuf::uint8>(80u /* 80 & 0xFF */)) {
  395           DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
  396                bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(input, &using_ctc_)));
  397         } else {
  398           goto handle_unusual;
  399         }
  400         break;
  401       }
  402 
  403       // string image_input = 11;
  404       case 11: {
  405         if (static_cast<::google::protobuf::uint8>(tag) ==
  406             static_cast<::google::protobuf::uint8>(90u /* 90 & 0xFF */)) {
  407           DO_(::google::protobuf::internal::WireFormatLite::ReadString(
  408               input, this->mutable_image_input()));
  409           DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
  410               this->image_input().data(), static_cast<int>(this->image_input().length()),
  411               ::google::protobuf::internal::WireFormatLite::PARSE,
  412               "tesseract.TFNetworkModel.image_input"));
  413         } else {
  414           goto handle_unusual;
  415         }
  416         break;
  417       }
  418 
  419       // string image_widths = 12;
  420       case 12: {
  421         if (static_cast<::google::protobuf::uint8>(tag) ==
  422             static_cast<::google::protobuf::uint8>(98u /* 98 & 0xFF */)) {
  423           DO_(::google::protobuf::internal::WireFormatLite::ReadString(
  424               input, this->mutable_image_widths()));
  425           DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
  426               this->image_widths().data(), static_cast<int>(this->image_widths().length()),
  427               ::google::protobuf::internal::WireFormatLite::PARSE,
  428               "tesseract.TFNetworkModel.image_widths"));
  429         } else {
  430           goto handle_unusual;
  431         }
  432         break;
  433       }
  434 
  435       // string image_heights = 13;
  436       case 13: {
  437         if (static_cast<::google::protobuf::uint8>(tag) ==
  438             static_cast<::google::protobuf::uint8>(106u /* 106 & 0xFF */)) {
  439           DO_(::google::protobuf::internal::WireFormatLite::ReadString(
  440               input, this->mutable_image_heights()));
  441           DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
  442               this->image_heights().data(), static_cast<int>(this->image_heights().length()),
  443               ::google::protobuf::internal::WireFormatLite::PARSE,
  444               "tesseract.TFNetworkModel.image_heights"));
  445         } else {
  446           goto handle_unusual;
  447         }
  448         break;
  449       }
  450 
  451       // string output_layer = 14;
  452       case 14: {
  453         if (static_cast<::google::protobuf::uint8>(tag) ==
  454             static_cast<::google::protobuf::uint8>(114u /* 114 & 0xFF */)) {
  455           DO_(::google::protobuf::internal::WireFormatLite::ReadString(
  456               input, this->mutable_output_layer()));
  457           DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
  458               this->output_layer().data(), static_cast<int>(this->output_layer().length()),
  459               ::google::protobuf::internal::WireFormatLite::PARSE,
  460               "tesseract.TFNetworkModel.output_layer"));
  461         } else {
  462           goto handle_unusual;
  463         }
  464         break;
  465       }
  466 
  467       default: {
  468       handle_unusual:
  469         if (tag == 0) {
  470           goto success;
  471         }
  472         DO_(::google::protobuf::internal::WireFormat::SkipField(
  473             input, tag, _internal_metadata_.mutable_unknown_fields()));
  474         break;
  475       }
  476     }
  477   }
  478 success:
  479   // @@protoc_insertion_point(parse_success:tesseract.TFNetworkModel)
  480   return true;
  481 failure:
  482   // @@protoc_insertion_point(parse_failure:tesseract.TFNetworkModel)
  483   return false;
  484 #undef DO_
  485 }
  486 
  487 void TFNetworkModel::SerializeWithCachedSizes(
  488     ::google::protobuf::io::CodedOutputStream *output) const {
  489   // @@protoc_insertion_point(serialize_start:tesseract.TFNetworkModel)
  490   ::google::protobuf::uint32 cached_has_bits = 0;
  491   (void)cached_has_bits;
  492 
  493   // .tensorflow.GraphDef graph = 1;
  494   if (this->has_graph()) {
  495     ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
  496         1, this->_internal_graph(), output);
  497   }
  498 
  499   // int64 global_step = 2;
  500   if (this->global_step() != 0) {
  501     ::google::protobuf::internal::WireFormatLite::WriteInt64(2, this->global_step(), output);
  502   }
  503 
  504   // string spec = 3;
  505   if (this->spec().size() > 0) {
  506     ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
  507         this->spec().data(), static_cast<int>(this->spec().length()),
  508         ::google::protobuf::internal::WireFormatLite::SERIALIZE, "tesseract.TFNetworkModel.spec");
  509     ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(3, this->spec(), output);
  510   }
  511 
  512   // int32 depth = 4;
  513   if (this->depth() != 0) {
  514     ::google::protobuf::internal::WireFormatLite::WriteInt32(4, this->depth(), output);
  515   }
  516 
  517   // int32 x_size = 5;
  518   if (this->x_size() != 0) {
  519     ::google::protobuf::internal::WireFormatLite::WriteInt32(5, this->x_size(), output);
  520   }
  521 
  522   // int32 y_size = 6;
  523   if (this->y_size() != 0) {
  524     ::google::protobuf::internal::WireFormatLite::WriteInt32(6, this->y_size(), output);
  525   }
  526 
  527   // int32 batch_size = 8;
  528   if (this->batch_size() != 0) {
  529     ::google::protobuf::internal::WireFormatLite::WriteInt32(8, this->batch_size(), output);
  530   }
  531 
  532   // int32 num_classes = 9;
  533   if (this->num_classes() != 0) {
  534     ::google::protobuf::internal::WireFormatLite::WriteInt32(9, this->num_classes(), output);
  535   }
  536 
  537   // bool using_ctc = 10;
  538   if (this->using_ctc() != 0) {
  539     ::google::protobuf::internal::WireFormatLite::WriteBool(10, this->using_ctc(), output);
  540   }
  541 
  542   // string image_input = 11;
  543   if (this->image_input().size() > 0) {
  544     ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
  545         this->image_input().data(), static_cast<int>(this->image_input().length()),
  546         ::google::protobuf::internal::WireFormatLite::SERIALIZE,
  547         "tesseract.TFNetworkModel.image_input");
  548     ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(11, this->image_input(),
  549                                                                           output);
  550   }
  551 
  552   // string image_widths = 12;
  553   if (this->image_widths().size() > 0) {
  554     ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
  555         this->image_widths().data(), static_cast<int>(this->image_widths().length()),
  556         ::google::protobuf::internal::WireFormatLite::SERIALIZE,
  557         "tesseract.TFNetworkModel.image_widths");
  558     ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(12, this->image_widths(),
  559                                                                           output);
  560   }
  561 
  562   // string image_heights = 13;
  563   if (this->image_heights().size() > 0) {
  564     ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
  565         this->image_heights().data(), static_cast<int>(this->image_heights().length()),
  566         ::google::protobuf::internal::WireFormatLite::SERIALIZE,
  567         "tesseract.TFNetworkModel.image_heights");
  568     ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(13, this->image_heights(),
  569                                                                           output);
  570   }
  571 
  572   // string output_layer = 14;
  573   if (this->output_layer().size() > 0) {
  574     ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
  575         this->output_layer().data(), static_cast<int>(this->output_layer().length()),
  576         ::google::protobuf::internal::WireFormatLite::SERIALIZE,
  577         "tesseract.TFNetworkModel.output_layer");
  578     ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(14, this->output_layer(),
  579                                                                           output);
  580   }
  581 
  582   if ((_internal_metadata_.have_unknown_fields() &&
  583        ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
  584     ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
  585         (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()
  586              ? _internal_metadata_.unknown_fields()
  587              : _internal_metadata_.default_instance()),
  588         output);
  589   }
  590   // @@protoc_insertion_point(serialize_end:tesseract.TFNetworkModel)
  591 }
  592 
  593 ::google::protobuf::uint8 *TFNetworkModel::InternalSerializeWithCachedSizesToArray(
  594     bool deterministic, ::google::protobuf::uint8 *target) const {
  595   (void)deterministic; // Unused
  596   // @@protoc_insertion_point(serialize_to_array_start:tesseract.TFNetworkModel)
  597   ::google::protobuf::uint32 cached_has_bits = 0;
  598   (void)cached_has_bits;
  599 
  600   // .tensorflow.GraphDef graph = 1;
  601   if (this->has_graph()) {
  602     target = ::google::protobuf::internal::WireFormatLite::InternalWriteMessageToArray(
  603         1, this->_internal_graph(), deterministic, target);
  604   }
  605 
  606   // int64 global_step = 2;
  607   if (this->global_step() != 0) {
  608     target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(2, this->global_step(),
  609                                                                              target);
  610   }
  611 
  612   // string spec = 3;
  613   if (this->spec().size() > 0) {
  614     ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
  615         this->spec().data(), static_cast<int>(this->spec().length()),
  616         ::google::protobuf::internal::WireFormatLite::SERIALIZE, "tesseract.TFNetworkModel.spec");
  617     target =
  618         ::google::protobuf::internal::WireFormatLite::WriteStringToArray(3, this->spec(), target);
  619   }
  620 
  621   // int32 depth = 4;
  622   if (this->depth() != 0) {
  623     target =
  624         ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(4, this->depth(), target);
  625   }
  626 
  627   // int32 x_size = 5;
  628   if (this->x_size() != 0) {
  629     target =
  630         ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(5, this->x_size(), target);
  631   }
  632 
  633   // int32 y_size = 6;
  634   if (this->y_size() != 0) {
  635     target =
  636         ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(6, this->y_size(), target);
  637   }
  638 
  639   // int32 batch_size = 8;
  640   if (this->batch_size() != 0) {
  641     target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(8, this->batch_size(),
  642                                                                              target);
  643   }
  644 
  645   // int32 num_classes = 9;
  646   if (this->num_classes() != 0) {
  647     target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(9, this->num_classes(),
  648                                                                              target);
  649   }
  650 
  651   // bool using_ctc = 10;
  652   if (this->using_ctc() != 0) {
  653     target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(10, this->using_ctc(),
  654                                                                             target);
  655   }
  656 
  657   // string image_input = 11;
  658   if (this->image_input().size() > 0) {
  659     ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
  660         this->image_input().data(), static_cast<int>(this->image_input().length()),
  661         ::google::protobuf::internal::WireFormatLite::SERIALIZE,
  662         "tesseract.TFNetworkModel.image_input");
  663     target = ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
  664         11, this->image_input(), target);
  665   }
  666 
  667   // string image_widths = 12;
  668   if (this->image_widths().size() > 0) {
  669     ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
  670         this->image_widths().data(), static_cast<int>(this->image_widths().length()),
  671         ::google::protobuf::internal::WireFormatLite::SERIALIZE,
  672         "tesseract.TFNetworkModel.image_widths");
  673     target = ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
  674         12, this->image_widths(), target);
  675   }
  676 
  677   // string image_heights = 13;
  678   if (this->image_heights().size() > 0) {
  679     ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
  680         this->image_heights().data(), static_cast<int>(this->image_heights().length()),
  681         ::google::protobuf::internal::WireFormatLite::SERIALIZE,
  682         "tesseract.TFNetworkModel.image_heights");
  683     target = ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
  684         13, this->image_heights(), target);
  685   }
  686 
  687   // string output_layer = 14;
  688   if (this->output_layer().size() > 0) {
  689     ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
  690         this->output_layer().data(), static_cast<int>(this->output_layer().length()),
  691         ::google::protobuf::internal::WireFormatLite::SERIALIZE,
  692         "tesseract.TFNetworkModel.output_layer");
  693     target = ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
  694         14, this->output_layer(), target);
  695   }
  696 
  697   if ((_internal_metadata_.have_unknown_fields() &&
  698        ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
  699     target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
  700         (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()
  701              ? _internal_metadata_.unknown_fields()
  702              : _internal_metadata_.default_instance()),
  703         target);
  704   }
  705   // @@protoc_insertion_point(serialize_to_array_end:tesseract.TFNetworkModel)
  706   return target;
  707 }
  708 
  709 size_t TFNetworkModel::ByteSizeLong() const {
  710   // @@protoc_insertion_point(message_byte_size_start:tesseract.TFNetworkModel)
  711   size_t total_size = 0;
  712 
  713   if ((_internal_metadata_.have_unknown_fields() &&
  714        ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
  715     total_size += ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
  716         (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()
  717              ? _internal_metadata_.unknown_fields()
  718              : _internal_metadata_.default_instance()));
  719   }
  720   // string spec = 3;
  721   if (this->spec().size() > 0) {
  722     total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize(this->spec());
  723   }
  724 
  725   // string image_input = 11;
  726   if (this->image_input().size() > 0) {
  727     total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize(this->image_input());
  728   }
  729 
  730   // string image_widths = 12;
  731   if (this->image_widths().size() > 0) {
  732     total_size +=
  733         1 + ::google::protobuf::internal::WireFormatLite::StringSize(this->image_widths());
  734   }
  735 
  736   // string image_heights = 13;
  737   if (this->image_heights().size() > 0) {
  738     total_size +=
  739         1 + ::google::protobuf::internal::WireFormatLite::StringSize(this->image_heights());
  740   }
  741 
  742   // string output_layer = 14;
  743   if (this->output_layer().size() > 0) {
  744     total_size +=
  745         1 + ::google::protobuf::internal::WireFormatLite::StringSize(this->output_layer());
  746   }
  747 
  748   // .tensorflow.GraphDef graph = 1;
  749   if (this->has_graph()) {
  750     total_size += 1 + ::google::protobuf::internal::WireFormatLite::MessageSize(*graph_);
  751   }
  752 
  753   // int64 global_step = 2;
  754   if (this->global_step() != 0) {
  755     total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int64Size(this->global_step());
  756   }
  757 
  758   // int32 depth = 4;
  759   if (this->depth() != 0) {
  760     total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size(this->depth());
  761   }
  762 
  763   // int32 x_size = 5;
  764   if (this->x_size() != 0) {
  765     total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size(this->x_size());
  766   }
  767 
  768   // int32 y_size = 6;
  769   if (this->y_size() != 0) {
  770     total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size(this->y_size());
  771   }
  772 
  773   // int32 batch_size = 8;
  774   if (this->batch_size() != 0) {
  775     total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size(this->batch_size());
  776   }
  777 
  778   // int32 num_classes = 9;
  779   if (this->num_classes() != 0) {
  780     total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size(this->num_classes());
  781   }
  782 
  783   // bool using_ctc = 10;
  784   if (this->using_ctc() != 0) {
  785     total_size += 1 + 1;
  786   }
  787 
  788   int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
  789   SetCachedSize(cached_size);
  790   return total_size;
  791 }
  792 
  793 void TFNetworkModel::MergeFrom(const ::google::protobuf::Message &from) {
  794   // @@protoc_insertion_point(generalized_merge_from_start:tesseract.TFNetworkModel)
  795   GOOGLE_DCHECK_NE(&from, this);
  796   const TFNetworkModel *source =
  797       ::google::protobuf::internal::DynamicCastToGenerated<const TFNetworkModel>(&from);
  798   if (source == NULL) {
  799     // @@protoc_insertion_point(generalized_merge_from_cast_fail:tesseract.TFNetworkModel)
  800     ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  801   } else {
  802     // @@protoc_insertion_point(generalized_merge_from_cast_success:tesseract.TFNetworkModel)
  803     MergeFrom(*source);
  804   }
  805 }
  806 
  807 void TFNetworkModel::MergeFrom(const TFNetworkModel &from) {
  808   // @@protoc_insertion_point(class_specific_merge_from_start:tesseract.TFNetworkModel)
  809   GOOGLE_DCHECK_NE(&from, this);
  810   _internal_metadata_.MergeFrom(from._internal_metadata_);
  811   ::google::protobuf::uint32 cached_has_bits = 0;
  812   (void)cached_has_bits;
  813 
  814   if (from.spec().size() > 0) {
  815     spec_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
  816                             from.spec_);
  817   }
  818   if (from.image_input().size() > 0) {
  819     image_input_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
  820                                    from.image_input_);
  821   }
  822   if (from.image_widths().size() > 0) {
  823     image_widths_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
  824                                     from.image_widths_);
  825   }
  826   if (from.image_heights().size() > 0) {
  827     image_heights_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
  828                                      from.image_heights_);
  829   }
  830   if (from.output_layer().size() > 0) {
  831     output_layer_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
  832                                     from.output_layer_);
  833   }
  834   if (from.has_graph()) {
  835     mutable_graph()->::tensorflow::GraphDef::MergeFrom(from.graph());
  836   }
  837   if (from.global_step() != 0) {
  838     set_global_step(from.global_step());
  839   }
  840   if (from.depth() != 0) {
  841     set_depth(from.depth());
  842   }
  843   if (from.x_size() != 0) {
  844     set_x_size(from.x_size());
  845   }
  846   if (from.y_size() != 0) {
  847     set_y_size(from.y_size());
  848   }
  849   if (from.batch_size() != 0) {
  850     set_batch_size(from.batch_size());
  851   }
  852   if (from.num_classes() != 0) {
  853     set_num_classes(from.num_classes());
  854   }
  855   if (from.using_ctc() != 0) {
  856     set_using_ctc(from.using_ctc());
  857   }
  858 }
  859 
  860 void TFNetworkModel::CopyFrom(const ::google::protobuf::Message &from) {
  861   // @@protoc_insertion_point(generalized_copy_from_start:tesseract.TFNetworkModel)
  862   if (&from == this)
  863     return;
  864   Clear();
  865   MergeFrom(from);
  866 }
  867 
  868 void TFNetworkModel::CopyFrom(const TFNetworkModel &from) {
  869   // @@protoc_insertion_point(class_specific_copy_from_start:tesseract.TFNetworkModel)
  870   if (&from == this)
  871     return;
  872   Clear();
  873   MergeFrom(from);
  874 }
  875 
  876 bool TFNetworkModel::IsInitialized() const {
  877   return true;
  878 }
  879 
  880 void TFNetworkModel::Swap(TFNetworkModel *other) {
  881   if (other == this)
  882     return;
  883   InternalSwap(other);
  884 }
  885 void TFNetworkModel::InternalSwap(TFNetworkModel *other) {
  886   using std::swap;
  887   spec_.Swap(&other->spec_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(),
  888              GetArenaNoVirtual());
  889   image_input_.Swap(&other->image_input_,
  890                     &::google::protobuf::internal::GetEmptyStringAlreadyInited(),
  891                     GetArenaNoVirtual());
  892   image_widths_.Swap(&other->image_widths_,
  893                      &::google::protobuf::internal::GetEmptyStringAlreadyInited(),
  894                      GetArenaNoVirtual());
  895   image_heights_.Swap(&other->image_heights_,
  896                       &::google::protobuf::internal::GetEmptyStringAlreadyInited(),
  897                       GetArenaNoVirtual());
  898   output_layer_.Swap(&other->output_layer_,
  899                      &::google::protobuf::internal::GetEmptyStringAlreadyInited(),
  900                      GetArenaNoVirtual());
  901   swap(graph_, other->graph_);
  902   swap(global_step_, other->global_step_);
  903   swap(depth_, other->depth_);
  904   swap(x_size_, other->x_size_);
  905   swap(y_size_, other->y_size_);
  906   swap(batch_size_, other->batch_size_);
  907   swap(num_classes_, other->num_classes_);
  908   swap(using_ctc_, other->using_ctc_);
  909   _internal_metadata_.Swap(&other->_internal_metadata_);
  910 }
  911 
  912 ::google::protobuf::Metadata TFNetworkModel::GetMetadata() const {
  913   protobuf_tfnetwork_2eproto::protobuf_AssignDescriptorsOnce();
  914   return ::protobuf_tfnetwork_2eproto::file_level_metadata[kIndexInFileMessages];
  915 }
  916 
  917 // @@protoc_insertion_point(namespace_scope)
  918 } // namespace tesseract
  919 namespace google {
  920 namespace protobuf {
  921 template <>
  922 GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::tesseract::TFNetworkModel *
  923 Arena::CreateMaybeMessage<::tesseract::TFNetworkModel>(Arena *arena) {
  924   return Arena::CreateInternal<::tesseract::TFNetworkModel>(arena);
  925 }
  926 } // namespace protobuf
  927 } // namespace google
  928 
  929 // @@protoc_insertion_point(global_scope)