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
8#include <google/protobuf/stubs/common.h>
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/descriptor.h>
13#include <google/protobuf/generated_message_reflection.h>
14#include <google/protobuf/reflection_ops.h>
15#include <google/protobuf/wire_format.h>
16// @@protoc_insertion_point(includes)
17#include <google/protobuf/port_def.inc>
18extern PROTOBUF_INTERNAL_EXPORT_tensorflow_2fcore_2fexample_2ffeature_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_FeatureLists_tensorflow_2fcore_2fexample_2ffeature_2eproto;
19extern PROTOBUF_INTERNAL_EXPORT_tensorflow_2fcore_2fexample_2ffeature_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_Features_tensorflow_2fcore_2fexample_2ffeature_2eproto;
20namespace tensorflow {
21class ExampleDefaultTypeInternal {
22 public:
23 ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<Example> _instance;
24} _Example_default_instance_;
25class SequenceExampleDefaultTypeInternal {
26 public:
27 ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<SequenceExample> _instance;
28} _SequenceExample_default_instance_;
29} // namespace tensorflow
30static void InitDefaultsscc_info_Example_tensorflow_2fcore_2fexample_2fexample_2eproto() {
31 GOOGLE_PROTOBUF_VERIFY_VERSION;
32
33 {
34 void* ptr = &::tensorflow::_Example_default_instance_;
35 new (ptr) ::tensorflow::Example();
36 ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
37 }
38 ::tensorflow::Example::InitAsDefaultInstance();
39}
40
41::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_Example_tensorflow_2fcore_2fexample_2fexample_2eproto =
42 {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsscc_info_Example_tensorflow_2fcore_2fexample_2fexample_2eproto}, {
43 &scc_info_Features_tensorflow_2fcore_2fexample_2ffeature_2eproto.base,}};
44
45static void InitDefaultsscc_info_SequenceExample_tensorflow_2fcore_2fexample_2fexample_2eproto() {
46 GOOGLE_PROTOBUF_VERIFY_VERSION;
47
48 {
49 void* ptr = &::tensorflow::_SequenceExample_default_instance_;
50 new (ptr) ::tensorflow::SequenceExample();
51 ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
52 }
53 ::tensorflow::SequenceExample::InitAsDefaultInstance();
54}
55
56::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<2> scc_info_SequenceExample_tensorflow_2fcore_2fexample_2fexample_2eproto =
57 {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 2, InitDefaultsscc_info_SequenceExample_tensorflow_2fcore_2fexample_2fexample_2eproto}, {
58 &scc_info_Features_tensorflow_2fcore_2fexample_2ffeature_2eproto.base,
59 &scc_info_FeatureLists_tensorflow_2fcore_2fexample_2ffeature_2eproto.base,}};
60
61static ::PROTOBUF_NAMESPACE_ID::Metadata file_level_metadata_tensorflow_2fcore_2fexample_2fexample_2eproto[2];
62static constexpr ::PROTOBUF_NAMESPACE_ID::EnumDescriptor const** file_level_enum_descriptors_tensorflow_2fcore_2fexample_2fexample_2eproto = nullptr;
63static constexpr ::PROTOBUF_NAMESPACE_ID::ServiceDescriptor const** file_level_service_descriptors_tensorflow_2fcore_2fexample_2fexample_2eproto = nullptr;
64
65const ::PROTOBUF_NAMESPACE_ID::uint32 TableStruct_tensorflow_2fcore_2fexample_2fexample_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
66 ~0u, // no _has_bits_
67 PROTOBUF_FIELD_OFFSET(::tensorflow::Example, _internal_metadata_),
68 ~0u, // no _extensions_
69 ~0u, // no _oneof_case_
70 ~0u, // no _weak_field_map_
71 PROTOBUF_FIELD_OFFSET(::tensorflow::Example, features_),
72 ~0u, // no _has_bits_
73 PROTOBUF_FIELD_OFFSET(::tensorflow::SequenceExample, _internal_metadata_),
74 ~0u, // no _extensions_
75 ~0u, // no _oneof_case_
76 ~0u, // no _weak_field_map_
77 PROTOBUF_FIELD_OFFSET(::tensorflow::SequenceExample, context_),
78 PROTOBUF_FIELD_OFFSET(::tensorflow::SequenceExample, feature_lists_),
79};
80static const ::PROTOBUF_NAMESPACE_ID::internal::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
81 { 0, -1, sizeof(::tensorflow::Example)},
82 { 6, -1, sizeof(::tensorflow::SequenceExample)},
83};
84
85static ::PROTOBUF_NAMESPACE_ID::Message const * const file_default_instances[] = {
86 reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::tensorflow::_Example_default_instance_),
87 reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::tensorflow::_SequenceExample_default_instance_),
88};
89
90const char descriptor_table_protodef_tensorflow_2fcore_2fexample_2fexample_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) =
91 "\n%tensorflow/core/example/example.proto\022"
92 "\ntensorflow\032%tensorflow/core/example/fea"
93 "ture.proto\"1\n\007Example\022&\n\010features\030\001 \001(\0132"
94 "\024.tensorflow.Features\"i\n\017SequenceExample"
95 "\022%\n\007context\030\001 \001(\0132\024.tensorflow.Features\022"
96 "/\n\rfeature_lists\030\002 \001(\0132\030.tensorflow.Feat"
97 "ureListsB\201\001\n\026org.tensorflow.exampleB\rExa"
98 "mpleProtosP\001ZSgithub.com/tensorflow/tens"
99 "orflow/tensorflow/go/core/example/exampl"
100 "e_protos_go_proto\370\001\001b\006proto3"
101 ;
102static const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable*const descriptor_table_tensorflow_2fcore_2fexample_2fexample_2eproto_deps[1] = {
103 &::descriptor_table_tensorflow_2fcore_2fexample_2ffeature_2eproto,
104};
105static ::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase*const descriptor_table_tensorflow_2fcore_2fexample_2fexample_2eproto_sccs[2] = {
106 &scc_info_Example_tensorflow_2fcore_2fexample_2fexample_2eproto.base,
107 &scc_info_SequenceExample_tensorflow_2fcore_2fexample_2fexample_2eproto.base,
108};
109static ::PROTOBUF_NAMESPACE_ID::internal::once_flag descriptor_table_tensorflow_2fcore_2fexample_2fexample_2eproto_once;
110static bool descriptor_table_tensorflow_2fcore_2fexample_2fexample_2eproto_initialized = false;
111const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_tensorflow_2fcore_2fexample_2fexample_2eproto = {
112 &descriptor_table_tensorflow_2fcore_2fexample_2fexample_2eproto_initialized, descriptor_table_protodef_tensorflow_2fcore_2fexample_2fexample_2eproto, "tensorflow/core/example/example.proto", 388,
113 &descriptor_table_tensorflow_2fcore_2fexample_2fexample_2eproto_once, descriptor_table_tensorflow_2fcore_2fexample_2fexample_2eproto_sccs, descriptor_table_tensorflow_2fcore_2fexample_2fexample_2eproto_deps, 2, 1,
114 schemas, file_default_instances, TableStruct_tensorflow_2fcore_2fexample_2fexample_2eproto::offsets,
115 file_level_metadata_tensorflow_2fcore_2fexample_2fexample_2eproto, 2, file_level_enum_descriptors_tensorflow_2fcore_2fexample_2fexample_2eproto, file_level_service_descriptors_tensorflow_2fcore_2fexample_2fexample_2eproto,
116};
117
118// Force running AddDescriptors() at dynamic initialization time.
119static bool dynamic_init_dummy_tensorflow_2fcore_2fexample_2fexample_2eproto = ( ::PROTOBUF_NAMESPACE_ID::internal::AddDescriptors(&descriptor_table_tensorflow_2fcore_2fexample_2fexample_2eproto), true);
120namespace tensorflow {
121
122// ===================================================================
123
124void Example::InitAsDefaultInstance() {
125 ::tensorflow::_Example_default_instance_._instance.get_mutable()->features_ = const_cast< ::tensorflow::Features*>(
126 ::tensorflow::Features::internal_default_instance());
127}
128class Example::_Internal {
129 public:
130 static const ::tensorflow::Features& features(const Example* msg);
131};
132
133const ::tensorflow::Features&
134Example::_Internal::features(const Example* msg) {
135 return *msg->features_;
136}
137void Example::unsafe_arena_set_allocated_features(
138 ::tensorflow::Features* features) {
139 if (GetArenaNoVirtual() == nullptr) {
140 delete features_;
141 }
142 features_ = features;
143 if (features) {
144
145 } else {
146
147 }
148 // @@protoc_insertion_point(field_unsafe_arena_set_allocated:tensorflow.Example.features)
149}
150void Example::clear_features() {
151 if (GetArenaNoVirtual() == nullptr && features_ != nullptr) {
152 delete features_;
153 }
154 features_ = nullptr;
155}
156Example::Example()
157 : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
158 SharedCtor();
159 // @@protoc_insertion_point(constructor:tensorflow.Example)
160}
161Example::Example(::PROTOBUF_NAMESPACE_ID::Arena* arena)
162 : ::PROTOBUF_NAMESPACE_ID::Message(),
163 _internal_metadata_(arena) {
164 SharedCtor();
165 RegisterArenaDtor(arena);
166 // @@protoc_insertion_point(arena_constructor:tensorflow.Example)
167}
168Example::Example(const Example& from)
169 : ::PROTOBUF_NAMESPACE_ID::Message(),
170 _internal_metadata_(nullptr) {
171 _internal_metadata_.MergeFrom(from._internal_metadata_);
172 if (from.has_features()) {
173 features_ = new ::tensorflow::Features(*from.features_);
174 } else {
175 features_ = nullptr;
176 }
177 // @@protoc_insertion_point(copy_constructor:tensorflow.Example)
178}
179
180void Example::SharedCtor() {
181 ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_Example_tensorflow_2fcore_2fexample_2fexample_2eproto.base);
182 features_ = nullptr;
183}
184
185Example::~Example() {
186 // @@protoc_insertion_point(destructor:tensorflow.Example)
187 SharedDtor();
188}
189
190void Example::SharedDtor() {
191 GOOGLE_DCHECK(GetArenaNoVirtual() == nullptr);
192 if (this != internal_default_instance()) delete features_;
193}
194
195void Example::ArenaDtor(void* object) {
196 Example* _this = reinterpret_cast< Example* >(object);
197 (void)_this;
198}
199void Example::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
200}
201void Example::SetCachedSize(int size) const {
202 _cached_size_.Set(size);
203}
204const Example& Example::default_instance() {
205 ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_Example_tensorflow_2fcore_2fexample_2fexample_2eproto.base);
206 return *internal_default_instance();
207}
208
209
210void Example::Clear() {
211// @@protoc_insertion_point(message_clear_start:tensorflow.Example)
212 ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
213 // Prevent compiler warnings about cached_has_bits being unused
214 (void) cached_has_bits;
215
216 if (GetArenaNoVirtual() == nullptr && features_ != nullptr) {
217 delete features_;
218 }
219 features_ = nullptr;
220 _internal_metadata_.Clear();
221}
222
223#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
224const char* Example::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
225#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
226 ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArenaNoVirtual(); (void)arena;
227 while (!ctx->Done(&ptr)) {
228 ::PROTOBUF_NAMESPACE_ID::uint32 tag;
229 ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
230 CHK_(ptr);
231 switch (tag >> 3) {
232 // .tensorflow.Features features = 1;
233 case 1:
234 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) {
235 ptr = ctx->ParseMessage(mutable_features(), ptr);
236 CHK_(ptr);
237 } else goto handle_unusual;
238 continue;
239 default: {
240 handle_unusual:
241 if ((tag & 7) == 4 || tag == 0) {
242 ctx->SetLastTag(tag);
243 goto success;
244 }
245 ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
246 CHK_(ptr != nullptr);
247 continue;
248 }
249 } // switch
250 } // while
251success:
252 return ptr;
253failure:
254 ptr = nullptr;
255 goto success;
256#undef CHK_
257}
258#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
259bool Example::MergePartialFromCodedStream(
260 ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) {
261#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure
262 ::PROTOBUF_NAMESPACE_ID::uint32 tag;
263 // @@protoc_insertion_point(parse_start:tensorflow.Example)
264 for (;;) {
265 ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
266 tag = p.first;
267 if (!p.second) goto handle_unusual;
268 switch (::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::GetTagFieldNumber(tag)) {
269 // .tensorflow.Features features = 1;
270 case 1: {
271 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (10 & 0xFF)) {
272 DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage(
273 input, mutable_features()));
274 } else {
275 goto handle_unusual;
276 }
277 break;
278 }
279
280 default: {
281 handle_unusual:
282 if (tag == 0) {
283 goto success;
284 }
285 DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SkipField(
286 input, tag, _internal_metadata_.mutable_unknown_fields()));
287 break;
288 }
289 }
290 }
291success:
292 // @@protoc_insertion_point(parse_success:tensorflow.Example)
293 return true;
294failure:
295 // @@protoc_insertion_point(parse_failure:tensorflow.Example)
296 return false;
297#undef DO_
298}
299#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
300
301void Example::SerializeWithCachedSizes(
302 ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const {
303 // @@protoc_insertion_point(serialize_start:tensorflow.Example)
304 ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
305 (void) cached_has_bits;
306
307 // .tensorflow.Features features = 1;
308 if (this->has_features()) {
309 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray(
310 1, _Internal::features(this), output);
311 }
312
313 if (_internal_metadata_.have_unknown_fields()) {
314 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields(
315 _internal_metadata_.unknown_fields(), output);
316 }
317 // @@protoc_insertion_point(serialize_end:tensorflow.Example)
318}
319
320::PROTOBUF_NAMESPACE_ID::uint8* Example::InternalSerializeWithCachedSizesToArray(
321 ::PROTOBUF_NAMESPACE_ID::uint8* target) const {
322 // @@protoc_insertion_point(serialize_to_array_start:tensorflow.Example)
323 ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
324 (void) cached_has_bits;
325
326 // .tensorflow.Features features = 1;
327 if (this->has_features()) {
328 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
329 InternalWriteMessageToArray(
330 1, _Internal::features(this), target);
331 }
332
333 if (_internal_metadata_.have_unknown_fields()) {
334 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray(
335 _internal_metadata_.unknown_fields(), target);
336 }
337 // @@protoc_insertion_point(serialize_to_array_end:tensorflow.Example)
338 return target;
339}
340
341size_t Example::ByteSizeLong() const {
342// @@protoc_insertion_point(message_byte_size_start:tensorflow.Example)
343 size_t total_size = 0;
344
345 if (_internal_metadata_.have_unknown_fields()) {
346 total_size +=
347 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::ComputeUnknownFieldsSize(
348 _internal_metadata_.unknown_fields());
349 }
350 ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
351 // Prevent compiler warnings about cached_has_bits being unused
352 (void) cached_has_bits;
353
354 // .tensorflow.Features features = 1;
355 if (this->has_features()) {
356 total_size += 1 +
357 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
358 *features_);
359 }
360
361 int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
362 SetCachedSize(cached_size);
363 return total_size;
364}
365
366void Example::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
367// @@protoc_insertion_point(generalized_merge_from_start:tensorflow.Example)
368 GOOGLE_DCHECK_NE(&from, this);
369 const Example* source =
370 ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<Example>(
371 &from);
372 if (source == nullptr) {
373 // @@protoc_insertion_point(generalized_merge_from_cast_fail:tensorflow.Example)
374 ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
375 } else {
376 // @@protoc_insertion_point(generalized_merge_from_cast_success:tensorflow.Example)
377 MergeFrom(*source);
378 }
379}
380
381void Example::MergeFrom(const Example& from) {
382// @@protoc_insertion_point(class_specific_merge_from_start:tensorflow.Example)
383 GOOGLE_DCHECK_NE(&from, this);
384 _internal_metadata_.MergeFrom(from._internal_metadata_);
385 ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
386 (void) cached_has_bits;
387
388 if (from.has_features()) {
389 mutable_features()->::tensorflow::Features::MergeFrom(from.features());
390 }
391}
392
393void Example::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
394// @@protoc_insertion_point(generalized_copy_from_start:tensorflow.Example)
395 if (&from == this) return;
396 Clear();
397 MergeFrom(from);
398}
399
400void Example::CopyFrom(const Example& from) {
401// @@protoc_insertion_point(class_specific_copy_from_start:tensorflow.Example)
402 if (&from == this) return;
403 Clear();
404 MergeFrom(from);
405}
406
407bool Example::IsInitialized() const {
408 return true;
409}
410
411void Example::InternalSwap(Example* other) {
412 using std::swap;
413 _internal_metadata_.Swap(&other->_internal_metadata_);
414 swap(features_, other->features_);
415}
416
417::PROTOBUF_NAMESPACE_ID::Metadata Example::GetMetadata() const {
418 return GetMetadataStatic();
419}
420
421
422// ===================================================================
423
424void SequenceExample::InitAsDefaultInstance() {
425 ::tensorflow::_SequenceExample_default_instance_._instance.get_mutable()->context_ = const_cast< ::tensorflow::Features*>(
426 ::tensorflow::Features::internal_default_instance());
427 ::tensorflow::_SequenceExample_default_instance_._instance.get_mutable()->feature_lists_ = const_cast< ::tensorflow::FeatureLists*>(
428 ::tensorflow::FeatureLists::internal_default_instance());
429}
430class SequenceExample::_Internal {
431 public:
432 static const ::tensorflow::Features& context(const SequenceExample* msg);
433 static const ::tensorflow::FeatureLists& feature_lists(const SequenceExample* msg);
434};
435
436const ::tensorflow::Features&
437SequenceExample::_Internal::context(const SequenceExample* msg) {
438 return *msg->context_;
439}
440const ::tensorflow::FeatureLists&
441SequenceExample::_Internal::feature_lists(const SequenceExample* msg) {
442 return *msg->feature_lists_;
443}
444void SequenceExample::unsafe_arena_set_allocated_context(
445 ::tensorflow::Features* context) {
446 if (GetArenaNoVirtual() == nullptr) {
447 delete context_;
448 }
449 context_ = context;
450 if (context) {
451
452 } else {
453
454 }
455 // @@protoc_insertion_point(field_unsafe_arena_set_allocated:tensorflow.SequenceExample.context)
456}
457void SequenceExample::clear_context() {
458 if (GetArenaNoVirtual() == nullptr && context_ != nullptr) {
459 delete context_;
460 }
461 context_ = nullptr;
462}
463void SequenceExample::unsafe_arena_set_allocated_feature_lists(
464 ::tensorflow::FeatureLists* feature_lists) {
465 if (GetArenaNoVirtual() == nullptr) {
466 delete feature_lists_;
467 }
468 feature_lists_ = feature_lists;
469 if (feature_lists) {
470
471 } else {
472
473 }
474 // @@protoc_insertion_point(field_unsafe_arena_set_allocated:tensorflow.SequenceExample.feature_lists)
475}
476void SequenceExample::clear_feature_lists() {
477 if (GetArenaNoVirtual() == nullptr && feature_lists_ != nullptr) {
478 delete feature_lists_;
479 }
480 feature_lists_ = nullptr;
481}
482SequenceExample::SequenceExample()
483 : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
484 SharedCtor();
485 // @@protoc_insertion_point(constructor:tensorflow.SequenceExample)
486}
487SequenceExample::SequenceExample(::PROTOBUF_NAMESPACE_ID::Arena* arena)
488 : ::PROTOBUF_NAMESPACE_ID::Message(),
489 _internal_metadata_(arena) {
490 SharedCtor();
491 RegisterArenaDtor(arena);
492 // @@protoc_insertion_point(arena_constructor:tensorflow.SequenceExample)
493}
494SequenceExample::SequenceExample(const SequenceExample& from)
495 : ::PROTOBUF_NAMESPACE_ID::Message(),
496 _internal_metadata_(nullptr) {
497 _internal_metadata_.MergeFrom(from._internal_metadata_);
498 if (from.has_context()) {
499 context_ = new ::tensorflow::Features(*from.context_);
500 } else {
501 context_ = nullptr;
502 }
503 if (from.has_feature_lists()) {
504 feature_lists_ = new ::tensorflow::FeatureLists(*from.feature_lists_);
505 } else {
506 feature_lists_ = nullptr;
507 }
508 // @@protoc_insertion_point(copy_constructor:tensorflow.SequenceExample)
509}
510
511void SequenceExample::SharedCtor() {
512 ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_SequenceExample_tensorflow_2fcore_2fexample_2fexample_2eproto.base);
513 ::memset(&context_, 0, static_cast<size_t>(
514 reinterpret_cast<char*>(&feature_lists_) -
515 reinterpret_cast<char*>(&context_)) + sizeof(feature_lists_));
516}
517
518SequenceExample::~SequenceExample() {
519 // @@protoc_insertion_point(destructor:tensorflow.SequenceExample)
520 SharedDtor();
521}
522
523void SequenceExample::SharedDtor() {
524 GOOGLE_DCHECK(GetArenaNoVirtual() == nullptr);
525 if (this != internal_default_instance()) delete context_;
526 if (this != internal_default_instance()) delete feature_lists_;
527}
528
529void SequenceExample::ArenaDtor(void* object) {
530 SequenceExample* _this = reinterpret_cast< SequenceExample* >(object);
531 (void)_this;
532}
533void SequenceExample::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
534}
535void SequenceExample::SetCachedSize(int size) const {
536 _cached_size_.Set(size);
537}
538const SequenceExample& SequenceExample::default_instance() {
539 ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_SequenceExample_tensorflow_2fcore_2fexample_2fexample_2eproto.base);
540 return *internal_default_instance();
541}
542
543
544void SequenceExample::Clear() {
545// @@protoc_insertion_point(message_clear_start:tensorflow.SequenceExample)
546 ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
547 // Prevent compiler warnings about cached_has_bits being unused
548 (void) cached_has_bits;
549
550 if (GetArenaNoVirtual() == nullptr && context_ != nullptr) {
551 delete context_;
552 }
553 context_ = nullptr;
554 if (GetArenaNoVirtual() == nullptr && feature_lists_ != nullptr) {
555 delete feature_lists_;
556 }
557 feature_lists_ = nullptr;
558 _internal_metadata_.Clear();
559}
560
561#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
562const char* SequenceExample::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
563#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
564 ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArenaNoVirtual(); (void)arena;
565 while (!ctx->Done(&ptr)) {
566 ::PROTOBUF_NAMESPACE_ID::uint32 tag;
567 ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
568 CHK_(ptr);
569 switch (tag >> 3) {
570 // .tensorflow.Features context = 1;
571 case 1:
572 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) {
573 ptr = ctx->ParseMessage(mutable_context(), ptr);
574 CHK_(ptr);
575 } else goto handle_unusual;
576 continue;
577 // .tensorflow.FeatureLists feature_lists = 2;
578 case 2:
579 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) {
580 ptr = ctx->ParseMessage(mutable_feature_lists(), ptr);
581 CHK_(ptr);
582 } else goto handle_unusual;
583 continue;
584 default: {
585 handle_unusual:
586 if ((tag & 7) == 4 || tag == 0) {
587 ctx->SetLastTag(tag);
588 goto success;
589 }
590 ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
591 CHK_(ptr != nullptr);
592 continue;
593 }
594 } // switch
595 } // while
596success:
597 return ptr;
598failure:
599 ptr = nullptr;
600 goto success;
601#undef CHK_
602}
603#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
604bool SequenceExample::MergePartialFromCodedStream(
605 ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) {
606#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure
607 ::PROTOBUF_NAMESPACE_ID::uint32 tag;
608 // @@protoc_insertion_point(parse_start:tensorflow.SequenceExample)
609 for (;;) {
610 ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
611 tag = p.first;
612 if (!p.second) goto handle_unusual;
613 switch (::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::GetTagFieldNumber(tag)) {
614 // .tensorflow.Features context = 1;
615 case 1: {
616 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (10 & 0xFF)) {
617 DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage(
618 input, mutable_context()));
619 } else {
620 goto handle_unusual;
621 }
622 break;
623 }
624
625 // .tensorflow.FeatureLists feature_lists = 2;
626 case 2: {
627 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (18 & 0xFF)) {
628 DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage(
629 input, mutable_feature_lists()));
630 } else {
631 goto handle_unusual;
632 }
633 break;
634 }
635
636 default: {
637 handle_unusual:
638 if (tag == 0) {
639 goto success;
640 }
641 DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SkipField(
642 input, tag, _internal_metadata_.mutable_unknown_fields()));
643 break;
644 }
645 }
646 }
647success:
648 // @@protoc_insertion_point(parse_success:tensorflow.SequenceExample)
649 return true;
650failure:
651 // @@protoc_insertion_point(parse_failure:tensorflow.SequenceExample)
652 return false;
653#undef DO_
654}
655#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
656
657void SequenceExample::SerializeWithCachedSizes(
658 ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const {
659 // @@protoc_insertion_point(serialize_start:tensorflow.SequenceExample)
660 ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
661 (void) cached_has_bits;
662
663 // .tensorflow.Features context = 1;
664 if (this->has_context()) {
665 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray(
666 1, _Internal::context(this), output);
667 }
668
669 // .tensorflow.FeatureLists feature_lists = 2;
670 if (this->has_feature_lists()) {
671 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray(
672 2, _Internal::feature_lists(this), output);
673 }
674
675 if (_internal_metadata_.have_unknown_fields()) {
676 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields(
677 _internal_metadata_.unknown_fields(), output);
678 }
679 // @@protoc_insertion_point(serialize_end:tensorflow.SequenceExample)
680}
681
682::PROTOBUF_NAMESPACE_ID::uint8* SequenceExample::InternalSerializeWithCachedSizesToArray(
683 ::PROTOBUF_NAMESPACE_ID::uint8* target) const {
684 // @@protoc_insertion_point(serialize_to_array_start:tensorflow.SequenceExample)
685 ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
686 (void) cached_has_bits;
687
688 // .tensorflow.Features context = 1;
689 if (this->has_context()) {
690 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
691 InternalWriteMessageToArray(
692 1, _Internal::context(this), target);
693 }
694
695 // .tensorflow.FeatureLists feature_lists = 2;
696 if (this->has_feature_lists()) {
697 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
698 InternalWriteMessageToArray(
699 2, _Internal::feature_lists(this), target);
700 }
701
702 if (_internal_metadata_.have_unknown_fields()) {
703 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray(
704 _internal_metadata_.unknown_fields(), target);
705 }
706 // @@protoc_insertion_point(serialize_to_array_end:tensorflow.SequenceExample)
707 return target;
708}
709
710size_t SequenceExample::ByteSizeLong() const {
711// @@protoc_insertion_point(message_byte_size_start:tensorflow.SequenceExample)
712 size_t total_size = 0;
713
714 if (_internal_metadata_.have_unknown_fields()) {
715 total_size +=
716 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::ComputeUnknownFieldsSize(
717 _internal_metadata_.unknown_fields());
718 }
719 ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
720 // Prevent compiler warnings about cached_has_bits being unused
721 (void) cached_has_bits;
722
723 // .tensorflow.Features context = 1;
724 if (this->has_context()) {
725 total_size += 1 +
726 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
727 *context_);
728 }
729
730 // .tensorflow.FeatureLists feature_lists = 2;
731 if (this->has_feature_lists()) {
732 total_size += 1 +
733 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
734 *feature_lists_);
735 }
736
737 int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
738 SetCachedSize(cached_size);
739 return total_size;
740}
741
742void SequenceExample::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
743// @@protoc_insertion_point(generalized_merge_from_start:tensorflow.SequenceExample)
744 GOOGLE_DCHECK_NE(&from, this);
745 const SequenceExample* source =
746 ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<SequenceExample>(
747 &from);
748 if (source == nullptr) {
749 // @@protoc_insertion_point(generalized_merge_from_cast_fail:tensorflow.SequenceExample)
750 ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
751 } else {
752 // @@protoc_insertion_point(generalized_merge_from_cast_success:tensorflow.SequenceExample)
753 MergeFrom(*source);
754 }
755}
756
757void SequenceExample::MergeFrom(const SequenceExample& from) {
758// @@protoc_insertion_point(class_specific_merge_from_start:tensorflow.SequenceExample)
759 GOOGLE_DCHECK_NE(&from, this);
760 _internal_metadata_.MergeFrom(from._internal_metadata_);
761 ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
762 (void) cached_has_bits;
763
764 if (from.has_context()) {
765 mutable_context()->::tensorflow::Features::MergeFrom(from.context());
766 }
767 if (from.has_feature_lists()) {
768 mutable_feature_lists()->::tensorflow::FeatureLists::MergeFrom(from.feature_lists());
769 }
770}
771
772void SequenceExample::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
773// @@protoc_insertion_point(generalized_copy_from_start:tensorflow.SequenceExample)
774 if (&from == this) return;
775 Clear();
776 MergeFrom(from);
777}
778
779void SequenceExample::CopyFrom(const SequenceExample& from) {
780// @@protoc_insertion_point(class_specific_copy_from_start:tensorflow.SequenceExample)
781 if (&from == this) return;
782 Clear();
783 MergeFrom(from);
784}
785
786bool SequenceExample::IsInitialized() const {
787 return true;
788}
789
790void SequenceExample::InternalSwap(SequenceExample* other) {
791 using std::swap;
792 _internal_metadata_.Swap(&other->_internal_metadata_);
793 swap(context_, other->context_);
794 swap(feature_lists_, other->feature_lists_);
795}
796
797::PROTOBUF_NAMESPACE_ID::Metadata SequenceExample::GetMetadata() const {
798 return GetMetadataStatic();
799}
800
801
802// @@protoc_insertion_point(namespace_scope)
803} // namespace tensorflow
804PROTOBUF_NAMESPACE_OPEN
805template<> PROTOBUF_NOINLINE ::tensorflow::Example* Arena::CreateMaybeMessage< ::tensorflow::Example >(Arena* arena) {
806 return Arena::CreateMessageInternal< ::tensorflow::Example >(arena);
807}
808template<> PROTOBUF_NOINLINE ::tensorflow::SequenceExample* Arena::CreateMaybeMessage< ::tensorflow::SequenceExample >(Arena* arena) {
809 return Arena::CreateMessageInternal< ::tensorflow::SequenceExample >(arena);
810}
811PROTOBUF_NAMESPACE_CLOSE
812
813// @@protoc_insertion_point(global_scope)
814#include <google/protobuf/port_undef.inc>
815