1 // Generated by the protocol buffer compiler.  DO NOT EDIT!
2 // source: tensorflow/core/framework/kernel_def.proto
3 
4 #include "tensorflow/core/framework/kernel_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 {
KernelDef_AttrConstraint(::_pbi::ConstantInitialized)22 PROTOBUF_CONSTEXPR KernelDef_AttrConstraint::KernelDef_AttrConstraint(
23     ::_pbi::ConstantInitialized): _impl_{
24     /*decltype(_impl_.name_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
25   , /*decltype(_impl_.allowed_values_)*/nullptr
26   , /*decltype(_impl_._cached_size_)*/{}} {}
27 struct KernelDef_AttrConstraintDefaultTypeInternal {
KernelDef_AttrConstraintDefaultTypeInternaltensorflow::KernelDef_AttrConstraintDefaultTypeInternal28   PROTOBUF_CONSTEXPR KernelDef_AttrConstraintDefaultTypeInternal()
29       : _instance(::_pbi::ConstantInitialized{}) {}
~KernelDef_AttrConstraintDefaultTypeInternaltensorflow::KernelDef_AttrConstraintDefaultTypeInternal30   ~KernelDef_AttrConstraintDefaultTypeInternal() {}
31   union {  // NOLINT(misc-non-private-member-variables-in-classes)
32     KernelDef_AttrConstraint _instance;
33   };
34 };
35 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 KernelDef_AttrConstraintDefaultTypeInternal _KernelDef_AttrConstraint_default_instance_;
KernelDef(::_pbi::ConstantInitialized)36 PROTOBUF_CONSTEXPR KernelDef::KernelDef(
37     ::_pbi::ConstantInitialized): _impl_{
38     /*decltype(_impl_.constraint_)*/{}
39   , /*decltype(_impl_.host_memory_arg_)*/{}
40   , /*decltype(_impl_.op_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
41   , /*decltype(_impl_.device_type_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
42   , /*decltype(_impl_.label_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
43   , /*decltype(_impl_.priority_)*/0
44   , /*decltype(_impl_._cached_size_)*/{}} {}
45 struct KernelDefDefaultTypeInternal {
KernelDefDefaultTypeInternaltensorflow::KernelDefDefaultTypeInternal46   PROTOBUF_CONSTEXPR KernelDefDefaultTypeInternal()
47       : _instance(::_pbi::ConstantInitialized{}) {}
~KernelDefDefaultTypeInternaltensorflow::KernelDefDefaultTypeInternal48   ~KernelDefDefaultTypeInternal() {}
49   union {  // NOLINT(misc-non-private-member-variables-in-classes)
50     KernelDef _instance;
51   };
52 };
53 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 KernelDefDefaultTypeInternal _KernelDef_default_instance_;
KernelList(::_pbi::ConstantInitialized)54 PROTOBUF_CONSTEXPR KernelList::KernelList(
55     ::_pbi::ConstantInitialized): _impl_{
56     /*decltype(_impl_.kernel_)*/{}
57   , /*decltype(_impl_._cached_size_)*/{}} {}
58 struct KernelListDefaultTypeInternal {
KernelListDefaultTypeInternaltensorflow::KernelListDefaultTypeInternal59   PROTOBUF_CONSTEXPR KernelListDefaultTypeInternal()
60       : _instance(::_pbi::ConstantInitialized{}) {}
~KernelListDefaultTypeInternaltensorflow::KernelListDefaultTypeInternal61   ~KernelListDefaultTypeInternal() {}
62   union {  // NOLINT(misc-non-private-member-variables-in-classes)
63     KernelList _instance;
64   };
65 };
66 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 KernelListDefaultTypeInternal _KernelList_default_instance_;
67 }  // namespace tensorflow
68 namespace tensorflow {
69 
70 // ===================================================================
71 
72 class KernelDef_AttrConstraint::_Internal {
73  public:
74   static const ::tensorflow::AttrValue& allowed_values(const KernelDef_AttrConstraint* msg);
75 };
76 
77 const ::tensorflow::AttrValue&
allowed_values(const KernelDef_AttrConstraint * msg)78 KernelDef_AttrConstraint::_Internal::allowed_values(const KernelDef_AttrConstraint* msg) {
79   return *msg->_impl_.allowed_values_;
80 }
clear_allowed_values()81 void KernelDef_AttrConstraint::clear_allowed_values() {
82   if (GetArenaForAllocation() == nullptr && _impl_.allowed_values_ != nullptr) {
83     delete _impl_.allowed_values_;
84   }
85   _impl_.allowed_values_ = nullptr;
86 }
KernelDef_AttrConstraint(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)87 KernelDef_AttrConstraint::KernelDef_AttrConstraint(::PROTOBUF_NAMESPACE_ID::Arena* arena,
88                          bool is_message_owned)
89   : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
90   SharedCtor(arena, is_message_owned);
91   // @@protoc_insertion_point(arena_constructor:tensorflow.KernelDef.AttrConstraint)
92 }
KernelDef_AttrConstraint(const KernelDef_AttrConstraint & from)93 KernelDef_AttrConstraint::KernelDef_AttrConstraint(const KernelDef_AttrConstraint& from)
94   : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
95   KernelDef_AttrConstraint* const _this = this; (void)_this;
96   new (&_impl_) Impl_{
97       decltype(_impl_.name_){}
98     , decltype(_impl_.allowed_values_){nullptr}
99     , /*decltype(_impl_._cached_size_)*/{}};
100 
101   _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
102   _impl_.name_.InitDefault();
103   #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
104     _impl_.name_.Set("", GetArenaForAllocation());
105   #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
106   if (!from._internal_name().empty()) {
107     _this->_impl_.name_.Set(from._internal_name(),
108       _this->GetArenaForAllocation());
109   }
110   if (from._internal_has_allowed_values()) {
111     _this->_impl_.allowed_values_ = new ::tensorflow::AttrValue(*from._impl_.allowed_values_);
112   }
113   // @@protoc_insertion_point(copy_constructor:tensorflow.KernelDef.AttrConstraint)
114 }
115 
SharedCtor(::_pb::Arena * arena,bool is_message_owned)116 inline void KernelDef_AttrConstraint::SharedCtor(
117     ::_pb::Arena* arena, bool is_message_owned) {
118   (void)arena;
119   (void)is_message_owned;
120   new (&_impl_) Impl_{
121       decltype(_impl_.name_){}
122     , decltype(_impl_.allowed_values_){nullptr}
123     , /*decltype(_impl_._cached_size_)*/{}
124   };
125   _impl_.name_.InitDefault();
126   #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
127     _impl_.name_.Set("", GetArenaForAllocation());
128   #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
129 }
130 
~KernelDef_AttrConstraint()131 KernelDef_AttrConstraint::~KernelDef_AttrConstraint() {
132   // @@protoc_insertion_point(destructor:tensorflow.KernelDef.AttrConstraint)
133   if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
134   (void)arena;
135     return;
136   }
137   SharedDtor();
138 }
139 
SharedDtor()140 inline void KernelDef_AttrConstraint::SharedDtor() {
141   GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
142   _impl_.name_.Destroy();
143   if (this != internal_default_instance()) delete _impl_.allowed_values_;
144 }
145 
SetCachedSize(int size) const146 void KernelDef_AttrConstraint::SetCachedSize(int size) const {
147   _impl_._cached_size_.Set(size);
148 }
149 
Clear()150 void KernelDef_AttrConstraint::Clear() {
151 // @@protoc_insertion_point(message_clear_start:tensorflow.KernelDef.AttrConstraint)
152   ::uint32_t cached_has_bits = 0;
153   // Prevent compiler warnings about cached_has_bits being unused
154   (void) cached_has_bits;
155 
156   _impl_.name_.ClearToEmpty();
157   if (GetArenaForAllocation() == nullptr && _impl_.allowed_values_ != nullptr) {
158     delete _impl_.allowed_values_;
159   }
160   _impl_.allowed_values_ = nullptr;
161   _internal_metadata_.Clear<std::string>();
162 }
163 
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)164 const char* KernelDef_AttrConstraint::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
165 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
166   while (!ctx->Done(&ptr)) {
167     ::uint32_t tag;
168     ptr = ::_pbi::ReadTag(ptr, &tag);
169     switch (tag >> 3) {
170       // string name = 1;
171       case 1:
172         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 10)) {
173           auto str = _internal_mutable_name();
174           ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
175           CHK_(ptr);
176           CHK_(::_pbi::VerifyUTF8(str, nullptr));
177         } else {
178           goto handle_unusual;
179         }
180         continue;
181       // .tensorflow.AttrValue allowed_values = 2;
182       case 2:
183         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 18)) {
184           ptr = ctx->ParseMessage(_internal_mutable_allowed_values(), ptr);
185           CHK_(ptr);
186         } else {
187           goto handle_unusual;
188         }
189         continue;
190       default:
191         goto handle_unusual;
192     }  // switch
193   handle_unusual:
194     if ((tag == 0) || ((tag & 7) == 4)) {
195       CHK_(ptr);
196       ctx->SetLastTag(tag);
197       goto message_done;
198     }
199     ptr = UnknownFieldParse(
200         tag,
201         _internal_metadata_.mutable_unknown_fields<std::string>(),
202         ptr, ctx);
203     CHK_(ptr != nullptr);
204   }  // while
205 message_done:
206   return ptr;
207 failure:
208   ptr = nullptr;
209   goto message_done;
210 #undef CHK_
211 }
212 
_InternalSerialize(::uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const213 ::uint8_t* KernelDef_AttrConstraint::_InternalSerialize(
214     ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
215   // @@protoc_insertion_point(serialize_to_array_start:tensorflow.KernelDef.AttrConstraint)
216   ::uint32_t cached_has_bits = 0;
217   (void) cached_has_bits;
218 
219   // string name = 1;
220   if (!this->_internal_name().empty()) {
221     ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
222       this->_internal_name().data(), static_cast<int>(this->_internal_name().length()),
223       ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
224       "tensorflow.KernelDef.AttrConstraint.name");
225     target = stream->WriteStringMaybeAliased(
226         1, this->_internal_name(), target);
227   }
228 
229   // .tensorflow.AttrValue allowed_values = 2;
230   if (this->_internal_has_allowed_values()) {
231     target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
232       InternalWriteMessage(2, _Internal::allowed_values(this),
233         _Internal::allowed_values(this).GetCachedSize(), target, stream);
234   }
235 
236   if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
237     target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
238         static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
239   }
240   // @@protoc_insertion_point(serialize_to_array_end:tensorflow.KernelDef.AttrConstraint)
241   return target;
242 }
243 
ByteSizeLong() const244 size_t KernelDef_AttrConstraint::ByteSizeLong() const {
245 // @@protoc_insertion_point(message_byte_size_start:tensorflow.KernelDef.AttrConstraint)
246   size_t total_size = 0;
247 
248   ::uint32_t cached_has_bits = 0;
249   // Prevent compiler warnings about cached_has_bits being unused
250   (void) cached_has_bits;
251 
252   // string name = 1;
253   if (!this->_internal_name().empty()) {
254     total_size += 1 +
255       ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
256         this->_internal_name());
257   }
258 
259   // .tensorflow.AttrValue allowed_values = 2;
260   if (this->_internal_has_allowed_values()) {
261     total_size += 1 +
262       ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
263         *_impl_.allowed_values_);
264   }
265 
266   if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
267     total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
268   }
269   int cached_size = ::_pbi::ToCachedSize(total_size);
270   SetCachedSize(cached_size);
271   return total_size;
272 }
273 
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)274 void KernelDef_AttrConstraint::CheckTypeAndMergeFrom(
275     const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
276   MergeFrom(*::_pbi::DownCast<const KernelDef_AttrConstraint*>(
277       &from));
278 }
279 
MergeFrom(const KernelDef_AttrConstraint & from)280 void KernelDef_AttrConstraint::MergeFrom(const KernelDef_AttrConstraint& from) {
281   KernelDef_AttrConstraint* const _this = this;
282   // @@protoc_insertion_point(class_specific_merge_from_start:tensorflow.KernelDef.AttrConstraint)
283   GOOGLE_DCHECK_NE(&from, _this);
284   ::uint32_t cached_has_bits = 0;
285   (void) cached_has_bits;
286 
287   if (!from._internal_name().empty()) {
288     _this->_internal_set_name(from._internal_name());
289   }
290   if (from._internal_has_allowed_values()) {
291     _this->_internal_mutable_allowed_values()->::tensorflow::AttrValue::MergeFrom(
292         from._internal_allowed_values());
293   }
294   _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
295 }
296 
CopyFrom(const KernelDef_AttrConstraint & from)297 void KernelDef_AttrConstraint::CopyFrom(const KernelDef_AttrConstraint& from) {
298 // @@protoc_insertion_point(class_specific_copy_from_start:tensorflow.KernelDef.AttrConstraint)
299   if (&from == this) return;
300   Clear();
301   MergeFrom(from);
302 }
303 
IsInitialized() const304 bool KernelDef_AttrConstraint::IsInitialized() const {
305   return true;
306 }
307 
InternalSwap(KernelDef_AttrConstraint * other)308 void KernelDef_AttrConstraint::InternalSwap(KernelDef_AttrConstraint* other) {
309   using std::swap;
310   auto* lhs_arena = GetArenaForAllocation();
311   auto* rhs_arena = other->GetArenaForAllocation();
312   _internal_metadata_.InternalSwap(&other->_internal_metadata_);
313   ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
314       &_impl_.name_, lhs_arena,
315       &other->_impl_.name_, rhs_arena
316   );
317   swap(_impl_.allowed_values_, other->_impl_.allowed_values_);
318 }
319 
GetTypeName() const320 std::string KernelDef_AttrConstraint::GetTypeName() const {
321   return "tensorflow.KernelDef.AttrConstraint";
322 }
323 
324 
325 // ===================================================================
326 
327 class KernelDef::_Internal {
328  public:
329 };
330 
KernelDef(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)331 KernelDef::KernelDef(::PROTOBUF_NAMESPACE_ID::Arena* arena,
332                          bool is_message_owned)
333   : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
334   SharedCtor(arena, is_message_owned);
335   // @@protoc_insertion_point(arena_constructor:tensorflow.KernelDef)
336 }
KernelDef(const KernelDef & from)337 KernelDef::KernelDef(const KernelDef& from)
338   : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
339   KernelDef* const _this = this; (void)_this;
340   new (&_impl_) Impl_{
341       decltype(_impl_.constraint_){from._impl_.constraint_}
342     , decltype(_impl_.host_memory_arg_){from._impl_.host_memory_arg_}
343     , decltype(_impl_.op_){}
344     , decltype(_impl_.device_type_){}
345     , decltype(_impl_.label_){}
346     , decltype(_impl_.priority_){}
347     , /*decltype(_impl_._cached_size_)*/{}};
348 
349   _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
350   _impl_.op_.InitDefault();
351   #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
352     _impl_.op_.Set("", GetArenaForAllocation());
353   #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
354   if (!from._internal_op().empty()) {
355     _this->_impl_.op_.Set(from._internal_op(),
356       _this->GetArenaForAllocation());
357   }
358   _impl_.device_type_.InitDefault();
359   #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
360     _impl_.device_type_.Set("", GetArenaForAllocation());
361   #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
362   if (!from._internal_device_type().empty()) {
363     _this->_impl_.device_type_.Set(from._internal_device_type(),
364       _this->GetArenaForAllocation());
365   }
366   _impl_.label_.InitDefault();
367   #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
368     _impl_.label_.Set("", GetArenaForAllocation());
369   #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
370   if (!from._internal_label().empty()) {
371     _this->_impl_.label_.Set(from._internal_label(),
372       _this->GetArenaForAllocation());
373   }
374   _this->_impl_.priority_ = from._impl_.priority_;
375   // @@protoc_insertion_point(copy_constructor:tensorflow.KernelDef)
376 }
377 
SharedCtor(::_pb::Arena * arena,bool is_message_owned)378 inline void KernelDef::SharedCtor(
379     ::_pb::Arena* arena, bool is_message_owned) {
380   (void)arena;
381   (void)is_message_owned;
382   new (&_impl_) Impl_{
383       decltype(_impl_.constraint_){arena}
384     , decltype(_impl_.host_memory_arg_){arena}
385     , decltype(_impl_.op_){}
386     , decltype(_impl_.device_type_){}
387     , decltype(_impl_.label_){}
388     , decltype(_impl_.priority_){0}
389     , /*decltype(_impl_._cached_size_)*/{}
390   };
391   _impl_.op_.InitDefault();
392   #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
393     _impl_.op_.Set("", GetArenaForAllocation());
394   #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
395   _impl_.device_type_.InitDefault();
396   #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
397     _impl_.device_type_.Set("", GetArenaForAllocation());
398   #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
399   _impl_.label_.InitDefault();
400   #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
401     _impl_.label_.Set("", GetArenaForAllocation());
402   #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
403 }
404 
~KernelDef()405 KernelDef::~KernelDef() {
406   // @@protoc_insertion_point(destructor:tensorflow.KernelDef)
407   if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
408   (void)arena;
409     return;
410   }
411   SharedDtor();
412 }
413 
SharedDtor()414 inline void KernelDef::SharedDtor() {
415   GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
416   _impl_.constraint_.~RepeatedPtrField();
417   _impl_.host_memory_arg_.~RepeatedPtrField();
418   _impl_.op_.Destroy();
419   _impl_.device_type_.Destroy();
420   _impl_.label_.Destroy();
421 }
422 
SetCachedSize(int size) const423 void KernelDef::SetCachedSize(int size) const {
424   _impl_._cached_size_.Set(size);
425 }
426 
Clear()427 void KernelDef::Clear() {
428 // @@protoc_insertion_point(message_clear_start:tensorflow.KernelDef)
429   ::uint32_t cached_has_bits = 0;
430   // Prevent compiler warnings about cached_has_bits being unused
431   (void) cached_has_bits;
432 
433   _impl_.constraint_.Clear();
434   _impl_.host_memory_arg_.Clear();
435   _impl_.op_.ClearToEmpty();
436   _impl_.device_type_.ClearToEmpty();
437   _impl_.label_.ClearToEmpty();
438   _impl_.priority_ = 0;
439   _internal_metadata_.Clear<std::string>();
440 }
441 
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)442 const char* KernelDef::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
443 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
444   while (!ctx->Done(&ptr)) {
445     ::uint32_t tag;
446     ptr = ::_pbi::ReadTag(ptr, &tag);
447     switch (tag >> 3) {
448       // string op = 1;
449       case 1:
450         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 10)) {
451           auto str = _internal_mutable_op();
452           ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
453           CHK_(ptr);
454           CHK_(::_pbi::VerifyUTF8(str, nullptr));
455         } else {
456           goto handle_unusual;
457         }
458         continue;
459       // string device_type = 2;
460       case 2:
461         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 18)) {
462           auto str = _internal_mutable_device_type();
463           ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
464           CHK_(ptr);
465           CHK_(::_pbi::VerifyUTF8(str, nullptr));
466         } else {
467           goto handle_unusual;
468         }
469         continue;
470       // repeated .tensorflow.KernelDef.AttrConstraint constraint = 3;
471       case 3:
472         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 26)) {
473           ptr -= 1;
474           do {
475             ptr += 1;
476             ptr = ctx->ParseMessage(_internal_add_constraint(), ptr);
477             CHK_(ptr);
478             if (!ctx->DataAvailable(ptr)) break;
479           } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<26>(ptr));
480         } else {
481           goto handle_unusual;
482         }
483         continue;
484       // repeated string host_memory_arg = 4;
485       case 4:
486         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 34)) {
487           ptr -= 1;
488           do {
489             ptr += 1;
490             auto str = _internal_add_host_memory_arg();
491             ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
492             CHK_(ptr);
493             CHK_(::_pbi::VerifyUTF8(str, nullptr));
494             if (!ctx->DataAvailable(ptr)) break;
495           } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<34>(ptr));
496         } else {
497           goto handle_unusual;
498         }
499         continue;
500       // string label = 5;
501       case 5:
502         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 42)) {
503           auto str = _internal_mutable_label();
504           ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
505           CHK_(ptr);
506           CHK_(::_pbi::VerifyUTF8(str, nullptr));
507         } else {
508           goto handle_unusual;
509         }
510         continue;
511       // int32 priority = 6;
512       case 6:
513         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 48)) {
514           _impl_.priority_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
515           CHK_(ptr);
516         } else {
517           goto handle_unusual;
518         }
519         continue;
520       default:
521         goto handle_unusual;
522     }  // switch
523   handle_unusual:
524     if ((tag == 0) || ((tag & 7) == 4)) {
525       CHK_(ptr);
526       ctx->SetLastTag(tag);
527       goto message_done;
528     }
529     ptr = UnknownFieldParse(
530         tag,
531         _internal_metadata_.mutable_unknown_fields<std::string>(),
532         ptr, ctx);
533     CHK_(ptr != nullptr);
534   }  // while
535 message_done:
536   return ptr;
537 failure:
538   ptr = nullptr;
539   goto message_done;
540 #undef CHK_
541 }
542 
_InternalSerialize(::uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const543 ::uint8_t* KernelDef::_InternalSerialize(
544     ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
545   // @@protoc_insertion_point(serialize_to_array_start:tensorflow.KernelDef)
546   ::uint32_t cached_has_bits = 0;
547   (void) cached_has_bits;
548 
549   // string op = 1;
550   if (!this->_internal_op().empty()) {
551     ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
552       this->_internal_op().data(), static_cast<int>(this->_internal_op().length()),
553       ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
554       "tensorflow.KernelDef.op");
555     target = stream->WriteStringMaybeAliased(
556         1, this->_internal_op(), target);
557   }
558 
559   // string device_type = 2;
560   if (!this->_internal_device_type().empty()) {
561     ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
562       this->_internal_device_type().data(), static_cast<int>(this->_internal_device_type().length()),
563       ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
564       "tensorflow.KernelDef.device_type");
565     target = stream->WriteStringMaybeAliased(
566         2, this->_internal_device_type(), target);
567   }
568 
569   // repeated .tensorflow.KernelDef.AttrConstraint constraint = 3;
570   for (unsigned i = 0,
571       n = static_cast<unsigned>(this->_internal_constraint_size()); i < n; i++) {
572     const auto& repfield = this->_internal_constraint(i);
573     target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
574         InternalWriteMessage(3, repfield, repfield.GetCachedSize(), target, stream);
575   }
576 
577   // repeated string host_memory_arg = 4;
578   for (int i = 0, n = this->_internal_host_memory_arg_size(); i < n; i++) {
579     const auto& s = this->_internal_host_memory_arg(i);
580     ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
581       s.data(), static_cast<int>(s.length()),
582       ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
583       "tensorflow.KernelDef.host_memory_arg");
584     target = stream->WriteString(4, s, target);
585   }
586 
587   // string label = 5;
588   if (!this->_internal_label().empty()) {
589     ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
590       this->_internal_label().data(), static_cast<int>(this->_internal_label().length()),
591       ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
592       "tensorflow.KernelDef.label");
593     target = stream->WriteStringMaybeAliased(
594         5, this->_internal_label(), target);
595   }
596 
597   // int32 priority = 6;
598   if (this->_internal_priority() != 0) {
599     target = stream->EnsureSpace(target);
600     target = ::_pbi::WireFormatLite::WriteInt32ToArray(6, this->_internal_priority(), target);
601   }
602 
603   if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
604     target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
605         static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
606   }
607   // @@protoc_insertion_point(serialize_to_array_end:tensorflow.KernelDef)
608   return target;
609 }
610 
ByteSizeLong() const611 size_t KernelDef::ByteSizeLong() const {
612 // @@protoc_insertion_point(message_byte_size_start:tensorflow.KernelDef)
613   size_t total_size = 0;
614 
615   ::uint32_t cached_has_bits = 0;
616   // Prevent compiler warnings about cached_has_bits being unused
617   (void) cached_has_bits;
618 
619   // repeated .tensorflow.KernelDef.AttrConstraint constraint = 3;
620   total_size += 1UL * this->_internal_constraint_size();
621   for (const auto& msg : this->_impl_.constraint_) {
622     total_size +=
623       ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
624   }
625 
626   // repeated string host_memory_arg = 4;
627   total_size += 1 *
628       ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(_impl_.host_memory_arg_.size());
629   for (int i = 0, n = _impl_.host_memory_arg_.size(); i < n; i++) {
630     total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
631       _impl_.host_memory_arg_.Get(i));
632   }
633 
634   // string op = 1;
635   if (!this->_internal_op().empty()) {
636     total_size += 1 +
637       ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
638         this->_internal_op());
639   }
640 
641   // string device_type = 2;
642   if (!this->_internal_device_type().empty()) {
643     total_size += 1 +
644       ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
645         this->_internal_device_type());
646   }
647 
648   // string label = 5;
649   if (!this->_internal_label().empty()) {
650     total_size += 1 +
651       ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
652         this->_internal_label());
653   }
654 
655   // int32 priority = 6;
656   if (this->_internal_priority() != 0) {
657     total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_priority());
658   }
659 
660   if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
661     total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
662   }
663   int cached_size = ::_pbi::ToCachedSize(total_size);
664   SetCachedSize(cached_size);
665   return total_size;
666 }
667 
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)668 void KernelDef::CheckTypeAndMergeFrom(
669     const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
670   MergeFrom(*::_pbi::DownCast<const KernelDef*>(
671       &from));
672 }
673 
MergeFrom(const KernelDef & from)674 void KernelDef::MergeFrom(const KernelDef& from) {
675   KernelDef* const _this = this;
676   // @@protoc_insertion_point(class_specific_merge_from_start:tensorflow.KernelDef)
677   GOOGLE_DCHECK_NE(&from, _this);
678   ::uint32_t cached_has_bits = 0;
679   (void) cached_has_bits;
680 
681   _this->_impl_.constraint_.MergeFrom(from._impl_.constraint_);
682   _this->_impl_.host_memory_arg_.MergeFrom(from._impl_.host_memory_arg_);
683   if (!from._internal_op().empty()) {
684     _this->_internal_set_op(from._internal_op());
685   }
686   if (!from._internal_device_type().empty()) {
687     _this->_internal_set_device_type(from._internal_device_type());
688   }
689   if (!from._internal_label().empty()) {
690     _this->_internal_set_label(from._internal_label());
691   }
692   if (from._internal_priority() != 0) {
693     _this->_internal_set_priority(from._internal_priority());
694   }
695   _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
696 }
697 
CopyFrom(const KernelDef & from)698 void KernelDef::CopyFrom(const KernelDef& from) {
699 // @@protoc_insertion_point(class_specific_copy_from_start:tensorflow.KernelDef)
700   if (&from == this) return;
701   Clear();
702   MergeFrom(from);
703 }
704 
IsInitialized() const705 bool KernelDef::IsInitialized() const {
706   return true;
707 }
708 
InternalSwap(KernelDef * other)709 void KernelDef::InternalSwap(KernelDef* other) {
710   using std::swap;
711   auto* lhs_arena = GetArenaForAllocation();
712   auto* rhs_arena = other->GetArenaForAllocation();
713   _internal_metadata_.InternalSwap(&other->_internal_metadata_);
714   _impl_.constraint_.InternalSwap(&other->_impl_.constraint_);
715   _impl_.host_memory_arg_.InternalSwap(&other->_impl_.host_memory_arg_);
716   ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
717       &_impl_.op_, lhs_arena,
718       &other->_impl_.op_, rhs_arena
719   );
720   ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
721       &_impl_.device_type_, lhs_arena,
722       &other->_impl_.device_type_, rhs_arena
723   );
724   ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
725       &_impl_.label_, lhs_arena,
726       &other->_impl_.label_, rhs_arena
727   );
728   swap(_impl_.priority_, other->_impl_.priority_);
729 }
730 
GetTypeName() const731 std::string KernelDef::GetTypeName() const {
732   return "tensorflow.KernelDef";
733 }
734 
735 
736 // ===================================================================
737 
738 class KernelList::_Internal {
739  public:
740 };
741 
KernelList(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)742 KernelList::KernelList(::PROTOBUF_NAMESPACE_ID::Arena* arena,
743                          bool is_message_owned)
744   : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
745   SharedCtor(arena, is_message_owned);
746   // @@protoc_insertion_point(arena_constructor:tensorflow.KernelList)
747 }
KernelList(const KernelList & from)748 KernelList::KernelList(const KernelList& from)
749   : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
750   KernelList* const _this = this; (void)_this;
751   new (&_impl_) Impl_{
752       decltype(_impl_.kernel_){from._impl_.kernel_}
753     , /*decltype(_impl_._cached_size_)*/{}};
754 
755   _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
756   // @@protoc_insertion_point(copy_constructor:tensorflow.KernelList)
757 }
758 
SharedCtor(::_pb::Arena * arena,bool is_message_owned)759 inline void KernelList::SharedCtor(
760     ::_pb::Arena* arena, bool is_message_owned) {
761   (void)arena;
762   (void)is_message_owned;
763   new (&_impl_) Impl_{
764       decltype(_impl_.kernel_){arena}
765     , /*decltype(_impl_._cached_size_)*/{}
766   };
767 }
768 
~KernelList()769 KernelList::~KernelList() {
770   // @@protoc_insertion_point(destructor:tensorflow.KernelList)
771   if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
772   (void)arena;
773     return;
774   }
775   SharedDtor();
776 }
777 
SharedDtor()778 inline void KernelList::SharedDtor() {
779   GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
780   _impl_.kernel_.~RepeatedPtrField();
781 }
782 
SetCachedSize(int size) const783 void KernelList::SetCachedSize(int size) const {
784   _impl_._cached_size_.Set(size);
785 }
786 
Clear()787 void KernelList::Clear() {
788 // @@protoc_insertion_point(message_clear_start:tensorflow.KernelList)
789   ::uint32_t cached_has_bits = 0;
790   // Prevent compiler warnings about cached_has_bits being unused
791   (void) cached_has_bits;
792 
793   _impl_.kernel_.Clear();
794   _internal_metadata_.Clear<std::string>();
795 }
796 
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)797 const char* KernelList::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
798 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
799   while (!ctx->Done(&ptr)) {
800     ::uint32_t tag;
801     ptr = ::_pbi::ReadTag(ptr, &tag);
802     switch (tag >> 3) {
803       // repeated .tensorflow.KernelDef kernel = 1;
804       case 1:
805         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 10)) {
806           ptr -= 1;
807           do {
808             ptr += 1;
809             ptr = ctx->ParseMessage(_internal_add_kernel(), ptr);
810             CHK_(ptr);
811             if (!ctx->DataAvailable(ptr)) break;
812           } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<10>(ptr));
813         } else {
814           goto handle_unusual;
815         }
816         continue;
817       default:
818         goto handle_unusual;
819     }  // switch
820   handle_unusual:
821     if ((tag == 0) || ((tag & 7) == 4)) {
822       CHK_(ptr);
823       ctx->SetLastTag(tag);
824       goto message_done;
825     }
826     ptr = UnknownFieldParse(
827         tag,
828         _internal_metadata_.mutable_unknown_fields<std::string>(),
829         ptr, ctx);
830     CHK_(ptr != nullptr);
831   }  // while
832 message_done:
833   return ptr;
834 failure:
835   ptr = nullptr;
836   goto message_done;
837 #undef CHK_
838 }
839 
_InternalSerialize(::uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const840 ::uint8_t* KernelList::_InternalSerialize(
841     ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
842   // @@protoc_insertion_point(serialize_to_array_start:tensorflow.KernelList)
843   ::uint32_t cached_has_bits = 0;
844   (void) cached_has_bits;
845 
846   // repeated .tensorflow.KernelDef kernel = 1;
847   for (unsigned i = 0,
848       n = static_cast<unsigned>(this->_internal_kernel_size()); i < n; i++) {
849     const auto& repfield = this->_internal_kernel(i);
850     target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
851         InternalWriteMessage(1, repfield, repfield.GetCachedSize(), target, stream);
852   }
853 
854   if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
855     target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
856         static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
857   }
858   // @@protoc_insertion_point(serialize_to_array_end:tensorflow.KernelList)
859   return target;
860 }
861 
ByteSizeLong() const862 size_t KernelList::ByteSizeLong() const {
863 // @@protoc_insertion_point(message_byte_size_start:tensorflow.KernelList)
864   size_t total_size = 0;
865 
866   ::uint32_t cached_has_bits = 0;
867   // Prevent compiler warnings about cached_has_bits being unused
868   (void) cached_has_bits;
869 
870   // repeated .tensorflow.KernelDef kernel = 1;
871   total_size += 1UL * this->_internal_kernel_size();
872   for (const auto& msg : this->_impl_.kernel_) {
873     total_size +=
874       ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
875   }
876 
877   if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
878     total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
879   }
880   int cached_size = ::_pbi::ToCachedSize(total_size);
881   SetCachedSize(cached_size);
882   return total_size;
883 }
884 
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)885 void KernelList::CheckTypeAndMergeFrom(
886     const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
887   MergeFrom(*::_pbi::DownCast<const KernelList*>(
888       &from));
889 }
890 
MergeFrom(const KernelList & from)891 void KernelList::MergeFrom(const KernelList& from) {
892   KernelList* const _this = this;
893   // @@protoc_insertion_point(class_specific_merge_from_start:tensorflow.KernelList)
894   GOOGLE_DCHECK_NE(&from, _this);
895   ::uint32_t cached_has_bits = 0;
896   (void) cached_has_bits;
897 
898   _this->_impl_.kernel_.MergeFrom(from._impl_.kernel_);
899   _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
900 }
901 
CopyFrom(const KernelList & from)902 void KernelList::CopyFrom(const KernelList& from) {
903 // @@protoc_insertion_point(class_specific_copy_from_start:tensorflow.KernelList)
904   if (&from == this) return;
905   Clear();
906   MergeFrom(from);
907 }
908 
IsInitialized() const909 bool KernelList::IsInitialized() const {
910   return true;
911 }
912 
InternalSwap(KernelList * other)913 void KernelList::InternalSwap(KernelList* other) {
914   using std::swap;
915   _internal_metadata_.InternalSwap(&other->_internal_metadata_);
916   _impl_.kernel_.InternalSwap(&other->_impl_.kernel_);
917 }
918 
GetTypeName() const919 std::string KernelList::GetTypeName() const {
920   return "tensorflow.KernelList";
921 }
922 
923 
924 // @@protoc_insertion_point(namespace_scope)
925 }  // namespace tensorflow
926 PROTOBUF_NAMESPACE_OPEN
927 template<> PROTOBUF_NOINLINE ::tensorflow::KernelDef_AttrConstraint*
CreateMaybeMessage(Arena * arena)928 Arena::CreateMaybeMessage< ::tensorflow::KernelDef_AttrConstraint >(Arena* arena) {
929   return Arena::CreateMessageInternal< ::tensorflow::KernelDef_AttrConstraint >(arena);
930 }
931 template<> PROTOBUF_NOINLINE ::tensorflow::KernelDef*
CreateMaybeMessage(Arena * arena)932 Arena::CreateMaybeMessage< ::tensorflow::KernelDef >(Arena* arena) {
933   return Arena::CreateMessageInternal< ::tensorflow::KernelDef >(arena);
934 }
935 template<> PROTOBUF_NOINLINE ::tensorflow::KernelList*
CreateMaybeMessage(Arena * arena)936 Arena::CreateMaybeMessage< ::tensorflow::KernelList >(Arena* arena) {
937   return Arena::CreateMessageInternal< ::tensorflow::KernelList >(arena);
938 }
939 PROTOBUF_NAMESPACE_CLOSE
940 
941 // @@protoc_insertion_point(global_scope)
942 #include <google/protobuf/port_undef.inc>
943