1// Generated by the protocol buffer compiler. DO NOT EDIT!
2// source: tensorflow/core/framework/graph.proto
3
4#include "tensorflow/core/framework/graph.pb.h"
5
6#include <algorithm>
7
8#include <google/protobuf/stubs/common.h>
9#include <google/protobuf/io/coded_stream.h>
10#include <google/protobuf/extension_set.h>
11#include <google/protobuf/wire_format_lite.h>
12#include <google/protobuf/descriptor.h>
13#include <google/protobuf/generated_message_reflection.h>
14#include <google/protobuf/reflection_ops.h>
15#include <google/protobuf/wire_format.h>
16// @@protoc_insertion_point(includes)
17#include <google/protobuf/port_def.inc>
18extern PROTOBUF_INTERNAL_EXPORT_tensorflow_2fcore_2fframework_2ffunction_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<3> scc_info_FunctionDefLibrary_tensorflow_2fcore_2fframework_2ffunction_2eproto;
19extern PROTOBUF_INTERNAL_EXPORT_tensorflow_2fcore_2fframework_2fnode_5fdef_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<3> scc_info_NodeDef_tensorflow_2fcore_2fframework_2fnode_5fdef_2eproto;
20extern PROTOBUF_INTERNAL_EXPORT_tensorflow_2fcore_2fframework_2fversions_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_VersionDef_tensorflow_2fcore_2fframework_2fversions_2eproto;
21namespace tensorflow {
22class GraphDefDefaultTypeInternal {
23 public:
24 ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<GraphDef> _instance;
25} _GraphDef_default_instance_;
26} // namespace tensorflow
27static void InitDefaultsscc_info_GraphDef_tensorflow_2fcore_2fframework_2fgraph_2eproto() {
28 GOOGLE_PROTOBUF_VERIFY_VERSION;
29
30 {
31 void* ptr = &::tensorflow::_GraphDef_default_instance_;
32 new (ptr) ::tensorflow::GraphDef();
33 ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
34 }
35 ::tensorflow::GraphDef::InitAsDefaultInstance();
36}
37
38::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<3> scc_info_GraphDef_tensorflow_2fcore_2fframework_2fgraph_2eproto =
39 {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 3, InitDefaultsscc_info_GraphDef_tensorflow_2fcore_2fframework_2fgraph_2eproto}, {
40 &scc_info_NodeDef_tensorflow_2fcore_2fframework_2fnode_5fdef_2eproto.base,
41 &scc_info_VersionDef_tensorflow_2fcore_2fframework_2fversions_2eproto.base,
42 &scc_info_FunctionDefLibrary_tensorflow_2fcore_2fframework_2ffunction_2eproto.base,}};
43
44static ::PROTOBUF_NAMESPACE_ID::Metadata file_level_metadata_tensorflow_2fcore_2fframework_2fgraph_2eproto[1];
45static constexpr ::PROTOBUF_NAMESPACE_ID::EnumDescriptor const** file_level_enum_descriptors_tensorflow_2fcore_2fframework_2fgraph_2eproto = nullptr;
46static constexpr ::PROTOBUF_NAMESPACE_ID::ServiceDescriptor const** file_level_service_descriptors_tensorflow_2fcore_2fframework_2fgraph_2eproto = nullptr;
47
48const ::PROTOBUF_NAMESPACE_ID::uint32 TableStruct_tensorflow_2fcore_2fframework_2fgraph_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
49 ~0u, // no _has_bits_
50 PROTOBUF_FIELD_OFFSET(::tensorflow::GraphDef, _internal_metadata_),
51 ~0u, // no _extensions_
52 ~0u, // no _oneof_case_
53 ~0u, // no _weak_field_map_
54 PROTOBUF_FIELD_OFFSET(::tensorflow::GraphDef, node_),
55 PROTOBUF_FIELD_OFFSET(::tensorflow::GraphDef, versions_),
56 PROTOBUF_FIELD_OFFSET(::tensorflow::GraphDef, version_),
57 PROTOBUF_FIELD_OFFSET(::tensorflow::GraphDef, library_),
58};
59static const ::PROTOBUF_NAMESPACE_ID::internal::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
60 { 0, -1, sizeof(::tensorflow::GraphDef)},
61};
62
63static ::PROTOBUF_NAMESPACE_ID::Message const * const file_default_instances[] = {
64 reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::tensorflow::_GraphDef_default_instance_),
65};
66
67const char descriptor_table_protodef_tensorflow_2fcore_2fframework_2fgraph_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) =
68 "\n%tensorflow/core/framework/graph.proto\022"
69 "\ntensorflow\032(tensorflow/core/framework/f"
70 "unction.proto\032(tensorflow/core/framework"
71 "/node_def.proto\032(tensorflow/core/framewo"
72 "rk/versions.proto\"\235\001\n\010GraphDef\022!\n\004node\030\001"
73 " \003(\0132\023.tensorflow.NodeDef\022(\n\010versions\030\004 "
74 "\001(\0132\026.tensorflow.VersionDef\022\023\n\007version\030\003"
75 " \001(\005B\002\030\001\022/\n\007library\030\002 \001(\0132\036.tensorflow.F"
76 "unctionDefLibraryBz\n\030org.tensorflow.fram"
77 "eworkB\013GraphProtosP\001ZLgithub.com/tensorf"
78 "low/tensorflow/tensorflow/go/core/framew"
79 "ork/graph_go_proto\370\001\001b\006proto3"
80 ;
81static const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable*const descriptor_table_tensorflow_2fcore_2fframework_2fgraph_2eproto_deps[3] = {
82 &::descriptor_table_tensorflow_2fcore_2fframework_2ffunction_2eproto,
83 &::descriptor_table_tensorflow_2fcore_2fframework_2fnode_5fdef_2eproto,
84 &::descriptor_table_tensorflow_2fcore_2fframework_2fversions_2eproto,
85};
86static ::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase*const descriptor_table_tensorflow_2fcore_2fframework_2fgraph_2eproto_sccs[1] = {
87 &scc_info_GraphDef_tensorflow_2fcore_2fframework_2fgraph_2eproto.base,
88};
89static ::PROTOBUF_NAMESPACE_ID::internal::once_flag descriptor_table_tensorflow_2fcore_2fframework_2fgraph_2eproto_once;
90static bool descriptor_table_tensorflow_2fcore_2fframework_2fgraph_2eproto_initialized = false;
91const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_tensorflow_2fcore_2fframework_2fgraph_2eproto = {
92 &descriptor_table_tensorflow_2fcore_2fframework_2fgraph_2eproto_initialized, descriptor_table_protodef_tensorflow_2fcore_2fframework_2fgraph_2eproto, "tensorflow/core/framework/graph.proto", 469,
93 &descriptor_table_tensorflow_2fcore_2fframework_2fgraph_2eproto_once, descriptor_table_tensorflow_2fcore_2fframework_2fgraph_2eproto_sccs, descriptor_table_tensorflow_2fcore_2fframework_2fgraph_2eproto_deps, 1, 3,
94 schemas, file_default_instances, TableStruct_tensorflow_2fcore_2fframework_2fgraph_2eproto::offsets,
95 file_level_metadata_tensorflow_2fcore_2fframework_2fgraph_2eproto, 1, file_level_enum_descriptors_tensorflow_2fcore_2fframework_2fgraph_2eproto, file_level_service_descriptors_tensorflow_2fcore_2fframework_2fgraph_2eproto,
96};
97
98// Force running AddDescriptors() at dynamic initialization time.
99static bool dynamic_init_dummy_tensorflow_2fcore_2fframework_2fgraph_2eproto = ( ::PROTOBUF_NAMESPACE_ID::internal::AddDescriptors(&descriptor_table_tensorflow_2fcore_2fframework_2fgraph_2eproto), true);
100namespace tensorflow {
101
102// ===================================================================
103
104void GraphDef::InitAsDefaultInstance() {
105 ::tensorflow::_GraphDef_default_instance_._instance.get_mutable()->versions_ = const_cast< ::tensorflow::VersionDef*>(
106 ::tensorflow::VersionDef::internal_default_instance());
107 ::tensorflow::_GraphDef_default_instance_._instance.get_mutable()->library_ = const_cast< ::tensorflow::FunctionDefLibrary*>(
108 ::tensorflow::FunctionDefLibrary::internal_default_instance());
109}
110class GraphDef::_Internal {
111 public:
112 static const ::tensorflow::VersionDef& versions(const GraphDef* msg);
113 static const ::tensorflow::FunctionDefLibrary& library(const GraphDef* msg);
114};
115
116const ::tensorflow::VersionDef&
117GraphDef::_Internal::versions(const GraphDef* msg) {
118 return *msg->versions_;
119}
120const ::tensorflow::FunctionDefLibrary&
121GraphDef::_Internal::library(const GraphDef* msg) {
122 return *msg->library_;
123}
124void GraphDef::clear_node() {
125 node_.Clear();
126}
127void GraphDef::unsafe_arena_set_allocated_versions(
128 ::tensorflow::VersionDef* versions) {
129 if (GetArenaNoVirtual() == nullptr) {
130 delete versions_;
131 }
132 versions_ = versions;
133 if (versions) {
134
135 } else {
136
137 }
138 // @@protoc_insertion_point(field_unsafe_arena_set_allocated:tensorflow.GraphDef.versions)
139}
140void GraphDef::clear_versions() {
141 if (GetArenaNoVirtual() == nullptr && versions_ != nullptr) {
142 delete versions_;
143 }
144 versions_ = nullptr;
145}
146void GraphDef::unsafe_arena_set_allocated_library(
147 ::tensorflow::FunctionDefLibrary* library) {
148 if (GetArenaNoVirtual() == nullptr) {
149 delete library_;
150 }
151 library_ = library;
152 if (library) {
153
154 } else {
155
156 }
157 // @@protoc_insertion_point(field_unsafe_arena_set_allocated:tensorflow.GraphDef.library)
158}
159void GraphDef::clear_library() {
160 if (GetArenaNoVirtual() == nullptr && library_ != nullptr) {
161 delete library_;
162 }
163 library_ = nullptr;
164}
165GraphDef::GraphDef()
166 : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
167 SharedCtor();
168 // @@protoc_insertion_point(constructor:tensorflow.GraphDef)
169}
170GraphDef::GraphDef(::PROTOBUF_NAMESPACE_ID::Arena* arena)
171 : ::PROTOBUF_NAMESPACE_ID::Message(),
172 _internal_metadata_(arena),
173 node_(arena) {
174 SharedCtor();
175 RegisterArenaDtor(arena);
176 // @@protoc_insertion_point(arena_constructor:tensorflow.GraphDef)
177}
178GraphDef::GraphDef(const GraphDef& from)
179 : ::PROTOBUF_NAMESPACE_ID::Message(),
180 _internal_metadata_(nullptr),
181 node_(from.node_) {
182 _internal_metadata_.MergeFrom(from._internal_metadata_);
183 if (from.has_library()) {
184 library_ = new ::tensorflow::FunctionDefLibrary(*from.library_);
185 } else {
186 library_ = nullptr;
187 }
188 if (from.has_versions()) {
189 versions_ = new ::tensorflow::VersionDef(*from.versions_);
190 } else {
191 versions_ = nullptr;
192 }
193 version_ = from.version_;
194 // @@protoc_insertion_point(copy_constructor:tensorflow.GraphDef)
195}
196
197void GraphDef::SharedCtor() {
198 ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_GraphDef_tensorflow_2fcore_2fframework_2fgraph_2eproto.base);
199 ::memset(&library_, 0, static_cast<size_t>(
200 reinterpret_cast<char*>(&version_) -
201 reinterpret_cast<char*>(&library_)) + sizeof(version_));
202}
203
204GraphDef::~GraphDef() {
205 // @@protoc_insertion_point(destructor:tensorflow.GraphDef)
206 SharedDtor();
207}
208
209void GraphDef::SharedDtor() {
210 GOOGLE_DCHECK(GetArenaNoVirtual() == nullptr);
211 if (this != internal_default_instance()) delete library_;
212 if (this != internal_default_instance()) delete versions_;
213}
214
215void GraphDef::ArenaDtor(void* object) {
216 GraphDef* _this = reinterpret_cast< GraphDef* >(object);
217 (void)_this;
218}
219void GraphDef::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
220}
221void GraphDef::SetCachedSize(int size) const {
222 _cached_size_.Set(size);
223}
224const GraphDef& GraphDef::default_instance() {
225 ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_GraphDef_tensorflow_2fcore_2fframework_2fgraph_2eproto.base);
226 return *internal_default_instance();
227}
228
229
230void GraphDef::Clear() {
231// @@protoc_insertion_point(message_clear_start:tensorflow.GraphDef)
232 ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
233 // Prevent compiler warnings about cached_has_bits being unused
234 (void) cached_has_bits;
235
236 node_.Clear();
237 if (GetArenaNoVirtual() == nullptr && library_ != nullptr) {
238 delete library_;
239 }
240 library_ = nullptr;
241 if (GetArenaNoVirtual() == nullptr && versions_ != nullptr) {
242 delete versions_;
243 }
244 versions_ = nullptr;
245 version_ = 0;
246 _internal_metadata_.Clear();
247}
248
249#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
250const char* GraphDef::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
251#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
252 ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArenaNoVirtual(); (void)arena;
253 while (!ctx->Done(&ptr)) {
254 ::PROTOBUF_NAMESPACE_ID::uint32 tag;
255 ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
256 CHK_(ptr);
257 switch (tag >> 3) {
258 // repeated .tensorflow.NodeDef node = 1;
259 case 1:
260 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) {
261 ptr -= 1;
262 do {
263 ptr += 1;
264 ptr = ctx->ParseMessage(add_node(), ptr);
265 CHK_(ptr);
266 if (!ctx->DataAvailable(ptr)) break;
267 } while (::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<::PROTOBUF_NAMESPACE_ID::uint8>(ptr) == 10);
268 } else goto handle_unusual;
269 continue;
270 // .tensorflow.FunctionDefLibrary library = 2;
271 case 2:
272 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) {
273 ptr = ctx->ParseMessage(mutable_library(), ptr);
274 CHK_(ptr);
275 } else goto handle_unusual;
276 continue;
277 // int32 version = 3 [deprecated = true];
278 case 3:
279 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24)) {
280 version_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
281 CHK_(ptr);
282 } else goto handle_unusual;
283 continue;
284 // .tensorflow.VersionDef versions = 4;
285 case 4:
286 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 34)) {
287 ptr = ctx->ParseMessage(mutable_versions(), ptr);
288 CHK_(ptr);
289 } else goto handle_unusual;
290 continue;
291 default: {
292 handle_unusual:
293 if ((tag & 7) == 4 || tag == 0) {
294 ctx->SetLastTag(tag);
295 goto success;
296 }
297 ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
298 CHK_(ptr != nullptr);
299 continue;
300 }
301 } // switch
302 } // while
303success:
304 return ptr;
305failure:
306 ptr = nullptr;
307 goto success;
308#undef CHK_
309}
310#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
311bool GraphDef::MergePartialFromCodedStream(
312 ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) {
313#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure
314 ::PROTOBUF_NAMESPACE_ID::uint32 tag;
315 // @@protoc_insertion_point(parse_start:tensorflow.GraphDef)
316 for (;;) {
317 ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
318 tag = p.first;
319 if (!p.second) goto handle_unusual;
320 switch (::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::GetTagFieldNumber(tag)) {
321 // repeated .tensorflow.NodeDef node = 1;
322 case 1: {
323 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (10 & 0xFF)) {
324 DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage(
325 input, add_node()));
326 } else {
327 goto handle_unusual;
328 }
329 break;
330 }
331
332 // .tensorflow.FunctionDefLibrary library = 2;
333 case 2: {
334 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (18 & 0xFF)) {
335 DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage(
336 input, mutable_library()));
337 } else {
338 goto handle_unusual;
339 }
340 break;
341 }
342
343 // int32 version = 3 [deprecated = true];
344 case 3: {
345 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (24 & 0xFF)) {
346
347 DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
348 ::PROTOBUF_NAMESPACE_ID::int32, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT32>(
349 input, &version_)));
350 } else {
351 goto handle_unusual;
352 }
353 break;
354 }
355
356 // .tensorflow.VersionDef versions = 4;
357 case 4: {
358 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (34 & 0xFF)) {
359 DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage(
360 input, mutable_versions()));
361 } else {
362 goto handle_unusual;
363 }
364 break;
365 }
366
367 default: {
368 handle_unusual:
369 if (tag == 0) {
370 goto success;
371 }
372 DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SkipField(
373 input, tag, _internal_metadata_.mutable_unknown_fields()));
374 break;
375 }
376 }
377 }
378success:
379 // @@protoc_insertion_point(parse_success:tensorflow.GraphDef)
380 return true;
381failure:
382 // @@protoc_insertion_point(parse_failure:tensorflow.GraphDef)
383 return false;
384#undef DO_
385}
386#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
387
388void GraphDef::SerializeWithCachedSizes(
389 ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const {
390 // @@protoc_insertion_point(serialize_start:tensorflow.GraphDef)
391 ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
392 (void) cached_has_bits;
393
394 // repeated .tensorflow.NodeDef node = 1;
395 for (unsigned int i = 0,
396 n = static_cast<unsigned int>(this->node_size()); i < n; i++) {
397 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray(
398 1,
399 this->node(static_cast<int>(i)),
400 output);
401 }
402
403 // .tensorflow.FunctionDefLibrary library = 2;
404 if (this->has_library()) {
405 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray(
406 2, _Internal::library(this), output);
407 }
408
409 // int32 version = 3 [deprecated = true];
410 if (this->version() != 0) {
411 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32(3, this->version(), output);
412 }
413
414 // .tensorflow.VersionDef versions = 4;
415 if (this->has_versions()) {
416 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray(
417 4, _Internal::versions(this), output);
418 }
419
420 if (_internal_metadata_.have_unknown_fields()) {
421 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields(
422 _internal_metadata_.unknown_fields(), output);
423 }
424 // @@protoc_insertion_point(serialize_end:tensorflow.GraphDef)
425}
426
427::PROTOBUF_NAMESPACE_ID::uint8* GraphDef::InternalSerializeWithCachedSizesToArray(
428 ::PROTOBUF_NAMESPACE_ID::uint8* target) const {
429 // @@protoc_insertion_point(serialize_to_array_start:tensorflow.GraphDef)
430 ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
431 (void) cached_has_bits;
432
433 // repeated .tensorflow.NodeDef node = 1;
434 for (unsigned int i = 0,
435 n = static_cast<unsigned int>(this->node_size()); i < n; i++) {
436 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
437 InternalWriteMessageToArray(
438 1, this->node(static_cast<int>(i)), target);
439 }
440
441 // .tensorflow.FunctionDefLibrary library = 2;
442 if (this->has_library()) {
443 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
444 InternalWriteMessageToArray(
445 2, _Internal::library(this), target);
446 }
447
448 // int32 version = 3 [deprecated = true];
449 if (this->version() != 0) {
450 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(3, this->version(), target);
451 }
452
453 // .tensorflow.VersionDef versions = 4;
454 if (this->has_versions()) {
455 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
456 InternalWriteMessageToArray(
457 4, _Internal::versions(this), target);
458 }
459
460 if (_internal_metadata_.have_unknown_fields()) {
461 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray(
462 _internal_metadata_.unknown_fields(), target);
463 }
464 // @@protoc_insertion_point(serialize_to_array_end:tensorflow.GraphDef)
465 return target;
466}
467
468size_t GraphDef::ByteSizeLong() const {
469// @@protoc_insertion_point(message_byte_size_start:tensorflow.GraphDef)
470 size_t total_size = 0;
471
472 if (_internal_metadata_.have_unknown_fields()) {
473 total_size +=
474 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::ComputeUnknownFieldsSize(
475 _internal_metadata_.unknown_fields());
476 }
477 ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
478 // Prevent compiler warnings about cached_has_bits being unused
479 (void) cached_has_bits;
480
481 // repeated .tensorflow.NodeDef node = 1;
482 {
483 unsigned int count = static_cast<unsigned int>(this->node_size());
484 total_size += 1UL * count;
485 for (unsigned int i = 0; i < count; i++) {
486 total_size +=
487 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
488 this->node(static_cast<int>(i)));
489 }
490 }
491
492 // .tensorflow.FunctionDefLibrary library = 2;
493 if (this->has_library()) {
494 total_size += 1 +
495 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
496 *library_);
497 }
498
499 // .tensorflow.VersionDef versions = 4;
500 if (this->has_versions()) {
501 total_size += 1 +
502 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
503 *versions_);
504 }
505
506 // int32 version = 3 [deprecated = true];
507 if (this->version() != 0) {
508 total_size += 1 +
509 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
510 this->version());
511 }
512
513 int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
514 SetCachedSize(cached_size);
515 return total_size;
516}
517
518void GraphDef::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
519// @@protoc_insertion_point(generalized_merge_from_start:tensorflow.GraphDef)
520 GOOGLE_DCHECK_NE(&from, this);
521 const GraphDef* source =
522 ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<GraphDef>(
523 &from);
524 if (source == nullptr) {
525 // @@protoc_insertion_point(generalized_merge_from_cast_fail:tensorflow.GraphDef)
526 ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
527 } else {
528 // @@protoc_insertion_point(generalized_merge_from_cast_success:tensorflow.GraphDef)
529 MergeFrom(*source);
530 }
531}
532
533void GraphDef::MergeFrom(const GraphDef& from) {
534// @@protoc_insertion_point(class_specific_merge_from_start:tensorflow.GraphDef)
535 GOOGLE_DCHECK_NE(&from, this);
536 _internal_metadata_.MergeFrom(from._internal_metadata_);
537 ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
538 (void) cached_has_bits;
539
540 node_.MergeFrom(from.node_);
541 if (from.has_library()) {
542 mutable_library()->::tensorflow::FunctionDefLibrary::MergeFrom(from.library());
543 }
544 if (from.has_versions()) {
545 mutable_versions()->::tensorflow::VersionDef::MergeFrom(from.versions());
546 }
547 if (from.version() != 0) {
548 set_version(from.version());
549 }
550}
551
552void GraphDef::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
553// @@protoc_insertion_point(generalized_copy_from_start:tensorflow.GraphDef)
554 if (&from == this) return;
555 Clear();
556 MergeFrom(from);
557}
558
559void GraphDef::CopyFrom(const GraphDef& from) {
560// @@protoc_insertion_point(class_specific_copy_from_start:tensorflow.GraphDef)
561 if (&from == this) return;
562 Clear();
563 MergeFrom(from);
564}
565
566bool GraphDef::IsInitialized() const {
567 return true;
568}
569
570void GraphDef::InternalSwap(GraphDef* other) {
571 using std::swap;
572 _internal_metadata_.Swap(&other->_internal_metadata_);
573 CastToBase(&node_)->InternalSwap(CastToBase(&other->node_));
574 swap(library_, other->library_);
575 swap(versions_, other->versions_);
576 swap(version_, other->version_);
577}
578
579::PROTOBUF_NAMESPACE_ID::Metadata GraphDef::GetMetadata() const {
580 return GetMetadataStatic();
581}
582
583
584// @@protoc_insertion_point(namespace_scope)
585} // namespace tensorflow
586PROTOBUF_NAMESPACE_OPEN
587template<> PROTOBUF_NOINLINE ::tensorflow::GraphDef* Arena::CreateMaybeMessage< ::tensorflow::GraphDef >(Arena* arena) {
588 return Arena::CreateMessageInternal< ::tensorflow::GraphDef >(arena);
589}
590PROTOBUF_NAMESPACE_CLOSE
591
592// @@protoc_insertion_point(global_scope)
593#include <google/protobuf/port_undef.inc>
594