1 | // Generated by the protocol buffer compiler. DO NOT EDIT! |
2 | // source: tensorflow/core/data/dataset.proto |
3 | |
4 | #include "tensorflow/core/data/dataset.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> |
18 | extern PROTOBUF_INTERNAL_EXPORT_tensorflow_2fcore_2fframework_2ftensor_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<2> scc_info_TensorProto_tensorflow_2fcore_2fframework_2ftensor_2eproto; |
19 | extern PROTOBUF_INTERNAL_EXPORT_tensorflow_2fcore_2fframework_2ftensor_5fshape_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_TensorShapeProto_tensorflow_2fcore_2fframework_2ftensor_5fshape_2eproto; |
20 | extern PROTOBUF_INTERNAL_EXPORT_tensorflow_2fcore_2fdata_2fdataset_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_CompressedComponentMetadata_tensorflow_2fcore_2fdata_2fdataset_2eproto; |
21 | namespace tensorflow { |
22 | namespace data { |
23 | class CompressedComponentMetadataDefaultTypeInternal { |
24 | public: |
25 | ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<CompressedComponentMetadata> _instance; |
26 | } _CompressedComponentMetadata_default_instance_; |
27 | class CompressedElementDefaultTypeInternal { |
28 | public: |
29 | ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<CompressedElement> _instance; |
30 | } _CompressedElement_default_instance_; |
31 | class UncompressedElementDefaultTypeInternal { |
32 | public: |
33 | ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<UncompressedElement> _instance; |
34 | } _UncompressedElement_default_instance_; |
35 | } // namespace data |
36 | } // namespace tensorflow |
37 | static void InitDefaultsscc_info_CompressedComponentMetadata_tensorflow_2fcore_2fdata_2fdataset_2eproto() { |
38 | GOOGLE_PROTOBUF_VERIFY_VERSION; |
39 | |
40 | { |
41 | void* ptr = &::tensorflow::data::_CompressedComponentMetadata_default_instance_; |
42 | new (ptr) ::tensorflow::data::CompressedComponentMetadata(); |
43 | ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); |
44 | } |
45 | ::tensorflow::data::CompressedComponentMetadata::InitAsDefaultInstance(); |
46 | } |
47 | |
48 | ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_CompressedComponentMetadata_tensorflow_2fcore_2fdata_2fdataset_2eproto = |
49 | {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsscc_info_CompressedComponentMetadata_tensorflow_2fcore_2fdata_2fdataset_2eproto}, { |
50 | &scc_info_TensorShapeProto_tensorflow_2fcore_2fframework_2ftensor_5fshape_2eproto.base,}}; |
51 | |
52 | static void InitDefaultsscc_info_CompressedElement_tensorflow_2fcore_2fdata_2fdataset_2eproto() { |
53 | GOOGLE_PROTOBUF_VERIFY_VERSION; |
54 | |
55 | { |
56 | void* ptr = &::tensorflow::data::_CompressedElement_default_instance_; |
57 | new (ptr) ::tensorflow::data::CompressedElement(); |
58 | ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); |
59 | } |
60 | ::tensorflow::data::CompressedElement::InitAsDefaultInstance(); |
61 | } |
62 | |
63 | ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_CompressedElement_tensorflow_2fcore_2fdata_2fdataset_2eproto = |
64 | {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsscc_info_CompressedElement_tensorflow_2fcore_2fdata_2fdataset_2eproto}, { |
65 | &scc_info_CompressedComponentMetadata_tensorflow_2fcore_2fdata_2fdataset_2eproto.base,}}; |
66 | |
67 | static void InitDefaultsscc_info_UncompressedElement_tensorflow_2fcore_2fdata_2fdataset_2eproto() { |
68 | GOOGLE_PROTOBUF_VERIFY_VERSION; |
69 | |
70 | { |
71 | void* ptr = &::tensorflow::data::_UncompressedElement_default_instance_; |
72 | new (ptr) ::tensorflow::data::UncompressedElement(); |
73 | ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); |
74 | } |
75 | ::tensorflow::data::UncompressedElement::InitAsDefaultInstance(); |
76 | } |
77 | |
78 | ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_UncompressedElement_tensorflow_2fcore_2fdata_2fdataset_2eproto = |
79 | {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsscc_info_UncompressedElement_tensorflow_2fcore_2fdata_2fdataset_2eproto}, { |
80 | &scc_info_TensorProto_tensorflow_2fcore_2fframework_2ftensor_2eproto.base,}}; |
81 | |
82 | static ::PROTOBUF_NAMESPACE_ID::Metadata file_level_metadata_tensorflow_2fcore_2fdata_2fdataset_2eproto[3]; |
83 | static constexpr ::PROTOBUF_NAMESPACE_ID::EnumDescriptor const** file_level_enum_descriptors_tensorflow_2fcore_2fdata_2fdataset_2eproto = nullptr; |
84 | static constexpr ::PROTOBUF_NAMESPACE_ID::ServiceDescriptor const** file_level_service_descriptors_tensorflow_2fcore_2fdata_2fdataset_2eproto = nullptr; |
85 | |
86 | const ::PROTOBUF_NAMESPACE_ID::uint32 TableStruct_tensorflow_2fcore_2fdata_2fdataset_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { |
87 | ~0u, // no _has_bits_ |
88 | PROTOBUF_FIELD_OFFSET(::tensorflow::data::CompressedComponentMetadata, _internal_metadata_), |
89 | ~0u, // no _extensions_ |
90 | ~0u, // no _oneof_case_ |
91 | ~0u, // no _weak_field_map_ |
92 | PROTOBUF_FIELD_OFFSET(::tensorflow::data::CompressedComponentMetadata, dtype_), |
93 | PROTOBUF_FIELD_OFFSET(::tensorflow::data::CompressedComponentMetadata, tensor_shape_), |
94 | PROTOBUF_FIELD_OFFSET(::tensorflow::data::CompressedComponentMetadata, tensor_size_bytes_), |
95 | ~0u, // no _has_bits_ |
96 | PROTOBUF_FIELD_OFFSET(::tensorflow::data::CompressedElement, _internal_metadata_), |
97 | ~0u, // no _extensions_ |
98 | ~0u, // no _oneof_case_ |
99 | ~0u, // no _weak_field_map_ |
100 | PROTOBUF_FIELD_OFFSET(::tensorflow::data::CompressedElement, data_), |
101 | PROTOBUF_FIELD_OFFSET(::tensorflow::data::CompressedElement, component_metadata_), |
102 | ~0u, // no _has_bits_ |
103 | PROTOBUF_FIELD_OFFSET(::tensorflow::data::UncompressedElement, _internal_metadata_), |
104 | ~0u, // no _extensions_ |
105 | ~0u, // no _oneof_case_ |
106 | ~0u, // no _weak_field_map_ |
107 | PROTOBUF_FIELD_OFFSET(::tensorflow::data::UncompressedElement, components_), |
108 | }; |
109 | static const ::PROTOBUF_NAMESPACE_ID::internal::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { |
110 | { 0, -1, sizeof(::tensorflow::data::CompressedComponentMetadata)}, |
111 | { 8, -1, sizeof(::tensorflow::data::CompressedElement)}, |
112 | { 15, -1, sizeof(::tensorflow::data::UncompressedElement)}, |
113 | }; |
114 | |
115 | static ::PROTOBUF_NAMESPACE_ID::Message const * const file_default_instances[] = { |
116 | reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::tensorflow::data::_CompressedComponentMetadata_default_instance_), |
117 | reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::tensorflow::data::_CompressedElement_default_instance_), |
118 | reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::tensorflow::data::_UncompressedElement_default_instance_), |
119 | }; |
120 | |
121 | const char descriptor_table_protodef_tensorflow_2fcore_2fdata_2fdataset_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = |
122 | "\n\"tensorflow/core/data/dataset.proto\022\017te" |
123 | "nsorflow.data\032&tensorflow/core/framework" |
124 | "/tensor.proto\032,tensorflow/core/framework" |
125 | "/tensor_shape.proto\032%tensorflow/core/fra" |
126 | "mework/types.proto\"\221\001\n\033CompressedCompone" |
127 | "ntMetadata\022#\n\005dtype\030\001 \001(\0162\024.tensorflow.D" |
128 | "ataType\0222\n\014tensor_shape\030\002 \001(\0132\034.tensorfl" |
129 | "ow.TensorShapeProto\022\031\n\021tensor_size_bytes" |
130 | "\030\003 \001(\003\"k\n\021CompressedElement\022\014\n\004data\030\001 \001(" |
131 | "\014\022H\n\022component_metadata\030\002 \003(\0132,.tensorfl" |
132 | "ow.data.CompressedComponentMetadata\"B\n\023U" |
133 | "ncompressedElement\022+\n\ncomponents\030\001 \003(\0132\027" |
134 | ".tensorflow.TensorProtoB\003\370\001\001b\006proto3" |
135 | ; |
136 | static const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable*const descriptor_table_tensorflow_2fcore_2fdata_2fdataset_2eproto_deps[3] = { |
137 | &::descriptor_table_tensorflow_2fcore_2fframework_2ftensor_2eproto, |
138 | &::descriptor_table_tensorflow_2fcore_2fframework_2ftensor_5fshape_2eproto, |
139 | &::descriptor_table_tensorflow_2fcore_2fframework_2ftypes_2eproto, |
140 | }; |
141 | static ::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase*const descriptor_table_tensorflow_2fcore_2fdata_2fdataset_2eproto_sccs[3] = { |
142 | &scc_info_CompressedComponentMetadata_tensorflow_2fcore_2fdata_2fdataset_2eproto.base, |
143 | &scc_info_CompressedElement_tensorflow_2fcore_2fdata_2fdataset_2eproto.base, |
144 | &scc_info_UncompressedElement_tensorflow_2fcore_2fdata_2fdataset_2eproto.base, |
145 | }; |
146 | static ::PROTOBUF_NAMESPACE_ID::internal::once_flag descriptor_table_tensorflow_2fcore_2fdata_2fdataset_2eproto_once; |
147 | static bool descriptor_table_tensorflow_2fcore_2fdata_2fdataset_2eproto_initialized = false; |
148 | const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_tensorflow_2fcore_2fdata_2fdataset_2eproto = { |
149 | &descriptor_table_tensorflow_2fcore_2fdata_2fdataset_2eproto_initialized, descriptor_table_protodef_tensorflow_2fcore_2fdata_2fdataset_2eproto, "tensorflow/core/data/dataset.proto" , 516, |
150 | &descriptor_table_tensorflow_2fcore_2fdata_2fdataset_2eproto_once, descriptor_table_tensorflow_2fcore_2fdata_2fdataset_2eproto_sccs, descriptor_table_tensorflow_2fcore_2fdata_2fdataset_2eproto_deps, 3, 3, |
151 | schemas, file_default_instances, TableStruct_tensorflow_2fcore_2fdata_2fdataset_2eproto::offsets, |
152 | file_level_metadata_tensorflow_2fcore_2fdata_2fdataset_2eproto, 3, file_level_enum_descriptors_tensorflow_2fcore_2fdata_2fdataset_2eproto, file_level_service_descriptors_tensorflow_2fcore_2fdata_2fdataset_2eproto, |
153 | }; |
154 | |
155 | // Force running AddDescriptors() at dynamic initialization time. |
156 | static bool dynamic_init_dummy_tensorflow_2fcore_2fdata_2fdataset_2eproto = ( ::PROTOBUF_NAMESPACE_ID::internal::AddDescriptors(&descriptor_table_tensorflow_2fcore_2fdata_2fdataset_2eproto), true); |
157 | namespace tensorflow { |
158 | namespace data { |
159 | |
160 | // =================================================================== |
161 | |
162 | void CompressedComponentMetadata::InitAsDefaultInstance() { |
163 | ::tensorflow::data::_CompressedComponentMetadata_default_instance_._instance.get_mutable()->tensor_shape_ = const_cast< ::tensorflow::TensorShapeProto*>( |
164 | ::tensorflow::TensorShapeProto::internal_default_instance()); |
165 | } |
166 | class CompressedComponentMetadata::_Internal { |
167 | public: |
168 | static const ::tensorflow::TensorShapeProto& tensor_shape(const CompressedComponentMetadata* msg); |
169 | }; |
170 | |
171 | const ::tensorflow::TensorShapeProto& |
172 | CompressedComponentMetadata::_Internal::tensor_shape(const CompressedComponentMetadata* msg) { |
173 | return *msg->tensor_shape_; |
174 | } |
175 | void CompressedComponentMetadata::unsafe_arena_set_allocated_tensor_shape( |
176 | ::tensorflow::TensorShapeProto* tensor_shape) { |
177 | if (GetArenaNoVirtual() == nullptr) { |
178 | delete tensor_shape_; |
179 | } |
180 | tensor_shape_ = tensor_shape; |
181 | if (tensor_shape) { |
182 | |
183 | } else { |
184 | |
185 | } |
186 | // @@protoc_insertion_point(field_unsafe_arena_set_allocated:tensorflow.data.CompressedComponentMetadata.tensor_shape) |
187 | } |
188 | void CompressedComponentMetadata::clear_tensor_shape() { |
189 | if (GetArenaNoVirtual() == nullptr && tensor_shape_ != nullptr) { |
190 | delete tensor_shape_; |
191 | } |
192 | tensor_shape_ = nullptr; |
193 | } |
194 | CompressedComponentMetadata::CompressedComponentMetadata() |
195 | : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) { |
196 | SharedCtor(); |
197 | // @@protoc_insertion_point(constructor:tensorflow.data.CompressedComponentMetadata) |
198 | } |
199 | CompressedComponentMetadata::CompressedComponentMetadata(::PROTOBUF_NAMESPACE_ID::Arena* arena) |
200 | : ::PROTOBUF_NAMESPACE_ID::Message(), |
201 | _internal_metadata_(arena) { |
202 | SharedCtor(); |
203 | RegisterArenaDtor(arena); |
204 | // @@protoc_insertion_point(arena_constructor:tensorflow.data.CompressedComponentMetadata) |
205 | } |
206 | CompressedComponentMetadata::CompressedComponentMetadata(const CompressedComponentMetadata& from) |
207 | : ::PROTOBUF_NAMESPACE_ID::Message(), |
208 | _internal_metadata_(nullptr) { |
209 | _internal_metadata_.MergeFrom(from._internal_metadata_); |
210 | if (from.has_tensor_shape()) { |
211 | tensor_shape_ = new ::tensorflow::TensorShapeProto(*from.tensor_shape_); |
212 | } else { |
213 | tensor_shape_ = nullptr; |
214 | } |
215 | ::memcpy(&tensor_size_bytes_, &from.tensor_size_bytes_, |
216 | static_cast<size_t>(reinterpret_cast<char*>(&dtype_) - |
217 | reinterpret_cast<char*>(&tensor_size_bytes_)) + sizeof(dtype_)); |
218 | // @@protoc_insertion_point(copy_constructor:tensorflow.data.CompressedComponentMetadata) |
219 | } |
220 | |
221 | void CompressedComponentMetadata::SharedCtor() { |
222 | ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_CompressedComponentMetadata_tensorflow_2fcore_2fdata_2fdataset_2eproto.base); |
223 | ::memset(&tensor_shape_, 0, static_cast<size_t>( |
224 | reinterpret_cast<char*>(&dtype_) - |
225 | reinterpret_cast<char*>(&tensor_shape_)) + sizeof(dtype_)); |
226 | } |
227 | |
228 | CompressedComponentMetadata::~CompressedComponentMetadata() { |
229 | // @@protoc_insertion_point(destructor:tensorflow.data.CompressedComponentMetadata) |
230 | SharedDtor(); |
231 | } |
232 | |
233 | void CompressedComponentMetadata::SharedDtor() { |
234 | GOOGLE_DCHECK(GetArenaNoVirtual() == nullptr); |
235 | if (this != internal_default_instance()) delete tensor_shape_; |
236 | } |
237 | |
238 | void CompressedComponentMetadata::ArenaDtor(void* object) { |
239 | CompressedComponentMetadata* _this = reinterpret_cast< CompressedComponentMetadata* >(object); |
240 | (void)_this; |
241 | } |
242 | void CompressedComponentMetadata::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { |
243 | } |
244 | void CompressedComponentMetadata::SetCachedSize(int size) const { |
245 | _cached_size_.Set(size); |
246 | } |
247 | const CompressedComponentMetadata& CompressedComponentMetadata::default_instance() { |
248 | ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_CompressedComponentMetadata_tensorflow_2fcore_2fdata_2fdataset_2eproto.base); |
249 | return *internal_default_instance(); |
250 | } |
251 | |
252 | |
253 | void CompressedComponentMetadata::Clear() { |
254 | // @@protoc_insertion_point(message_clear_start:tensorflow.data.CompressedComponentMetadata) |
255 | ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; |
256 | // Prevent compiler warnings about cached_has_bits being unused |
257 | (void) cached_has_bits; |
258 | |
259 | if (GetArenaNoVirtual() == nullptr && tensor_shape_ != nullptr) { |
260 | delete tensor_shape_; |
261 | } |
262 | tensor_shape_ = nullptr; |
263 | ::memset(&tensor_size_bytes_, 0, static_cast<size_t>( |
264 | reinterpret_cast<char*>(&dtype_) - |
265 | reinterpret_cast<char*>(&tensor_size_bytes_)) + sizeof(dtype_)); |
266 | _internal_metadata_.Clear(); |
267 | } |
268 | |
269 | #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER |
270 | const char* CompressedComponentMetadata::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { |
271 | #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure |
272 | ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArenaNoVirtual(); (void)arena; |
273 | while (!ctx->Done(&ptr)) { |
274 | ::PROTOBUF_NAMESPACE_ID::uint32 tag; |
275 | ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); |
276 | CHK_(ptr); |
277 | switch (tag >> 3) { |
278 | // .tensorflow.DataType dtype = 1; |
279 | case 1: |
280 | if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) { |
281 | ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); |
282 | CHK_(ptr); |
283 | set_dtype(static_cast<::tensorflow::DataType>(val)); |
284 | } else goto handle_unusual; |
285 | continue; |
286 | // .tensorflow.TensorShapeProto tensor_shape = 2; |
287 | case 2: |
288 | if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { |
289 | ptr = ctx->ParseMessage(mutable_tensor_shape(), ptr); |
290 | CHK_(ptr); |
291 | } else goto handle_unusual; |
292 | continue; |
293 | // int64 tensor_size_bytes = 3; |
294 | case 3: |
295 | if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24)) { |
296 | tensor_size_bytes_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); |
297 | CHK_(ptr); |
298 | } else goto handle_unusual; |
299 | continue; |
300 | default: { |
301 | handle_unusual: |
302 | if ((tag & 7) == 4 || tag == 0) { |
303 | ctx->SetLastTag(tag); |
304 | goto success; |
305 | } |
306 | ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx); |
307 | CHK_(ptr != nullptr); |
308 | continue; |
309 | } |
310 | } // switch |
311 | } // while |
312 | success: |
313 | return ptr; |
314 | failure: |
315 | ptr = nullptr; |
316 | goto success; |
317 | #undef CHK_ |
318 | } |
319 | #else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER |
320 | bool CompressedComponentMetadata::MergePartialFromCodedStream( |
321 | ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) { |
322 | #define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure |
323 | ::PROTOBUF_NAMESPACE_ID::uint32 tag; |
324 | // @@protoc_insertion_point(parse_start:tensorflow.data.CompressedComponentMetadata) |
325 | for (;;) { |
326 | ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); |
327 | tag = p.first; |
328 | if (!p.second) goto handle_unusual; |
329 | switch (::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::GetTagFieldNumber(tag)) { |
330 | // .tensorflow.DataType dtype = 1; |
331 | case 1: { |
332 | if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (8 & 0xFF)) { |
333 | int value = 0; |
334 | DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< |
335 | int, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_ENUM>( |
336 | input, &value))); |
337 | set_dtype(static_cast< ::tensorflow::DataType >(value)); |
338 | } else { |
339 | goto handle_unusual; |
340 | } |
341 | break; |
342 | } |
343 | |
344 | // .tensorflow.TensorShapeProto tensor_shape = 2; |
345 | case 2: { |
346 | if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (18 & 0xFF)) { |
347 | DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage( |
348 | input, mutable_tensor_shape())); |
349 | } else { |
350 | goto handle_unusual; |
351 | } |
352 | break; |
353 | } |
354 | |
355 | // int64 tensor_size_bytes = 3; |
356 | case 3: { |
357 | if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (24 & 0xFF)) { |
358 | |
359 | DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< |
360 | ::PROTOBUF_NAMESPACE_ID::int64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT64>( |
361 | input, &tensor_size_bytes_))); |
362 | } else { |
363 | goto handle_unusual; |
364 | } |
365 | break; |
366 | } |
367 | |
368 | default: { |
369 | handle_unusual: |
370 | if (tag == 0) { |
371 | goto success; |
372 | } |
373 | DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SkipField( |
374 | input, tag, _internal_metadata_.mutable_unknown_fields())); |
375 | break; |
376 | } |
377 | } |
378 | } |
379 | success: |
380 | // @@protoc_insertion_point(parse_success:tensorflow.data.CompressedComponentMetadata) |
381 | return true; |
382 | failure: |
383 | // @@protoc_insertion_point(parse_failure:tensorflow.data.CompressedComponentMetadata) |
384 | return false; |
385 | #undef DO_ |
386 | } |
387 | #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER |
388 | |
389 | void CompressedComponentMetadata::SerializeWithCachedSizes( |
390 | ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const { |
391 | // @@protoc_insertion_point(serialize_start:tensorflow.data.CompressedComponentMetadata) |
392 | ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; |
393 | (void) cached_has_bits; |
394 | |
395 | // .tensorflow.DataType dtype = 1; |
396 | if (this->dtype() != 0) { |
397 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnum( |
398 | 1, this->dtype(), output); |
399 | } |
400 | |
401 | // .tensorflow.TensorShapeProto tensor_shape = 2; |
402 | if (this->has_tensor_shape()) { |
403 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray( |
404 | 2, _Internal::tensor_shape(this), output); |
405 | } |
406 | |
407 | // int64 tensor_size_bytes = 3; |
408 | if (this->tensor_size_bytes() != 0) { |
409 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64(3, this->tensor_size_bytes(), output); |
410 | } |
411 | |
412 | if (_internal_metadata_.have_unknown_fields()) { |
413 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields( |
414 | _internal_metadata_.unknown_fields(), output); |
415 | } |
416 | // @@protoc_insertion_point(serialize_end:tensorflow.data.CompressedComponentMetadata) |
417 | } |
418 | |
419 | ::PROTOBUF_NAMESPACE_ID::uint8* CompressedComponentMetadata::InternalSerializeWithCachedSizesToArray( |
420 | ::PROTOBUF_NAMESPACE_ID::uint8* target) const { |
421 | // @@protoc_insertion_point(serialize_to_array_start:tensorflow.data.CompressedComponentMetadata) |
422 | ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; |
423 | (void) cached_has_bits; |
424 | |
425 | // .tensorflow.DataType dtype = 1; |
426 | if (this->dtype() != 0) { |
427 | target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray( |
428 | 1, this->dtype(), target); |
429 | } |
430 | |
431 | // .tensorflow.TensorShapeProto tensor_shape = 2; |
432 | if (this->has_tensor_shape()) { |
433 | target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: |
434 | InternalWriteMessageToArray( |
435 | 2, _Internal::tensor_shape(this), target); |
436 | } |
437 | |
438 | // int64 tensor_size_bytes = 3; |
439 | if (this->tensor_size_bytes() != 0) { |
440 | target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(3, this->tensor_size_bytes(), target); |
441 | } |
442 | |
443 | if (_internal_metadata_.have_unknown_fields()) { |
444 | target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray( |
445 | _internal_metadata_.unknown_fields(), target); |
446 | } |
447 | // @@protoc_insertion_point(serialize_to_array_end:tensorflow.data.CompressedComponentMetadata) |
448 | return target; |
449 | } |
450 | |
451 | size_t CompressedComponentMetadata::ByteSizeLong() const { |
452 | // @@protoc_insertion_point(message_byte_size_start:tensorflow.data.CompressedComponentMetadata) |
453 | size_t total_size = 0; |
454 | |
455 | if (_internal_metadata_.have_unknown_fields()) { |
456 | total_size += |
457 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::ComputeUnknownFieldsSize( |
458 | _internal_metadata_.unknown_fields()); |
459 | } |
460 | ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; |
461 | // Prevent compiler warnings about cached_has_bits being unused |
462 | (void) cached_has_bits; |
463 | |
464 | // .tensorflow.TensorShapeProto tensor_shape = 2; |
465 | if (this->has_tensor_shape()) { |
466 | total_size += 1 + |
467 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( |
468 | *tensor_shape_); |
469 | } |
470 | |
471 | // int64 tensor_size_bytes = 3; |
472 | if (this->tensor_size_bytes() != 0) { |
473 | total_size += 1 + |
474 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64Size( |
475 | this->tensor_size_bytes()); |
476 | } |
477 | |
478 | // .tensorflow.DataType dtype = 1; |
479 | if (this->dtype() != 0) { |
480 | total_size += 1 + |
481 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->dtype()); |
482 | } |
483 | |
484 | int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); |
485 | SetCachedSize(cached_size); |
486 | return total_size; |
487 | } |
488 | |
489 | void CompressedComponentMetadata::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { |
490 | // @@protoc_insertion_point(generalized_merge_from_start:tensorflow.data.CompressedComponentMetadata) |
491 | GOOGLE_DCHECK_NE(&from, this); |
492 | const CompressedComponentMetadata* source = |
493 | ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<CompressedComponentMetadata>( |
494 | &from); |
495 | if (source == nullptr) { |
496 | // @@protoc_insertion_point(generalized_merge_from_cast_fail:tensorflow.data.CompressedComponentMetadata) |
497 | ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); |
498 | } else { |
499 | // @@protoc_insertion_point(generalized_merge_from_cast_success:tensorflow.data.CompressedComponentMetadata) |
500 | MergeFrom(*source); |
501 | } |
502 | } |
503 | |
504 | void CompressedComponentMetadata::MergeFrom(const CompressedComponentMetadata& from) { |
505 | // @@protoc_insertion_point(class_specific_merge_from_start:tensorflow.data.CompressedComponentMetadata) |
506 | GOOGLE_DCHECK_NE(&from, this); |
507 | _internal_metadata_.MergeFrom(from._internal_metadata_); |
508 | ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; |
509 | (void) cached_has_bits; |
510 | |
511 | if (from.has_tensor_shape()) { |
512 | mutable_tensor_shape()->::tensorflow::TensorShapeProto::MergeFrom(from.tensor_shape()); |
513 | } |
514 | if (from.tensor_size_bytes() != 0) { |
515 | set_tensor_size_bytes(from.tensor_size_bytes()); |
516 | } |
517 | if (from.dtype() != 0) { |
518 | set_dtype(from.dtype()); |
519 | } |
520 | } |
521 | |
522 | void CompressedComponentMetadata::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { |
523 | // @@protoc_insertion_point(generalized_copy_from_start:tensorflow.data.CompressedComponentMetadata) |
524 | if (&from == this) return; |
525 | Clear(); |
526 | MergeFrom(from); |
527 | } |
528 | |
529 | void CompressedComponentMetadata::CopyFrom(const CompressedComponentMetadata& from) { |
530 | // @@protoc_insertion_point(class_specific_copy_from_start:tensorflow.data.CompressedComponentMetadata) |
531 | if (&from == this) return; |
532 | Clear(); |
533 | MergeFrom(from); |
534 | } |
535 | |
536 | bool CompressedComponentMetadata::IsInitialized() const { |
537 | return true; |
538 | } |
539 | |
540 | void CompressedComponentMetadata::InternalSwap(CompressedComponentMetadata* other) { |
541 | using std::swap; |
542 | _internal_metadata_.Swap(&other->_internal_metadata_); |
543 | swap(tensor_shape_, other->tensor_shape_); |
544 | swap(tensor_size_bytes_, other->tensor_size_bytes_); |
545 | swap(dtype_, other->dtype_); |
546 | } |
547 | |
548 | ::PROTOBUF_NAMESPACE_ID::Metadata CompressedComponentMetadata::GetMetadata() const { |
549 | return GetMetadataStatic(); |
550 | } |
551 | |
552 | |
553 | // =================================================================== |
554 | |
555 | void CompressedElement::InitAsDefaultInstance() { |
556 | } |
557 | class CompressedElement::_Internal { |
558 | public: |
559 | }; |
560 | |
561 | CompressedElement::CompressedElement() |
562 | : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) { |
563 | SharedCtor(); |
564 | // @@protoc_insertion_point(constructor:tensorflow.data.CompressedElement) |
565 | } |
566 | CompressedElement::CompressedElement(::PROTOBUF_NAMESPACE_ID::Arena* arena) |
567 | : ::PROTOBUF_NAMESPACE_ID::Message(), |
568 | _internal_metadata_(arena), |
569 | component_metadata_(arena) { |
570 | SharedCtor(); |
571 | RegisterArenaDtor(arena); |
572 | // @@protoc_insertion_point(arena_constructor:tensorflow.data.CompressedElement) |
573 | } |
574 | CompressedElement::CompressedElement(const CompressedElement& from) |
575 | : ::PROTOBUF_NAMESPACE_ID::Message(), |
576 | _internal_metadata_(nullptr), |
577 | component_metadata_(from.component_metadata_) { |
578 | _internal_metadata_.MergeFrom(from._internal_metadata_); |
579 | data_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); |
580 | if (!from.data().empty()) { |
581 | data_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.data(), |
582 | GetArenaNoVirtual()); |
583 | } |
584 | // @@protoc_insertion_point(copy_constructor:tensorflow.data.CompressedElement) |
585 | } |
586 | |
587 | void CompressedElement::SharedCtor() { |
588 | ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_CompressedElement_tensorflow_2fcore_2fdata_2fdataset_2eproto.base); |
589 | data_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); |
590 | } |
591 | |
592 | CompressedElement::~CompressedElement() { |
593 | // @@protoc_insertion_point(destructor:tensorflow.data.CompressedElement) |
594 | SharedDtor(); |
595 | } |
596 | |
597 | void CompressedElement::SharedDtor() { |
598 | GOOGLE_DCHECK(GetArenaNoVirtual() == nullptr); |
599 | data_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); |
600 | } |
601 | |
602 | void CompressedElement::ArenaDtor(void* object) { |
603 | CompressedElement* _this = reinterpret_cast< CompressedElement* >(object); |
604 | (void)_this; |
605 | } |
606 | void CompressedElement::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { |
607 | } |
608 | void CompressedElement::SetCachedSize(int size) const { |
609 | _cached_size_.Set(size); |
610 | } |
611 | const CompressedElement& CompressedElement::default_instance() { |
612 | ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_CompressedElement_tensorflow_2fcore_2fdata_2fdataset_2eproto.base); |
613 | return *internal_default_instance(); |
614 | } |
615 | |
616 | |
617 | void CompressedElement::Clear() { |
618 | // @@protoc_insertion_point(message_clear_start:tensorflow.data.CompressedElement) |
619 | ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; |
620 | // Prevent compiler warnings about cached_has_bits being unused |
621 | (void) cached_has_bits; |
622 | |
623 | component_metadata_.Clear(); |
624 | data_.ClearToEmpty(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); |
625 | _internal_metadata_.Clear(); |
626 | } |
627 | |
628 | #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER |
629 | const char* CompressedElement::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { |
630 | #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure |
631 | ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArenaNoVirtual(); (void)arena; |
632 | while (!ctx->Done(&ptr)) { |
633 | ::PROTOBUF_NAMESPACE_ID::uint32 tag; |
634 | ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); |
635 | CHK_(ptr); |
636 | switch (tag >> 3) { |
637 | // bytes data = 1; |
638 | case 1: |
639 | if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { |
640 | ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(mutable_data(), ptr, ctx); |
641 | CHK_(ptr); |
642 | } else goto handle_unusual; |
643 | continue; |
644 | // repeated .tensorflow.data.CompressedComponentMetadata component_metadata = 2; |
645 | case 2: |
646 | if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { |
647 | ptr -= 1; |
648 | do { |
649 | ptr += 1; |
650 | ptr = ctx->ParseMessage(add_component_metadata(), ptr); |
651 | CHK_(ptr); |
652 | if (!ctx->DataAvailable(ptr)) break; |
653 | } while (::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<::PROTOBUF_NAMESPACE_ID::uint8>(ptr) == 18); |
654 | } else goto handle_unusual; |
655 | continue; |
656 | default: { |
657 | handle_unusual: |
658 | if ((tag & 7) == 4 || tag == 0) { |
659 | ctx->SetLastTag(tag); |
660 | goto success; |
661 | } |
662 | ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx); |
663 | CHK_(ptr != nullptr); |
664 | continue; |
665 | } |
666 | } // switch |
667 | } // while |
668 | success: |
669 | return ptr; |
670 | failure: |
671 | ptr = nullptr; |
672 | goto success; |
673 | #undef CHK_ |
674 | } |
675 | #else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER |
676 | bool CompressedElement::MergePartialFromCodedStream( |
677 | ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) { |
678 | #define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure |
679 | ::PROTOBUF_NAMESPACE_ID::uint32 tag; |
680 | // @@protoc_insertion_point(parse_start:tensorflow.data.CompressedElement) |
681 | for (;;) { |
682 | ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); |
683 | tag = p.first; |
684 | if (!p.second) goto handle_unusual; |
685 | switch (::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::GetTagFieldNumber(tag)) { |
686 | // bytes data = 1; |
687 | case 1: { |
688 | if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (10 & 0xFF)) { |
689 | DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadBytes( |
690 | input, this->mutable_data())); |
691 | } else { |
692 | goto handle_unusual; |
693 | } |
694 | break; |
695 | } |
696 | |
697 | // repeated .tensorflow.data.CompressedComponentMetadata component_metadata = 2; |
698 | case 2: { |
699 | if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (18 & 0xFF)) { |
700 | DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage( |
701 | input, add_component_metadata())); |
702 | } else { |
703 | goto handle_unusual; |
704 | } |
705 | break; |
706 | } |
707 | |
708 | default: { |
709 | handle_unusual: |
710 | if (tag == 0) { |
711 | goto success; |
712 | } |
713 | DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SkipField( |
714 | input, tag, _internal_metadata_.mutable_unknown_fields())); |
715 | break; |
716 | } |
717 | } |
718 | } |
719 | success: |
720 | // @@protoc_insertion_point(parse_success:tensorflow.data.CompressedElement) |
721 | return true; |
722 | failure: |
723 | // @@protoc_insertion_point(parse_failure:tensorflow.data.CompressedElement) |
724 | return false; |
725 | #undef DO_ |
726 | } |
727 | #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER |
728 | |
729 | void CompressedElement::SerializeWithCachedSizes( |
730 | ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const { |
731 | // @@protoc_insertion_point(serialize_start:tensorflow.data.CompressedElement) |
732 | ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; |
733 | (void) cached_has_bits; |
734 | |
735 | // bytes data = 1; |
736 | if (this->data().size() > 0) { |
737 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBytesMaybeAliased( |
738 | 1, this->data(), output); |
739 | } |
740 | |
741 | // repeated .tensorflow.data.CompressedComponentMetadata component_metadata = 2; |
742 | for (unsigned int i = 0, |
743 | n = static_cast<unsigned int>(this->component_metadata_size()); i < n; i++) { |
744 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray( |
745 | 2, |
746 | this->component_metadata(static_cast<int>(i)), |
747 | output); |
748 | } |
749 | |
750 | if (_internal_metadata_.have_unknown_fields()) { |
751 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields( |
752 | _internal_metadata_.unknown_fields(), output); |
753 | } |
754 | // @@protoc_insertion_point(serialize_end:tensorflow.data.CompressedElement) |
755 | } |
756 | |
757 | ::PROTOBUF_NAMESPACE_ID::uint8* CompressedElement::InternalSerializeWithCachedSizesToArray( |
758 | ::PROTOBUF_NAMESPACE_ID::uint8* target) const { |
759 | // @@protoc_insertion_point(serialize_to_array_start:tensorflow.data.CompressedElement) |
760 | ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; |
761 | (void) cached_has_bits; |
762 | |
763 | // bytes data = 1; |
764 | if (this->data().size() > 0) { |
765 | target = |
766 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBytesToArray( |
767 | 1, this->data(), target); |
768 | } |
769 | |
770 | // repeated .tensorflow.data.CompressedComponentMetadata component_metadata = 2; |
771 | for (unsigned int i = 0, |
772 | n = static_cast<unsigned int>(this->component_metadata_size()); i < n; i++) { |
773 | target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: |
774 | InternalWriteMessageToArray( |
775 | 2, this->component_metadata(static_cast<int>(i)), target); |
776 | } |
777 | |
778 | if (_internal_metadata_.have_unknown_fields()) { |
779 | target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray( |
780 | _internal_metadata_.unknown_fields(), target); |
781 | } |
782 | // @@protoc_insertion_point(serialize_to_array_end:tensorflow.data.CompressedElement) |
783 | return target; |
784 | } |
785 | |
786 | size_t CompressedElement::ByteSizeLong() const { |
787 | // @@protoc_insertion_point(message_byte_size_start:tensorflow.data.CompressedElement) |
788 | size_t total_size = 0; |
789 | |
790 | if (_internal_metadata_.have_unknown_fields()) { |
791 | total_size += |
792 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::ComputeUnknownFieldsSize( |
793 | _internal_metadata_.unknown_fields()); |
794 | } |
795 | ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; |
796 | // Prevent compiler warnings about cached_has_bits being unused |
797 | (void) cached_has_bits; |
798 | |
799 | // repeated .tensorflow.data.CompressedComponentMetadata component_metadata = 2; |
800 | { |
801 | unsigned int count = static_cast<unsigned int>(this->component_metadata_size()); |
802 | total_size += 1UL * count; |
803 | for (unsigned int i = 0; i < count; i++) { |
804 | total_size += |
805 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( |
806 | this->component_metadata(static_cast<int>(i))); |
807 | } |
808 | } |
809 | |
810 | // bytes data = 1; |
811 | if (this->data().size() > 0) { |
812 | total_size += 1 + |
813 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( |
814 | this->data()); |
815 | } |
816 | |
817 | int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); |
818 | SetCachedSize(cached_size); |
819 | return total_size; |
820 | } |
821 | |
822 | void CompressedElement::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { |
823 | // @@protoc_insertion_point(generalized_merge_from_start:tensorflow.data.CompressedElement) |
824 | GOOGLE_DCHECK_NE(&from, this); |
825 | const CompressedElement* source = |
826 | ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<CompressedElement>( |
827 | &from); |
828 | if (source == nullptr) { |
829 | // @@protoc_insertion_point(generalized_merge_from_cast_fail:tensorflow.data.CompressedElement) |
830 | ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); |
831 | } else { |
832 | // @@protoc_insertion_point(generalized_merge_from_cast_success:tensorflow.data.CompressedElement) |
833 | MergeFrom(*source); |
834 | } |
835 | } |
836 | |
837 | void CompressedElement::MergeFrom(const CompressedElement& from) { |
838 | // @@protoc_insertion_point(class_specific_merge_from_start:tensorflow.data.CompressedElement) |
839 | GOOGLE_DCHECK_NE(&from, this); |
840 | _internal_metadata_.MergeFrom(from._internal_metadata_); |
841 | ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; |
842 | (void) cached_has_bits; |
843 | |
844 | component_metadata_.MergeFrom(from.component_metadata_); |
845 | if (from.data().size() > 0) { |
846 | set_data(from.data()); |
847 | } |
848 | } |
849 | |
850 | void CompressedElement::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { |
851 | // @@protoc_insertion_point(generalized_copy_from_start:tensorflow.data.CompressedElement) |
852 | if (&from == this) return; |
853 | Clear(); |
854 | MergeFrom(from); |
855 | } |
856 | |
857 | void CompressedElement::CopyFrom(const CompressedElement& from) { |
858 | // @@protoc_insertion_point(class_specific_copy_from_start:tensorflow.data.CompressedElement) |
859 | if (&from == this) return; |
860 | Clear(); |
861 | MergeFrom(from); |
862 | } |
863 | |
864 | bool CompressedElement::IsInitialized() const { |
865 | return true; |
866 | } |
867 | |
868 | void CompressedElement::InternalSwap(CompressedElement* other) { |
869 | using std::swap; |
870 | _internal_metadata_.Swap(&other->_internal_metadata_); |
871 | CastToBase(&component_metadata_)->InternalSwap(CastToBase(&other->component_metadata_)); |
872 | data_.Swap(&other->data_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), |
873 | GetArenaNoVirtual()); |
874 | } |
875 | |
876 | ::PROTOBUF_NAMESPACE_ID::Metadata CompressedElement::GetMetadata() const { |
877 | return GetMetadataStatic(); |
878 | } |
879 | |
880 | |
881 | // =================================================================== |
882 | |
883 | void UncompressedElement::InitAsDefaultInstance() { |
884 | } |
885 | class UncompressedElement::_Internal { |
886 | public: |
887 | }; |
888 | |
889 | void UncompressedElement::clear_components() { |
890 | components_.Clear(); |
891 | } |
892 | UncompressedElement::UncompressedElement() |
893 | : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) { |
894 | SharedCtor(); |
895 | // @@protoc_insertion_point(constructor:tensorflow.data.UncompressedElement) |
896 | } |
897 | UncompressedElement::UncompressedElement(::PROTOBUF_NAMESPACE_ID::Arena* arena) |
898 | : ::PROTOBUF_NAMESPACE_ID::Message(), |
899 | _internal_metadata_(arena), |
900 | components_(arena) { |
901 | SharedCtor(); |
902 | RegisterArenaDtor(arena); |
903 | // @@protoc_insertion_point(arena_constructor:tensorflow.data.UncompressedElement) |
904 | } |
905 | UncompressedElement::UncompressedElement(const UncompressedElement& from) |
906 | : ::PROTOBUF_NAMESPACE_ID::Message(), |
907 | _internal_metadata_(nullptr), |
908 | components_(from.components_) { |
909 | _internal_metadata_.MergeFrom(from._internal_metadata_); |
910 | // @@protoc_insertion_point(copy_constructor:tensorflow.data.UncompressedElement) |
911 | } |
912 | |
913 | void UncompressedElement::SharedCtor() { |
914 | ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_UncompressedElement_tensorflow_2fcore_2fdata_2fdataset_2eproto.base); |
915 | } |
916 | |
917 | UncompressedElement::~UncompressedElement() { |
918 | // @@protoc_insertion_point(destructor:tensorflow.data.UncompressedElement) |
919 | SharedDtor(); |
920 | } |
921 | |
922 | void UncompressedElement::SharedDtor() { |
923 | GOOGLE_DCHECK(GetArenaNoVirtual() == nullptr); |
924 | } |
925 | |
926 | void UncompressedElement::ArenaDtor(void* object) { |
927 | UncompressedElement* _this = reinterpret_cast< UncompressedElement* >(object); |
928 | (void)_this; |
929 | } |
930 | void UncompressedElement::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { |
931 | } |
932 | void UncompressedElement::SetCachedSize(int size) const { |
933 | _cached_size_.Set(size); |
934 | } |
935 | const UncompressedElement& UncompressedElement::default_instance() { |
936 | ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_UncompressedElement_tensorflow_2fcore_2fdata_2fdataset_2eproto.base); |
937 | return *internal_default_instance(); |
938 | } |
939 | |
940 | |
941 | void UncompressedElement::Clear() { |
942 | // @@protoc_insertion_point(message_clear_start:tensorflow.data.UncompressedElement) |
943 | ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; |
944 | // Prevent compiler warnings about cached_has_bits being unused |
945 | (void) cached_has_bits; |
946 | |
947 | components_.Clear(); |
948 | _internal_metadata_.Clear(); |
949 | } |
950 | |
951 | #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER |
952 | const char* UncompressedElement::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { |
953 | #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure |
954 | ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArenaNoVirtual(); (void)arena; |
955 | while (!ctx->Done(&ptr)) { |
956 | ::PROTOBUF_NAMESPACE_ID::uint32 tag; |
957 | ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); |
958 | CHK_(ptr); |
959 | switch (tag >> 3) { |
960 | // repeated .tensorflow.TensorProto components = 1; |
961 | case 1: |
962 | if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { |
963 | ptr -= 1; |
964 | do { |
965 | ptr += 1; |
966 | ptr = ctx->ParseMessage(add_components(), ptr); |
967 | CHK_(ptr); |
968 | if (!ctx->DataAvailable(ptr)) break; |
969 | } while (::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<::PROTOBUF_NAMESPACE_ID::uint8>(ptr) == 10); |
970 | } else goto handle_unusual; |
971 | continue; |
972 | default: { |
973 | handle_unusual: |
974 | if ((tag & 7) == 4 || tag == 0) { |
975 | ctx->SetLastTag(tag); |
976 | goto success; |
977 | } |
978 | ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx); |
979 | CHK_(ptr != nullptr); |
980 | continue; |
981 | } |
982 | } // switch |
983 | } // while |
984 | success: |
985 | return ptr; |
986 | failure: |
987 | ptr = nullptr; |
988 | goto success; |
989 | #undef CHK_ |
990 | } |
991 | #else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER |
992 | bool UncompressedElement::MergePartialFromCodedStream( |
993 | ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) { |
994 | #define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure |
995 | ::PROTOBUF_NAMESPACE_ID::uint32 tag; |
996 | // @@protoc_insertion_point(parse_start:tensorflow.data.UncompressedElement) |
997 | for (;;) { |
998 | ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); |
999 | tag = p.first; |
1000 | if (!p.second) goto handle_unusual; |
1001 | switch (::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::GetTagFieldNumber(tag)) { |
1002 | // repeated .tensorflow.TensorProto components = 1; |
1003 | case 1: { |
1004 | if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (10 & 0xFF)) { |
1005 | DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage( |
1006 | input, add_components())); |
1007 | } else { |
1008 | goto handle_unusual; |
1009 | } |
1010 | break; |
1011 | } |
1012 | |
1013 | default: { |
1014 | handle_unusual: |
1015 | if (tag == 0) { |
1016 | goto success; |
1017 | } |
1018 | DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SkipField( |
1019 | input, tag, _internal_metadata_.mutable_unknown_fields())); |
1020 | break; |
1021 | } |
1022 | } |
1023 | } |
1024 | success: |
1025 | // @@protoc_insertion_point(parse_success:tensorflow.data.UncompressedElement) |
1026 | return true; |
1027 | failure: |
1028 | // @@protoc_insertion_point(parse_failure:tensorflow.data.UncompressedElement) |
1029 | return false; |
1030 | #undef DO_ |
1031 | } |
1032 | #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER |
1033 | |
1034 | void UncompressedElement::SerializeWithCachedSizes( |
1035 | ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const { |
1036 | // @@protoc_insertion_point(serialize_start:tensorflow.data.UncompressedElement) |
1037 | ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; |
1038 | (void) cached_has_bits; |
1039 | |
1040 | // repeated .tensorflow.TensorProto components = 1; |
1041 | for (unsigned int i = 0, |
1042 | n = static_cast<unsigned int>(this->components_size()); i < n; i++) { |
1043 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray( |
1044 | 1, |
1045 | this->components(static_cast<int>(i)), |
1046 | output); |
1047 | } |
1048 | |
1049 | if (_internal_metadata_.have_unknown_fields()) { |
1050 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields( |
1051 | _internal_metadata_.unknown_fields(), output); |
1052 | } |
1053 | // @@protoc_insertion_point(serialize_end:tensorflow.data.UncompressedElement) |
1054 | } |
1055 | |
1056 | ::PROTOBUF_NAMESPACE_ID::uint8* UncompressedElement::InternalSerializeWithCachedSizesToArray( |
1057 | ::PROTOBUF_NAMESPACE_ID::uint8* target) const { |
1058 | // @@protoc_insertion_point(serialize_to_array_start:tensorflow.data.UncompressedElement) |
1059 | ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; |
1060 | (void) cached_has_bits; |
1061 | |
1062 | // repeated .tensorflow.TensorProto components = 1; |
1063 | for (unsigned int i = 0, |
1064 | n = static_cast<unsigned int>(this->components_size()); i < n; i++) { |
1065 | target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: |
1066 | InternalWriteMessageToArray( |
1067 | 1, this->components(static_cast<int>(i)), target); |
1068 | } |
1069 | |
1070 | if (_internal_metadata_.have_unknown_fields()) { |
1071 | target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray( |
1072 | _internal_metadata_.unknown_fields(), target); |
1073 | } |
1074 | // @@protoc_insertion_point(serialize_to_array_end:tensorflow.data.UncompressedElement) |
1075 | return target; |
1076 | } |
1077 | |
1078 | size_t UncompressedElement::ByteSizeLong() const { |
1079 | // @@protoc_insertion_point(message_byte_size_start:tensorflow.data.UncompressedElement) |
1080 | size_t total_size = 0; |
1081 | |
1082 | if (_internal_metadata_.have_unknown_fields()) { |
1083 | total_size += |
1084 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::ComputeUnknownFieldsSize( |
1085 | _internal_metadata_.unknown_fields()); |
1086 | } |
1087 | ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; |
1088 | // Prevent compiler warnings about cached_has_bits being unused |
1089 | (void) cached_has_bits; |
1090 | |
1091 | // repeated .tensorflow.TensorProto components = 1; |
1092 | { |
1093 | unsigned int count = static_cast<unsigned int>(this->components_size()); |
1094 | total_size += 1UL * count; |
1095 | for (unsigned int i = 0; i < count; i++) { |
1096 | total_size += |
1097 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( |
1098 | this->components(static_cast<int>(i))); |
1099 | } |
1100 | } |
1101 | |
1102 | int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); |
1103 | SetCachedSize(cached_size); |
1104 | return total_size; |
1105 | } |
1106 | |
1107 | void UncompressedElement::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { |
1108 | // @@protoc_insertion_point(generalized_merge_from_start:tensorflow.data.UncompressedElement) |
1109 | GOOGLE_DCHECK_NE(&from, this); |
1110 | const UncompressedElement* source = |
1111 | ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<UncompressedElement>( |
1112 | &from); |
1113 | if (source == nullptr) { |
1114 | // @@protoc_insertion_point(generalized_merge_from_cast_fail:tensorflow.data.UncompressedElement) |
1115 | ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); |
1116 | } else { |
1117 | // @@protoc_insertion_point(generalized_merge_from_cast_success:tensorflow.data.UncompressedElement) |
1118 | MergeFrom(*source); |
1119 | } |
1120 | } |
1121 | |
1122 | void UncompressedElement::MergeFrom(const UncompressedElement& from) { |
1123 | // @@protoc_insertion_point(class_specific_merge_from_start:tensorflow.data.UncompressedElement) |
1124 | GOOGLE_DCHECK_NE(&from, this); |
1125 | _internal_metadata_.MergeFrom(from._internal_metadata_); |
1126 | ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; |
1127 | (void) cached_has_bits; |
1128 | |
1129 | components_.MergeFrom(from.components_); |
1130 | } |
1131 | |
1132 | void UncompressedElement::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { |
1133 | // @@protoc_insertion_point(generalized_copy_from_start:tensorflow.data.UncompressedElement) |
1134 | if (&from == this) return; |
1135 | Clear(); |
1136 | MergeFrom(from); |
1137 | } |
1138 | |
1139 | void UncompressedElement::CopyFrom(const UncompressedElement& from) { |
1140 | // @@protoc_insertion_point(class_specific_copy_from_start:tensorflow.data.UncompressedElement) |
1141 | if (&from == this) return; |
1142 | Clear(); |
1143 | MergeFrom(from); |
1144 | } |
1145 | |
1146 | bool UncompressedElement::IsInitialized() const { |
1147 | return true; |
1148 | } |
1149 | |
1150 | void UncompressedElement::InternalSwap(UncompressedElement* other) { |
1151 | using std::swap; |
1152 | _internal_metadata_.Swap(&other->_internal_metadata_); |
1153 | CastToBase(&components_)->InternalSwap(CastToBase(&other->components_)); |
1154 | } |
1155 | |
1156 | ::PROTOBUF_NAMESPACE_ID::Metadata UncompressedElement::GetMetadata() const { |
1157 | return GetMetadataStatic(); |
1158 | } |
1159 | |
1160 | |
1161 | // @@protoc_insertion_point(namespace_scope) |
1162 | } // namespace data |
1163 | } // namespace tensorflow |
1164 | PROTOBUF_NAMESPACE_OPEN |
1165 | template<> PROTOBUF_NOINLINE ::tensorflow::data::CompressedComponentMetadata* Arena::CreateMaybeMessage< ::tensorflow::data::CompressedComponentMetadata >(Arena* arena) { |
1166 | return Arena::CreateMessageInternal< ::tensorflow::data::CompressedComponentMetadata >(arena); |
1167 | } |
1168 | template<> PROTOBUF_NOINLINE ::tensorflow::data::CompressedElement* Arena::CreateMaybeMessage< ::tensorflow::data::CompressedElement >(Arena* arena) { |
1169 | return Arena::CreateMessageInternal< ::tensorflow::data::CompressedElement >(arena); |
1170 | } |
1171 | template<> PROTOBUF_NOINLINE ::tensorflow::data::UncompressedElement* Arena::CreateMaybeMessage< ::tensorflow::data::UncompressedElement >(Arena* arena) { |
1172 | return Arena::CreateMessageInternal< ::tensorflow::data::UncompressedElement >(arena); |
1173 | } |
1174 | PROTOBUF_NAMESPACE_CLOSE |
1175 | |
1176 | // @@protoc_insertion_point(global_scope) |
1177 | #include <google/protobuf/port_undef.inc> |
1178 | |