1 // Generated by the protocol buffer compiler. DO NOT EDIT!
2 // source: tensorflow/core/framework/attr_value.proto
3
4 #include "tensorflow/core/framework/attr_value.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 {
AttrValue_ListValue(::_pbi::ConstantInitialized)22 PROTOBUF_CONSTEXPR AttrValue_ListValue::AttrValue_ListValue(
23 ::_pbi::ConstantInitialized): _impl_{
24 /*decltype(_impl_.s_)*/{}
25 , /*decltype(_impl_.i_)*/{}
26 , /*decltype(_impl_._i_cached_byte_size_)*/{0}
27 , /*decltype(_impl_.f_)*/{}
28 , /*decltype(_impl_.b_)*/{}
29 , /*decltype(_impl_.type_)*/{}
30 , /*decltype(_impl_._type_cached_byte_size_)*/{0}
31 , /*decltype(_impl_.shape_)*/{}
32 , /*decltype(_impl_.tensor_)*/{}
33 , /*decltype(_impl_.func_)*/{}
34 , /*decltype(_impl_._cached_size_)*/{}} {}
35 struct AttrValue_ListValueDefaultTypeInternal {
AttrValue_ListValueDefaultTypeInternaltensorflow::AttrValue_ListValueDefaultTypeInternal36 PROTOBUF_CONSTEXPR AttrValue_ListValueDefaultTypeInternal()
37 : _instance(::_pbi::ConstantInitialized{}) {}
~AttrValue_ListValueDefaultTypeInternaltensorflow::AttrValue_ListValueDefaultTypeInternal38 ~AttrValue_ListValueDefaultTypeInternal() {}
39 union { // NOLINT(misc-non-private-member-variables-in-classes)
40 AttrValue_ListValue _instance;
41 };
42 };
43 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 AttrValue_ListValueDefaultTypeInternal _AttrValue_ListValue_default_instance_;
AttrValue(::_pbi::ConstantInitialized)44 PROTOBUF_CONSTEXPR AttrValue::AttrValue(
45 ::_pbi::ConstantInitialized): _impl_{
46 /*decltype(_impl_.value_)*/{}
47 , /*decltype(_impl_._cached_size_)*/{}
48 , /*decltype(_impl_._oneof_case_)*/{}} {}
49 struct AttrValueDefaultTypeInternal {
AttrValueDefaultTypeInternaltensorflow::AttrValueDefaultTypeInternal50 PROTOBUF_CONSTEXPR AttrValueDefaultTypeInternal()
51 : _instance(::_pbi::ConstantInitialized{}) {}
~AttrValueDefaultTypeInternaltensorflow::AttrValueDefaultTypeInternal52 ~AttrValueDefaultTypeInternal() {}
53 union { // NOLINT(misc-non-private-member-variables-in-classes)
54 AttrValue _instance;
55 };
56 };
57 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 AttrValueDefaultTypeInternal _AttrValue_default_instance_;
NameAttrList_AttrEntry_DoNotUse(::_pbi::ConstantInitialized)58 PROTOBUF_CONSTEXPR NameAttrList_AttrEntry_DoNotUse::NameAttrList_AttrEntry_DoNotUse(
59 ::_pbi::ConstantInitialized) {}
60 struct NameAttrList_AttrEntry_DoNotUseDefaultTypeInternal {
NameAttrList_AttrEntry_DoNotUseDefaultTypeInternaltensorflow::NameAttrList_AttrEntry_DoNotUseDefaultTypeInternal61 PROTOBUF_CONSTEXPR NameAttrList_AttrEntry_DoNotUseDefaultTypeInternal()
62 : _instance(::_pbi::ConstantInitialized{}) {}
~NameAttrList_AttrEntry_DoNotUseDefaultTypeInternaltensorflow::NameAttrList_AttrEntry_DoNotUseDefaultTypeInternal63 ~NameAttrList_AttrEntry_DoNotUseDefaultTypeInternal() {}
64 union { // NOLINT(misc-non-private-member-variables-in-classes)
65 NameAttrList_AttrEntry_DoNotUse _instance;
66 };
67 };
68 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 NameAttrList_AttrEntry_DoNotUseDefaultTypeInternal _NameAttrList_AttrEntry_DoNotUse_default_instance_;
NameAttrList(::_pbi::ConstantInitialized)69 PROTOBUF_CONSTEXPR NameAttrList::NameAttrList(
70 ::_pbi::ConstantInitialized): _impl_{
71 /*decltype(_impl_.attr_)*/{}
72 , /*decltype(_impl_.name_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
73 , /*decltype(_impl_._cached_size_)*/{}} {}
74 struct NameAttrListDefaultTypeInternal {
NameAttrListDefaultTypeInternaltensorflow::NameAttrListDefaultTypeInternal75 PROTOBUF_CONSTEXPR NameAttrListDefaultTypeInternal()
76 : _instance(::_pbi::ConstantInitialized{}) {}
~NameAttrListDefaultTypeInternaltensorflow::NameAttrListDefaultTypeInternal77 ~NameAttrListDefaultTypeInternal() {}
78 union { // NOLINT(misc-non-private-member-variables-in-classes)
79 NameAttrList _instance;
80 };
81 };
82 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 NameAttrListDefaultTypeInternal _NameAttrList_default_instance_;
83 } // namespace tensorflow
84 namespace tensorflow {
85
86 // ===================================================================
87
88 class AttrValue_ListValue::_Internal {
89 public:
90 };
91
clear_shape()92 void AttrValue_ListValue::clear_shape() {
93 _impl_.shape_.Clear();
94 }
clear_tensor()95 void AttrValue_ListValue::clear_tensor() {
96 _impl_.tensor_.Clear();
97 }
AttrValue_ListValue(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)98 AttrValue_ListValue::AttrValue_ListValue(::PROTOBUF_NAMESPACE_ID::Arena* arena,
99 bool is_message_owned)
100 : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
101 SharedCtor(arena, is_message_owned);
102 // @@protoc_insertion_point(arena_constructor:tensorflow.AttrValue.ListValue)
103 }
AttrValue_ListValue(const AttrValue_ListValue & from)104 AttrValue_ListValue::AttrValue_ListValue(const AttrValue_ListValue& from)
105 : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
106 AttrValue_ListValue* const _this = this; (void)_this;
107 new (&_impl_) Impl_{
108 decltype(_impl_.s_){from._impl_.s_}
109 , decltype(_impl_.i_){from._impl_.i_}
110 , /*decltype(_impl_._i_cached_byte_size_)*/{0}
111 , decltype(_impl_.f_){from._impl_.f_}
112 , decltype(_impl_.b_){from._impl_.b_}
113 , decltype(_impl_.type_){from._impl_.type_}
114 , /*decltype(_impl_._type_cached_byte_size_)*/{0}
115 , decltype(_impl_.shape_){from._impl_.shape_}
116 , decltype(_impl_.tensor_){from._impl_.tensor_}
117 , decltype(_impl_.func_){from._impl_.func_}
118 , /*decltype(_impl_._cached_size_)*/{}};
119
120 _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
121 // @@protoc_insertion_point(copy_constructor:tensorflow.AttrValue.ListValue)
122 }
123
SharedCtor(::_pb::Arena * arena,bool is_message_owned)124 inline void AttrValue_ListValue::SharedCtor(
125 ::_pb::Arena* arena, bool is_message_owned) {
126 (void)arena;
127 (void)is_message_owned;
128 new (&_impl_) Impl_{
129 decltype(_impl_.s_){arena}
130 , decltype(_impl_.i_){arena}
131 , /*decltype(_impl_._i_cached_byte_size_)*/{0}
132 , decltype(_impl_.f_){arena}
133 , decltype(_impl_.b_){arena}
134 , decltype(_impl_.type_){arena}
135 , /*decltype(_impl_._type_cached_byte_size_)*/{0}
136 , decltype(_impl_.shape_){arena}
137 , decltype(_impl_.tensor_){arena}
138 , decltype(_impl_.func_){arena}
139 , /*decltype(_impl_._cached_size_)*/{}
140 };
141 }
142
~AttrValue_ListValue()143 AttrValue_ListValue::~AttrValue_ListValue() {
144 // @@protoc_insertion_point(destructor:tensorflow.AttrValue.ListValue)
145 if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
146 (void)arena;
147 return;
148 }
149 SharedDtor();
150 }
151
SharedDtor()152 inline void AttrValue_ListValue::SharedDtor() {
153 GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
154 _impl_.s_.~RepeatedPtrField();
155 _impl_.i_.~RepeatedField();
156 _impl_.f_.~RepeatedField();
157 _impl_.b_.~RepeatedField();
158 _impl_.type_.~RepeatedField();
159 _impl_.shape_.~RepeatedPtrField();
160 _impl_.tensor_.~RepeatedPtrField();
161 _impl_.func_.~RepeatedPtrField();
162 }
163
SetCachedSize(int size) const164 void AttrValue_ListValue::SetCachedSize(int size) const {
165 _impl_._cached_size_.Set(size);
166 }
167
Clear()168 void AttrValue_ListValue::Clear() {
169 // @@protoc_insertion_point(message_clear_start:tensorflow.AttrValue.ListValue)
170 ::uint32_t cached_has_bits = 0;
171 // Prevent compiler warnings about cached_has_bits being unused
172 (void) cached_has_bits;
173
174 _impl_.s_.Clear();
175 _impl_.i_.Clear();
176 _impl_.f_.Clear();
177 _impl_.b_.Clear();
178 _impl_.type_.Clear();
179 _impl_.shape_.Clear();
180 _impl_.tensor_.Clear();
181 _impl_.func_.Clear();
182 _internal_metadata_.Clear<std::string>();
183 }
184
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)185 const char* AttrValue_ListValue::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
186 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
187 while (!ctx->Done(&ptr)) {
188 ::uint32_t tag;
189 ptr = ::_pbi::ReadTag(ptr, &tag);
190 switch (tag >> 3) {
191 // repeated bytes s = 2;
192 case 2:
193 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 18)) {
194 ptr -= 1;
195 do {
196 ptr += 1;
197 auto str = _internal_add_s();
198 ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
199 CHK_(ptr);
200 if (!ctx->DataAvailable(ptr)) break;
201 } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<18>(ptr));
202 } else {
203 goto handle_unusual;
204 }
205 continue;
206 // repeated int64 i = 3 [packed = true];
207 case 3:
208 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 26)) {
209 ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedInt64Parser(_internal_mutable_i(), ptr, ctx);
210 CHK_(ptr);
211 } else if (static_cast<::uint8_t>(tag) == 24) {
212 _internal_add_i(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr));
213 CHK_(ptr);
214 } else {
215 goto handle_unusual;
216 }
217 continue;
218 // repeated float f = 4 [packed = true];
219 case 4:
220 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 34)) {
221 ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedFloatParser(_internal_mutable_f(), ptr, ctx);
222 CHK_(ptr);
223 } else if (static_cast<::uint8_t>(tag) == 37) {
224 _internal_add_f(::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr));
225 ptr += sizeof(float);
226 } else {
227 goto handle_unusual;
228 }
229 continue;
230 // repeated bool b = 5 [packed = true];
231 case 5:
232 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 42)) {
233 ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedBoolParser(_internal_mutable_b(), ptr, ctx);
234 CHK_(ptr);
235 } else if (static_cast<::uint8_t>(tag) == 40) {
236 _internal_add_b(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr));
237 CHK_(ptr);
238 } else {
239 goto handle_unusual;
240 }
241 continue;
242 // repeated .tensorflow.DataType type = 6 [packed = true];
243 case 6:
244 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 50)) {
245 ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedEnumParser(_internal_mutable_type(), ptr, ctx);
246 CHK_(ptr);
247 } else if (static_cast<::uint8_t>(tag) == 48) {
248 ::uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
249 CHK_(ptr);
250 _internal_add_type(static_cast<::tensorflow::DataType>(val));
251 } else {
252 goto handle_unusual;
253 }
254 continue;
255 // repeated .tensorflow.TensorShapeProto shape = 7;
256 case 7:
257 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 58)) {
258 ptr -= 1;
259 do {
260 ptr += 1;
261 ptr = ctx->ParseMessage(_internal_add_shape(), ptr);
262 CHK_(ptr);
263 if (!ctx->DataAvailable(ptr)) break;
264 } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<58>(ptr));
265 } else {
266 goto handle_unusual;
267 }
268 continue;
269 // repeated .tensorflow.TensorProto tensor = 8;
270 case 8:
271 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 66)) {
272 ptr -= 1;
273 do {
274 ptr += 1;
275 ptr = ctx->ParseMessage(_internal_add_tensor(), ptr);
276 CHK_(ptr);
277 if (!ctx->DataAvailable(ptr)) break;
278 } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<66>(ptr));
279 } else {
280 goto handle_unusual;
281 }
282 continue;
283 // repeated .tensorflow.NameAttrList func = 9;
284 case 9:
285 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 74)) {
286 ptr -= 1;
287 do {
288 ptr += 1;
289 ptr = ctx->ParseMessage(_internal_add_func(), ptr);
290 CHK_(ptr);
291 if (!ctx->DataAvailable(ptr)) break;
292 } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<74>(ptr));
293 } else {
294 goto handle_unusual;
295 }
296 continue;
297 default:
298 goto handle_unusual;
299 } // switch
300 handle_unusual:
301 if ((tag == 0) || ((tag & 7) == 4)) {
302 CHK_(ptr);
303 ctx->SetLastTag(tag);
304 goto message_done;
305 }
306 ptr = UnknownFieldParse(
307 tag,
308 _internal_metadata_.mutable_unknown_fields<std::string>(),
309 ptr, ctx);
310 CHK_(ptr != nullptr);
311 } // while
312 message_done:
313 return ptr;
314 failure:
315 ptr = nullptr;
316 goto message_done;
317 #undef CHK_
318 }
319
_InternalSerialize(::uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const320 ::uint8_t* AttrValue_ListValue::_InternalSerialize(
321 ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
322 // @@protoc_insertion_point(serialize_to_array_start:tensorflow.AttrValue.ListValue)
323 ::uint32_t cached_has_bits = 0;
324 (void) cached_has_bits;
325
326 // repeated bytes s = 2;
327 for (int i = 0, n = this->_internal_s_size(); i < n; i++) {
328 const auto& s = this->_internal_s(i);
329 target = stream->WriteBytes(2, s, target);
330 }
331
332 // repeated int64 i = 3 [packed = true];
333 {
334 int byte_size = _impl_._i_cached_byte_size_.load(std::memory_order_relaxed);
335 if (byte_size > 0) {
336 target = stream->WriteInt64Packed(
337 3, _internal_i(), byte_size, target);
338 }
339 }
340
341 // repeated float f = 4 [packed = true];
342 if (this->_internal_f_size() > 0) {
343 target = stream->WriteFixedPacked(4, _internal_f(), target);
344 }
345
346 // repeated bool b = 5 [packed = true];
347 if (this->_internal_b_size() > 0) {
348 target = stream->WriteFixedPacked(5, _internal_b(), target);
349 }
350
351 // repeated .tensorflow.DataType type = 6 [packed = true];
352 {
353 int byte_size = _impl_._type_cached_byte_size_.load(std::memory_order_relaxed);
354 if (byte_size > 0) {
355 target = stream->WriteEnumPacked(
356 6, _impl_.type_, byte_size, target);
357 }
358 }
359
360 // repeated .tensorflow.TensorShapeProto shape = 7;
361 for (unsigned i = 0,
362 n = static_cast<unsigned>(this->_internal_shape_size()); i < n; i++) {
363 const auto& repfield = this->_internal_shape(i);
364 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
365 InternalWriteMessage(7, repfield, repfield.GetCachedSize(), target, stream);
366 }
367
368 // repeated .tensorflow.TensorProto tensor = 8;
369 for (unsigned i = 0,
370 n = static_cast<unsigned>(this->_internal_tensor_size()); i < n; i++) {
371 const auto& repfield = this->_internal_tensor(i);
372 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
373 InternalWriteMessage(8, repfield, repfield.GetCachedSize(), target, stream);
374 }
375
376 // repeated .tensorflow.NameAttrList func = 9;
377 for (unsigned i = 0,
378 n = static_cast<unsigned>(this->_internal_func_size()); i < n; i++) {
379 const auto& repfield = this->_internal_func(i);
380 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
381 InternalWriteMessage(9, repfield, repfield.GetCachedSize(), target, stream);
382 }
383
384 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
385 target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
386 static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
387 }
388 // @@protoc_insertion_point(serialize_to_array_end:tensorflow.AttrValue.ListValue)
389 return target;
390 }
391
ByteSizeLong() const392 size_t AttrValue_ListValue::ByteSizeLong() const {
393 // @@protoc_insertion_point(message_byte_size_start:tensorflow.AttrValue.ListValue)
394 size_t total_size = 0;
395
396 ::uint32_t cached_has_bits = 0;
397 // Prevent compiler warnings about cached_has_bits being unused
398 (void) cached_has_bits;
399
400 // repeated bytes s = 2;
401 total_size += 1 *
402 ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(_impl_.s_.size());
403 for (int i = 0, n = _impl_.s_.size(); i < n; i++) {
404 total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize(
405 _impl_.s_.Get(i));
406 }
407
408 // repeated int64 i = 3 [packed = true];
409 {
410 size_t data_size = ::_pbi::WireFormatLite::
411 Int64Size(this->_impl_.i_);
412 if (data_size > 0) {
413 total_size += 1 +
414 ::_pbi::WireFormatLite::Int32Size(static_cast<::int32_t>(data_size));
415 }
416 int cached_size = ::_pbi::ToCachedSize(data_size);
417 _impl_._i_cached_byte_size_.store(cached_size,
418 std::memory_order_relaxed);
419 total_size += data_size;
420 }
421
422 // repeated float f = 4 [packed = true];
423 {
424 unsigned int count = static_cast<unsigned int>(this->_internal_f_size());
425 size_t data_size = 4UL * count;
426 if (data_size > 0) {
427 total_size += 1 +
428 ::_pbi::WireFormatLite::Int32Size(static_cast<::int32_t>(data_size));
429 }
430 total_size += data_size;
431 }
432
433 // repeated bool b = 5 [packed = true];
434 {
435 unsigned int count = static_cast<unsigned int>(this->_internal_b_size());
436 size_t data_size = 1UL * count;
437 if (data_size > 0) {
438 total_size += 1 +
439 ::_pbi::WireFormatLite::Int32Size(static_cast<::int32_t>(data_size));
440 }
441 total_size += data_size;
442 }
443
444 // repeated .tensorflow.DataType type = 6 [packed = true];
445 {
446 size_t data_size = 0;
447 unsigned int count = static_cast<unsigned int>(this->_internal_type_size());for (unsigned int i = 0; i < count; i++) {
448 data_size += ::_pbi::WireFormatLite::EnumSize(
449 this->_internal_type(static_cast<int>(i)));
450 }
451 if (data_size > 0) {
452 total_size += 1 +
453 ::_pbi::WireFormatLite::Int32Size(static_cast<::int32_t>(data_size));
454 }
455 int cached_size = ::_pbi::ToCachedSize(data_size);
456 _impl_._type_cached_byte_size_.store(cached_size,
457 std::memory_order_relaxed);
458 total_size += data_size;
459 }
460
461 // repeated .tensorflow.TensorShapeProto shape = 7;
462 total_size += 1UL * this->_internal_shape_size();
463 for (const auto& msg : this->_impl_.shape_) {
464 total_size +=
465 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
466 }
467
468 // repeated .tensorflow.TensorProto tensor = 8;
469 total_size += 1UL * this->_internal_tensor_size();
470 for (const auto& msg : this->_impl_.tensor_) {
471 total_size +=
472 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
473 }
474
475 // repeated .tensorflow.NameAttrList func = 9;
476 total_size += 1UL * this->_internal_func_size();
477 for (const auto& msg : this->_impl_.func_) {
478 total_size +=
479 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
480 }
481
482 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
483 total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
484 }
485 int cached_size = ::_pbi::ToCachedSize(total_size);
486 SetCachedSize(cached_size);
487 return total_size;
488 }
489
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)490 void AttrValue_ListValue::CheckTypeAndMergeFrom(
491 const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
492 MergeFrom(*::_pbi::DownCast<const AttrValue_ListValue*>(
493 &from));
494 }
495
MergeFrom(const AttrValue_ListValue & from)496 void AttrValue_ListValue::MergeFrom(const AttrValue_ListValue& from) {
497 AttrValue_ListValue* const _this = this;
498 // @@protoc_insertion_point(class_specific_merge_from_start:tensorflow.AttrValue.ListValue)
499 GOOGLE_DCHECK_NE(&from, _this);
500 ::uint32_t cached_has_bits = 0;
501 (void) cached_has_bits;
502
503 _this->_impl_.s_.MergeFrom(from._impl_.s_);
504 _this->_impl_.i_.MergeFrom(from._impl_.i_);
505 _this->_impl_.f_.MergeFrom(from._impl_.f_);
506 _this->_impl_.b_.MergeFrom(from._impl_.b_);
507 _this->_impl_.type_.MergeFrom(from._impl_.type_);
508 _this->_impl_.shape_.MergeFrom(from._impl_.shape_);
509 _this->_impl_.tensor_.MergeFrom(from._impl_.tensor_);
510 _this->_impl_.func_.MergeFrom(from._impl_.func_);
511 _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
512 }
513
CopyFrom(const AttrValue_ListValue & from)514 void AttrValue_ListValue::CopyFrom(const AttrValue_ListValue& from) {
515 // @@protoc_insertion_point(class_specific_copy_from_start:tensorflow.AttrValue.ListValue)
516 if (&from == this) return;
517 Clear();
518 MergeFrom(from);
519 }
520
IsInitialized() const521 bool AttrValue_ListValue::IsInitialized() const {
522 return true;
523 }
524
InternalSwap(AttrValue_ListValue * other)525 void AttrValue_ListValue::InternalSwap(AttrValue_ListValue* other) {
526 using std::swap;
527 _internal_metadata_.InternalSwap(&other->_internal_metadata_);
528 _impl_.s_.InternalSwap(&other->_impl_.s_);
529 _impl_.i_.InternalSwap(&other->_impl_.i_);
530 _impl_.f_.InternalSwap(&other->_impl_.f_);
531 _impl_.b_.InternalSwap(&other->_impl_.b_);
532 _impl_.type_.InternalSwap(&other->_impl_.type_);
533 _impl_.shape_.InternalSwap(&other->_impl_.shape_);
534 _impl_.tensor_.InternalSwap(&other->_impl_.tensor_);
535 _impl_.func_.InternalSwap(&other->_impl_.func_);
536 }
537
GetTypeName() const538 std::string AttrValue_ListValue::GetTypeName() const {
539 return "tensorflow.AttrValue.ListValue";
540 }
541
542
543 // ===================================================================
544
545 class AttrValue::_Internal {
546 public:
547 static const ::tensorflow::TensorShapeProto& shape(const AttrValue* msg);
548 static const ::tensorflow::TensorProto& tensor(const AttrValue* msg);
549 static const ::tensorflow::AttrValue_ListValue& list(const AttrValue* msg);
550 static const ::tensorflow::NameAttrList& func(const AttrValue* msg);
551 };
552
553 const ::tensorflow::TensorShapeProto&
shape(const AttrValue * msg)554 AttrValue::_Internal::shape(const AttrValue* msg) {
555 return *msg->_impl_.value_.shape_;
556 }
557 const ::tensorflow::TensorProto&
tensor(const AttrValue * msg)558 AttrValue::_Internal::tensor(const AttrValue* msg) {
559 return *msg->_impl_.value_.tensor_;
560 }
561 const ::tensorflow::AttrValue_ListValue&
list(const AttrValue * msg)562 AttrValue::_Internal::list(const AttrValue* msg) {
563 return *msg->_impl_.value_.list_;
564 }
565 const ::tensorflow::NameAttrList&
func(const AttrValue * msg)566 AttrValue::_Internal::func(const AttrValue* msg) {
567 return *msg->_impl_.value_.func_;
568 }
set_allocated_shape(::tensorflow::TensorShapeProto * shape)569 void AttrValue::set_allocated_shape(::tensorflow::TensorShapeProto* shape) {
570 ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
571 clear_value();
572 if (shape) {
573 ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
574 ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(
575 reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(shape));
576 if (message_arena != submessage_arena) {
577 shape = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
578 message_arena, shape, submessage_arena);
579 }
580 set_has_shape();
581 _impl_.value_.shape_ = shape;
582 }
583 // @@protoc_insertion_point(field_set_allocated:tensorflow.AttrValue.shape)
584 }
clear_shape()585 void AttrValue::clear_shape() {
586 if (_internal_has_shape()) {
587 if (GetArenaForAllocation() == nullptr) {
588 delete _impl_.value_.shape_;
589 }
590 clear_has_value();
591 }
592 }
set_allocated_tensor(::tensorflow::TensorProto * tensor)593 void AttrValue::set_allocated_tensor(::tensorflow::TensorProto* tensor) {
594 ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
595 clear_value();
596 if (tensor) {
597 ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
598 ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(
599 reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(tensor));
600 if (message_arena != submessage_arena) {
601 tensor = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
602 message_arena, tensor, submessage_arena);
603 }
604 set_has_tensor();
605 _impl_.value_.tensor_ = tensor;
606 }
607 // @@protoc_insertion_point(field_set_allocated:tensorflow.AttrValue.tensor)
608 }
clear_tensor()609 void AttrValue::clear_tensor() {
610 if (_internal_has_tensor()) {
611 if (GetArenaForAllocation() == nullptr) {
612 delete _impl_.value_.tensor_;
613 }
614 clear_has_value();
615 }
616 }
set_allocated_list(::tensorflow::AttrValue_ListValue * list)617 void AttrValue::set_allocated_list(::tensorflow::AttrValue_ListValue* list) {
618 ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
619 clear_value();
620 if (list) {
621 ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
622 ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(list);
623 if (message_arena != submessage_arena) {
624 list = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
625 message_arena, list, submessage_arena);
626 }
627 set_has_list();
628 _impl_.value_.list_ = list;
629 }
630 // @@protoc_insertion_point(field_set_allocated:tensorflow.AttrValue.list)
631 }
set_allocated_func(::tensorflow::NameAttrList * func)632 void AttrValue::set_allocated_func(::tensorflow::NameAttrList* func) {
633 ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
634 clear_value();
635 if (func) {
636 ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
637 ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(func);
638 if (message_arena != submessage_arena) {
639 func = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
640 message_arena, func, submessage_arena);
641 }
642 set_has_func();
643 _impl_.value_.func_ = func;
644 }
645 // @@protoc_insertion_point(field_set_allocated:tensorflow.AttrValue.func)
646 }
AttrValue(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)647 AttrValue::AttrValue(::PROTOBUF_NAMESPACE_ID::Arena* arena,
648 bool is_message_owned)
649 : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
650 SharedCtor(arena, is_message_owned);
651 // @@protoc_insertion_point(arena_constructor:tensorflow.AttrValue)
652 }
AttrValue(const AttrValue & from)653 AttrValue::AttrValue(const AttrValue& from)
654 : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
655 AttrValue* const _this = this; (void)_this;
656 new (&_impl_) Impl_{
657 decltype(_impl_.value_){}
658 , /*decltype(_impl_._cached_size_)*/{}
659 , /*decltype(_impl_._oneof_case_)*/{}};
660
661 _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
662 clear_has_value();
663 switch (from.value_case()) {
664 case kS: {
665 _this->_internal_set_s(from._internal_s());
666 break;
667 }
668 case kI: {
669 _this->_internal_set_i(from._internal_i());
670 break;
671 }
672 case kF: {
673 _this->_internal_set_f(from._internal_f());
674 break;
675 }
676 case kB: {
677 _this->_internal_set_b(from._internal_b());
678 break;
679 }
680 case kType: {
681 _this->_internal_set_type(from._internal_type());
682 break;
683 }
684 case kShape: {
685 _this->_internal_mutable_shape()->::tensorflow::TensorShapeProto::MergeFrom(
686 from._internal_shape());
687 break;
688 }
689 case kTensor: {
690 _this->_internal_mutable_tensor()->::tensorflow::TensorProto::MergeFrom(
691 from._internal_tensor());
692 break;
693 }
694 case kList: {
695 _this->_internal_mutable_list()->::tensorflow::AttrValue_ListValue::MergeFrom(
696 from._internal_list());
697 break;
698 }
699 case kFunc: {
700 _this->_internal_mutable_func()->::tensorflow::NameAttrList::MergeFrom(
701 from._internal_func());
702 break;
703 }
704 case kPlaceholder: {
705 _this->_internal_set_placeholder(from._internal_placeholder());
706 break;
707 }
708 case VALUE_NOT_SET: {
709 break;
710 }
711 }
712 // @@protoc_insertion_point(copy_constructor:tensorflow.AttrValue)
713 }
714
SharedCtor(::_pb::Arena * arena,bool is_message_owned)715 inline void AttrValue::SharedCtor(
716 ::_pb::Arena* arena, bool is_message_owned) {
717 (void)arena;
718 (void)is_message_owned;
719 new (&_impl_) Impl_{
720 decltype(_impl_.value_){}
721 , /*decltype(_impl_._cached_size_)*/{}
722 , /*decltype(_impl_._oneof_case_)*/{}
723 };
724 clear_has_value();
725 }
726
~AttrValue()727 AttrValue::~AttrValue() {
728 // @@protoc_insertion_point(destructor:tensorflow.AttrValue)
729 if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
730 (void)arena;
731 return;
732 }
733 SharedDtor();
734 }
735
SharedDtor()736 inline void AttrValue::SharedDtor() {
737 GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
738 if (has_value()) {
739 clear_value();
740 }
741 }
742
SetCachedSize(int size) const743 void AttrValue::SetCachedSize(int size) const {
744 _impl_._cached_size_.Set(size);
745 }
746
clear_value()747 void AttrValue::clear_value() {
748 // @@protoc_insertion_point(one_of_clear_start:tensorflow.AttrValue)
749 switch (value_case()) {
750 case kS: {
751 _impl_.value_.s_.Destroy();
752 break;
753 }
754 case kI: {
755 // No need to clear
756 break;
757 }
758 case kF: {
759 // No need to clear
760 break;
761 }
762 case kB: {
763 // No need to clear
764 break;
765 }
766 case kType: {
767 // No need to clear
768 break;
769 }
770 case kShape: {
771 if (GetArenaForAllocation() == nullptr) {
772 delete _impl_.value_.shape_;
773 }
774 break;
775 }
776 case kTensor: {
777 if (GetArenaForAllocation() == nullptr) {
778 delete _impl_.value_.tensor_;
779 }
780 break;
781 }
782 case kList: {
783 if (GetArenaForAllocation() == nullptr) {
784 delete _impl_.value_.list_;
785 }
786 break;
787 }
788 case kFunc: {
789 if (GetArenaForAllocation() == nullptr) {
790 delete _impl_.value_.func_;
791 }
792 break;
793 }
794 case kPlaceholder: {
795 _impl_.value_.placeholder_.Destroy();
796 break;
797 }
798 case VALUE_NOT_SET: {
799 break;
800 }
801 }
802 _impl_._oneof_case_[0] = VALUE_NOT_SET;
803 }
804
805
Clear()806 void AttrValue::Clear() {
807 // @@protoc_insertion_point(message_clear_start:tensorflow.AttrValue)
808 ::uint32_t cached_has_bits = 0;
809 // Prevent compiler warnings about cached_has_bits being unused
810 (void) cached_has_bits;
811
812 clear_value();
813 _internal_metadata_.Clear<std::string>();
814 }
815
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)816 const char* AttrValue::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
817 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
818 while (!ctx->Done(&ptr)) {
819 ::uint32_t tag;
820 ptr = ::_pbi::ReadTag(ptr, &tag);
821 switch (tag >> 3) {
822 // .tensorflow.AttrValue.ListValue list = 1;
823 case 1:
824 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 10)) {
825 ptr = ctx->ParseMessage(_internal_mutable_list(), ptr);
826 CHK_(ptr);
827 } else {
828 goto handle_unusual;
829 }
830 continue;
831 // bytes s = 2;
832 case 2:
833 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 18)) {
834 auto str = _internal_mutable_s();
835 ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
836 CHK_(ptr);
837 } else {
838 goto handle_unusual;
839 }
840 continue;
841 // int64 i = 3;
842 case 3:
843 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 24)) {
844 _internal_set_i(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr));
845 CHK_(ptr);
846 } else {
847 goto handle_unusual;
848 }
849 continue;
850 // float f = 4;
851 case 4:
852 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 37)) {
853 _internal_set_f(::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr));
854 ptr += sizeof(float);
855 } else {
856 goto handle_unusual;
857 }
858 continue;
859 // bool b = 5;
860 case 5:
861 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 40)) {
862 _internal_set_b(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr));
863 CHK_(ptr);
864 } else {
865 goto handle_unusual;
866 }
867 continue;
868 // .tensorflow.DataType type = 6;
869 case 6:
870 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 48)) {
871 ::uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
872 CHK_(ptr);
873 _internal_set_type(static_cast<::tensorflow::DataType>(val));
874 } else {
875 goto handle_unusual;
876 }
877 continue;
878 // .tensorflow.TensorShapeProto shape = 7;
879 case 7:
880 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 58)) {
881 ptr = ctx->ParseMessage(_internal_mutable_shape(), ptr);
882 CHK_(ptr);
883 } else {
884 goto handle_unusual;
885 }
886 continue;
887 // .tensorflow.TensorProto tensor = 8;
888 case 8:
889 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 66)) {
890 ptr = ctx->ParseMessage(_internal_mutable_tensor(), ptr);
891 CHK_(ptr);
892 } else {
893 goto handle_unusual;
894 }
895 continue;
896 // string placeholder = 9;
897 case 9:
898 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 74)) {
899 auto str = _internal_mutable_placeholder();
900 ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
901 CHK_(ptr);
902 CHK_(::_pbi::VerifyUTF8(str, nullptr));
903 } else {
904 goto handle_unusual;
905 }
906 continue;
907 // .tensorflow.NameAttrList func = 10;
908 case 10:
909 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 82)) {
910 ptr = ctx->ParseMessage(_internal_mutable_func(), ptr);
911 CHK_(ptr);
912 } else {
913 goto handle_unusual;
914 }
915 continue;
916 default:
917 goto handle_unusual;
918 } // switch
919 handle_unusual:
920 if ((tag == 0) || ((tag & 7) == 4)) {
921 CHK_(ptr);
922 ctx->SetLastTag(tag);
923 goto message_done;
924 }
925 ptr = UnknownFieldParse(
926 tag,
927 _internal_metadata_.mutable_unknown_fields<std::string>(),
928 ptr, ctx);
929 CHK_(ptr != nullptr);
930 } // while
931 message_done:
932 return ptr;
933 failure:
934 ptr = nullptr;
935 goto message_done;
936 #undef CHK_
937 }
938
_InternalSerialize(::uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const939 ::uint8_t* AttrValue::_InternalSerialize(
940 ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
941 // @@protoc_insertion_point(serialize_to_array_start:tensorflow.AttrValue)
942 ::uint32_t cached_has_bits = 0;
943 (void) cached_has_bits;
944
945 // .tensorflow.AttrValue.ListValue list = 1;
946 if (_internal_has_list()) {
947 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
948 InternalWriteMessage(1, _Internal::list(this),
949 _Internal::list(this).GetCachedSize(), target, stream);
950 }
951
952 // bytes s = 2;
953 if (_internal_has_s()) {
954 target = stream->WriteBytesMaybeAliased(
955 2, this->_internal_s(), target);
956 }
957
958 // int64 i = 3;
959 if (_internal_has_i()) {
960 target = stream->EnsureSpace(target);
961 target = ::_pbi::WireFormatLite::WriteInt64ToArray(3, this->_internal_i(), target);
962 }
963
964 // float f = 4;
965 if (_internal_has_f()) {
966 target = stream->EnsureSpace(target);
967 target = ::_pbi::WireFormatLite::WriteFloatToArray(4, this->_internal_f(), target);
968 }
969
970 // bool b = 5;
971 if (_internal_has_b()) {
972 target = stream->EnsureSpace(target);
973 target = ::_pbi::WireFormatLite::WriteBoolToArray(5, this->_internal_b(), target);
974 }
975
976 // .tensorflow.DataType type = 6;
977 if (_internal_has_type()) {
978 target = stream->EnsureSpace(target);
979 target = ::_pbi::WireFormatLite::WriteEnumToArray(
980 6, this->_internal_type(), target);
981 }
982
983 // .tensorflow.TensorShapeProto shape = 7;
984 if (_internal_has_shape()) {
985 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
986 InternalWriteMessage(7, _Internal::shape(this),
987 _Internal::shape(this).GetCachedSize(), target, stream);
988 }
989
990 // .tensorflow.TensorProto tensor = 8;
991 if (_internal_has_tensor()) {
992 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
993 InternalWriteMessage(8, _Internal::tensor(this),
994 _Internal::tensor(this).GetCachedSize(), target, stream);
995 }
996
997 // string placeholder = 9;
998 if (_internal_has_placeholder()) {
999 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
1000 this->_internal_placeholder().data(), static_cast<int>(this->_internal_placeholder().length()),
1001 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
1002 "tensorflow.AttrValue.placeholder");
1003 target = stream->WriteStringMaybeAliased(
1004 9, this->_internal_placeholder(), target);
1005 }
1006
1007 // .tensorflow.NameAttrList func = 10;
1008 if (_internal_has_func()) {
1009 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
1010 InternalWriteMessage(10, _Internal::func(this),
1011 _Internal::func(this).GetCachedSize(), target, stream);
1012 }
1013
1014 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
1015 target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
1016 static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
1017 }
1018 // @@protoc_insertion_point(serialize_to_array_end:tensorflow.AttrValue)
1019 return target;
1020 }
1021
ByteSizeLong() const1022 size_t AttrValue::ByteSizeLong() const {
1023 // @@protoc_insertion_point(message_byte_size_start:tensorflow.AttrValue)
1024 size_t total_size = 0;
1025
1026 switch (value_case()) {
1027 // bytes s = 2;
1028 case kS: {
1029 total_size += 1 +
1030 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize(
1031 this->_internal_s());
1032 break;
1033 }
1034 // int64 i = 3;
1035 case kI: {
1036 total_size += ::_pbi::WireFormatLite::Int64SizePlusOne(this->_internal_i());
1037 break;
1038 }
1039 // float f = 4;
1040 case kF: {
1041 total_size += 1 + 4;
1042 break;
1043 }
1044 // bool b = 5;
1045 case kB: {
1046 total_size += 1 + 1;
1047 break;
1048 }
1049 // .tensorflow.DataType type = 6;
1050 case kType: {
1051 total_size += 1 +
1052 ::_pbi::WireFormatLite::EnumSize(this->_internal_type());
1053 break;
1054 }
1055 // .tensorflow.TensorShapeProto shape = 7;
1056 case kShape: {
1057 total_size += 1 +
1058 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
1059 *_impl_.value_.shape_);
1060 break;
1061 }
1062 // .tensorflow.TensorProto tensor = 8;
1063 case kTensor: {
1064 total_size += 1 +
1065 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
1066 *_impl_.value_.tensor_);
1067 break;
1068 }
1069 // .tensorflow.AttrValue.ListValue list = 1;
1070 case kList: {
1071 total_size += 1 +
1072 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
1073 *_impl_.value_.list_);
1074 break;
1075 }
1076 // .tensorflow.NameAttrList func = 10;
1077 case kFunc: {
1078 total_size += 1 +
1079 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
1080 *_impl_.value_.func_);
1081 break;
1082 }
1083 // string placeholder = 9;
1084 case kPlaceholder: {
1085 total_size += 1 +
1086 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
1087 this->_internal_placeholder());
1088 break;
1089 }
1090 case VALUE_NOT_SET: {
1091 break;
1092 }
1093 }
1094 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
1095 total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
1096 }
1097 int cached_size = ::_pbi::ToCachedSize(total_size);
1098 SetCachedSize(cached_size);
1099 return total_size;
1100 }
1101
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)1102 void AttrValue::CheckTypeAndMergeFrom(
1103 const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
1104 MergeFrom(*::_pbi::DownCast<const AttrValue*>(
1105 &from));
1106 }
1107
MergeFrom(const AttrValue & from)1108 void AttrValue::MergeFrom(const AttrValue& from) {
1109 AttrValue* const _this = this;
1110 // @@protoc_insertion_point(class_specific_merge_from_start:tensorflow.AttrValue)
1111 GOOGLE_DCHECK_NE(&from, _this);
1112 ::uint32_t cached_has_bits = 0;
1113 (void) cached_has_bits;
1114
1115 switch (from.value_case()) {
1116 case kS: {
1117 _this->_internal_set_s(from._internal_s());
1118 break;
1119 }
1120 case kI: {
1121 _this->_internal_set_i(from._internal_i());
1122 break;
1123 }
1124 case kF: {
1125 _this->_internal_set_f(from._internal_f());
1126 break;
1127 }
1128 case kB: {
1129 _this->_internal_set_b(from._internal_b());
1130 break;
1131 }
1132 case kType: {
1133 _this->_internal_set_type(from._internal_type());
1134 break;
1135 }
1136 case kShape: {
1137 _this->_internal_mutable_shape()->::tensorflow::TensorShapeProto::MergeFrom(
1138 from._internal_shape());
1139 break;
1140 }
1141 case kTensor: {
1142 _this->_internal_mutable_tensor()->::tensorflow::TensorProto::MergeFrom(
1143 from._internal_tensor());
1144 break;
1145 }
1146 case kList: {
1147 _this->_internal_mutable_list()->::tensorflow::AttrValue_ListValue::MergeFrom(
1148 from._internal_list());
1149 break;
1150 }
1151 case kFunc: {
1152 _this->_internal_mutable_func()->::tensorflow::NameAttrList::MergeFrom(
1153 from._internal_func());
1154 break;
1155 }
1156 case kPlaceholder: {
1157 _this->_internal_set_placeholder(from._internal_placeholder());
1158 break;
1159 }
1160 case VALUE_NOT_SET: {
1161 break;
1162 }
1163 }
1164 _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
1165 }
1166
CopyFrom(const AttrValue & from)1167 void AttrValue::CopyFrom(const AttrValue& from) {
1168 // @@protoc_insertion_point(class_specific_copy_from_start:tensorflow.AttrValue)
1169 if (&from == this) return;
1170 Clear();
1171 MergeFrom(from);
1172 }
1173
IsInitialized() const1174 bool AttrValue::IsInitialized() const {
1175 return true;
1176 }
1177
InternalSwap(AttrValue * other)1178 void AttrValue::InternalSwap(AttrValue* other) {
1179 using std::swap;
1180 _internal_metadata_.InternalSwap(&other->_internal_metadata_);
1181 swap(_impl_.value_, other->_impl_.value_);
1182 swap(_impl_._oneof_case_[0], other->_impl_._oneof_case_[0]);
1183 }
1184
GetTypeName() const1185 std::string AttrValue::GetTypeName() const {
1186 return "tensorflow.AttrValue";
1187 }
1188
1189
1190 // ===================================================================
1191
NameAttrList_AttrEntry_DoNotUse()1192 NameAttrList_AttrEntry_DoNotUse::NameAttrList_AttrEntry_DoNotUse() {}
NameAttrList_AttrEntry_DoNotUse(::PROTOBUF_NAMESPACE_ID::Arena * arena)1193 NameAttrList_AttrEntry_DoNotUse::NameAttrList_AttrEntry_DoNotUse(::PROTOBUF_NAMESPACE_ID::Arena* arena)
1194 : SuperType(arena) {}
MergeFrom(const NameAttrList_AttrEntry_DoNotUse & other)1195 void NameAttrList_AttrEntry_DoNotUse::MergeFrom(const NameAttrList_AttrEntry_DoNotUse& other) {
1196 MergeFromInternal(other);
1197 }
1198
1199 // ===================================================================
1200
1201 class NameAttrList::_Internal {
1202 public:
1203 };
1204
NameAttrList(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)1205 NameAttrList::NameAttrList(::PROTOBUF_NAMESPACE_ID::Arena* arena,
1206 bool is_message_owned)
1207 : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
1208 SharedCtor(arena, is_message_owned);
1209 // @@protoc_insertion_point(arena_constructor:tensorflow.NameAttrList)
1210 }
NameAttrList(const NameAttrList & from)1211 NameAttrList::NameAttrList(const NameAttrList& from)
1212 : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
1213 NameAttrList* const _this = this; (void)_this;
1214 new (&_impl_) Impl_{
1215 /*decltype(_impl_.attr_)*/{}
1216 , decltype(_impl_.name_){}
1217 , /*decltype(_impl_._cached_size_)*/{}};
1218
1219 _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
1220 _this->_impl_.attr_.MergeFrom(from._impl_.attr_);
1221 _impl_.name_.InitDefault();
1222 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
1223 _impl_.name_.Set("", GetArenaForAllocation());
1224 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
1225 if (!from._internal_name().empty()) {
1226 _this->_impl_.name_.Set(from._internal_name(),
1227 _this->GetArenaForAllocation());
1228 }
1229 // @@protoc_insertion_point(copy_constructor:tensorflow.NameAttrList)
1230 }
1231
SharedCtor(::_pb::Arena * arena,bool is_message_owned)1232 inline void NameAttrList::SharedCtor(
1233 ::_pb::Arena* arena, bool is_message_owned) {
1234 (void)arena;
1235 (void)is_message_owned;
1236 new (&_impl_) Impl_{
1237 /*decltype(_impl_.attr_)*/{::_pbi::ArenaInitialized(), arena}
1238 , decltype(_impl_.name_){}
1239 , /*decltype(_impl_._cached_size_)*/{}
1240 };
1241 _impl_.name_.InitDefault();
1242 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
1243 _impl_.name_.Set("", GetArenaForAllocation());
1244 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
1245 }
1246
~NameAttrList()1247 NameAttrList::~NameAttrList() {
1248 // @@protoc_insertion_point(destructor:tensorflow.NameAttrList)
1249 if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
1250 (void)arena;
1251 return;
1252 }
1253 SharedDtor();
1254 }
1255
SharedDtor()1256 inline void NameAttrList::SharedDtor() {
1257 GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
1258 _impl_.attr_.Destruct();
1259 _impl_.attr_.~MapFieldLite();
1260 _impl_.name_.Destroy();
1261 }
1262
SetCachedSize(int size) const1263 void NameAttrList::SetCachedSize(int size) const {
1264 _impl_._cached_size_.Set(size);
1265 }
1266
Clear()1267 void NameAttrList::Clear() {
1268 // @@protoc_insertion_point(message_clear_start:tensorflow.NameAttrList)
1269 ::uint32_t cached_has_bits = 0;
1270 // Prevent compiler warnings about cached_has_bits being unused
1271 (void) cached_has_bits;
1272
1273 _impl_.attr_.Clear();
1274 _impl_.name_.ClearToEmpty();
1275 _internal_metadata_.Clear<std::string>();
1276 }
1277
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)1278 const char* NameAttrList::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
1279 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
1280 while (!ctx->Done(&ptr)) {
1281 ::uint32_t tag;
1282 ptr = ::_pbi::ReadTag(ptr, &tag);
1283 switch (tag >> 3) {
1284 // string name = 1;
1285 case 1:
1286 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 10)) {
1287 auto str = _internal_mutable_name();
1288 ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
1289 CHK_(ptr);
1290 CHK_(::_pbi::VerifyUTF8(str, nullptr));
1291 } else {
1292 goto handle_unusual;
1293 }
1294 continue;
1295 // map<string, .tensorflow.AttrValue> attr = 2;
1296 case 2:
1297 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 18)) {
1298 ptr -= 1;
1299 do {
1300 ptr += 1;
1301 ptr = ctx->ParseMessage(&_impl_.attr_, ptr);
1302 CHK_(ptr);
1303 if (!ctx->DataAvailable(ptr)) break;
1304 } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<18>(ptr));
1305 } else {
1306 goto handle_unusual;
1307 }
1308 continue;
1309 default:
1310 goto handle_unusual;
1311 } // switch
1312 handle_unusual:
1313 if ((tag == 0) || ((tag & 7) == 4)) {
1314 CHK_(ptr);
1315 ctx->SetLastTag(tag);
1316 goto message_done;
1317 }
1318 ptr = UnknownFieldParse(
1319 tag,
1320 _internal_metadata_.mutable_unknown_fields<std::string>(),
1321 ptr, ctx);
1322 CHK_(ptr != nullptr);
1323 } // while
1324 message_done:
1325 return ptr;
1326 failure:
1327 ptr = nullptr;
1328 goto message_done;
1329 #undef CHK_
1330 }
1331
_InternalSerialize(::uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const1332 ::uint8_t* NameAttrList::_InternalSerialize(
1333 ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
1334 // @@protoc_insertion_point(serialize_to_array_start:tensorflow.NameAttrList)
1335 ::uint32_t cached_has_bits = 0;
1336 (void) cached_has_bits;
1337
1338 // string name = 1;
1339 if (!this->_internal_name().empty()) {
1340 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
1341 this->_internal_name().data(), static_cast<int>(this->_internal_name().length()),
1342 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
1343 "tensorflow.NameAttrList.name");
1344 target = stream->WriteStringMaybeAliased(
1345 1, this->_internal_name(), target);
1346 }
1347
1348 // map<string, .tensorflow.AttrValue> attr = 2;
1349 if (!this->_internal_attr().empty()) {
1350 using MapType = ::_pb::Map<std::string, ::tensorflow::AttrValue>;
1351 using WireHelper = NameAttrList_AttrEntry_DoNotUse::Funcs;
1352 const auto& map_field = this->_internal_attr();
1353 auto check_utf8 = [](const MapType::value_type& entry) {
1354 (void)entry;
1355 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
1356 entry.first.data(), static_cast<int>(entry.first.length()),
1357 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
1358 "tensorflow.NameAttrList.AttrEntry.key");
1359 };
1360
1361 if (stream->IsSerializationDeterministic() && map_field.size() > 1) {
1362 for (const auto& entry : ::_pbi::MapSorterPtr<MapType>(map_field)) {
1363 target = WireHelper::InternalSerialize(2, entry.first, entry.second, target, stream);
1364 check_utf8(entry);
1365 }
1366 } else {
1367 for (const auto& entry : map_field) {
1368 target = WireHelper::InternalSerialize(2, entry.first, entry.second, target, stream);
1369 check_utf8(entry);
1370 }
1371 }
1372 }
1373
1374 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
1375 target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
1376 static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
1377 }
1378 // @@protoc_insertion_point(serialize_to_array_end:tensorflow.NameAttrList)
1379 return target;
1380 }
1381
ByteSizeLong() const1382 size_t NameAttrList::ByteSizeLong() const {
1383 // @@protoc_insertion_point(message_byte_size_start:tensorflow.NameAttrList)
1384 size_t total_size = 0;
1385
1386 ::uint32_t cached_has_bits = 0;
1387 // Prevent compiler warnings about cached_has_bits being unused
1388 (void) cached_has_bits;
1389
1390 // map<string, .tensorflow.AttrValue> attr = 2;
1391 total_size += 1 *
1392 ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(this->_internal_attr_size());
1393 for (::PROTOBUF_NAMESPACE_ID::Map< std::string, ::tensorflow::AttrValue >::const_iterator
1394 it = this->_internal_attr().begin();
1395 it != this->_internal_attr().end(); ++it) {
1396 total_size += NameAttrList_AttrEntry_DoNotUse::Funcs::ByteSizeLong(it->first, it->second);
1397 }
1398
1399 // string name = 1;
1400 if (!this->_internal_name().empty()) {
1401 total_size += 1 +
1402 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
1403 this->_internal_name());
1404 }
1405
1406 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
1407 total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
1408 }
1409 int cached_size = ::_pbi::ToCachedSize(total_size);
1410 SetCachedSize(cached_size);
1411 return total_size;
1412 }
1413
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)1414 void NameAttrList::CheckTypeAndMergeFrom(
1415 const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
1416 MergeFrom(*::_pbi::DownCast<const NameAttrList*>(
1417 &from));
1418 }
1419
MergeFrom(const NameAttrList & from)1420 void NameAttrList::MergeFrom(const NameAttrList& from) {
1421 NameAttrList* const _this = this;
1422 // @@protoc_insertion_point(class_specific_merge_from_start:tensorflow.NameAttrList)
1423 GOOGLE_DCHECK_NE(&from, _this);
1424 ::uint32_t cached_has_bits = 0;
1425 (void) cached_has_bits;
1426
1427 _this->_impl_.attr_.MergeFrom(from._impl_.attr_);
1428 if (!from._internal_name().empty()) {
1429 _this->_internal_set_name(from._internal_name());
1430 }
1431 _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
1432 }
1433
CopyFrom(const NameAttrList & from)1434 void NameAttrList::CopyFrom(const NameAttrList& from) {
1435 // @@protoc_insertion_point(class_specific_copy_from_start:tensorflow.NameAttrList)
1436 if (&from == this) return;
1437 Clear();
1438 MergeFrom(from);
1439 }
1440
IsInitialized() const1441 bool NameAttrList::IsInitialized() const {
1442 return true;
1443 }
1444
InternalSwap(NameAttrList * other)1445 void NameAttrList::InternalSwap(NameAttrList* other) {
1446 using std::swap;
1447 auto* lhs_arena = GetArenaForAllocation();
1448 auto* rhs_arena = other->GetArenaForAllocation();
1449 _internal_metadata_.InternalSwap(&other->_internal_metadata_);
1450 _impl_.attr_.InternalSwap(&other->_impl_.attr_);
1451 ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
1452 &_impl_.name_, lhs_arena,
1453 &other->_impl_.name_, rhs_arena
1454 );
1455 }
1456
GetTypeName() const1457 std::string NameAttrList::GetTypeName() const {
1458 return "tensorflow.NameAttrList";
1459 }
1460
1461
1462 // @@protoc_insertion_point(namespace_scope)
1463 } // namespace tensorflow
1464 PROTOBUF_NAMESPACE_OPEN
1465 template<> PROTOBUF_NOINLINE ::tensorflow::AttrValue_ListValue*
CreateMaybeMessage(Arena * arena)1466 Arena::CreateMaybeMessage< ::tensorflow::AttrValue_ListValue >(Arena* arena) {
1467 return Arena::CreateMessageInternal< ::tensorflow::AttrValue_ListValue >(arena);
1468 }
1469 template<> PROTOBUF_NOINLINE ::tensorflow::AttrValue*
CreateMaybeMessage(Arena * arena)1470 Arena::CreateMaybeMessage< ::tensorflow::AttrValue >(Arena* arena) {
1471 return Arena::CreateMessageInternal< ::tensorflow::AttrValue >(arena);
1472 }
1473 template<> PROTOBUF_NOINLINE ::tensorflow::NameAttrList_AttrEntry_DoNotUse*
CreateMaybeMessage(Arena * arena)1474 Arena::CreateMaybeMessage< ::tensorflow::NameAttrList_AttrEntry_DoNotUse >(Arena* arena) {
1475 return Arena::CreateMessageInternal< ::tensorflow::NameAttrList_AttrEntry_DoNotUse >(arena);
1476 }
1477 template<> PROTOBUF_NOINLINE ::tensorflow::NameAttrList*
CreateMaybeMessage(Arena * arena)1478 Arena::CreateMaybeMessage< ::tensorflow::NameAttrList >(Arena* arena) {
1479 return Arena::CreateMessageInternal< ::tensorflow::NameAttrList >(arena);
1480 }
1481 PROTOBUF_NAMESPACE_CLOSE
1482
1483 // @@protoc_insertion_point(global_scope)
1484 #include <google/protobuf/port_undef.inc>
1485