1 // Generated by the protocol buffer compiler. DO NOT EDIT!
2 // source: tensorflow/core/framework/node_def.proto
3
4 #include "tensorflow/core/framework/node_def.pb.h"
5
6 #include <algorithm>
7 #include <cstdint>
8
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/io/zero_copy_stream_impl_lite.h>
13 // @@protoc_insertion_point(includes)
14 #include <google/protobuf/port_def.inc>
15
16 PROTOBUF_PRAGMA_INIT_SEG
17
18 namespace _pb = ::PROTOBUF_NAMESPACE_ID;
19 namespace _pbi = _pb::internal;
20
21 namespace tensorflow {
NodeDef_AttrEntry_DoNotUse(::_pbi::ConstantInitialized)22 PROTOBUF_CONSTEXPR NodeDef_AttrEntry_DoNotUse::NodeDef_AttrEntry_DoNotUse(
23 ::_pbi::ConstantInitialized) {}
24 struct NodeDef_AttrEntry_DoNotUseDefaultTypeInternal {
NodeDef_AttrEntry_DoNotUseDefaultTypeInternaltensorflow::NodeDef_AttrEntry_DoNotUseDefaultTypeInternal25 PROTOBUF_CONSTEXPR NodeDef_AttrEntry_DoNotUseDefaultTypeInternal()
26 : _instance(::_pbi::ConstantInitialized{}) {}
~NodeDef_AttrEntry_DoNotUseDefaultTypeInternaltensorflow::NodeDef_AttrEntry_DoNotUseDefaultTypeInternal27 ~NodeDef_AttrEntry_DoNotUseDefaultTypeInternal() {}
28 union { // NOLINT(misc-non-private-member-variables-in-classes)
29 NodeDef_AttrEntry_DoNotUse _instance;
30 };
31 };
32 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 NodeDef_AttrEntry_DoNotUseDefaultTypeInternal _NodeDef_AttrEntry_DoNotUse_default_instance_;
NodeDef_ExperimentalDebugInfo(::_pbi::ConstantInitialized)33 PROTOBUF_CONSTEXPR NodeDef_ExperimentalDebugInfo::NodeDef_ExperimentalDebugInfo(
34 ::_pbi::ConstantInitialized): _impl_{
35 /*decltype(_impl_.original_node_names_)*/{}
36 , /*decltype(_impl_.original_func_names_)*/{}
37 , /*decltype(_impl_._cached_size_)*/{}} {}
38 struct NodeDef_ExperimentalDebugInfoDefaultTypeInternal {
NodeDef_ExperimentalDebugInfoDefaultTypeInternaltensorflow::NodeDef_ExperimentalDebugInfoDefaultTypeInternal39 PROTOBUF_CONSTEXPR NodeDef_ExperimentalDebugInfoDefaultTypeInternal()
40 : _instance(::_pbi::ConstantInitialized{}) {}
~NodeDef_ExperimentalDebugInfoDefaultTypeInternaltensorflow::NodeDef_ExperimentalDebugInfoDefaultTypeInternal41 ~NodeDef_ExperimentalDebugInfoDefaultTypeInternal() {}
42 union { // NOLINT(misc-non-private-member-variables-in-classes)
43 NodeDef_ExperimentalDebugInfo _instance;
44 };
45 };
46 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 NodeDef_ExperimentalDebugInfoDefaultTypeInternal _NodeDef_ExperimentalDebugInfo_default_instance_;
NodeDef(::_pbi::ConstantInitialized)47 PROTOBUF_CONSTEXPR NodeDef::NodeDef(
48 ::_pbi::ConstantInitialized): _impl_{
49 /*decltype(_impl_.input_)*/{}
50 , /*decltype(_impl_.attr_)*/{}
51 , /*decltype(_impl_.name_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
52 , /*decltype(_impl_.op_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
53 , /*decltype(_impl_.device_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
54 , /*decltype(_impl_.experimental_debug_info_)*/nullptr
55 , /*decltype(_impl_.experimental_type_)*/nullptr
56 , /*decltype(_impl_._cached_size_)*/{}} {}
57 struct NodeDefDefaultTypeInternal {
NodeDefDefaultTypeInternaltensorflow::NodeDefDefaultTypeInternal58 PROTOBUF_CONSTEXPR NodeDefDefaultTypeInternal()
59 : _instance(::_pbi::ConstantInitialized{}) {}
~NodeDefDefaultTypeInternaltensorflow::NodeDefDefaultTypeInternal60 ~NodeDefDefaultTypeInternal() {}
61 union { // NOLINT(misc-non-private-member-variables-in-classes)
62 NodeDef _instance;
63 };
64 };
65 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 NodeDefDefaultTypeInternal _NodeDef_default_instance_;
66 } // namespace tensorflow
67 namespace tensorflow {
68
69 // ===================================================================
70
NodeDef_AttrEntry_DoNotUse()71 NodeDef_AttrEntry_DoNotUse::NodeDef_AttrEntry_DoNotUse() {}
NodeDef_AttrEntry_DoNotUse(::PROTOBUF_NAMESPACE_ID::Arena * arena)72 NodeDef_AttrEntry_DoNotUse::NodeDef_AttrEntry_DoNotUse(::PROTOBUF_NAMESPACE_ID::Arena* arena)
73 : SuperType(arena) {}
MergeFrom(const NodeDef_AttrEntry_DoNotUse & other)74 void NodeDef_AttrEntry_DoNotUse::MergeFrom(const NodeDef_AttrEntry_DoNotUse& other) {
75 MergeFromInternal(other);
76 }
77
78 // ===================================================================
79
80 class NodeDef_ExperimentalDebugInfo::_Internal {
81 public:
82 };
83
NodeDef_ExperimentalDebugInfo(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)84 NodeDef_ExperimentalDebugInfo::NodeDef_ExperimentalDebugInfo(::PROTOBUF_NAMESPACE_ID::Arena* arena,
85 bool is_message_owned)
86 : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
87 SharedCtor(arena, is_message_owned);
88 // @@protoc_insertion_point(arena_constructor:tensorflow.NodeDef.ExperimentalDebugInfo)
89 }
NodeDef_ExperimentalDebugInfo(const NodeDef_ExperimentalDebugInfo & from)90 NodeDef_ExperimentalDebugInfo::NodeDef_ExperimentalDebugInfo(const NodeDef_ExperimentalDebugInfo& from)
91 : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
92 NodeDef_ExperimentalDebugInfo* const _this = this; (void)_this;
93 new (&_impl_) Impl_{
94 decltype(_impl_.original_node_names_){from._impl_.original_node_names_}
95 , decltype(_impl_.original_func_names_){from._impl_.original_func_names_}
96 , /*decltype(_impl_._cached_size_)*/{}};
97
98 _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
99 // @@protoc_insertion_point(copy_constructor:tensorflow.NodeDef.ExperimentalDebugInfo)
100 }
101
SharedCtor(::_pb::Arena * arena,bool is_message_owned)102 inline void NodeDef_ExperimentalDebugInfo::SharedCtor(
103 ::_pb::Arena* arena, bool is_message_owned) {
104 (void)arena;
105 (void)is_message_owned;
106 new (&_impl_) Impl_{
107 decltype(_impl_.original_node_names_){arena}
108 , decltype(_impl_.original_func_names_){arena}
109 , /*decltype(_impl_._cached_size_)*/{}
110 };
111 }
112
~NodeDef_ExperimentalDebugInfo()113 NodeDef_ExperimentalDebugInfo::~NodeDef_ExperimentalDebugInfo() {
114 // @@protoc_insertion_point(destructor:tensorflow.NodeDef.ExperimentalDebugInfo)
115 if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
116 (void)arena;
117 return;
118 }
119 SharedDtor();
120 }
121
SharedDtor()122 inline void NodeDef_ExperimentalDebugInfo::SharedDtor() {
123 GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
124 _impl_.original_node_names_.~RepeatedPtrField();
125 _impl_.original_func_names_.~RepeatedPtrField();
126 }
127
SetCachedSize(int size) const128 void NodeDef_ExperimentalDebugInfo::SetCachedSize(int size) const {
129 _impl_._cached_size_.Set(size);
130 }
131
Clear()132 void NodeDef_ExperimentalDebugInfo::Clear() {
133 // @@protoc_insertion_point(message_clear_start:tensorflow.NodeDef.ExperimentalDebugInfo)
134 ::uint32_t cached_has_bits = 0;
135 // Prevent compiler warnings about cached_has_bits being unused
136 (void) cached_has_bits;
137
138 _impl_.original_node_names_.Clear();
139 _impl_.original_func_names_.Clear();
140 _internal_metadata_.Clear<std::string>();
141 }
142
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)143 const char* NodeDef_ExperimentalDebugInfo::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
144 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
145 while (!ctx->Done(&ptr)) {
146 ::uint32_t tag;
147 ptr = ::_pbi::ReadTag(ptr, &tag);
148 switch (tag >> 3) {
149 // repeated string original_node_names = 1;
150 case 1:
151 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 10)) {
152 ptr -= 1;
153 do {
154 ptr += 1;
155 auto str = _internal_add_original_node_names();
156 ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
157 CHK_(ptr);
158 CHK_(::_pbi::VerifyUTF8(str, nullptr));
159 if (!ctx->DataAvailable(ptr)) break;
160 } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<10>(ptr));
161 } else {
162 goto handle_unusual;
163 }
164 continue;
165 // repeated string original_func_names = 2;
166 case 2:
167 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 18)) {
168 ptr -= 1;
169 do {
170 ptr += 1;
171 auto str = _internal_add_original_func_names();
172 ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
173 CHK_(ptr);
174 CHK_(::_pbi::VerifyUTF8(str, nullptr));
175 if (!ctx->DataAvailable(ptr)) break;
176 } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<18>(ptr));
177 } else {
178 goto handle_unusual;
179 }
180 continue;
181 default:
182 goto handle_unusual;
183 } // switch
184 handle_unusual:
185 if ((tag == 0) || ((tag & 7) == 4)) {
186 CHK_(ptr);
187 ctx->SetLastTag(tag);
188 goto message_done;
189 }
190 ptr = UnknownFieldParse(
191 tag,
192 _internal_metadata_.mutable_unknown_fields<std::string>(),
193 ptr, ctx);
194 CHK_(ptr != nullptr);
195 } // while
196 message_done:
197 return ptr;
198 failure:
199 ptr = nullptr;
200 goto message_done;
201 #undef CHK_
202 }
203
_InternalSerialize(::uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const204 ::uint8_t* NodeDef_ExperimentalDebugInfo::_InternalSerialize(
205 ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
206 // @@protoc_insertion_point(serialize_to_array_start:tensorflow.NodeDef.ExperimentalDebugInfo)
207 ::uint32_t cached_has_bits = 0;
208 (void) cached_has_bits;
209
210 // repeated string original_node_names = 1;
211 for (int i = 0, n = this->_internal_original_node_names_size(); i < n; i++) {
212 const auto& s = this->_internal_original_node_names(i);
213 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
214 s.data(), static_cast<int>(s.length()),
215 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
216 "tensorflow.NodeDef.ExperimentalDebugInfo.original_node_names");
217 target = stream->WriteString(1, s, target);
218 }
219
220 // repeated string original_func_names = 2;
221 for (int i = 0, n = this->_internal_original_func_names_size(); i < n; i++) {
222 const auto& s = this->_internal_original_func_names(i);
223 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
224 s.data(), static_cast<int>(s.length()),
225 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
226 "tensorflow.NodeDef.ExperimentalDebugInfo.original_func_names");
227 target = stream->WriteString(2, s, target);
228 }
229
230 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
231 target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
232 static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
233 }
234 // @@protoc_insertion_point(serialize_to_array_end:tensorflow.NodeDef.ExperimentalDebugInfo)
235 return target;
236 }
237
ByteSizeLong() const238 size_t NodeDef_ExperimentalDebugInfo::ByteSizeLong() const {
239 // @@protoc_insertion_point(message_byte_size_start:tensorflow.NodeDef.ExperimentalDebugInfo)
240 size_t total_size = 0;
241
242 ::uint32_t cached_has_bits = 0;
243 // Prevent compiler warnings about cached_has_bits being unused
244 (void) cached_has_bits;
245
246 // repeated string original_node_names = 1;
247 total_size += 1 *
248 ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(_impl_.original_node_names_.size());
249 for (int i = 0, n = _impl_.original_node_names_.size(); i < n; i++) {
250 total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
251 _impl_.original_node_names_.Get(i));
252 }
253
254 // repeated string original_func_names = 2;
255 total_size += 1 *
256 ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(_impl_.original_func_names_.size());
257 for (int i = 0, n = _impl_.original_func_names_.size(); i < n; i++) {
258 total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
259 _impl_.original_func_names_.Get(i));
260 }
261
262 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
263 total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
264 }
265 int cached_size = ::_pbi::ToCachedSize(total_size);
266 SetCachedSize(cached_size);
267 return total_size;
268 }
269
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)270 void NodeDef_ExperimentalDebugInfo::CheckTypeAndMergeFrom(
271 const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
272 MergeFrom(*::_pbi::DownCast<const NodeDef_ExperimentalDebugInfo*>(
273 &from));
274 }
275
MergeFrom(const NodeDef_ExperimentalDebugInfo & from)276 void NodeDef_ExperimentalDebugInfo::MergeFrom(const NodeDef_ExperimentalDebugInfo& from) {
277 NodeDef_ExperimentalDebugInfo* const _this = this;
278 // @@protoc_insertion_point(class_specific_merge_from_start:tensorflow.NodeDef.ExperimentalDebugInfo)
279 GOOGLE_DCHECK_NE(&from, _this);
280 ::uint32_t cached_has_bits = 0;
281 (void) cached_has_bits;
282
283 _this->_impl_.original_node_names_.MergeFrom(from._impl_.original_node_names_);
284 _this->_impl_.original_func_names_.MergeFrom(from._impl_.original_func_names_);
285 _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
286 }
287
CopyFrom(const NodeDef_ExperimentalDebugInfo & from)288 void NodeDef_ExperimentalDebugInfo::CopyFrom(const NodeDef_ExperimentalDebugInfo& from) {
289 // @@protoc_insertion_point(class_specific_copy_from_start:tensorflow.NodeDef.ExperimentalDebugInfo)
290 if (&from == this) return;
291 Clear();
292 MergeFrom(from);
293 }
294
IsInitialized() const295 bool NodeDef_ExperimentalDebugInfo::IsInitialized() const {
296 return true;
297 }
298
InternalSwap(NodeDef_ExperimentalDebugInfo * other)299 void NodeDef_ExperimentalDebugInfo::InternalSwap(NodeDef_ExperimentalDebugInfo* other) {
300 using std::swap;
301 _internal_metadata_.InternalSwap(&other->_internal_metadata_);
302 _impl_.original_node_names_.InternalSwap(&other->_impl_.original_node_names_);
303 _impl_.original_func_names_.InternalSwap(&other->_impl_.original_func_names_);
304 }
305
GetTypeName() const306 std::string NodeDef_ExperimentalDebugInfo::GetTypeName() const {
307 return "tensorflow.NodeDef.ExperimentalDebugInfo";
308 }
309
310
311 // ===================================================================
312
313 class NodeDef::_Internal {
314 public:
315 static const ::tensorflow::NodeDef_ExperimentalDebugInfo& experimental_debug_info(const NodeDef* msg);
316 static const ::tensorflow::FullTypeDef& experimental_type(const NodeDef* msg);
317 };
318
319 const ::tensorflow::NodeDef_ExperimentalDebugInfo&
experimental_debug_info(const NodeDef * msg)320 NodeDef::_Internal::experimental_debug_info(const NodeDef* msg) {
321 return *msg->_impl_.experimental_debug_info_;
322 }
323 const ::tensorflow::FullTypeDef&
experimental_type(const NodeDef * msg)324 NodeDef::_Internal::experimental_type(const NodeDef* msg) {
325 return *msg->_impl_.experimental_type_;
326 }
clear_attr()327 void NodeDef::clear_attr() {
328 _impl_.attr_.Clear();
329 }
clear_experimental_type()330 void NodeDef::clear_experimental_type() {
331 if (GetArenaForAllocation() == nullptr && _impl_.experimental_type_ != nullptr) {
332 delete _impl_.experimental_type_;
333 }
334 _impl_.experimental_type_ = nullptr;
335 }
NodeDef(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)336 NodeDef::NodeDef(::PROTOBUF_NAMESPACE_ID::Arena* arena,
337 bool is_message_owned)
338 : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
339 SharedCtor(arena, is_message_owned);
340 // @@protoc_insertion_point(arena_constructor:tensorflow.NodeDef)
341 }
NodeDef(const NodeDef & from)342 NodeDef::NodeDef(const NodeDef& from)
343 : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
344 NodeDef* const _this = this; (void)_this;
345 new (&_impl_) Impl_{
346 decltype(_impl_.input_){from._impl_.input_}
347 , /*decltype(_impl_.attr_)*/{}
348 , decltype(_impl_.name_){}
349 , decltype(_impl_.op_){}
350 , decltype(_impl_.device_){}
351 , decltype(_impl_.experimental_debug_info_){nullptr}
352 , decltype(_impl_.experimental_type_){nullptr}
353 , /*decltype(_impl_._cached_size_)*/{}};
354
355 _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
356 _this->_impl_.attr_.MergeFrom(from._impl_.attr_);
357 _impl_.name_.InitDefault();
358 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
359 _impl_.name_.Set("", GetArenaForAllocation());
360 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
361 if (!from._internal_name().empty()) {
362 _this->_impl_.name_.Set(from._internal_name(),
363 _this->GetArenaForAllocation());
364 }
365 _impl_.op_.InitDefault();
366 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
367 _impl_.op_.Set("", GetArenaForAllocation());
368 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
369 if (!from._internal_op().empty()) {
370 _this->_impl_.op_.Set(from._internal_op(),
371 _this->GetArenaForAllocation());
372 }
373 _impl_.device_.InitDefault();
374 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
375 _impl_.device_.Set("", GetArenaForAllocation());
376 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
377 if (!from._internal_device().empty()) {
378 _this->_impl_.device_.Set(from._internal_device(),
379 _this->GetArenaForAllocation());
380 }
381 if (from._internal_has_experimental_debug_info()) {
382 _this->_impl_.experimental_debug_info_ = new ::tensorflow::NodeDef_ExperimentalDebugInfo(*from._impl_.experimental_debug_info_);
383 }
384 if (from._internal_has_experimental_type()) {
385 _this->_impl_.experimental_type_ = new ::tensorflow::FullTypeDef(*from._impl_.experimental_type_);
386 }
387 // @@protoc_insertion_point(copy_constructor:tensorflow.NodeDef)
388 }
389
SharedCtor(::_pb::Arena * arena,bool is_message_owned)390 inline void NodeDef::SharedCtor(
391 ::_pb::Arena* arena, bool is_message_owned) {
392 (void)arena;
393 (void)is_message_owned;
394 new (&_impl_) Impl_{
395 decltype(_impl_.input_){arena}
396 , /*decltype(_impl_.attr_)*/{::_pbi::ArenaInitialized(), arena}
397 , decltype(_impl_.name_){}
398 , decltype(_impl_.op_){}
399 , decltype(_impl_.device_){}
400 , decltype(_impl_.experimental_debug_info_){nullptr}
401 , decltype(_impl_.experimental_type_){nullptr}
402 , /*decltype(_impl_._cached_size_)*/{}
403 };
404 _impl_.name_.InitDefault();
405 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
406 _impl_.name_.Set("", GetArenaForAllocation());
407 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
408 _impl_.op_.InitDefault();
409 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
410 _impl_.op_.Set("", GetArenaForAllocation());
411 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
412 _impl_.device_.InitDefault();
413 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
414 _impl_.device_.Set("", GetArenaForAllocation());
415 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
416 }
417
~NodeDef()418 NodeDef::~NodeDef() {
419 // @@protoc_insertion_point(destructor:tensorflow.NodeDef)
420 if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
421 (void)arena;
422 return;
423 }
424 SharedDtor();
425 }
426
SharedDtor()427 inline void NodeDef::SharedDtor() {
428 GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
429 _impl_.input_.~RepeatedPtrField();
430 _impl_.attr_.Destruct();
431 _impl_.attr_.~MapFieldLite();
432 _impl_.name_.Destroy();
433 _impl_.op_.Destroy();
434 _impl_.device_.Destroy();
435 if (this != internal_default_instance()) delete _impl_.experimental_debug_info_;
436 if (this != internal_default_instance()) delete _impl_.experimental_type_;
437 }
438
SetCachedSize(int size) const439 void NodeDef::SetCachedSize(int size) const {
440 _impl_._cached_size_.Set(size);
441 }
442
Clear()443 void NodeDef::Clear() {
444 // @@protoc_insertion_point(message_clear_start:tensorflow.NodeDef)
445 ::uint32_t cached_has_bits = 0;
446 // Prevent compiler warnings about cached_has_bits being unused
447 (void) cached_has_bits;
448
449 _impl_.input_.Clear();
450 _impl_.attr_.Clear();
451 _impl_.name_.ClearToEmpty();
452 _impl_.op_.ClearToEmpty();
453 _impl_.device_.ClearToEmpty();
454 if (GetArenaForAllocation() == nullptr && _impl_.experimental_debug_info_ != nullptr) {
455 delete _impl_.experimental_debug_info_;
456 }
457 _impl_.experimental_debug_info_ = nullptr;
458 if (GetArenaForAllocation() == nullptr && _impl_.experimental_type_ != nullptr) {
459 delete _impl_.experimental_type_;
460 }
461 _impl_.experimental_type_ = nullptr;
462 _internal_metadata_.Clear<std::string>();
463 }
464
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)465 const char* NodeDef::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
466 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
467 while (!ctx->Done(&ptr)) {
468 ::uint32_t tag;
469 ptr = ::_pbi::ReadTag(ptr, &tag);
470 switch (tag >> 3) {
471 // string name = 1;
472 case 1:
473 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 10)) {
474 auto str = _internal_mutable_name();
475 ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
476 CHK_(ptr);
477 CHK_(::_pbi::VerifyUTF8(str, nullptr));
478 } else {
479 goto handle_unusual;
480 }
481 continue;
482 // string op = 2;
483 case 2:
484 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 18)) {
485 auto str = _internal_mutable_op();
486 ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
487 CHK_(ptr);
488 CHK_(::_pbi::VerifyUTF8(str, nullptr));
489 } else {
490 goto handle_unusual;
491 }
492 continue;
493 // repeated string input = 3;
494 case 3:
495 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 26)) {
496 ptr -= 1;
497 do {
498 ptr += 1;
499 auto str = _internal_add_input();
500 ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
501 CHK_(ptr);
502 CHK_(::_pbi::VerifyUTF8(str, nullptr));
503 if (!ctx->DataAvailable(ptr)) break;
504 } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<26>(ptr));
505 } else {
506 goto handle_unusual;
507 }
508 continue;
509 // string device = 4;
510 case 4:
511 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 34)) {
512 auto str = _internal_mutable_device();
513 ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
514 CHK_(ptr);
515 CHK_(::_pbi::VerifyUTF8(str, nullptr));
516 } else {
517 goto handle_unusual;
518 }
519 continue;
520 // map<string, .tensorflow.AttrValue> attr = 5;
521 case 5:
522 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 42)) {
523 ptr -= 1;
524 do {
525 ptr += 1;
526 ptr = ctx->ParseMessage(&_impl_.attr_, ptr);
527 CHK_(ptr);
528 if (!ctx->DataAvailable(ptr)) break;
529 } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<42>(ptr));
530 } else {
531 goto handle_unusual;
532 }
533 continue;
534 // .tensorflow.NodeDef.ExperimentalDebugInfo experimental_debug_info = 6;
535 case 6:
536 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 50)) {
537 ptr = ctx->ParseMessage(_internal_mutable_experimental_debug_info(), ptr);
538 CHK_(ptr);
539 } else {
540 goto handle_unusual;
541 }
542 continue;
543 // .tensorflow.FullTypeDef experimental_type = 7;
544 case 7:
545 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 58)) {
546 ptr = ctx->ParseMessage(_internal_mutable_experimental_type(), ptr);
547 CHK_(ptr);
548 } else {
549 goto handle_unusual;
550 }
551 continue;
552 default:
553 goto handle_unusual;
554 } // switch
555 handle_unusual:
556 if ((tag == 0) || ((tag & 7) == 4)) {
557 CHK_(ptr);
558 ctx->SetLastTag(tag);
559 goto message_done;
560 }
561 ptr = UnknownFieldParse(
562 tag,
563 _internal_metadata_.mutable_unknown_fields<std::string>(),
564 ptr, ctx);
565 CHK_(ptr != nullptr);
566 } // while
567 message_done:
568 return ptr;
569 failure:
570 ptr = nullptr;
571 goto message_done;
572 #undef CHK_
573 }
574
_InternalSerialize(::uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const575 ::uint8_t* NodeDef::_InternalSerialize(
576 ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
577 // @@protoc_insertion_point(serialize_to_array_start:tensorflow.NodeDef)
578 ::uint32_t cached_has_bits = 0;
579 (void) cached_has_bits;
580
581 // string name = 1;
582 if (!this->_internal_name().empty()) {
583 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
584 this->_internal_name().data(), static_cast<int>(this->_internal_name().length()),
585 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
586 "tensorflow.NodeDef.name");
587 target = stream->WriteStringMaybeAliased(
588 1, this->_internal_name(), target);
589 }
590
591 // string op = 2;
592 if (!this->_internal_op().empty()) {
593 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
594 this->_internal_op().data(), static_cast<int>(this->_internal_op().length()),
595 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
596 "tensorflow.NodeDef.op");
597 target = stream->WriteStringMaybeAliased(
598 2, this->_internal_op(), target);
599 }
600
601 // repeated string input = 3;
602 for (int i = 0, n = this->_internal_input_size(); i < n; i++) {
603 const auto& s = this->_internal_input(i);
604 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
605 s.data(), static_cast<int>(s.length()),
606 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
607 "tensorflow.NodeDef.input");
608 target = stream->WriteString(3, s, target);
609 }
610
611 // string device = 4;
612 if (!this->_internal_device().empty()) {
613 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
614 this->_internal_device().data(), static_cast<int>(this->_internal_device().length()),
615 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
616 "tensorflow.NodeDef.device");
617 target = stream->WriteStringMaybeAliased(
618 4, this->_internal_device(), target);
619 }
620
621 // map<string, .tensorflow.AttrValue> attr = 5;
622 if (!this->_internal_attr().empty()) {
623 using MapType = ::_pb::Map<std::string, ::tensorflow::AttrValue>;
624 using WireHelper = NodeDef_AttrEntry_DoNotUse::Funcs;
625 const auto& map_field = this->_internal_attr();
626 auto check_utf8 = [](const MapType::value_type& entry) {
627 (void)entry;
628 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
629 entry.first.data(), static_cast<int>(entry.first.length()),
630 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
631 "tensorflow.NodeDef.AttrEntry.key");
632 };
633
634 if (stream->IsSerializationDeterministic() && map_field.size() > 1) {
635 for (const auto& entry : ::_pbi::MapSorterPtr<MapType>(map_field)) {
636 target = WireHelper::InternalSerialize(5, entry.first, entry.second, target, stream);
637 check_utf8(entry);
638 }
639 } else {
640 for (const auto& entry : map_field) {
641 target = WireHelper::InternalSerialize(5, entry.first, entry.second, target, stream);
642 check_utf8(entry);
643 }
644 }
645 }
646
647 // .tensorflow.NodeDef.ExperimentalDebugInfo experimental_debug_info = 6;
648 if (this->_internal_has_experimental_debug_info()) {
649 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
650 InternalWriteMessage(6, _Internal::experimental_debug_info(this),
651 _Internal::experimental_debug_info(this).GetCachedSize(), target, stream);
652 }
653
654 // .tensorflow.FullTypeDef experimental_type = 7;
655 if (this->_internal_has_experimental_type()) {
656 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
657 InternalWriteMessage(7, _Internal::experimental_type(this),
658 _Internal::experimental_type(this).GetCachedSize(), target, stream);
659 }
660
661 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
662 target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
663 static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
664 }
665 // @@protoc_insertion_point(serialize_to_array_end:tensorflow.NodeDef)
666 return target;
667 }
668
ByteSizeLong() const669 size_t NodeDef::ByteSizeLong() const {
670 // @@protoc_insertion_point(message_byte_size_start:tensorflow.NodeDef)
671 size_t total_size = 0;
672
673 ::uint32_t cached_has_bits = 0;
674 // Prevent compiler warnings about cached_has_bits being unused
675 (void) cached_has_bits;
676
677 // repeated string input = 3;
678 total_size += 1 *
679 ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(_impl_.input_.size());
680 for (int i = 0, n = _impl_.input_.size(); i < n; i++) {
681 total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
682 _impl_.input_.Get(i));
683 }
684
685 // map<string, .tensorflow.AttrValue> attr = 5;
686 total_size += 1 *
687 ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(this->_internal_attr_size());
688 for (::PROTOBUF_NAMESPACE_ID::Map< std::string, ::tensorflow::AttrValue >::const_iterator
689 it = this->_internal_attr().begin();
690 it != this->_internal_attr().end(); ++it) {
691 total_size += NodeDef_AttrEntry_DoNotUse::Funcs::ByteSizeLong(it->first, it->second);
692 }
693
694 // string name = 1;
695 if (!this->_internal_name().empty()) {
696 total_size += 1 +
697 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
698 this->_internal_name());
699 }
700
701 // string op = 2;
702 if (!this->_internal_op().empty()) {
703 total_size += 1 +
704 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
705 this->_internal_op());
706 }
707
708 // string device = 4;
709 if (!this->_internal_device().empty()) {
710 total_size += 1 +
711 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
712 this->_internal_device());
713 }
714
715 // .tensorflow.NodeDef.ExperimentalDebugInfo experimental_debug_info = 6;
716 if (this->_internal_has_experimental_debug_info()) {
717 total_size += 1 +
718 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
719 *_impl_.experimental_debug_info_);
720 }
721
722 // .tensorflow.FullTypeDef experimental_type = 7;
723 if (this->_internal_has_experimental_type()) {
724 total_size += 1 +
725 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
726 *_impl_.experimental_type_);
727 }
728
729 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
730 total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
731 }
732 int cached_size = ::_pbi::ToCachedSize(total_size);
733 SetCachedSize(cached_size);
734 return total_size;
735 }
736
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)737 void NodeDef::CheckTypeAndMergeFrom(
738 const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
739 MergeFrom(*::_pbi::DownCast<const NodeDef*>(
740 &from));
741 }
742
MergeFrom(const NodeDef & from)743 void NodeDef::MergeFrom(const NodeDef& from) {
744 NodeDef* const _this = this;
745 // @@protoc_insertion_point(class_specific_merge_from_start:tensorflow.NodeDef)
746 GOOGLE_DCHECK_NE(&from, _this);
747 ::uint32_t cached_has_bits = 0;
748 (void) cached_has_bits;
749
750 _this->_impl_.input_.MergeFrom(from._impl_.input_);
751 _this->_impl_.attr_.MergeFrom(from._impl_.attr_);
752 if (!from._internal_name().empty()) {
753 _this->_internal_set_name(from._internal_name());
754 }
755 if (!from._internal_op().empty()) {
756 _this->_internal_set_op(from._internal_op());
757 }
758 if (!from._internal_device().empty()) {
759 _this->_internal_set_device(from._internal_device());
760 }
761 if (from._internal_has_experimental_debug_info()) {
762 _this->_internal_mutable_experimental_debug_info()->::tensorflow::NodeDef_ExperimentalDebugInfo::MergeFrom(
763 from._internal_experimental_debug_info());
764 }
765 if (from._internal_has_experimental_type()) {
766 _this->_internal_mutable_experimental_type()->::tensorflow::FullTypeDef::MergeFrom(
767 from._internal_experimental_type());
768 }
769 _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
770 }
771
CopyFrom(const NodeDef & from)772 void NodeDef::CopyFrom(const NodeDef& from) {
773 // @@protoc_insertion_point(class_specific_copy_from_start:tensorflow.NodeDef)
774 if (&from == this) return;
775 Clear();
776 MergeFrom(from);
777 }
778
IsInitialized() const779 bool NodeDef::IsInitialized() const {
780 return true;
781 }
782
InternalSwap(NodeDef * other)783 void NodeDef::InternalSwap(NodeDef* other) {
784 using std::swap;
785 auto* lhs_arena = GetArenaForAllocation();
786 auto* rhs_arena = other->GetArenaForAllocation();
787 _internal_metadata_.InternalSwap(&other->_internal_metadata_);
788 _impl_.input_.InternalSwap(&other->_impl_.input_);
789 _impl_.attr_.InternalSwap(&other->_impl_.attr_);
790 ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
791 &_impl_.name_, lhs_arena,
792 &other->_impl_.name_, rhs_arena
793 );
794 ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
795 &_impl_.op_, lhs_arena,
796 &other->_impl_.op_, rhs_arena
797 );
798 ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
799 &_impl_.device_, lhs_arena,
800 &other->_impl_.device_, rhs_arena
801 );
802 ::PROTOBUF_NAMESPACE_ID::internal::memswap<
803 PROTOBUF_FIELD_OFFSET(NodeDef, _impl_.experimental_type_)
804 + sizeof(NodeDef::_impl_.experimental_type_) // NOLINT
805 - PROTOBUF_FIELD_OFFSET(NodeDef, _impl_.experimental_debug_info_)>(
806 reinterpret_cast<char*>(&_impl_.experimental_debug_info_),
807 reinterpret_cast<char*>(&other->_impl_.experimental_debug_info_));
808 }
809
GetTypeName() const810 std::string NodeDef::GetTypeName() const {
811 return "tensorflow.NodeDef";
812 }
813
814
815 // @@protoc_insertion_point(namespace_scope)
816 } // namespace tensorflow
817 PROTOBUF_NAMESPACE_OPEN
818 template<> PROTOBUF_NOINLINE ::tensorflow::NodeDef_AttrEntry_DoNotUse*
CreateMaybeMessage(Arena * arena)819 Arena::CreateMaybeMessage< ::tensorflow::NodeDef_AttrEntry_DoNotUse >(Arena* arena) {
820 return Arena::CreateMessageInternal< ::tensorflow::NodeDef_AttrEntry_DoNotUse >(arena);
821 }
822 template<> PROTOBUF_NOINLINE ::tensorflow::NodeDef_ExperimentalDebugInfo*
CreateMaybeMessage(Arena * arena)823 Arena::CreateMaybeMessage< ::tensorflow::NodeDef_ExperimentalDebugInfo >(Arena* arena) {
824 return Arena::CreateMessageInternal< ::tensorflow::NodeDef_ExperimentalDebugInfo >(arena);
825 }
826 template<> PROTOBUF_NOINLINE ::tensorflow::NodeDef*
CreateMaybeMessage(Arena * arena)827 Arena::CreateMaybeMessage< ::tensorflow::NodeDef >(Arena* arena) {
828 return Arena::CreateMessageInternal< ::tensorflow::NodeDef >(arena);
829 }
830 PROTOBUF_NAMESPACE_CLOSE
831
832 // @@protoc_insertion_point(global_scope)
833 #include <google/protobuf/port_undef.inc>
834