1 // Generated by the protocol buffer compiler. DO NOT EDIT!
2 // source: graph.proto
3
4 #include "graph.pb.h"
5
6 #include <algorithm>
7
8 #include <google/protobuf/stubs/common.h>
9 #include <google/protobuf/stubs/port.h>
10 #include <google/protobuf/stubs/once.h>
11 #include <google/protobuf/io/coded_stream.h>
12 #include <google/protobuf/wire_format_lite_inl.h>
13 #include <google/protobuf/descriptor.h>
14 #include <google/protobuf/generated_message_reflection.h>
15 #include <google/protobuf/reflection_ops.h>
16 #include <google/protobuf/wire_format.h>
17 // This is a temporary google only hack
18 #ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
19 #include "third_party/protobuf/version.h"
20 #endif
21 // @@protoc_insertion_point(includes)
22 namespace opencv_tensorflow {
23 class GraphDefDefaultTypeInternal {
24 public:
25 ::google::protobuf::internal::ExplicitlyConstructed<GraphDef>
26 _instance;
27 } _GraphDef_default_instance_;
28 class NodeDef_AttrEntry_DoNotUseDefaultTypeInternal {
29 public:
30 ::google::protobuf::internal::ExplicitlyConstructed<NodeDef_AttrEntry_DoNotUse>
31 _instance;
32 } _NodeDef_AttrEntry_DoNotUse_default_instance_;
33 class NodeDefDefaultTypeInternal {
34 public:
35 ::google::protobuf::internal::ExplicitlyConstructed<NodeDef>
36 _instance;
37 } _NodeDef_default_instance_;
38 } // namespace opencv_tensorflow
39 namespace protobuf_graph_2eproto {
InitDefaultsGraphDefImpl()40 void InitDefaultsGraphDefImpl() {
41 GOOGLE_PROTOBUF_VERIFY_VERSION;
42
43 #ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
44 ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
45 #else
46 ::google::protobuf::internal::InitProtobufDefaults();
47 #endif // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
48 protobuf_graph_2eproto::InitDefaultsNodeDef();
49 protobuf_versions_2eproto::InitDefaultsVersionDef();
50 protobuf_function_2eproto::InitDefaultsFunctionDefLibrary();
51 {
52 void* ptr = &::opencv_tensorflow::_GraphDef_default_instance_;
53 new (ptr) ::opencv_tensorflow::GraphDef();
54 ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
55 }
56 ::opencv_tensorflow::GraphDef::InitAsDefaultInstance();
57 }
58
InitDefaultsGraphDef()59 void InitDefaultsGraphDef() {
60 static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
61 ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsGraphDefImpl);
62 }
63
InitDefaultsNodeDef_AttrEntry_DoNotUseImpl()64 void InitDefaultsNodeDef_AttrEntry_DoNotUseImpl() {
65 GOOGLE_PROTOBUF_VERIFY_VERSION;
66
67 #ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
68 ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
69 #else
70 ::google::protobuf::internal::InitProtobufDefaults();
71 #endif // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
72 protobuf_attr_5fvalue_2eproto::InitDefaultsAttrValue();
73 {
74 void* ptr = &::opencv_tensorflow::_NodeDef_AttrEntry_DoNotUse_default_instance_;
75 new (ptr) ::opencv_tensorflow::NodeDef_AttrEntry_DoNotUse();
76 }
77 ::opencv_tensorflow::NodeDef_AttrEntry_DoNotUse::InitAsDefaultInstance();
78 }
79
InitDefaultsNodeDef_AttrEntry_DoNotUse()80 void InitDefaultsNodeDef_AttrEntry_DoNotUse() {
81 static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
82 ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsNodeDef_AttrEntry_DoNotUseImpl);
83 }
84
InitDefaultsNodeDefImpl()85 void InitDefaultsNodeDefImpl() {
86 GOOGLE_PROTOBUF_VERIFY_VERSION;
87
88 #ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
89 ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
90 #else
91 ::google::protobuf::internal::InitProtobufDefaults();
92 #endif // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
93 protobuf_graph_2eproto::InitDefaultsNodeDef_AttrEntry_DoNotUse();
94 {
95 void* ptr = &::opencv_tensorflow::_NodeDef_default_instance_;
96 new (ptr) ::opencv_tensorflow::NodeDef();
97 ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
98 }
99 ::opencv_tensorflow::NodeDef::InitAsDefaultInstance();
100 }
101
InitDefaultsNodeDef()102 void InitDefaultsNodeDef() {
103 static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
104 ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsNodeDefImpl);
105 }
106
107 ::google::protobuf::Metadata file_level_metadata[3];
108
109 const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
110 ~0u, // no _has_bits_
111 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::GraphDef, _internal_metadata_),
112 ~0u, // no _extensions_
113 ~0u, // no _oneof_case_
114 ~0u, // no _weak_field_map_
115 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::GraphDef, node_),
116 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::GraphDef, versions_),
117 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::GraphDef, version_),
118 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::GraphDef, library_),
119 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::NodeDef_AttrEntry_DoNotUse, _has_bits_),
120 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::NodeDef_AttrEntry_DoNotUse, _internal_metadata_),
121 ~0u, // no _extensions_
122 ~0u, // no _oneof_case_
123 ~0u, // no _weak_field_map_
124 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::NodeDef_AttrEntry_DoNotUse, key_),
125 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::NodeDef_AttrEntry_DoNotUse, value_),
126 0,
127 1,
128 ~0u, // no _has_bits_
129 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::NodeDef, _internal_metadata_),
130 ~0u, // no _extensions_
131 ~0u, // no _oneof_case_
132 ~0u, // no _weak_field_map_
133 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::NodeDef, name_),
134 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::NodeDef, op_),
135 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::NodeDef, input_),
136 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::NodeDef, device_),
137 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::NodeDef, attr_),
138 };
139 static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
140 { 0, -1, sizeof(::opencv_tensorflow::GraphDef)},
141 { 9, 16, sizeof(::opencv_tensorflow::NodeDef_AttrEntry_DoNotUse)},
142 { 18, -1, sizeof(::opencv_tensorflow::NodeDef)},
143 };
144
145 static ::google::protobuf::Message const * const file_default_instances[] = {
146 reinterpret_cast<const ::google::protobuf::Message*>(&::opencv_tensorflow::_GraphDef_default_instance_),
147 reinterpret_cast<const ::google::protobuf::Message*>(&::opencv_tensorflow::_NodeDef_AttrEntry_DoNotUse_default_instance_),
148 reinterpret_cast<const ::google::protobuf::Message*>(&::opencv_tensorflow::_NodeDef_default_instance_),
149 };
150
protobuf_AssignDescriptors()151 void protobuf_AssignDescriptors() {
152 AddDescriptors();
153 ::google::protobuf::MessageFactory* factory = NULL;
154 AssignDescriptors(
155 "graph.proto", schemas, file_default_instances, TableStruct::offsets, factory,
156 file_level_metadata, NULL, NULL);
157 }
158
protobuf_AssignDescriptorsOnce()159 void protobuf_AssignDescriptorsOnce() {
160 static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
161 ::google::protobuf::GoogleOnceInit(&once, &protobuf_AssignDescriptors);
162 }
163
164 void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD;
protobuf_RegisterTypes(const::std::string &)165 void protobuf_RegisterTypes(const ::std::string&) {
166 protobuf_AssignDescriptorsOnce();
167 ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 3);
168 }
169
AddDescriptorsImpl()170 void AddDescriptorsImpl() {
171 InitDefaults();
172 static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
173 "\n\013graph.proto\022\021opencv_tensorflow\032\020attr_v"
174 "alue.proto\032\016function.proto\032\016versions.pro"
175 "to\"\262\001\n\010GraphDef\022(\n\004node\030\001 \003(\0132\032.opencv_t"
176 "ensorflow.NodeDef\022/\n\010versions\030\004 \001(\0132\035.op"
177 "encv_tensorflow.VersionDef\022\023\n\007version\030\003 "
178 "\001(\005B\002\030\001\0226\n\007library\030\002 \001(\0132%.opencv_tensor"
179 "flow.FunctionDefLibrary\"\301\001\n\007NodeDef\022\014\n\004n"
180 "ame\030\001 \001(\t\022\n\n\002op\030\002 \001(\t\022\r\n\005input\030\003 \003(\t\022\016\n\006"
181 "device\030\004 \001(\t\0222\n\004attr\030\005 \003(\0132$.opencv_tens"
182 "orflow.NodeDef.AttrEntry\032I\n\tAttrEntry\022\013\n"
183 "\003key\030\001 \001(\t\022+\n\005value\030\002 \001(\0132\034.opencv_tenso"
184 "rflow.AttrValue:\0028\001B,\n\030org.tensorflow.fr"
185 "ameworkB\013GraphProtosP\001\370\001\001b\006proto3"
186 };
187 ::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
188 descriptor, 513);
189 ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
190 "graph.proto", &protobuf_RegisterTypes);
191 ::protobuf_attr_5fvalue_2eproto::AddDescriptors();
192 ::protobuf_function_2eproto::AddDescriptors();
193 ::protobuf_versions_2eproto::AddDescriptors();
194 }
195
AddDescriptors()196 void AddDescriptors() {
197 static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
198 ::google::protobuf::GoogleOnceInit(&once, &AddDescriptorsImpl);
199 }
200 // Force AddDescriptors() to be called at dynamic initialization time.
201 struct StaticDescriptorInitializer {
StaticDescriptorInitializerprotobuf_graph_2eproto::StaticDescriptorInitializer202 StaticDescriptorInitializer() {
203 AddDescriptors();
204 }
205 } static_descriptor_initializer;
206 } // namespace protobuf_graph_2eproto
207 namespace opencv_tensorflow {
208
209 // ===================================================================
210
InitAsDefaultInstance()211 void GraphDef::InitAsDefaultInstance() {
212 ::opencv_tensorflow::_GraphDef_default_instance_._instance.get_mutable()->versions_ = const_cast< ::opencv_tensorflow::VersionDef*>(
213 ::opencv_tensorflow::VersionDef::internal_default_instance());
214 ::opencv_tensorflow::_GraphDef_default_instance_._instance.get_mutable()->library_ = const_cast< ::opencv_tensorflow::FunctionDefLibrary*>(
215 ::opencv_tensorflow::FunctionDefLibrary::internal_default_instance());
216 }
_slow_mutable_versions()217 void GraphDef::_slow_mutable_versions() {
218 versions_ = ::google::protobuf::Arena::CreateMessage< ::opencv_tensorflow::VersionDef >(
219 GetArenaNoVirtual());
220 }
unsafe_arena_set_allocated_versions(::opencv_tensorflow::VersionDef * versions)221 void GraphDef::unsafe_arena_set_allocated_versions(
222 ::opencv_tensorflow::VersionDef* versions) {
223 if (GetArenaNoVirtual() == NULL) {
224 delete versions_;
225 }
226 versions_ = versions;
227 if (versions) {
228
229 } else {
230
231 }
232 // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_tensorflow.GraphDef.versions)
233 }
clear_versions()234 void GraphDef::clear_versions() {
235 if (GetArenaNoVirtual() == NULL && versions_ != NULL) {
236 delete versions_;
237 }
238 versions_ = NULL;
239 }
_slow_mutable_library()240 void GraphDef::_slow_mutable_library() {
241 library_ = ::google::protobuf::Arena::CreateMessage< ::opencv_tensorflow::FunctionDefLibrary >(
242 GetArenaNoVirtual());
243 }
unsafe_arena_set_allocated_library(::opencv_tensorflow::FunctionDefLibrary * library)244 void GraphDef::unsafe_arena_set_allocated_library(
245 ::opencv_tensorflow::FunctionDefLibrary* library) {
246 if (GetArenaNoVirtual() == NULL) {
247 delete library_;
248 }
249 library_ = library;
250 if (library) {
251
252 } else {
253
254 }
255 // @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_tensorflow.GraphDef.library)
256 }
clear_library()257 void GraphDef::clear_library() {
258 if (GetArenaNoVirtual() == NULL && library_ != NULL) {
259 delete library_;
260 }
261 library_ = NULL;
262 }
263 #if !defined(_MSC_VER) || _MSC_VER >= 1900
264 const int GraphDef::kNodeFieldNumber;
265 const int GraphDef::kVersionsFieldNumber;
266 const int GraphDef::kVersionFieldNumber;
267 const int GraphDef::kLibraryFieldNumber;
268 #endif // !defined(_MSC_VER) || _MSC_VER >= 1900
269
GraphDef()270 GraphDef::GraphDef()
271 : ::google::protobuf::Message(), _internal_metadata_(NULL) {
272 if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
273 ::protobuf_graph_2eproto::InitDefaultsGraphDef();
274 }
275 SharedCtor();
276 // @@protoc_insertion_point(constructor:opencv_tensorflow.GraphDef)
277 }
GraphDef(::google::protobuf::Arena * arena)278 GraphDef::GraphDef(::google::protobuf::Arena* arena)
279 : ::google::protobuf::Message(),
280 _internal_metadata_(arena),
281 node_(arena) {
282 ::protobuf_graph_2eproto::InitDefaultsGraphDef();
283 SharedCtor();
284 RegisterArenaDtor(arena);
285 // @@protoc_insertion_point(arena_constructor:opencv_tensorflow.GraphDef)
286 }
GraphDef(const GraphDef & from)287 GraphDef::GraphDef(const GraphDef& from)
288 : ::google::protobuf::Message(),
289 _internal_metadata_(NULL),
290 node_(from.node_),
291 _cached_size_(0) {
292 _internal_metadata_.MergeFrom(from._internal_metadata_);
293 if (from.has_library()) {
294 library_ = new ::opencv_tensorflow::FunctionDefLibrary(*from.library_);
295 } else {
296 library_ = NULL;
297 }
298 if (from.has_versions()) {
299 versions_ = new ::opencv_tensorflow::VersionDef(*from.versions_);
300 } else {
301 versions_ = NULL;
302 }
303 version_ = from.version_;
304 // @@protoc_insertion_point(copy_constructor:opencv_tensorflow.GraphDef)
305 }
306
SharedCtor()307 void GraphDef::SharedCtor() {
308 ::memset(&library_, 0, static_cast<size_t>(
309 reinterpret_cast<char*>(&version_) -
310 reinterpret_cast<char*>(&library_)) + sizeof(version_));
311 _cached_size_ = 0;
312 }
313
~GraphDef()314 GraphDef::~GraphDef() {
315 // @@protoc_insertion_point(destructor:opencv_tensorflow.GraphDef)
316 SharedDtor();
317 }
318
SharedDtor()319 void GraphDef::SharedDtor() {
320 GOOGLE_DCHECK(GetArenaNoVirtual() == NULL);
321 if (this != internal_default_instance()) delete library_;
322 if (this != internal_default_instance()) delete versions_;
323 }
324
ArenaDtor(void * object)325 void GraphDef::ArenaDtor(void* object) {
326 GraphDef* _this = reinterpret_cast< GraphDef* >(object);
327 (void)_this;
328 }
RegisterArenaDtor(::google::protobuf::Arena * arena)329 void GraphDef::RegisterArenaDtor(::google::protobuf::Arena* arena) {
330 }
SetCachedSize(int size) const331 void GraphDef::SetCachedSize(int size) const {
332 GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
333 _cached_size_ = size;
334 GOOGLE_SAFE_CONCURRENT_WRITES_END();
335 }
descriptor()336 const ::google::protobuf::Descriptor* GraphDef::descriptor() {
337 ::protobuf_graph_2eproto::protobuf_AssignDescriptorsOnce();
338 return ::protobuf_graph_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
339 }
340
default_instance()341 const GraphDef& GraphDef::default_instance() {
342 ::protobuf_graph_2eproto::InitDefaultsGraphDef();
343 return *internal_default_instance();
344 }
345
New(::google::protobuf::Arena * arena) const346 GraphDef* GraphDef::New(::google::protobuf::Arena* arena) const {
347 return ::google::protobuf::Arena::CreateMessage<GraphDef>(arena);
348 }
349
Clear()350 void GraphDef::Clear() {
351 // @@protoc_insertion_point(message_clear_start:opencv_tensorflow.GraphDef)
352 ::google::protobuf::uint32 cached_has_bits = 0;
353 // Prevent compiler warnings about cached_has_bits being unused
354 (void) cached_has_bits;
355
356 node_.Clear();
357 if (GetArenaNoVirtual() == NULL && library_ != NULL) {
358 delete library_;
359 }
360 library_ = NULL;
361 if (GetArenaNoVirtual() == NULL && versions_ != NULL) {
362 delete versions_;
363 }
364 versions_ = NULL;
365 version_ = 0;
366 _internal_metadata_.Clear();
367 }
368
MergePartialFromCodedStream(::google::protobuf::io::CodedInputStream * input)369 bool GraphDef::MergePartialFromCodedStream(
370 ::google::protobuf::io::CodedInputStream* input) {
371 #define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
372 ::google::protobuf::uint32 tag;
373 // @@protoc_insertion_point(parse_start:opencv_tensorflow.GraphDef)
374 for (;;) {
375 ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
376 tag = p.first;
377 if (!p.second) goto handle_unusual;
378 switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
379 // repeated .opencv_tensorflow.NodeDef node = 1;
380 case 1: {
381 if (static_cast< ::google::protobuf::uint8>(tag) ==
382 static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
383 DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(input, add_node()));
384 } else {
385 goto handle_unusual;
386 }
387 break;
388 }
389
390 // .opencv_tensorflow.FunctionDefLibrary library = 2;
391 case 2: {
392 if (static_cast< ::google::protobuf::uint8>(tag) ==
393 static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) {
394 DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
395 input, mutable_library()));
396 } else {
397 goto handle_unusual;
398 }
399 break;
400 }
401
402 // int32 version = 3 [deprecated = true];
403 case 3: {
404 if (static_cast< ::google::protobuf::uint8>(tag) ==
405 static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) {
406
407 DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
408 ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
409 input, &version_)));
410 } else {
411 goto handle_unusual;
412 }
413 break;
414 }
415
416 // .opencv_tensorflow.VersionDef versions = 4;
417 case 4: {
418 if (static_cast< ::google::protobuf::uint8>(tag) ==
419 static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) {
420 DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
421 input, mutable_versions()));
422 } else {
423 goto handle_unusual;
424 }
425 break;
426 }
427
428 default: {
429 handle_unusual:
430 if (tag == 0) {
431 goto success;
432 }
433 DO_(::google::protobuf::internal::WireFormat::SkipField(
434 input, tag, _internal_metadata_.mutable_unknown_fields()));
435 break;
436 }
437 }
438 }
439 success:
440 // @@protoc_insertion_point(parse_success:opencv_tensorflow.GraphDef)
441 return true;
442 failure:
443 // @@protoc_insertion_point(parse_failure:opencv_tensorflow.GraphDef)
444 return false;
445 #undef DO_
446 }
447
SerializeWithCachedSizes(::google::protobuf::io::CodedOutputStream * output) const448 void GraphDef::SerializeWithCachedSizes(
449 ::google::protobuf::io::CodedOutputStream* output) const {
450 // @@protoc_insertion_point(serialize_start:opencv_tensorflow.GraphDef)
451 ::google::protobuf::uint32 cached_has_bits = 0;
452 (void) cached_has_bits;
453
454 // repeated .opencv_tensorflow.NodeDef node = 1;
455 for (unsigned int i = 0,
456 n = static_cast<unsigned int>(this->node_size()); i < n; i++) {
457 ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
458 1, this->node(static_cast<int>(i)), output);
459 }
460
461 // .opencv_tensorflow.FunctionDefLibrary library = 2;
462 if (this->has_library()) {
463 ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
464 2, *this->library_, output);
465 }
466
467 // int32 version = 3 [deprecated = true];
468 if (this->version() != 0) {
469 ::google::protobuf::internal::WireFormatLite::WriteInt32(3, this->version(), output);
470 }
471
472 // .opencv_tensorflow.VersionDef versions = 4;
473 if (this->has_versions()) {
474 ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
475 4, *this->versions_, output);
476 }
477
478 if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
479 ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
480 (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output);
481 }
482 // @@protoc_insertion_point(serialize_end:opencv_tensorflow.GraphDef)
483 }
484
InternalSerializeWithCachedSizesToArray(bool deterministic,::google::protobuf::uint8 * target) const485 ::google::protobuf::uint8* GraphDef::InternalSerializeWithCachedSizesToArray(
486 bool deterministic, ::google::protobuf::uint8* target) const {
487 (void)deterministic; // Unused
488 // @@protoc_insertion_point(serialize_to_array_start:opencv_tensorflow.GraphDef)
489 ::google::protobuf::uint32 cached_has_bits = 0;
490 (void) cached_has_bits;
491
492 // repeated .opencv_tensorflow.NodeDef node = 1;
493 for (unsigned int i = 0,
494 n = static_cast<unsigned int>(this->node_size()); i < n; i++) {
495 target = ::google::protobuf::internal::WireFormatLite::
496 InternalWriteMessageToArray(
497 1, this->node(static_cast<int>(i)), deterministic, target);
498 }
499
500 // .opencv_tensorflow.FunctionDefLibrary library = 2;
501 if (this->has_library()) {
502 target = ::google::protobuf::internal::WireFormatLite::
503 InternalWriteMessageToArray(
504 2, *this->library_, deterministic, target);
505 }
506
507 // int32 version = 3 [deprecated = true];
508 if (this->version() != 0) {
509 target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(3, this->version(), target);
510 }
511
512 // .opencv_tensorflow.VersionDef versions = 4;
513 if (this->has_versions()) {
514 target = ::google::protobuf::internal::WireFormatLite::
515 InternalWriteMessageToArray(
516 4, *this->versions_, deterministic, target);
517 }
518
519 if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
520 target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
521 (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target);
522 }
523 // @@protoc_insertion_point(serialize_to_array_end:opencv_tensorflow.GraphDef)
524 return target;
525 }
526
ByteSizeLong() const527 size_t GraphDef::ByteSizeLong() const {
528 // @@protoc_insertion_point(message_byte_size_start:opencv_tensorflow.GraphDef)
529 size_t total_size = 0;
530
531 if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
532 total_size +=
533 ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
534 (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()));
535 }
536 // repeated .opencv_tensorflow.NodeDef node = 1;
537 {
538 unsigned int count = static_cast<unsigned int>(this->node_size());
539 total_size += 1UL * count;
540 for (unsigned int i = 0; i < count; i++) {
541 total_size +=
542 ::google::protobuf::internal::WireFormatLite::MessageSize(
543 this->node(static_cast<int>(i)));
544 }
545 }
546
547 // .opencv_tensorflow.FunctionDefLibrary library = 2;
548 if (this->has_library()) {
549 total_size += 1 +
550 ::google::protobuf::internal::WireFormatLite::MessageSize(
551 *this->library_);
552 }
553
554 // .opencv_tensorflow.VersionDef versions = 4;
555 if (this->has_versions()) {
556 total_size += 1 +
557 ::google::protobuf::internal::WireFormatLite::MessageSize(
558 *this->versions_);
559 }
560
561 // int32 version = 3 [deprecated = true];
562 if (this->version() != 0) {
563 total_size += 1 +
564 ::google::protobuf::internal::WireFormatLite::Int32Size(
565 this->version());
566 }
567
568 int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
569 GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
570 _cached_size_ = cached_size;
571 GOOGLE_SAFE_CONCURRENT_WRITES_END();
572 return total_size;
573 }
574
MergeFrom(const::google::protobuf::Message & from)575 void GraphDef::MergeFrom(const ::google::protobuf::Message& from) {
576 // @@protoc_insertion_point(generalized_merge_from_start:opencv_tensorflow.GraphDef)
577 GOOGLE_DCHECK_NE(&from, this);
578 const GraphDef* source =
579 ::google::protobuf::internal::DynamicCastToGenerated<const GraphDef>(
580 &from);
581 if (source == NULL) {
582 // @@protoc_insertion_point(generalized_merge_from_cast_fail:opencv_tensorflow.GraphDef)
583 ::google::protobuf::internal::ReflectionOps::Merge(from, this);
584 } else {
585 // @@protoc_insertion_point(generalized_merge_from_cast_success:opencv_tensorflow.GraphDef)
586 MergeFrom(*source);
587 }
588 }
589
MergeFrom(const GraphDef & from)590 void GraphDef::MergeFrom(const GraphDef& from) {
591 // @@protoc_insertion_point(class_specific_merge_from_start:opencv_tensorflow.GraphDef)
592 GOOGLE_DCHECK_NE(&from, this);
593 _internal_metadata_.MergeFrom(from._internal_metadata_);
594 ::google::protobuf::uint32 cached_has_bits = 0;
595 (void) cached_has_bits;
596
597 node_.MergeFrom(from.node_);
598 if (from.has_library()) {
599 mutable_library()->::opencv_tensorflow::FunctionDefLibrary::MergeFrom(from.library());
600 }
601 if (from.has_versions()) {
602 mutable_versions()->::opencv_tensorflow::VersionDef::MergeFrom(from.versions());
603 }
604 if (from.version() != 0) {
605 set_version(from.version());
606 }
607 }
608
CopyFrom(const::google::protobuf::Message & from)609 void GraphDef::CopyFrom(const ::google::protobuf::Message& from) {
610 // @@protoc_insertion_point(generalized_copy_from_start:opencv_tensorflow.GraphDef)
611 if (&from == this) return;
612 Clear();
613 MergeFrom(from);
614 }
615
CopyFrom(const GraphDef & from)616 void GraphDef::CopyFrom(const GraphDef& from) {
617 // @@protoc_insertion_point(class_specific_copy_from_start:opencv_tensorflow.GraphDef)
618 if (&from == this) return;
619 Clear();
620 MergeFrom(from);
621 }
622
IsInitialized() const623 bool GraphDef::IsInitialized() const {
624 return true;
625 }
626
Swap(GraphDef * other)627 void GraphDef::Swap(GraphDef* other) {
628 if (other == this) return;
629 if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) {
630 InternalSwap(other);
631 } else {
632 GraphDef* temp = New(GetArenaNoVirtual());
633 temp->MergeFrom(*other);
634 other->CopyFrom(*this);
635 InternalSwap(temp);
636 if (GetArenaNoVirtual() == NULL) {
637 delete temp;
638 }
639 }
640 }
UnsafeArenaSwap(GraphDef * other)641 void GraphDef::UnsafeArenaSwap(GraphDef* other) {
642 if (other == this) return;
643 GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual());
644 InternalSwap(other);
645 }
InternalSwap(GraphDef * other)646 void GraphDef::InternalSwap(GraphDef* other) {
647 using std::swap;
648 node_.InternalSwap(&other->node_);
649 swap(library_, other->library_);
650 swap(versions_, other->versions_);
651 swap(version_, other->version_);
652 _internal_metadata_.Swap(&other->_internal_metadata_);
653 swap(_cached_size_, other->_cached_size_);
654 }
655
GetMetadata() const656 ::google::protobuf::Metadata GraphDef::GetMetadata() const {
657 protobuf_graph_2eproto::protobuf_AssignDescriptorsOnce();
658 return ::protobuf_graph_2eproto::file_level_metadata[kIndexInFileMessages];
659 }
660
661
662 // ===================================================================
663
NodeDef_AttrEntry_DoNotUse()664 NodeDef_AttrEntry_DoNotUse::NodeDef_AttrEntry_DoNotUse() {}
NodeDef_AttrEntry_DoNotUse(::google::protobuf::Arena * arena)665 NodeDef_AttrEntry_DoNotUse::NodeDef_AttrEntry_DoNotUse(::google::protobuf::Arena* arena) : SuperType(arena) {}
MergeFrom(const NodeDef_AttrEntry_DoNotUse & other)666 void NodeDef_AttrEntry_DoNotUse::MergeFrom(const NodeDef_AttrEntry_DoNotUse& other) {
667 MergeFromInternal(other);
668 }
GetMetadata() const669 ::google::protobuf::Metadata NodeDef_AttrEntry_DoNotUse::GetMetadata() const {
670 ::protobuf_graph_2eproto::protobuf_AssignDescriptorsOnce();
671 return ::protobuf_graph_2eproto::file_level_metadata[1];
672 }
MergeFrom(const::google::protobuf::Message & other)673 void NodeDef_AttrEntry_DoNotUse::MergeFrom(
674 const ::google::protobuf::Message& other) {
675 ::google::protobuf::Message::MergeFrom(other);
676 }
677
678
679 // ===================================================================
680
InitAsDefaultInstance()681 void NodeDef::InitAsDefaultInstance() {
682 }
clear_attr()683 void NodeDef::clear_attr() {
684 attr_.Clear();
685 }
686 #if !defined(_MSC_VER) || _MSC_VER >= 1900
687 const int NodeDef::kNameFieldNumber;
688 const int NodeDef::kOpFieldNumber;
689 const int NodeDef::kInputFieldNumber;
690 const int NodeDef::kDeviceFieldNumber;
691 const int NodeDef::kAttrFieldNumber;
692 #endif // !defined(_MSC_VER) || _MSC_VER >= 1900
693
NodeDef()694 NodeDef::NodeDef()
695 : ::google::protobuf::Message(), _internal_metadata_(NULL) {
696 if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
697 ::protobuf_graph_2eproto::InitDefaultsNodeDef();
698 }
699 SharedCtor();
700 // @@protoc_insertion_point(constructor:opencv_tensorflow.NodeDef)
701 }
NodeDef(::google::protobuf::Arena * arena)702 NodeDef::NodeDef(::google::protobuf::Arena* arena)
703 : ::google::protobuf::Message(),
704 _internal_metadata_(arena),
705 input_(arena),
706 attr_(arena) {
707 ::protobuf_graph_2eproto::InitDefaultsNodeDef();
708 SharedCtor();
709 RegisterArenaDtor(arena);
710 // @@protoc_insertion_point(arena_constructor:opencv_tensorflow.NodeDef)
711 }
NodeDef(const NodeDef & from)712 NodeDef::NodeDef(const NodeDef& from)
713 : ::google::protobuf::Message(),
714 _internal_metadata_(NULL),
715 input_(from.input_),
716 _cached_size_(0) {
717 _internal_metadata_.MergeFrom(from._internal_metadata_);
718 attr_.MergeFrom(from.attr_);
719 name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
720 if (from.name().size() > 0) {
721 name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name(),
722 GetArenaNoVirtual());
723 }
724 op_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
725 if (from.op().size() > 0) {
726 op_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.op(),
727 GetArenaNoVirtual());
728 }
729 device_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
730 if (from.device().size() > 0) {
731 device_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.device(),
732 GetArenaNoVirtual());
733 }
734 // @@protoc_insertion_point(copy_constructor:opencv_tensorflow.NodeDef)
735 }
736
SharedCtor()737 void NodeDef::SharedCtor() {
738 name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
739 op_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
740 device_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
741 _cached_size_ = 0;
742 }
743
~NodeDef()744 NodeDef::~NodeDef() {
745 // @@protoc_insertion_point(destructor:opencv_tensorflow.NodeDef)
746 SharedDtor();
747 }
748
SharedDtor()749 void NodeDef::SharedDtor() {
750 GOOGLE_DCHECK(GetArenaNoVirtual() == NULL);
751 name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
752 op_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
753 device_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
754 }
755
ArenaDtor(void * object)756 void NodeDef::ArenaDtor(void* object) {
757 NodeDef* _this = reinterpret_cast< NodeDef* >(object);
758 (void)_this;
759 }
RegisterArenaDtor(::google::protobuf::Arena * arena)760 void NodeDef::RegisterArenaDtor(::google::protobuf::Arena* arena) {
761 }
SetCachedSize(int size) const762 void NodeDef::SetCachedSize(int size) const {
763 GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
764 _cached_size_ = size;
765 GOOGLE_SAFE_CONCURRENT_WRITES_END();
766 }
descriptor()767 const ::google::protobuf::Descriptor* NodeDef::descriptor() {
768 ::protobuf_graph_2eproto::protobuf_AssignDescriptorsOnce();
769 return ::protobuf_graph_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
770 }
771
default_instance()772 const NodeDef& NodeDef::default_instance() {
773 ::protobuf_graph_2eproto::InitDefaultsNodeDef();
774 return *internal_default_instance();
775 }
776
New(::google::protobuf::Arena * arena) const777 NodeDef* NodeDef::New(::google::protobuf::Arena* arena) const {
778 return ::google::protobuf::Arena::CreateMessage<NodeDef>(arena);
779 }
780
Clear()781 void NodeDef::Clear() {
782 // @@protoc_insertion_point(message_clear_start:opencv_tensorflow.NodeDef)
783 ::google::protobuf::uint32 cached_has_bits = 0;
784 // Prevent compiler warnings about cached_has_bits being unused
785 (void) cached_has_bits;
786
787 input_.Clear();
788 attr_.Clear();
789 name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
790 op_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
791 device_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
792 _internal_metadata_.Clear();
793 }
794
MergePartialFromCodedStream(::google::protobuf::io::CodedInputStream * input)795 bool NodeDef::MergePartialFromCodedStream(
796 ::google::protobuf::io::CodedInputStream* input) {
797 #define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
798 ::google::protobuf::uint32 tag;
799 // @@protoc_insertion_point(parse_start:opencv_tensorflow.NodeDef)
800 for (;;) {
801 ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
802 tag = p.first;
803 if (!p.second) goto handle_unusual;
804 switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
805 // string name = 1;
806 case 1: {
807 if (static_cast< ::google::protobuf::uint8>(tag) ==
808 static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
809 DO_(::google::protobuf::internal::WireFormatLite::ReadString(
810 input, this->mutable_name()));
811 DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
812 this->name().data(), static_cast<int>(this->name().length()),
813 ::google::protobuf::internal::WireFormatLite::PARSE,
814 "opencv_tensorflow.NodeDef.name"));
815 } else {
816 goto handle_unusual;
817 }
818 break;
819 }
820
821 // string op = 2;
822 case 2: {
823 if (static_cast< ::google::protobuf::uint8>(tag) ==
824 static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) {
825 DO_(::google::protobuf::internal::WireFormatLite::ReadString(
826 input, this->mutable_op()));
827 DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
828 this->op().data(), static_cast<int>(this->op().length()),
829 ::google::protobuf::internal::WireFormatLite::PARSE,
830 "opencv_tensorflow.NodeDef.op"));
831 } else {
832 goto handle_unusual;
833 }
834 break;
835 }
836
837 // repeated string input = 3;
838 case 3: {
839 if (static_cast< ::google::protobuf::uint8>(tag) ==
840 static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) {
841 DO_(::google::protobuf::internal::WireFormatLite::ReadString(
842 input, this->add_input()));
843 DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
844 this->input(this->input_size() - 1).data(),
845 static_cast<int>(this->input(this->input_size() - 1).length()),
846 ::google::protobuf::internal::WireFormatLite::PARSE,
847 "opencv_tensorflow.NodeDef.input"));
848 } else {
849 goto handle_unusual;
850 }
851 break;
852 }
853
854 // string device = 4;
855 case 4: {
856 if (static_cast< ::google::protobuf::uint8>(tag) ==
857 static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) {
858 DO_(::google::protobuf::internal::WireFormatLite::ReadString(
859 input, this->mutable_device()));
860 DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
861 this->device().data(), static_cast<int>(this->device().length()),
862 ::google::protobuf::internal::WireFormatLite::PARSE,
863 "opencv_tensorflow.NodeDef.device"));
864 } else {
865 goto handle_unusual;
866 }
867 break;
868 }
869
870 // map<string, .opencv_tensorflow.AttrValue> attr = 5;
871 case 5: {
872 if (static_cast< ::google::protobuf::uint8>(tag) ==
873 static_cast< ::google::protobuf::uint8>(42u /* 42 & 0xFF */)) {
874 NodeDef_AttrEntry_DoNotUse::Parser< ::google::protobuf::internal::MapField<
875 NodeDef_AttrEntry_DoNotUse,
876 ::std::string, ::opencv_tensorflow::AttrValue,
877 ::google::protobuf::internal::WireFormatLite::TYPE_STRING,
878 ::google::protobuf::internal::WireFormatLite::TYPE_MESSAGE,
879 0 >,
880 ::google::protobuf::Map< ::std::string, ::opencv_tensorflow::AttrValue > > parser(&attr_);
881 DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
882 input, &parser));
883 DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
884 parser.key().data(), static_cast<int>(parser.key().length()),
885 ::google::protobuf::internal::WireFormatLite::PARSE,
886 "opencv_tensorflow.NodeDef.AttrEntry.key"));
887 } else {
888 goto handle_unusual;
889 }
890 break;
891 }
892
893 default: {
894 handle_unusual:
895 if (tag == 0) {
896 goto success;
897 }
898 DO_(::google::protobuf::internal::WireFormat::SkipField(
899 input, tag, _internal_metadata_.mutable_unknown_fields()));
900 break;
901 }
902 }
903 }
904 success:
905 // @@protoc_insertion_point(parse_success:opencv_tensorflow.NodeDef)
906 return true;
907 failure:
908 // @@protoc_insertion_point(parse_failure:opencv_tensorflow.NodeDef)
909 return false;
910 #undef DO_
911 }
912
SerializeWithCachedSizes(::google::protobuf::io::CodedOutputStream * output) const913 void NodeDef::SerializeWithCachedSizes(
914 ::google::protobuf::io::CodedOutputStream* output) const {
915 // @@protoc_insertion_point(serialize_start:opencv_tensorflow.NodeDef)
916 ::google::protobuf::uint32 cached_has_bits = 0;
917 (void) cached_has_bits;
918
919 // string name = 1;
920 if (this->name().size() > 0) {
921 ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
922 this->name().data(), static_cast<int>(this->name().length()),
923 ::google::protobuf::internal::WireFormatLite::SERIALIZE,
924 "opencv_tensorflow.NodeDef.name");
925 ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
926 1, this->name(), output);
927 }
928
929 // string op = 2;
930 if (this->op().size() > 0) {
931 ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
932 this->op().data(), static_cast<int>(this->op().length()),
933 ::google::protobuf::internal::WireFormatLite::SERIALIZE,
934 "opencv_tensorflow.NodeDef.op");
935 ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
936 2, this->op(), output);
937 }
938
939 // repeated string input = 3;
940 for (int i = 0, n = this->input_size(); i < n; i++) {
941 ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
942 this->input(i).data(), static_cast<int>(this->input(i).length()),
943 ::google::protobuf::internal::WireFormatLite::SERIALIZE,
944 "opencv_tensorflow.NodeDef.input");
945 ::google::protobuf::internal::WireFormatLite::WriteString(
946 3, this->input(i), output);
947 }
948
949 // string device = 4;
950 if (this->device().size() > 0) {
951 ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
952 this->device().data(), static_cast<int>(this->device().length()),
953 ::google::protobuf::internal::WireFormatLite::SERIALIZE,
954 "opencv_tensorflow.NodeDef.device");
955 ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
956 4, this->device(), output);
957 }
958
959 // map<string, .opencv_tensorflow.AttrValue> attr = 5;
960 if (!this->attr().empty()) {
961 typedef ::google::protobuf::Map< ::std::string, ::opencv_tensorflow::AttrValue >::const_pointer
962 ConstPtr;
963 typedef ConstPtr SortItem;
964 typedef ::google::protobuf::internal::CompareByDerefFirst<SortItem> Less;
965 struct Utf8Check {
966 static void Check(ConstPtr p) {
967 ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
968 p->first.data(), static_cast<int>(p->first.length()),
969 ::google::protobuf::internal::WireFormatLite::SERIALIZE,
970 "opencv_tensorflow.NodeDef.AttrEntry.key");
971 }
972 };
973
974 if (output->IsSerializationDeterministic() &&
975 this->attr().size() > 1) {
976 ::google::protobuf::scoped_array<SortItem> items(
977 new SortItem[this->attr().size()]);
978 typedef ::google::protobuf::Map< ::std::string, ::opencv_tensorflow::AttrValue >::size_type size_type;
979 size_type n = 0;
980 for (::google::protobuf::Map< ::std::string, ::opencv_tensorflow::AttrValue >::const_iterator
981 it = this->attr().begin();
982 it != this->attr().end(); ++it, ++n) {
983 items[static_cast<ptrdiff_t>(n)] = SortItem(&*it);
984 }
985 ::std::sort(&items[0], &items[static_cast<ptrdiff_t>(n)], Less());
986 ::google::protobuf::scoped_ptr<NodeDef_AttrEntry_DoNotUse> entry;
987 for (size_type i = 0; i < n; i++) {
988 entry.reset(attr_.NewEntryWrapper(
989 items[static_cast<ptrdiff_t>(i)]->first, items[static_cast<ptrdiff_t>(i)]->second));
990 ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
991 5, *entry, output);
992 if (entry->GetArena() != NULL) {
993 entry.release();
994 }
995 Utf8Check::Check(items[static_cast<ptrdiff_t>(i)]);
996 }
997 } else {
998 ::google::protobuf::scoped_ptr<NodeDef_AttrEntry_DoNotUse> entry;
999 for (::google::protobuf::Map< ::std::string, ::opencv_tensorflow::AttrValue >::const_iterator
1000 it = this->attr().begin();
1001 it != this->attr().end(); ++it) {
1002 entry.reset(attr_.NewEntryWrapper(
1003 it->first, it->second));
1004 ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
1005 5, *entry, output);
1006 if (entry->GetArena() != NULL) {
1007 entry.release();
1008 }
1009 Utf8Check::Check(&*it);
1010 }
1011 }
1012 }
1013
1014 if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
1015 ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
1016 (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output);
1017 }
1018 // @@protoc_insertion_point(serialize_end:opencv_tensorflow.NodeDef)
1019 }
1020
InternalSerializeWithCachedSizesToArray(bool deterministic,::google::protobuf::uint8 * target) const1021 ::google::protobuf::uint8* NodeDef::InternalSerializeWithCachedSizesToArray(
1022 bool deterministic, ::google::protobuf::uint8* target) const {
1023 (void)deterministic; // Unused
1024 // @@protoc_insertion_point(serialize_to_array_start:opencv_tensorflow.NodeDef)
1025 ::google::protobuf::uint32 cached_has_bits = 0;
1026 (void) cached_has_bits;
1027
1028 // string name = 1;
1029 if (this->name().size() > 0) {
1030 ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
1031 this->name().data(), static_cast<int>(this->name().length()),
1032 ::google::protobuf::internal::WireFormatLite::SERIALIZE,
1033 "opencv_tensorflow.NodeDef.name");
1034 target =
1035 ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
1036 1, this->name(), target);
1037 }
1038
1039 // string op = 2;
1040 if (this->op().size() > 0) {
1041 ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
1042 this->op().data(), static_cast<int>(this->op().length()),
1043 ::google::protobuf::internal::WireFormatLite::SERIALIZE,
1044 "opencv_tensorflow.NodeDef.op");
1045 target =
1046 ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
1047 2, this->op(), target);
1048 }
1049
1050 // repeated string input = 3;
1051 for (int i = 0, n = this->input_size(); i < n; i++) {
1052 ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
1053 this->input(i).data(), static_cast<int>(this->input(i).length()),
1054 ::google::protobuf::internal::WireFormatLite::SERIALIZE,
1055 "opencv_tensorflow.NodeDef.input");
1056 target = ::google::protobuf::internal::WireFormatLite::
1057 WriteStringToArray(3, this->input(i), target);
1058 }
1059
1060 // string device = 4;
1061 if (this->device().size() > 0) {
1062 ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
1063 this->device().data(), static_cast<int>(this->device().length()),
1064 ::google::protobuf::internal::WireFormatLite::SERIALIZE,
1065 "opencv_tensorflow.NodeDef.device");
1066 target =
1067 ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
1068 4, this->device(), target);
1069 }
1070
1071 // map<string, .opencv_tensorflow.AttrValue> attr = 5;
1072 if (!this->attr().empty()) {
1073 typedef ::google::protobuf::Map< ::std::string, ::opencv_tensorflow::AttrValue >::const_pointer
1074 ConstPtr;
1075 typedef ConstPtr SortItem;
1076 typedef ::google::protobuf::internal::CompareByDerefFirst<SortItem> Less;
1077 struct Utf8Check {
1078 static void Check(ConstPtr p) {
1079 ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
1080 p->first.data(), static_cast<int>(p->first.length()),
1081 ::google::protobuf::internal::WireFormatLite::SERIALIZE,
1082 "opencv_tensorflow.NodeDef.AttrEntry.key");
1083 }
1084 };
1085
1086 if (deterministic &&
1087 this->attr().size() > 1) {
1088 ::google::protobuf::scoped_array<SortItem> items(
1089 new SortItem[this->attr().size()]);
1090 typedef ::google::protobuf::Map< ::std::string, ::opencv_tensorflow::AttrValue >::size_type size_type;
1091 size_type n = 0;
1092 for (::google::protobuf::Map< ::std::string, ::opencv_tensorflow::AttrValue >::const_iterator
1093 it = this->attr().begin();
1094 it != this->attr().end(); ++it, ++n) {
1095 items[static_cast<ptrdiff_t>(n)] = SortItem(&*it);
1096 }
1097 ::std::sort(&items[0], &items[static_cast<ptrdiff_t>(n)], Less());
1098 ::google::protobuf::scoped_ptr<NodeDef_AttrEntry_DoNotUse> entry;
1099 for (size_type i = 0; i < n; i++) {
1100 entry.reset(attr_.NewEntryWrapper(
1101 items[static_cast<ptrdiff_t>(i)]->first, items[static_cast<ptrdiff_t>(i)]->second));
1102 target = ::google::protobuf::internal::WireFormatLite::
1103 InternalWriteMessageNoVirtualToArray(
1104 5, *entry, deterministic, target);
1105 ;
1106 if (entry->GetArena() != NULL) {
1107 entry.release();
1108 }
1109 Utf8Check::Check(items[static_cast<ptrdiff_t>(i)]);
1110 }
1111 } else {
1112 ::google::protobuf::scoped_ptr<NodeDef_AttrEntry_DoNotUse> entry;
1113 for (::google::protobuf::Map< ::std::string, ::opencv_tensorflow::AttrValue >::const_iterator
1114 it = this->attr().begin();
1115 it != this->attr().end(); ++it) {
1116 entry.reset(attr_.NewEntryWrapper(
1117 it->first, it->second));
1118 target = ::google::protobuf::internal::WireFormatLite::
1119 InternalWriteMessageNoVirtualToArray(
1120 5, *entry, deterministic, target);
1121 ;
1122 if (entry->GetArena() != NULL) {
1123 entry.release();
1124 }
1125 Utf8Check::Check(&*it);
1126 }
1127 }
1128 }
1129
1130 if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
1131 target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
1132 (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target);
1133 }
1134 // @@protoc_insertion_point(serialize_to_array_end:opencv_tensorflow.NodeDef)
1135 return target;
1136 }
1137
ByteSizeLong() const1138 size_t NodeDef::ByteSizeLong() const {
1139 // @@protoc_insertion_point(message_byte_size_start:opencv_tensorflow.NodeDef)
1140 size_t total_size = 0;
1141
1142 if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
1143 total_size +=
1144 ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
1145 (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()));
1146 }
1147 // repeated string input = 3;
1148 total_size += 1 *
1149 ::google::protobuf::internal::FromIntSize(this->input_size());
1150 for (int i = 0, n = this->input_size(); i < n; i++) {
1151 total_size += ::google::protobuf::internal::WireFormatLite::StringSize(
1152 this->input(i));
1153 }
1154
1155 // map<string, .opencv_tensorflow.AttrValue> attr = 5;
1156 total_size += 1 *
1157 ::google::protobuf::internal::FromIntSize(this->attr_size());
1158 {
1159 ::google::protobuf::scoped_ptr<NodeDef_AttrEntry_DoNotUse> entry;
1160 for (::google::protobuf::Map< ::std::string, ::opencv_tensorflow::AttrValue >::const_iterator
1161 it = this->attr().begin();
1162 it != this->attr().end(); ++it) {
1163 if (entry.get() != NULL && entry->GetArena() != NULL) {
1164 entry.release();
1165 }
1166 entry.reset(attr_.NewEntryWrapper(it->first, it->second));
1167 total_size += ::google::protobuf::internal::WireFormatLite::
1168 MessageSizeNoVirtual(*entry);
1169 }
1170 if (entry.get() != NULL && entry->GetArena() != NULL) {
1171 entry.release();
1172 }
1173 }
1174
1175 // string name = 1;
1176 if (this->name().size() > 0) {
1177 total_size += 1 +
1178 ::google::protobuf::internal::WireFormatLite::StringSize(
1179 this->name());
1180 }
1181
1182 // string op = 2;
1183 if (this->op().size() > 0) {
1184 total_size += 1 +
1185 ::google::protobuf::internal::WireFormatLite::StringSize(
1186 this->op());
1187 }
1188
1189 // string device = 4;
1190 if (this->device().size() > 0) {
1191 total_size += 1 +
1192 ::google::protobuf::internal::WireFormatLite::StringSize(
1193 this->device());
1194 }
1195
1196 int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
1197 GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
1198 _cached_size_ = cached_size;
1199 GOOGLE_SAFE_CONCURRENT_WRITES_END();
1200 return total_size;
1201 }
1202
MergeFrom(const::google::protobuf::Message & from)1203 void NodeDef::MergeFrom(const ::google::protobuf::Message& from) {
1204 // @@protoc_insertion_point(generalized_merge_from_start:opencv_tensorflow.NodeDef)
1205 GOOGLE_DCHECK_NE(&from, this);
1206 const NodeDef* source =
1207 ::google::protobuf::internal::DynamicCastToGenerated<const NodeDef>(
1208 &from);
1209 if (source == NULL) {
1210 // @@protoc_insertion_point(generalized_merge_from_cast_fail:opencv_tensorflow.NodeDef)
1211 ::google::protobuf::internal::ReflectionOps::Merge(from, this);
1212 } else {
1213 // @@protoc_insertion_point(generalized_merge_from_cast_success:opencv_tensorflow.NodeDef)
1214 MergeFrom(*source);
1215 }
1216 }
1217
MergeFrom(const NodeDef & from)1218 void NodeDef::MergeFrom(const NodeDef& from) {
1219 // @@protoc_insertion_point(class_specific_merge_from_start:opencv_tensorflow.NodeDef)
1220 GOOGLE_DCHECK_NE(&from, this);
1221 _internal_metadata_.MergeFrom(from._internal_metadata_);
1222 ::google::protobuf::uint32 cached_has_bits = 0;
1223 (void) cached_has_bits;
1224
1225 input_.MergeFrom(from.input_);
1226 attr_.MergeFrom(from.attr_);
1227 if (from.name().size() > 0) {
1228 set_name(from.name());
1229 }
1230 if (from.op().size() > 0) {
1231 set_op(from.op());
1232 }
1233 if (from.device().size() > 0) {
1234 set_device(from.device());
1235 }
1236 }
1237
CopyFrom(const::google::protobuf::Message & from)1238 void NodeDef::CopyFrom(const ::google::protobuf::Message& from) {
1239 // @@protoc_insertion_point(generalized_copy_from_start:opencv_tensorflow.NodeDef)
1240 if (&from == this) return;
1241 Clear();
1242 MergeFrom(from);
1243 }
1244
CopyFrom(const NodeDef & from)1245 void NodeDef::CopyFrom(const NodeDef& from) {
1246 // @@protoc_insertion_point(class_specific_copy_from_start:opencv_tensorflow.NodeDef)
1247 if (&from == this) return;
1248 Clear();
1249 MergeFrom(from);
1250 }
1251
IsInitialized() const1252 bool NodeDef::IsInitialized() const {
1253 return true;
1254 }
1255
Swap(NodeDef * other)1256 void NodeDef::Swap(NodeDef* other) {
1257 if (other == this) return;
1258 if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) {
1259 InternalSwap(other);
1260 } else {
1261 NodeDef* temp = New(GetArenaNoVirtual());
1262 temp->MergeFrom(*other);
1263 other->CopyFrom(*this);
1264 InternalSwap(temp);
1265 if (GetArenaNoVirtual() == NULL) {
1266 delete temp;
1267 }
1268 }
1269 }
UnsafeArenaSwap(NodeDef * other)1270 void NodeDef::UnsafeArenaSwap(NodeDef* other) {
1271 if (other == this) return;
1272 GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual());
1273 InternalSwap(other);
1274 }
InternalSwap(NodeDef * other)1275 void NodeDef::InternalSwap(NodeDef* other) {
1276 using std::swap;
1277 input_.InternalSwap(&other->input_);
1278 attr_.Swap(&other->attr_);
1279 name_.Swap(&other->name_);
1280 op_.Swap(&other->op_);
1281 device_.Swap(&other->device_);
1282 _internal_metadata_.Swap(&other->_internal_metadata_);
1283 swap(_cached_size_, other->_cached_size_);
1284 }
1285
GetMetadata() const1286 ::google::protobuf::Metadata NodeDef::GetMetadata() const {
1287 protobuf_graph_2eproto::protobuf_AssignDescriptorsOnce();
1288 return ::protobuf_graph_2eproto::file_level_metadata[kIndexInFileMessages];
1289 }
1290
1291
1292 // @@protoc_insertion_point(namespace_scope)
1293 } // namespace opencv_tensorflow
1294
1295 // @@protoc_insertion_point(global_scope)
1296