1 // Generated by the protocol buffer compiler. DO NOT EDIT!
2 // source: tensorflow/core/example/example.proto
3
4 #include "tensorflow/core/example/example.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 {
Example(::_pbi::ConstantInitialized)22 PROTOBUF_CONSTEXPR Example::Example(
23 ::_pbi::ConstantInitialized): _impl_{
24 /*decltype(_impl_.features_)*/nullptr
25 , /*decltype(_impl_._cached_size_)*/{}} {}
26 struct ExampleDefaultTypeInternal {
ExampleDefaultTypeInternaltensorflow::ExampleDefaultTypeInternal27 PROTOBUF_CONSTEXPR ExampleDefaultTypeInternal()
28 : _instance(::_pbi::ConstantInitialized{}) {}
~ExampleDefaultTypeInternaltensorflow::ExampleDefaultTypeInternal29 ~ExampleDefaultTypeInternal() {}
30 union { // NOLINT(misc-non-private-member-variables-in-classes)
31 Example _instance;
32 };
33 };
34 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ExampleDefaultTypeInternal _Example_default_instance_;
SequenceExample(::_pbi::ConstantInitialized)35 PROTOBUF_CONSTEXPR SequenceExample::SequenceExample(
36 ::_pbi::ConstantInitialized): _impl_{
37 /*decltype(_impl_.context_)*/nullptr
38 , /*decltype(_impl_.feature_lists_)*/nullptr
39 , /*decltype(_impl_._cached_size_)*/{}} {}
40 struct SequenceExampleDefaultTypeInternal {
SequenceExampleDefaultTypeInternaltensorflow::SequenceExampleDefaultTypeInternal41 PROTOBUF_CONSTEXPR SequenceExampleDefaultTypeInternal()
42 : _instance(::_pbi::ConstantInitialized{}) {}
~SequenceExampleDefaultTypeInternaltensorflow::SequenceExampleDefaultTypeInternal43 ~SequenceExampleDefaultTypeInternal() {}
44 union { // NOLINT(misc-non-private-member-variables-in-classes)
45 SequenceExample _instance;
46 };
47 };
48 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 SequenceExampleDefaultTypeInternal _SequenceExample_default_instance_;
49 } // namespace tensorflow
50 namespace tensorflow {
51
52 // ===================================================================
53
54 class Example::_Internal {
55 public:
56 static const ::tensorflow::Features& features(const Example* msg);
57 };
58
59 const ::tensorflow::Features&
features(const Example * msg)60 Example::_Internal::features(const Example* msg) {
61 return *msg->_impl_.features_;
62 }
clear_features()63 void Example::clear_features() {
64 if (GetArenaForAllocation() == nullptr && _impl_.features_ != nullptr) {
65 delete _impl_.features_;
66 }
67 _impl_.features_ = nullptr;
68 }
Example(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)69 Example::Example(::PROTOBUF_NAMESPACE_ID::Arena* arena,
70 bool is_message_owned)
71 : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
72 SharedCtor(arena, is_message_owned);
73 // @@protoc_insertion_point(arena_constructor:tensorflow.Example)
74 }
Example(const Example & from)75 Example::Example(const Example& from)
76 : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
77 Example* const _this = this; (void)_this;
78 new (&_impl_) Impl_{
79 decltype(_impl_.features_){nullptr}
80 , /*decltype(_impl_._cached_size_)*/{}};
81
82 _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
83 if (from._internal_has_features()) {
84 _this->_impl_.features_ = new ::tensorflow::Features(*from._impl_.features_);
85 }
86 // @@protoc_insertion_point(copy_constructor:tensorflow.Example)
87 }
88
SharedCtor(::_pb::Arena * arena,bool is_message_owned)89 inline void Example::SharedCtor(
90 ::_pb::Arena* arena, bool is_message_owned) {
91 (void)arena;
92 (void)is_message_owned;
93 new (&_impl_) Impl_{
94 decltype(_impl_.features_){nullptr}
95 , /*decltype(_impl_._cached_size_)*/{}
96 };
97 }
98
~Example()99 Example::~Example() {
100 // @@protoc_insertion_point(destructor:tensorflow.Example)
101 if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
102 (void)arena;
103 return;
104 }
105 SharedDtor();
106 }
107
SharedDtor()108 inline void Example::SharedDtor() {
109 GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
110 if (this != internal_default_instance()) delete _impl_.features_;
111 }
112
SetCachedSize(int size) const113 void Example::SetCachedSize(int size) const {
114 _impl_._cached_size_.Set(size);
115 }
116
Clear()117 void Example::Clear() {
118 // @@protoc_insertion_point(message_clear_start:tensorflow.Example)
119 ::uint32_t cached_has_bits = 0;
120 // Prevent compiler warnings about cached_has_bits being unused
121 (void) cached_has_bits;
122
123 if (GetArenaForAllocation() == nullptr && _impl_.features_ != nullptr) {
124 delete _impl_.features_;
125 }
126 _impl_.features_ = nullptr;
127 _internal_metadata_.Clear<std::string>();
128 }
129
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)130 const char* Example::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
131 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
132 while (!ctx->Done(&ptr)) {
133 ::uint32_t tag;
134 ptr = ::_pbi::ReadTag(ptr, &tag);
135 switch (tag >> 3) {
136 // .tensorflow.Features features = 1;
137 case 1:
138 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 10)) {
139 ptr = ctx->ParseMessage(_internal_mutable_features(), ptr);
140 CHK_(ptr);
141 } else {
142 goto handle_unusual;
143 }
144 continue;
145 default:
146 goto handle_unusual;
147 } // switch
148 handle_unusual:
149 if ((tag == 0) || ((tag & 7) == 4)) {
150 CHK_(ptr);
151 ctx->SetLastTag(tag);
152 goto message_done;
153 }
154 ptr = UnknownFieldParse(
155 tag,
156 _internal_metadata_.mutable_unknown_fields<std::string>(),
157 ptr, ctx);
158 CHK_(ptr != nullptr);
159 } // while
160 message_done:
161 return ptr;
162 failure:
163 ptr = nullptr;
164 goto message_done;
165 #undef CHK_
166 }
167
_InternalSerialize(::uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const168 ::uint8_t* Example::_InternalSerialize(
169 ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
170 // @@protoc_insertion_point(serialize_to_array_start:tensorflow.Example)
171 ::uint32_t cached_has_bits = 0;
172 (void) cached_has_bits;
173
174 // .tensorflow.Features features = 1;
175 if (this->_internal_has_features()) {
176 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
177 InternalWriteMessage(1, _Internal::features(this),
178 _Internal::features(this).GetCachedSize(), target, stream);
179 }
180
181 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
182 target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
183 static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
184 }
185 // @@protoc_insertion_point(serialize_to_array_end:tensorflow.Example)
186 return target;
187 }
188
ByteSizeLong() const189 size_t Example::ByteSizeLong() const {
190 // @@protoc_insertion_point(message_byte_size_start:tensorflow.Example)
191 size_t total_size = 0;
192
193 ::uint32_t cached_has_bits = 0;
194 // Prevent compiler warnings about cached_has_bits being unused
195 (void) cached_has_bits;
196
197 // .tensorflow.Features features = 1;
198 if (this->_internal_has_features()) {
199 total_size += 1 +
200 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
201 *_impl_.features_);
202 }
203
204 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
205 total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
206 }
207 int cached_size = ::_pbi::ToCachedSize(total_size);
208 SetCachedSize(cached_size);
209 return total_size;
210 }
211
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)212 void Example::CheckTypeAndMergeFrom(
213 const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
214 MergeFrom(*::_pbi::DownCast<const Example*>(
215 &from));
216 }
217
MergeFrom(const Example & from)218 void Example::MergeFrom(const Example& from) {
219 Example* const _this = this;
220 // @@protoc_insertion_point(class_specific_merge_from_start:tensorflow.Example)
221 GOOGLE_DCHECK_NE(&from, _this);
222 ::uint32_t cached_has_bits = 0;
223 (void) cached_has_bits;
224
225 if (from._internal_has_features()) {
226 _this->_internal_mutable_features()->::tensorflow::Features::MergeFrom(
227 from._internal_features());
228 }
229 _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
230 }
231
CopyFrom(const Example & from)232 void Example::CopyFrom(const Example& from) {
233 // @@protoc_insertion_point(class_specific_copy_from_start:tensorflow.Example)
234 if (&from == this) return;
235 Clear();
236 MergeFrom(from);
237 }
238
IsInitialized() const239 bool Example::IsInitialized() const {
240 return true;
241 }
242
InternalSwap(Example * other)243 void Example::InternalSwap(Example* other) {
244 using std::swap;
245 _internal_metadata_.InternalSwap(&other->_internal_metadata_);
246 swap(_impl_.features_, other->_impl_.features_);
247 }
248
GetTypeName() const249 std::string Example::GetTypeName() const {
250 return "tensorflow.Example";
251 }
252
253
254 // ===================================================================
255
256 class SequenceExample::_Internal {
257 public:
258 static const ::tensorflow::Features& context(const SequenceExample* msg);
259 static const ::tensorflow::FeatureLists& feature_lists(const SequenceExample* msg);
260 };
261
262 const ::tensorflow::Features&
context(const SequenceExample * msg)263 SequenceExample::_Internal::context(const SequenceExample* msg) {
264 return *msg->_impl_.context_;
265 }
266 const ::tensorflow::FeatureLists&
feature_lists(const SequenceExample * msg)267 SequenceExample::_Internal::feature_lists(const SequenceExample* msg) {
268 return *msg->_impl_.feature_lists_;
269 }
clear_context()270 void SequenceExample::clear_context() {
271 if (GetArenaForAllocation() == nullptr && _impl_.context_ != nullptr) {
272 delete _impl_.context_;
273 }
274 _impl_.context_ = nullptr;
275 }
clear_feature_lists()276 void SequenceExample::clear_feature_lists() {
277 if (GetArenaForAllocation() == nullptr && _impl_.feature_lists_ != nullptr) {
278 delete _impl_.feature_lists_;
279 }
280 _impl_.feature_lists_ = nullptr;
281 }
SequenceExample(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)282 SequenceExample::SequenceExample(::PROTOBUF_NAMESPACE_ID::Arena* arena,
283 bool is_message_owned)
284 : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
285 SharedCtor(arena, is_message_owned);
286 // @@protoc_insertion_point(arena_constructor:tensorflow.SequenceExample)
287 }
SequenceExample(const SequenceExample & from)288 SequenceExample::SequenceExample(const SequenceExample& from)
289 : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
290 SequenceExample* const _this = this; (void)_this;
291 new (&_impl_) Impl_{
292 decltype(_impl_.context_){nullptr}
293 , decltype(_impl_.feature_lists_){nullptr}
294 , /*decltype(_impl_._cached_size_)*/{}};
295
296 _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
297 if (from._internal_has_context()) {
298 _this->_impl_.context_ = new ::tensorflow::Features(*from._impl_.context_);
299 }
300 if (from._internal_has_feature_lists()) {
301 _this->_impl_.feature_lists_ = new ::tensorflow::FeatureLists(*from._impl_.feature_lists_);
302 }
303 // @@protoc_insertion_point(copy_constructor:tensorflow.SequenceExample)
304 }
305
SharedCtor(::_pb::Arena * arena,bool is_message_owned)306 inline void SequenceExample::SharedCtor(
307 ::_pb::Arena* arena, bool is_message_owned) {
308 (void)arena;
309 (void)is_message_owned;
310 new (&_impl_) Impl_{
311 decltype(_impl_.context_){nullptr}
312 , decltype(_impl_.feature_lists_){nullptr}
313 , /*decltype(_impl_._cached_size_)*/{}
314 };
315 }
316
~SequenceExample()317 SequenceExample::~SequenceExample() {
318 // @@protoc_insertion_point(destructor:tensorflow.SequenceExample)
319 if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
320 (void)arena;
321 return;
322 }
323 SharedDtor();
324 }
325
SharedDtor()326 inline void SequenceExample::SharedDtor() {
327 GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
328 if (this != internal_default_instance()) delete _impl_.context_;
329 if (this != internal_default_instance()) delete _impl_.feature_lists_;
330 }
331
SetCachedSize(int size) const332 void SequenceExample::SetCachedSize(int size) const {
333 _impl_._cached_size_.Set(size);
334 }
335
Clear()336 void SequenceExample::Clear() {
337 // @@protoc_insertion_point(message_clear_start:tensorflow.SequenceExample)
338 ::uint32_t cached_has_bits = 0;
339 // Prevent compiler warnings about cached_has_bits being unused
340 (void) cached_has_bits;
341
342 if (GetArenaForAllocation() == nullptr && _impl_.context_ != nullptr) {
343 delete _impl_.context_;
344 }
345 _impl_.context_ = nullptr;
346 if (GetArenaForAllocation() == nullptr && _impl_.feature_lists_ != nullptr) {
347 delete _impl_.feature_lists_;
348 }
349 _impl_.feature_lists_ = nullptr;
350 _internal_metadata_.Clear<std::string>();
351 }
352
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)353 const char* SequenceExample::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
354 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
355 while (!ctx->Done(&ptr)) {
356 ::uint32_t tag;
357 ptr = ::_pbi::ReadTag(ptr, &tag);
358 switch (tag >> 3) {
359 // .tensorflow.Features context = 1;
360 case 1:
361 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 10)) {
362 ptr = ctx->ParseMessage(_internal_mutable_context(), ptr);
363 CHK_(ptr);
364 } else {
365 goto handle_unusual;
366 }
367 continue;
368 // .tensorflow.FeatureLists feature_lists = 2;
369 case 2:
370 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 18)) {
371 ptr = ctx->ParseMessage(_internal_mutable_feature_lists(), ptr);
372 CHK_(ptr);
373 } else {
374 goto handle_unusual;
375 }
376 continue;
377 default:
378 goto handle_unusual;
379 } // switch
380 handle_unusual:
381 if ((tag == 0) || ((tag & 7) == 4)) {
382 CHK_(ptr);
383 ctx->SetLastTag(tag);
384 goto message_done;
385 }
386 ptr = UnknownFieldParse(
387 tag,
388 _internal_metadata_.mutable_unknown_fields<std::string>(),
389 ptr, ctx);
390 CHK_(ptr != nullptr);
391 } // while
392 message_done:
393 return ptr;
394 failure:
395 ptr = nullptr;
396 goto message_done;
397 #undef CHK_
398 }
399
_InternalSerialize(::uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const400 ::uint8_t* SequenceExample::_InternalSerialize(
401 ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
402 // @@protoc_insertion_point(serialize_to_array_start:tensorflow.SequenceExample)
403 ::uint32_t cached_has_bits = 0;
404 (void) cached_has_bits;
405
406 // .tensorflow.Features context = 1;
407 if (this->_internal_has_context()) {
408 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
409 InternalWriteMessage(1, _Internal::context(this),
410 _Internal::context(this).GetCachedSize(), target, stream);
411 }
412
413 // .tensorflow.FeatureLists feature_lists = 2;
414 if (this->_internal_has_feature_lists()) {
415 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
416 InternalWriteMessage(2, _Internal::feature_lists(this),
417 _Internal::feature_lists(this).GetCachedSize(), target, stream);
418 }
419
420 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
421 target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
422 static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
423 }
424 // @@protoc_insertion_point(serialize_to_array_end:tensorflow.SequenceExample)
425 return target;
426 }
427
ByteSizeLong() const428 size_t SequenceExample::ByteSizeLong() const {
429 // @@protoc_insertion_point(message_byte_size_start:tensorflow.SequenceExample)
430 size_t total_size = 0;
431
432 ::uint32_t cached_has_bits = 0;
433 // Prevent compiler warnings about cached_has_bits being unused
434 (void) cached_has_bits;
435
436 // .tensorflow.Features context = 1;
437 if (this->_internal_has_context()) {
438 total_size += 1 +
439 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
440 *_impl_.context_);
441 }
442
443 // .tensorflow.FeatureLists feature_lists = 2;
444 if (this->_internal_has_feature_lists()) {
445 total_size += 1 +
446 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
447 *_impl_.feature_lists_);
448 }
449
450 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
451 total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
452 }
453 int cached_size = ::_pbi::ToCachedSize(total_size);
454 SetCachedSize(cached_size);
455 return total_size;
456 }
457
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)458 void SequenceExample::CheckTypeAndMergeFrom(
459 const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
460 MergeFrom(*::_pbi::DownCast<const SequenceExample*>(
461 &from));
462 }
463
MergeFrom(const SequenceExample & from)464 void SequenceExample::MergeFrom(const SequenceExample& from) {
465 SequenceExample* const _this = this;
466 // @@protoc_insertion_point(class_specific_merge_from_start:tensorflow.SequenceExample)
467 GOOGLE_DCHECK_NE(&from, _this);
468 ::uint32_t cached_has_bits = 0;
469 (void) cached_has_bits;
470
471 if (from._internal_has_context()) {
472 _this->_internal_mutable_context()->::tensorflow::Features::MergeFrom(
473 from._internal_context());
474 }
475 if (from._internal_has_feature_lists()) {
476 _this->_internal_mutable_feature_lists()->::tensorflow::FeatureLists::MergeFrom(
477 from._internal_feature_lists());
478 }
479 _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
480 }
481
CopyFrom(const SequenceExample & from)482 void SequenceExample::CopyFrom(const SequenceExample& from) {
483 // @@protoc_insertion_point(class_specific_copy_from_start:tensorflow.SequenceExample)
484 if (&from == this) return;
485 Clear();
486 MergeFrom(from);
487 }
488
IsInitialized() const489 bool SequenceExample::IsInitialized() const {
490 return true;
491 }
492
InternalSwap(SequenceExample * other)493 void SequenceExample::InternalSwap(SequenceExample* other) {
494 using std::swap;
495 _internal_metadata_.InternalSwap(&other->_internal_metadata_);
496 ::PROTOBUF_NAMESPACE_ID::internal::memswap<
497 PROTOBUF_FIELD_OFFSET(SequenceExample, _impl_.feature_lists_)
498 + sizeof(SequenceExample::_impl_.feature_lists_) // NOLINT
499 - PROTOBUF_FIELD_OFFSET(SequenceExample, _impl_.context_)>(
500 reinterpret_cast<char*>(&_impl_.context_),
501 reinterpret_cast<char*>(&other->_impl_.context_));
502 }
503
GetTypeName() const504 std::string SequenceExample::GetTypeName() const {
505 return "tensorflow.SequenceExample";
506 }
507
508
509 // @@protoc_insertion_point(namespace_scope)
510 } // namespace tensorflow
511 PROTOBUF_NAMESPACE_OPEN
512 template<> PROTOBUF_NOINLINE ::tensorflow::Example*
CreateMaybeMessage(Arena * arena)513 Arena::CreateMaybeMessage< ::tensorflow::Example >(Arena* arena) {
514 return Arena::CreateMessageInternal< ::tensorflow::Example >(arena);
515 }
516 template<> PROTOBUF_NOINLINE ::tensorflow::SequenceExample*
CreateMaybeMessage(Arena * arena)517 Arena::CreateMaybeMessage< ::tensorflow::SequenceExample >(Arena* arena) {
518 return Arena::CreateMessageInternal< ::tensorflow::SequenceExample >(arena);
519 }
520 PROTOBUF_NAMESPACE_CLOSE
521
522 // @@protoc_insertion_point(global_scope)
523 #include <google/protobuf/port_undef.inc>
524