1 // Generated by the protocol buffer compiler. DO NOT EDIT!
2 // source: tensorflow/core/framework/resource_handle.proto
3
4 #include "tensorflow/core/framework/resource_handle.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 {
ResourceHandleProto_DtypeAndShape(::_pbi::ConstantInitialized)22 PROTOBUF_CONSTEXPR ResourceHandleProto_DtypeAndShape::ResourceHandleProto_DtypeAndShape(
23 ::_pbi::ConstantInitialized): _impl_{
24 /*decltype(_impl_.shape_)*/nullptr
25 , /*decltype(_impl_.dtype_)*/0
26 , /*decltype(_impl_._cached_size_)*/{}} {}
27 struct ResourceHandleProto_DtypeAndShapeDefaultTypeInternal {
ResourceHandleProto_DtypeAndShapeDefaultTypeInternaltensorflow::ResourceHandleProto_DtypeAndShapeDefaultTypeInternal28 PROTOBUF_CONSTEXPR ResourceHandleProto_DtypeAndShapeDefaultTypeInternal()
29 : _instance(::_pbi::ConstantInitialized{}) {}
~ResourceHandleProto_DtypeAndShapeDefaultTypeInternaltensorflow::ResourceHandleProto_DtypeAndShapeDefaultTypeInternal30 ~ResourceHandleProto_DtypeAndShapeDefaultTypeInternal() {}
31 union { // NOLINT(misc-non-private-member-variables-in-classes)
32 ResourceHandleProto_DtypeAndShape _instance;
33 };
34 };
35 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ResourceHandleProto_DtypeAndShapeDefaultTypeInternal _ResourceHandleProto_DtypeAndShape_default_instance_;
ResourceHandleProto(::_pbi::ConstantInitialized)36 PROTOBUF_CONSTEXPR ResourceHandleProto::ResourceHandleProto(
37 ::_pbi::ConstantInitialized): _impl_{
38 /*decltype(_impl_.dtypes_and_shapes_)*/{}
39 , /*decltype(_impl_.device_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
40 , /*decltype(_impl_.container_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
41 , /*decltype(_impl_.name_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
42 , /*decltype(_impl_.maybe_type_name_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
43 , /*decltype(_impl_.hash_code_)*/::uint64_t{0u}
44 , /*decltype(_impl_._cached_size_)*/{}} {}
45 struct ResourceHandleProtoDefaultTypeInternal {
ResourceHandleProtoDefaultTypeInternaltensorflow::ResourceHandleProtoDefaultTypeInternal46 PROTOBUF_CONSTEXPR ResourceHandleProtoDefaultTypeInternal()
47 : _instance(::_pbi::ConstantInitialized{}) {}
~ResourceHandleProtoDefaultTypeInternaltensorflow::ResourceHandleProtoDefaultTypeInternal48 ~ResourceHandleProtoDefaultTypeInternal() {}
49 union { // NOLINT(misc-non-private-member-variables-in-classes)
50 ResourceHandleProto _instance;
51 };
52 };
53 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ResourceHandleProtoDefaultTypeInternal _ResourceHandleProto_default_instance_;
54 } // namespace tensorflow
55 namespace tensorflow {
56
57 // ===================================================================
58
59 class ResourceHandleProto_DtypeAndShape::_Internal {
60 public:
61 static const ::tensorflow::TensorShapeProto& shape(const ResourceHandleProto_DtypeAndShape* msg);
62 };
63
64 const ::tensorflow::TensorShapeProto&
shape(const ResourceHandleProto_DtypeAndShape * msg)65 ResourceHandleProto_DtypeAndShape::_Internal::shape(const ResourceHandleProto_DtypeAndShape* msg) {
66 return *msg->_impl_.shape_;
67 }
clear_shape()68 void ResourceHandleProto_DtypeAndShape::clear_shape() {
69 if (GetArenaForAllocation() == nullptr && _impl_.shape_ != nullptr) {
70 delete _impl_.shape_;
71 }
72 _impl_.shape_ = nullptr;
73 }
ResourceHandleProto_DtypeAndShape(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)74 ResourceHandleProto_DtypeAndShape::ResourceHandleProto_DtypeAndShape(::PROTOBUF_NAMESPACE_ID::Arena* arena,
75 bool is_message_owned)
76 : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
77 SharedCtor(arena, is_message_owned);
78 // @@protoc_insertion_point(arena_constructor:tensorflow.ResourceHandleProto.DtypeAndShape)
79 }
ResourceHandleProto_DtypeAndShape(const ResourceHandleProto_DtypeAndShape & from)80 ResourceHandleProto_DtypeAndShape::ResourceHandleProto_DtypeAndShape(const ResourceHandleProto_DtypeAndShape& from)
81 : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
82 ResourceHandleProto_DtypeAndShape* const _this = this; (void)_this;
83 new (&_impl_) Impl_{
84 decltype(_impl_.shape_){nullptr}
85 , decltype(_impl_.dtype_){}
86 , /*decltype(_impl_._cached_size_)*/{}};
87
88 _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
89 if (from._internal_has_shape()) {
90 _this->_impl_.shape_ = new ::tensorflow::TensorShapeProto(*from._impl_.shape_);
91 }
92 _this->_impl_.dtype_ = from._impl_.dtype_;
93 // @@protoc_insertion_point(copy_constructor:tensorflow.ResourceHandleProto.DtypeAndShape)
94 }
95
SharedCtor(::_pb::Arena * arena,bool is_message_owned)96 inline void ResourceHandleProto_DtypeAndShape::SharedCtor(
97 ::_pb::Arena* arena, bool is_message_owned) {
98 (void)arena;
99 (void)is_message_owned;
100 new (&_impl_) Impl_{
101 decltype(_impl_.shape_){nullptr}
102 , decltype(_impl_.dtype_){0}
103 , /*decltype(_impl_._cached_size_)*/{}
104 };
105 }
106
~ResourceHandleProto_DtypeAndShape()107 ResourceHandleProto_DtypeAndShape::~ResourceHandleProto_DtypeAndShape() {
108 // @@protoc_insertion_point(destructor:tensorflow.ResourceHandleProto.DtypeAndShape)
109 if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
110 (void)arena;
111 return;
112 }
113 SharedDtor();
114 }
115
SharedDtor()116 inline void ResourceHandleProto_DtypeAndShape::SharedDtor() {
117 GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
118 if (this != internal_default_instance()) delete _impl_.shape_;
119 }
120
SetCachedSize(int size) const121 void ResourceHandleProto_DtypeAndShape::SetCachedSize(int size) const {
122 _impl_._cached_size_.Set(size);
123 }
124
Clear()125 void ResourceHandleProto_DtypeAndShape::Clear() {
126 // @@protoc_insertion_point(message_clear_start:tensorflow.ResourceHandleProto.DtypeAndShape)
127 ::uint32_t cached_has_bits = 0;
128 // Prevent compiler warnings about cached_has_bits being unused
129 (void) cached_has_bits;
130
131 if (GetArenaForAllocation() == nullptr && _impl_.shape_ != nullptr) {
132 delete _impl_.shape_;
133 }
134 _impl_.shape_ = nullptr;
135 _impl_.dtype_ = 0;
136 _internal_metadata_.Clear<std::string>();
137 }
138
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)139 const char* ResourceHandleProto_DtypeAndShape::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
140 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
141 while (!ctx->Done(&ptr)) {
142 ::uint32_t tag;
143 ptr = ::_pbi::ReadTag(ptr, &tag);
144 switch (tag >> 3) {
145 // .tensorflow.DataType dtype = 1;
146 case 1:
147 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 8)) {
148 ::uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
149 CHK_(ptr);
150 _internal_set_dtype(static_cast<::tensorflow::DataType>(val));
151 } else {
152 goto handle_unusual;
153 }
154 continue;
155 // .tensorflow.TensorShapeProto shape = 2;
156 case 2:
157 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 18)) {
158 ptr = ctx->ParseMessage(_internal_mutable_shape(), ptr);
159 CHK_(ptr);
160 } else {
161 goto handle_unusual;
162 }
163 continue;
164 default:
165 goto handle_unusual;
166 } // switch
167 handle_unusual:
168 if ((tag == 0) || ((tag & 7) == 4)) {
169 CHK_(ptr);
170 ctx->SetLastTag(tag);
171 goto message_done;
172 }
173 ptr = UnknownFieldParse(
174 tag,
175 _internal_metadata_.mutable_unknown_fields<std::string>(),
176 ptr, ctx);
177 CHK_(ptr != nullptr);
178 } // while
179 message_done:
180 return ptr;
181 failure:
182 ptr = nullptr;
183 goto message_done;
184 #undef CHK_
185 }
186
_InternalSerialize(::uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const187 ::uint8_t* ResourceHandleProto_DtypeAndShape::_InternalSerialize(
188 ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
189 // @@protoc_insertion_point(serialize_to_array_start:tensorflow.ResourceHandleProto.DtypeAndShape)
190 ::uint32_t cached_has_bits = 0;
191 (void) cached_has_bits;
192
193 // .tensorflow.DataType dtype = 1;
194 if (this->_internal_dtype() != 0) {
195 target = stream->EnsureSpace(target);
196 target = ::_pbi::WireFormatLite::WriteEnumToArray(
197 1, this->_internal_dtype(), target);
198 }
199
200 // .tensorflow.TensorShapeProto shape = 2;
201 if (this->_internal_has_shape()) {
202 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
203 InternalWriteMessage(2, _Internal::shape(this),
204 _Internal::shape(this).GetCachedSize(), target, stream);
205 }
206
207 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
208 target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
209 static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
210 }
211 // @@protoc_insertion_point(serialize_to_array_end:tensorflow.ResourceHandleProto.DtypeAndShape)
212 return target;
213 }
214
ByteSizeLong() const215 size_t ResourceHandleProto_DtypeAndShape::ByteSizeLong() const {
216 // @@protoc_insertion_point(message_byte_size_start:tensorflow.ResourceHandleProto.DtypeAndShape)
217 size_t total_size = 0;
218
219 ::uint32_t cached_has_bits = 0;
220 // Prevent compiler warnings about cached_has_bits being unused
221 (void) cached_has_bits;
222
223 // .tensorflow.TensorShapeProto shape = 2;
224 if (this->_internal_has_shape()) {
225 total_size += 1 +
226 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
227 *_impl_.shape_);
228 }
229
230 // .tensorflow.DataType dtype = 1;
231 if (this->_internal_dtype() != 0) {
232 total_size += 1 +
233 ::_pbi::WireFormatLite::EnumSize(this->_internal_dtype());
234 }
235
236 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
237 total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
238 }
239 int cached_size = ::_pbi::ToCachedSize(total_size);
240 SetCachedSize(cached_size);
241 return total_size;
242 }
243
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)244 void ResourceHandleProto_DtypeAndShape::CheckTypeAndMergeFrom(
245 const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
246 MergeFrom(*::_pbi::DownCast<const ResourceHandleProto_DtypeAndShape*>(
247 &from));
248 }
249
MergeFrom(const ResourceHandleProto_DtypeAndShape & from)250 void ResourceHandleProto_DtypeAndShape::MergeFrom(const ResourceHandleProto_DtypeAndShape& from) {
251 ResourceHandleProto_DtypeAndShape* const _this = this;
252 // @@protoc_insertion_point(class_specific_merge_from_start:tensorflow.ResourceHandleProto.DtypeAndShape)
253 GOOGLE_DCHECK_NE(&from, _this);
254 ::uint32_t cached_has_bits = 0;
255 (void) cached_has_bits;
256
257 if (from._internal_has_shape()) {
258 _this->_internal_mutable_shape()->::tensorflow::TensorShapeProto::MergeFrom(
259 from._internal_shape());
260 }
261 if (from._internal_dtype() != 0) {
262 _this->_internal_set_dtype(from._internal_dtype());
263 }
264 _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
265 }
266
CopyFrom(const ResourceHandleProto_DtypeAndShape & from)267 void ResourceHandleProto_DtypeAndShape::CopyFrom(const ResourceHandleProto_DtypeAndShape& from) {
268 // @@protoc_insertion_point(class_specific_copy_from_start:tensorflow.ResourceHandleProto.DtypeAndShape)
269 if (&from == this) return;
270 Clear();
271 MergeFrom(from);
272 }
273
IsInitialized() const274 bool ResourceHandleProto_DtypeAndShape::IsInitialized() const {
275 return true;
276 }
277
InternalSwap(ResourceHandleProto_DtypeAndShape * other)278 void ResourceHandleProto_DtypeAndShape::InternalSwap(ResourceHandleProto_DtypeAndShape* other) {
279 using std::swap;
280 _internal_metadata_.InternalSwap(&other->_internal_metadata_);
281 ::PROTOBUF_NAMESPACE_ID::internal::memswap<
282 PROTOBUF_FIELD_OFFSET(ResourceHandleProto_DtypeAndShape, _impl_.dtype_)
283 + sizeof(ResourceHandleProto_DtypeAndShape::_impl_.dtype_) // NOLINT
284 - PROTOBUF_FIELD_OFFSET(ResourceHandleProto_DtypeAndShape, _impl_.shape_)>(
285 reinterpret_cast<char*>(&_impl_.shape_),
286 reinterpret_cast<char*>(&other->_impl_.shape_));
287 }
288
GetTypeName() const289 std::string ResourceHandleProto_DtypeAndShape::GetTypeName() const {
290 return "tensorflow.ResourceHandleProto.DtypeAndShape";
291 }
292
293
294 // ===================================================================
295
296 class ResourceHandleProto::_Internal {
297 public:
298 };
299
ResourceHandleProto(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)300 ResourceHandleProto::ResourceHandleProto(::PROTOBUF_NAMESPACE_ID::Arena* arena,
301 bool is_message_owned)
302 : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
303 SharedCtor(arena, is_message_owned);
304 // @@protoc_insertion_point(arena_constructor:tensorflow.ResourceHandleProto)
305 }
ResourceHandleProto(const ResourceHandleProto & from)306 ResourceHandleProto::ResourceHandleProto(const ResourceHandleProto& from)
307 : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
308 ResourceHandleProto* const _this = this; (void)_this;
309 new (&_impl_) Impl_{
310 decltype(_impl_.dtypes_and_shapes_){from._impl_.dtypes_and_shapes_}
311 , decltype(_impl_.device_){}
312 , decltype(_impl_.container_){}
313 , decltype(_impl_.name_){}
314 , decltype(_impl_.maybe_type_name_){}
315 , decltype(_impl_.hash_code_){}
316 , /*decltype(_impl_._cached_size_)*/{}};
317
318 _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
319 _impl_.device_.InitDefault();
320 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
321 _impl_.device_.Set("", GetArenaForAllocation());
322 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
323 if (!from._internal_device().empty()) {
324 _this->_impl_.device_.Set(from._internal_device(),
325 _this->GetArenaForAllocation());
326 }
327 _impl_.container_.InitDefault();
328 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
329 _impl_.container_.Set("", GetArenaForAllocation());
330 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
331 if (!from._internal_container().empty()) {
332 _this->_impl_.container_.Set(from._internal_container(),
333 _this->GetArenaForAllocation());
334 }
335 _impl_.name_.InitDefault();
336 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
337 _impl_.name_.Set("", GetArenaForAllocation());
338 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
339 if (!from._internal_name().empty()) {
340 _this->_impl_.name_.Set(from._internal_name(),
341 _this->GetArenaForAllocation());
342 }
343 _impl_.maybe_type_name_.InitDefault();
344 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
345 _impl_.maybe_type_name_.Set("", GetArenaForAllocation());
346 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
347 if (!from._internal_maybe_type_name().empty()) {
348 _this->_impl_.maybe_type_name_.Set(from._internal_maybe_type_name(),
349 _this->GetArenaForAllocation());
350 }
351 _this->_impl_.hash_code_ = from._impl_.hash_code_;
352 // @@protoc_insertion_point(copy_constructor:tensorflow.ResourceHandleProto)
353 }
354
SharedCtor(::_pb::Arena * arena,bool is_message_owned)355 inline void ResourceHandleProto::SharedCtor(
356 ::_pb::Arena* arena, bool is_message_owned) {
357 (void)arena;
358 (void)is_message_owned;
359 new (&_impl_) Impl_{
360 decltype(_impl_.dtypes_and_shapes_){arena}
361 , decltype(_impl_.device_){}
362 , decltype(_impl_.container_){}
363 , decltype(_impl_.name_){}
364 , decltype(_impl_.maybe_type_name_){}
365 , decltype(_impl_.hash_code_){::uint64_t{0u}}
366 , /*decltype(_impl_._cached_size_)*/{}
367 };
368 _impl_.device_.InitDefault();
369 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
370 _impl_.device_.Set("", GetArenaForAllocation());
371 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
372 _impl_.container_.InitDefault();
373 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
374 _impl_.container_.Set("", GetArenaForAllocation());
375 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
376 _impl_.name_.InitDefault();
377 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
378 _impl_.name_.Set("", GetArenaForAllocation());
379 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
380 _impl_.maybe_type_name_.InitDefault();
381 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
382 _impl_.maybe_type_name_.Set("", GetArenaForAllocation());
383 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
384 }
385
~ResourceHandleProto()386 ResourceHandleProto::~ResourceHandleProto() {
387 // @@protoc_insertion_point(destructor:tensorflow.ResourceHandleProto)
388 if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
389 (void)arena;
390 return;
391 }
392 SharedDtor();
393 }
394
SharedDtor()395 inline void ResourceHandleProto::SharedDtor() {
396 GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
397 _impl_.dtypes_and_shapes_.~RepeatedPtrField();
398 _impl_.device_.Destroy();
399 _impl_.container_.Destroy();
400 _impl_.name_.Destroy();
401 _impl_.maybe_type_name_.Destroy();
402 }
403
SetCachedSize(int size) const404 void ResourceHandleProto::SetCachedSize(int size) const {
405 _impl_._cached_size_.Set(size);
406 }
407
Clear()408 void ResourceHandleProto::Clear() {
409 // @@protoc_insertion_point(message_clear_start:tensorflow.ResourceHandleProto)
410 ::uint32_t cached_has_bits = 0;
411 // Prevent compiler warnings about cached_has_bits being unused
412 (void) cached_has_bits;
413
414 _impl_.dtypes_and_shapes_.Clear();
415 _impl_.device_.ClearToEmpty();
416 _impl_.container_.ClearToEmpty();
417 _impl_.name_.ClearToEmpty();
418 _impl_.maybe_type_name_.ClearToEmpty();
419 _impl_.hash_code_ = ::uint64_t{0u};
420 _internal_metadata_.Clear<std::string>();
421 }
422
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)423 const char* ResourceHandleProto::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
424 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
425 while (!ctx->Done(&ptr)) {
426 ::uint32_t tag;
427 ptr = ::_pbi::ReadTag(ptr, &tag);
428 switch (tag >> 3) {
429 // string device = 1;
430 case 1:
431 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 10)) {
432 auto str = _internal_mutable_device();
433 ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
434 CHK_(ptr);
435 CHK_(::_pbi::VerifyUTF8(str, nullptr));
436 } else {
437 goto handle_unusual;
438 }
439 continue;
440 // string container = 2;
441 case 2:
442 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 18)) {
443 auto str = _internal_mutable_container();
444 ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
445 CHK_(ptr);
446 CHK_(::_pbi::VerifyUTF8(str, nullptr));
447 } else {
448 goto handle_unusual;
449 }
450 continue;
451 // string name = 3;
452 case 3:
453 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 26)) {
454 auto str = _internal_mutable_name();
455 ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
456 CHK_(ptr);
457 CHK_(::_pbi::VerifyUTF8(str, nullptr));
458 } else {
459 goto handle_unusual;
460 }
461 continue;
462 // uint64 hash_code = 4;
463 case 4:
464 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 32)) {
465 _impl_.hash_code_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
466 CHK_(ptr);
467 } else {
468 goto handle_unusual;
469 }
470 continue;
471 // string maybe_type_name = 5;
472 case 5:
473 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 42)) {
474 auto str = _internal_mutable_maybe_type_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 // repeated .tensorflow.ResourceHandleProto.DtypeAndShape dtypes_and_shapes = 6;
483 case 6:
484 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 50)) {
485 ptr -= 1;
486 do {
487 ptr += 1;
488 ptr = ctx->ParseMessage(_internal_add_dtypes_and_shapes(), ptr);
489 CHK_(ptr);
490 if (!ctx->DataAvailable(ptr)) break;
491 } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<50>(ptr));
492 } else {
493 goto handle_unusual;
494 }
495 continue;
496 default:
497 goto handle_unusual;
498 } // switch
499 handle_unusual:
500 if ((tag == 0) || ((tag & 7) == 4)) {
501 CHK_(ptr);
502 ctx->SetLastTag(tag);
503 goto message_done;
504 }
505 ptr = UnknownFieldParse(
506 tag,
507 _internal_metadata_.mutable_unknown_fields<std::string>(),
508 ptr, ctx);
509 CHK_(ptr != nullptr);
510 } // while
511 message_done:
512 return ptr;
513 failure:
514 ptr = nullptr;
515 goto message_done;
516 #undef CHK_
517 }
518
_InternalSerialize(::uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const519 ::uint8_t* ResourceHandleProto::_InternalSerialize(
520 ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
521 // @@protoc_insertion_point(serialize_to_array_start:tensorflow.ResourceHandleProto)
522 ::uint32_t cached_has_bits = 0;
523 (void) cached_has_bits;
524
525 // string device = 1;
526 if (!this->_internal_device().empty()) {
527 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
528 this->_internal_device().data(), static_cast<int>(this->_internal_device().length()),
529 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
530 "tensorflow.ResourceHandleProto.device");
531 target = stream->WriteStringMaybeAliased(
532 1, this->_internal_device(), target);
533 }
534
535 // string container = 2;
536 if (!this->_internal_container().empty()) {
537 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
538 this->_internal_container().data(), static_cast<int>(this->_internal_container().length()),
539 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
540 "tensorflow.ResourceHandleProto.container");
541 target = stream->WriteStringMaybeAliased(
542 2, this->_internal_container(), target);
543 }
544
545 // string name = 3;
546 if (!this->_internal_name().empty()) {
547 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
548 this->_internal_name().data(), static_cast<int>(this->_internal_name().length()),
549 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
550 "tensorflow.ResourceHandleProto.name");
551 target = stream->WriteStringMaybeAliased(
552 3, this->_internal_name(), target);
553 }
554
555 // uint64 hash_code = 4;
556 if (this->_internal_hash_code() != 0) {
557 target = stream->EnsureSpace(target);
558 target = ::_pbi::WireFormatLite::WriteUInt64ToArray(4, this->_internal_hash_code(), target);
559 }
560
561 // string maybe_type_name = 5;
562 if (!this->_internal_maybe_type_name().empty()) {
563 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
564 this->_internal_maybe_type_name().data(), static_cast<int>(this->_internal_maybe_type_name().length()),
565 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
566 "tensorflow.ResourceHandleProto.maybe_type_name");
567 target = stream->WriteStringMaybeAliased(
568 5, this->_internal_maybe_type_name(), target);
569 }
570
571 // repeated .tensorflow.ResourceHandleProto.DtypeAndShape dtypes_and_shapes = 6;
572 for (unsigned i = 0,
573 n = static_cast<unsigned>(this->_internal_dtypes_and_shapes_size()); i < n; i++) {
574 const auto& repfield = this->_internal_dtypes_and_shapes(i);
575 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
576 InternalWriteMessage(6, repfield, repfield.GetCachedSize(), target, stream);
577 }
578
579 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
580 target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
581 static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
582 }
583 // @@protoc_insertion_point(serialize_to_array_end:tensorflow.ResourceHandleProto)
584 return target;
585 }
586
ByteSizeLong() const587 size_t ResourceHandleProto::ByteSizeLong() const {
588 // @@protoc_insertion_point(message_byte_size_start:tensorflow.ResourceHandleProto)
589 size_t total_size = 0;
590
591 ::uint32_t cached_has_bits = 0;
592 // Prevent compiler warnings about cached_has_bits being unused
593 (void) cached_has_bits;
594
595 // repeated .tensorflow.ResourceHandleProto.DtypeAndShape dtypes_and_shapes = 6;
596 total_size += 1UL * this->_internal_dtypes_and_shapes_size();
597 for (const auto& msg : this->_impl_.dtypes_and_shapes_) {
598 total_size +=
599 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
600 }
601
602 // string device = 1;
603 if (!this->_internal_device().empty()) {
604 total_size += 1 +
605 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
606 this->_internal_device());
607 }
608
609 // string container = 2;
610 if (!this->_internal_container().empty()) {
611 total_size += 1 +
612 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
613 this->_internal_container());
614 }
615
616 // string name = 3;
617 if (!this->_internal_name().empty()) {
618 total_size += 1 +
619 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
620 this->_internal_name());
621 }
622
623 // string maybe_type_name = 5;
624 if (!this->_internal_maybe_type_name().empty()) {
625 total_size += 1 +
626 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
627 this->_internal_maybe_type_name());
628 }
629
630 // uint64 hash_code = 4;
631 if (this->_internal_hash_code() != 0) {
632 total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_hash_code());
633 }
634
635 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
636 total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
637 }
638 int cached_size = ::_pbi::ToCachedSize(total_size);
639 SetCachedSize(cached_size);
640 return total_size;
641 }
642
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)643 void ResourceHandleProto::CheckTypeAndMergeFrom(
644 const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
645 MergeFrom(*::_pbi::DownCast<const ResourceHandleProto*>(
646 &from));
647 }
648
MergeFrom(const ResourceHandleProto & from)649 void ResourceHandleProto::MergeFrom(const ResourceHandleProto& from) {
650 ResourceHandleProto* const _this = this;
651 // @@protoc_insertion_point(class_specific_merge_from_start:tensorflow.ResourceHandleProto)
652 GOOGLE_DCHECK_NE(&from, _this);
653 ::uint32_t cached_has_bits = 0;
654 (void) cached_has_bits;
655
656 _this->_impl_.dtypes_and_shapes_.MergeFrom(from._impl_.dtypes_and_shapes_);
657 if (!from._internal_device().empty()) {
658 _this->_internal_set_device(from._internal_device());
659 }
660 if (!from._internal_container().empty()) {
661 _this->_internal_set_container(from._internal_container());
662 }
663 if (!from._internal_name().empty()) {
664 _this->_internal_set_name(from._internal_name());
665 }
666 if (!from._internal_maybe_type_name().empty()) {
667 _this->_internal_set_maybe_type_name(from._internal_maybe_type_name());
668 }
669 if (from._internal_hash_code() != 0) {
670 _this->_internal_set_hash_code(from._internal_hash_code());
671 }
672 _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
673 }
674
CopyFrom(const ResourceHandleProto & from)675 void ResourceHandleProto::CopyFrom(const ResourceHandleProto& from) {
676 // @@protoc_insertion_point(class_specific_copy_from_start:tensorflow.ResourceHandleProto)
677 if (&from == this) return;
678 Clear();
679 MergeFrom(from);
680 }
681
IsInitialized() const682 bool ResourceHandleProto::IsInitialized() const {
683 return true;
684 }
685
InternalSwap(ResourceHandleProto * other)686 void ResourceHandleProto::InternalSwap(ResourceHandleProto* other) {
687 using std::swap;
688 auto* lhs_arena = GetArenaForAllocation();
689 auto* rhs_arena = other->GetArenaForAllocation();
690 _internal_metadata_.InternalSwap(&other->_internal_metadata_);
691 _impl_.dtypes_and_shapes_.InternalSwap(&other->_impl_.dtypes_and_shapes_);
692 ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
693 &_impl_.device_, lhs_arena,
694 &other->_impl_.device_, rhs_arena
695 );
696 ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
697 &_impl_.container_, lhs_arena,
698 &other->_impl_.container_, rhs_arena
699 );
700 ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
701 &_impl_.name_, lhs_arena,
702 &other->_impl_.name_, rhs_arena
703 );
704 ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
705 &_impl_.maybe_type_name_, lhs_arena,
706 &other->_impl_.maybe_type_name_, rhs_arena
707 );
708 swap(_impl_.hash_code_, other->_impl_.hash_code_);
709 }
710
GetTypeName() const711 std::string ResourceHandleProto::GetTypeName() const {
712 return "tensorflow.ResourceHandleProto";
713 }
714
715
716 // @@protoc_insertion_point(namespace_scope)
717 } // namespace tensorflow
718 PROTOBUF_NAMESPACE_OPEN
719 template<> PROTOBUF_NOINLINE ::tensorflow::ResourceHandleProto_DtypeAndShape*
CreateMaybeMessage(Arena * arena)720 Arena::CreateMaybeMessage< ::tensorflow::ResourceHandleProto_DtypeAndShape >(Arena* arena) {
721 return Arena::CreateMessageInternal< ::tensorflow::ResourceHandleProto_DtypeAndShape >(arena);
722 }
723 template<> PROTOBUF_NOINLINE ::tensorflow::ResourceHandleProto*
CreateMaybeMessage(Arena * arena)724 Arena::CreateMaybeMessage< ::tensorflow::ResourceHandleProto >(Arena* arena) {
725 return Arena::CreateMessageInternal< ::tensorflow::ResourceHandleProto >(arena);
726 }
727 PROTOBUF_NAMESPACE_CLOSE
728
729 // @@protoc_insertion_point(global_scope)
730 #include <google/protobuf/port_undef.inc>
731