1 | // Generated by the protocol buffer compiler. DO NOT EDIT! |
2 | // source: tensorflow/core/framework/tensor.proto |
3 | |
4 | #include "tensorflow/core/framework/tensor.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_2fresource_5fhandle_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_ResourceHandleProto_tensorflow_2fcore_2fframework_2fresource_5fhandle_2eproto; |
19 | extern PROTOBUF_INTERNAL_EXPORT_tensorflow_2fcore_2fframework_2ftensor_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<2> scc_info_TensorProto_tensorflow_2fcore_2fframework_2ftensor_2eproto; |
20 | 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; |
21 | namespace tensorflow { |
22 | class TensorProtoDefaultTypeInternal { |
23 | public: |
24 | ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<TensorProto> _instance; |
25 | } _TensorProto_default_instance_; |
26 | class VariantTensorDataProtoDefaultTypeInternal { |
27 | public: |
28 | ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<VariantTensorDataProto> _instance; |
29 | } _VariantTensorDataProto_default_instance_; |
30 | } // namespace tensorflow |
31 | static void InitDefaultsscc_info_TensorProto_tensorflow_2fcore_2fframework_2ftensor_2eproto() { |
32 | GOOGLE_PROTOBUF_VERIFY_VERSION; |
33 | |
34 | { |
35 | void* ptr = &::tensorflow::_TensorProto_default_instance_; |
36 | new (ptr) ::tensorflow::TensorProto(); |
37 | ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); |
38 | } |
39 | { |
40 | void* ptr = &::tensorflow::_VariantTensorDataProto_default_instance_; |
41 | new (ptr) ::tensorflow::VariantTensorDataProto(); |
42 | ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); |
43 | } |
44 | ::tensorflow::TensorProto::InitAsDefaultInstance(); |
45 | ::tensorflow::VariantTensorDataProto::InitAsDefaultInstance(); |
46 | } |
47 | |
48 | ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<2> scc_info_TensorProto_tensorflow_2fcore_2fframework_2ftensor_2eproto = |
49 | {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 2, InitDefaultsscc_info_TensorProto_tensorflow_2fcore_2fframework_2ftensor_2eproto}, { |
50 | &scc_info_TensorShapeProto_tensorflow_2fcore_2fframework_2ftensor_5fshape_2eproto.base, |
51 | &scc_info_ResourceHandleProto_tensorflow_2fcore_2fframework_2fresource_5fhandle_2eproto.base,}}; |
52 | |
53 | static ::PROTOBUF_NAMESPACE_ID::Metadata file_level_metadata_tensorflow_2fcore_2fframework_2ftensor_2eproto[2]; |
54 | static constexpr ::PROTOBUF_NAMESPACE_ID::EnumDescriptor const** file_level_enum_descriptors_tensorflow_2fcore_2fframework_2ftensor_2eproto = nullptr; |
55 | static constexpr ::PROTOBUF_NAMESPACE_ID::ServiceDescriptor const** file_level_service_descriptors_tensorflow_2fcore_2fframework_2ftensor_2eproto = nullptr; |
56 | |
57 | const ::PROTOBUF_NAMESPACE_ID::uint32 TableStruct_tensorflow_2fcore_2fframework_2ftensor_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { |
58 | ~0u, // no _has_bits_ |
59 | PROTOBUF_FIELD_OFFSET(::tensorflow::TensorProto, _internal_metadata_), |
60 | ~0u, // no _extensions_ |
61 | ~0u, // no _oneof_case_ |
62 | ~0u, // no _weak_field_map_ |
63 | PROTOBUF_FIELD_OFFSET(::tensorflow::TensorProto, dtype_), |
64 | PROTOBUF_FIELD_OFFSET(::tensorflow::TensorProto, tensor_shape_), |
65 | PROTOBUF_FIELD_OFFSET(::tensorflow::TensorProto, version_number_), |
66 | PROTOBUF_FIELD_OFFSET(::tensorflow::TensorProto, tensor_content_), |
67 | PROTOBUF_FIELD_OFFSET(::tensorflow::TensorProto, half_val_), |
68 | PROTOBUF_FIELD_OFFSET(::tensorflow::TensorProto, float_val_), |
69 | PROTOBUF_FIELD_OFFSET(::tensorflow::TensorProto, double_val_), |
70 | PROTOBUF_FIELD_OFFSET(::tensorflow::TensorProto, int_val_), |
71 | PROTOBUF_FIELD_OFFSET(::tensorflow::TensorProto, string_val_), |
72 | PROTOBUF_FIELD_OFFSET(::tensorflow::TensorProto, scomplex_val_), |
73 | PROTOBUF_FIELD_OFFSET(::tensorflow::TensorProto, int64_val_), |
74 | PROTOBUF_FIELD_OFFSET(::tensorflow::TensorProto, bool_val_), |
75 | PROTOBUF_FIELD_OFFSET(::tensorflow::TensorProto, dcomplex_val_), |
76 | PROTOBUF_FIELD_OFFSET(::tensorflow::TensorProto, resource_handle_val_), |
77 | PROTOBUF_FIELD_OFFSET(::tensorflow::TensorProto, variant_val_), |
78 | PROTOBUF_FIELD_OFFSET(::tensorflow::TensorProto, uint32_val_), |
79 | PROTOBUF_FIELD_OFFSET(::tensorflow::TensorProto, uint64_val_), |
80 | ~0u, // no _has_bits_ |
81 | PROTOBUF_FIELD_OFFSET(::tensorflow::VariantTensorDataProto, _internal_metadata_), |
82 | ~0u, // no _extensions_ |
83 | ~0u, // no _oneof_case_ |
84 | ~0u, // no _weak_field_map_ |
85 | PROTOBUF_FIELD_OFFSET(::tensorflow::VariantTensorDataProto, type_name_), |
86 | PROTOBUF_FIELD_OFFSET(::tensorflow::VariantTensorDataProto, metadata_), |
87 | PROTOBUF_FIELD_OFFSET(::tensorflow::VariantTensorDataProto, tensors_), |
88 | }; |
89 | static const ::PROTOBUF_NAMESPACE_ID::internal::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { |
90 | { 0, -1, sizeof(::tensorflow::TensorProto)}, |
91 | { 22, -1, sizeof(::tensorflow::VariantTensorDataProto)}, |
92 | }; |
93 | |
94 | static ::PROTOBUF_NAMESPACE_ID::Message const * const file_default_instances[] = { |
95 | reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::tensorflow::_TensorProto_default_instance_), |
96 | reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::tensorflow::_VariantTensorDataProto_default_instance_), |
97 | }; |
98 | |
99 | const char descriptor_table_protodef_tensorflow_2fcore_2fframework_2ftensor_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = |
100 | "\n&tensorflow/core/framework/tensor.proto" |
101 | "\022\ntensorflow\032/tensorflow/core/framework/" |
102 | "resource_handle.proto\032,tensorflow/core/f" |
103 | "ramework/tensor_shape.proto\032%tensorflow/" |
104 | "core/framework/types.proto\"\214\004\n\013TensorPro" |
105 | "to\022#\n\005dtype\030\001 \001(\0162\024.tensorflow.DataType\022" |
106 | "2\n\014tensor_shape\030\002 \001(\0132\034.tensorflow.Tenso" |
107 | "rShapeProto\022\026\n\016version_number\030\003 \001(\005\022\026\n\016t" |
108 | "ensor_content\030\004 \001(\014\022\024\n\010half_val\030\r \003(\005B\002\020" |
109 | "\001\022\025\n\tfloat_val\030\005 \003(\002B\002\020\001\022\026\n\ndouble_val\030\006" |
110 | " \003(\001B\002\020\001\022\023\n\007int_val\030\007 \003(\005B\002\020\001\022\022\n\nstring_" |
111 | "val\030\010 \003(\014\022\030\n\014scomplex_val\030\t \003(\002B\002\020\001\022\025\n\ti" |
112 | "nt64_val\030\n \003(\003B\002\020\001\022\024\n\010bool_val\030\013 \003(\010B\002\020\001" |
113 | "\022\030\n\014dcomplex_val\030\014 \003(\001B\002\020\001\022<\n\023resource_h" |
114 | "andle_val\030\016 \003(\0132\037.tensorflow.ResourceHan" |
115 | "dleProto\0227\n\013variant_val\030\017 \003(\0132\".tensorfl" |
116 | "ow.VariantTensorDataProto\022\026\n\nuint32_val\030" |
117 | "\020 \003(\rB\002\020\001\022\026\n\nuint64_val\030\021 \003(\004B\002\020\001\"g\n\026Var" |
118 | "iantTensorDataProto\022\021\n\ttype_name\030\001 \001(\t\022\020" |
119 | "\n\010metadata\030\002 \001(\014\022(\n\007tensors\030\003 \003(\0132\027.tens" |
120 | "orflow.TensorProtoB|\n\030org.tensorflow.fra" |
121 | "meworkB\014TensorProtosP\001ZMgithub.com/tenso" |
122 | "rflow/tensorflow/tensorflow/go/core/fram" |
123 | "ework/tensor_go_proto\370\001\001b\006proto3" |
124 | ; |
125 | static const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable*const descriptor_table_tensorflow_2fcore_2fframework_2ftensor_2eproto_deps[3] = { |
126 | &::descriptor_table_tensorflow_2fcore_2fframework_2fresource_5fhandle_2eproto, |
127 | &::descriptor_table_tensorflow_2fcore_2fframework_2ftensor_5fshape_2eproto, |
128 | &::descriptor_table_tensorflow_2fcore_2fframework_2ftypes_2eproto, |
129 | }; |
130 | static ::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase*const descriptor_table_tensorflow_2fcore_2fframework_2ftensor_2eproto_sccs[1] = { |
131 | &scc_info_TensorProto_tensorflow_2fcore_2fframework_2ftensor_2eproto.base, |
132 | }; |
133 | static ::PROTOBUF_NAMESPACE_ID::internal::once_flag descriptor_table_tensorflow_2fcore_2fframework_2ftensor_2eproto_once; |
134 | static bool descriptor_table_tensorflow_2fcore_2fframework_2ftensor_2eproto_initialized = false; |
135 | const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_tensorflow_2fcore_2fframework_2ftensor_2eproto = { |
136 | &descriptor_table_tensorflow_2fcore_2fframework_2ftensor_2eproto_initialized, descriptor_table_protodef_tensorflow_2fcore_2fframework_2ftensor_2eproto, "tensorflow/core/framework/tensor.proto" , 952, |
137 | &descriptor_table_tensorflow_2fcore_2fframework_2ftensor_2eproto_once, descriptor_table_tensorflow_2fcore_2fframework_2ftensor_2eproto_sccs, descriptor_table_tensorflow_2fcore_2fframework_2ftensor_2eproto_deps, 1, 3, |
138 | schemas, file_default_instances, TableStruct_tensorflow_2fcore_2fframework_2ftensor_2eproto::offsets, |
139 | file_level_metadata_tensorflow_2fcore_2fframework_2ftensor_2eproto, 2, file_level_enum_descriptors_tensorflow_2fcore_2fframework_2ftensor_2eproto, file_level_service_descriptors_tensorflow_2fcore_2fframework_2ftensor_2eproto, |
140 | }; |
141 | |
142 | // Force running AddDescriptors() at dynamic initialization time. |
143 | static bool dynamic_init_dummy_tensorflow_2fcore_2fframework_2ftensor_2eproto = ( ::PROTOBUF_NAMESPACE_ID::internal::AddDescriptors(&descriptor_table_tensorflow_2fcore_2fframework_2ftensor_2eproto), true); |
144 | namespace tensorflow { |
145 | |
146 | // =================================================================== |
147 | |
148 | void TensorProto::InitAsDefaultInstance() { |
149 | ::tensorflow::_TensorProto_default_instance_._instance.get_mutable()->tensor_shape_ = const_cast< ::tensorflow::TensorShapeProto*>( |
150 | ::tensorflow::TensorShapeProto::internal_default_instance()); |
151 | } |
152 | class TensorProto::_Internal { |
153 | public: |
154 | static const ::tensorflow::TensorShapeProto& tensor_shape(const TensorProto* msg); |
155 | }; |
156 | |
157 | const ::tensorflow::TensorShapeProto& |
158 | TensorProto::_Internal::tensor_shape(const TensorProto* msg) { |
159 | return *msg->tensor_shape_; |
160 | } |
161 | void TensorProto::unsafe_arena_set_allocated_tensor_shape( |
162 | ::tensorflow::TensorShapeProto* tensor_shape) { |
163 | if (GetArenaNoVirtual() == nullptr) { |
164 | delete tensor_shape_; |
165 | } |
166 | tensor_shape_ = tensor_shape; |
167 | if (tensor_shape) { |
168 | |
169 | } else { |
170 | |
171 | } |
172 | // @@protoc_insertion_point(field_unsafe_arena_set_allocated:tensorflow.TensorProto.tensor_shape) |
173 | } |
174 | void TensorProto::clear_tensor_shape() { |
175 | if (GetArenaNoVirtual() == nullptr && tensor_shape_ != nullptr) { |
176 | delete tensor_shape_; |
177 | } |
178 | tensor_shape_ = nullptr; |
179 | } |
180 | void TensorProto::clear_resource_handle_val() { |
181 | resource_handle_val_.Clear(); |
182 | } |
183 | TensorProto::TensorProto() |
184 | : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) { |
185 | SharedCtor(); |
186 | // @@protoc_insertion_point(constructor:tensorflow.TensorProto) |
187 | } |
188 | TensorProto::TensorProto(::PROTOBUF_NAMESPACE_ID::Arena* arena) |
189 | : ::PROTOBUF_NAMESPACE_ID::Message(), |
190 | _internal_metadata_(arena), |
191 | float_val_(arena), |
192 | double_val_(arena), |
193 | int_val_(arena), |
194 | string_val_(arena), |
195 | scomplex_val_(arena), |
196 | int64_val_(arena), |
197 | bool_val_(arena), |
198 | dcomplex_val_(arena), |
199 | half_val_(arena), |
200 | resource_handle_val_(arena), |
201 | variant_val_(arena), |
202 | uint32_val_(arena), |
203 | uint64_val_(arena) { |
204 | SharedCtor(); |
205 | RegisterArenaDtor(arena); |
206 | // @@protoc_insertion_point(arena_constructor:tensorflow.TensorProto) |
207 | } |
208 | TensorProto::TensorProto(const TensorProto& from) |
209 | : ::PROTOBUF_NAMESPACE_ID::Message(), |
210 | _internal_metadata_(nullptr), |
211 | float_val_(from.float_val_), |
212 | double_val_(from.double_val_), |
213 | int_val_(from.int_val_), |
214 | string_val_(from.string_val_), |
215 | scomplex_val_(from.scomplex_val_), |
216 | int64_val_(from.int64_val_), |
217 | bool_val_(from.bool_val_), |
218 | dcomplex_val_(from.dcomplex_val_), |
219 | half_val_(from.half_val_), |
220 | resource_handle_val_(from.resource_handle_val_), |
221 | variant_val_(from.variant_val_), |
222 | uint32_val_(from.uint32_val_), |
223 | uint64_val_(from.uint64_val_) { |
224 | _internal_metadata_.MergeFrom(from._internal_metadata_); |
225 | tensor_content_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); |
226 | if (!from.tensor_content().empty()) { |
227 | tensor_content_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.tensor_content(), |
228 | GetArenaNoVirtual()); |
229 | } |
230 | if (from.has_tensor_shape()) { |
231 | tensor_shape_ = new ::tensorflow::TensorShapeProto(*from.tensor_shape_); |
232 | } else { |
233 | tensor_shape_ = nullptr; |
234 | } |
235 | ::memcpy(&dtype_, &from.dtype_, |
236 | static_cast<size_t>(reinterpret_cast<char*>(&version_number_) - |
237 | reinterpret_cast<char*>(&dtype_)) + sizeof(version_number_)); |
238 | // @@protoc_insertion_point(copy_constructor:tensorflow.TensorProto) |
239 | } |
240 | |
241 | void TensorProto::SharedCtor() { |
242 | ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_TensorProto_tensorflow_2fcore_2fframework_2ftensor_2eproto.base); |
243 | tensor_content_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); |
244 | ::memset(&tensor_shape_, 0, static_cast<size_t>( |
245 | reinterpret_cast<char*>(&version_number_) - |
246 | reinterpret_cast<char*>(&tensor_shape_)) + sizeof(version_number_)); |
247 | } |
248 | |
249 | TensorProto::~TensorProto() { |
250 | // @@protoc_insertion_point(destructor:tensorflow.TensorProto) |
251 | SharedDtor(); |
252 | } |
253 | |
254 | void TensorProto::SharedDtor() { |
255 | GOOGLE_DCHECK(GetArenaNoVirtual() == nullptr); |
256 | tensor_content_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); |
257 | if (this != internal_default_instance()) delete tensor_shape_; |
258 | } |
259 | |
260 | void TensorProto::ArenaDtor(void* object) { |
261 | TensorProto* _this = reinterpret_cast< TensorProto* >(object); |
262 | (void)_this; |
263 | } |
264 | void TensorProto::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { |
265 | } |
266 | void TensorProto::SetCachedSize(int size) const { |
267 | _cached_size_.Set(size); |
268 | } |
269 | const TensorProto& TensorProto::default_instance() { |
270 | ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_TensorProto_tensorflow_2fcore_2fframework_2ftensor_2eproto.base); |
271 | return *internal_default_instance(); |
272 | } |
273 | |
274 | |
275 | void TensorProto::Clear() { |
276 | // @@protoc_insertion_point(message_clear_start:tensorflow.TensorProto) |
277 | ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; |
278 | // Prevent compiler warnings about cached_has_bits being unused |
279 | (void) cached_has_bits; |
280 | |
281 | float_val_.Clear(); |
282 | double_val_.Clear(); |
283 | int_val_.Clear(); |
284 | string_val_.Clear(); |
285 | scomplex_val_.Clear(); |
286 | int64_val_.Clear(); |
287 | bool_val_.Clear(); |
288 | dcomplex_val_.Clear(); |
289 | half_val_.Clear(); |
290 | resource_handle_val_.Clear(); |
291 | variant_val_.Clear(); |
292 | uint32_val_.Clear(); |
293 | uint64_val_.Clear(); |
294 | tensor_content_.ClearToEmpty(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); |
295 | if (GetArenaNoVirtual() == nullptr && tensor_shape_ != nullptr) { |
296 | delete tensor_shape_; |
297 | } |
298 | tensor_shape_ = nullptr; |
299 | ::memset(&dtype_, 0, static_cast<size_t>( |
300 | reinterpret_cast<char*>(&version_number_) - |
301 | reinterpret_cast<char*>(&dtype_)) + sizeof(version_number_)); |
302 | _internal_metadata_.Clear(); |
303 | } |
304 | |
305 | #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER |
306 | const char* TensorProto::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { |
307 | #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure |
308 | ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArenaNoVirtual(); (void)arena; |
309 | while (!ctx->Done(&ptr)) { |
310 | ::PROTOBUF_NAMESPACE_ID::uint32 tag; |
311 | ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); |
312 | CHK_(ptr); |
313 | switch (tag >> 3) { |
314 | // .tensorflow.DataType dtype = 1; |
315 | case 1: |
316 | if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) { |
317 | ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); |
318 | CHK_(ptr); |
319 | set_dtype(static_cast<::tensorflow::DataType>(val)); |
320 | } else goto handle_unusual; |
321 | continue; |
322 | // .tensorflow.TensorShapeProto tensor_shape = 2; |
323 | case 2: |
324 | if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { |
325 | ptr = ctx->ParseMessage(mutable_tensor_shape(), ptr); |
326 | CHK_(ptr); |
327 | } else goto handle_unusual; |
328 | continue; |
329 | // int32 version_number = 3; |
330 | case 3: |
331 | if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24)) { |
332 | version_number_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); |
333 | CHK_(ptr); |
334 | } else goto handle_unusual; |
335 | continue; |
336 | // bytes tensor_content = 4; |
337 | case 4: |
338 | if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 34)) { |
339 | ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(mutable_tensor_content(), ptr, ctx); |
340 | CHK_(ptr); |
341 | } else goto handle_unusual; |
342 | continue; |
343 | // repeated float float_val = 5 [packed = true]; |
344 | case 5: |
345 | if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 42)) { |
346 | ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedFloatParser(mutable_float_val(), ptr, ctx); |
347 | CHK_(ptr); |
348 | } else if (static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 45) { |
349 | add_float_val(::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr)); |
350 | ptr += sizeof(float); |
351 | } else goto handle_unusual; |
352 | continue; |
353 | // repeated double double_val = 6 [packed = true]; |
354 | case 6: |
355 | if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 50)) { |
356 | ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedDoubleParser(mutable_double_val(), ptr, ctx); |
357 | CHK_(ptr); |
358 | } else if (static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 49) { |
359 | add_double_val(::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<double>(ptr)); |
360 | ptr += sizeof(double); |
361 | } else goto handle_unusual; |
362 | continue; |
363 | // repeated int32 int_val = 7 [packed = true]; |
364 | case 7: |
365 | if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 58)) { |
366 | ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedInt32Parser(mutable_int_val(), ptr, ctx); |
367 | CHK_(ptr); |
368 | } else if (static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 56) { |
369 | add_int_val(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr)); |
370 | CHK_(ptr); |
371 | } else goto handle_unusual; |
372 | continue; |
373 | // repeated bytes string_val = 8; |
374 | case 8: |
375 | if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 66)) { |
376 | ptr -= 1; |
377 | do { |
378 | ptr += 1; |
379 | ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(add_string_val(), ptr, ctx); |
380 | CHK_(ptr); |
381 | if (!ctx->DataAvailable(ptr)) break; |
382 | } while (::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<::PROTOBUF_NAMESPACE_ID::uint8>(ptr) == 66); |
383 | } else goto handle_unusual; |
384 | continue; |
385 | // repeated float scomplex_val = 9 [packed = true]; |
386 | case 9: |
387 | if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 74)) { |
388 | ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedFloatParser(mutable_scomplex_val(), ptr, ctx); |
389 | CHK_(ptr); |
390 | } else if (static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 77) { |
391 | add_scomplex_val(::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr)); |
392 | ptr += sizeof(float); |
393 | } else goto handle_unusual; |
394 | continue; |
395 | // repeated int64 int64_val = 10 [packed = true]; |
396 | case 10: |
397 | if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 82)) { |
398 | ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedInt64Parser(mutable_int64_val(), ptr, ctx); |
399 | CHK_(ptr); |
400 | } else if (static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 80) { |
401 | add_int64_val(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr)); |
402 | CHK_(ptr); |
403 | } else goto handle_unusual; |
404 | continue; |
405 | // repeated bool bool_val = 11 [packed = true]; |
406 | case 11: |
407 | if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 90)) { |
408 | ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedBoolParser(mutable_bool_val(), ptr, ctx); |
409 | CHK_(ptr); |
410 | } else if (static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 88) { |
411 | add_bool_val(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr)); |
412 | CHK_(ptr); |
413 | } else goto handle_unusual; |
414 | continue; |
415 | // repeated double dcomplex_val = 12 [packed = true]; |
416 | case 12: |
417 | if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 98)) { |
418 | ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedDoubleParser(mutable_dcomplex_val(), ptr, ctx); |
419 | CHK_(ptr); |
420 | } else if (static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 97) { |
421 | add_dcomplex_val(::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<double>(ptr)); |
422 | ptr += sizeof(double); |
423 | } else goto handle_unusual; |
424 | continue; |
425 | // repeated int32 half_val = 13 [packed = true]; |
426 | case 13: |
427 | if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 106)) { |
428 | ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedInt32Parser(mutable_half_val(), ptr, ctx); |
429 | CHK_(ptr); |
430 | } else if (static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 104) { |
431 | add_half_val(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr)); |
432 | CHK_(ptr); |
433 | } else goto handle_unusual; |
434 | continue; |
435 | // repeated .tensorflow.ResourceHandleProto resource_handle_val = 14; |
436 | case 14: |
437 | if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 114)) { |
438 | ptr -= 1; |
439 | do { |
440 | ptr += 1; |
441 | ptr = ctx->ParseMessage(add_resource_handle_val(), ptr); |
442 | CHK_(ptr); |
443 | if (!ctx->DataAvailable(ptr)) break; |
444 | } while (::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<::PROTOBUF_NAMESPACE_ID::uint8>(ptr) == 114); |
445 | } else goto handle_unusual; |
446 | continue; |
447 | // repeated .tensorflow.VariantTensorDataProto variant_val = 15; |
448 | case 15: |
449 | if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 122)) { |
450 | ptr -= 1; |
451 | do { |
452 | ptr += 1; |
453 | ptr = ctx->ParseMessage(add_variant_val(), ptr); |
454 | CHK_(ptr); |
455 | if (!ctx->DataAvailable(ptr)) break; |
456 | } while (::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<::PROTOBUF_NAMESPACE_ID::uint8>(ptr) == 122); |
457 | } else goto handle_unusual; |
458 | continue; |
459 | // repeated uint32 uint32_val = 16 [packed = true]; |
460 | case 16: |
461 | if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 130)) { |
462 | ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedUInt32Parser(mutable_uint32_val(), ptr, ctx); |
463 | CHK_(ptr); |
464 | } else if (static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 128) { |
465 | add_uint32_val(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr)); |
466 | CHK_(ptr); |
467 | } else goto handle_unusual; |
468 | continue; |
469 | // repeated uint64 uint64_val = 17 [packed = true]; |
470 | case 17: |
471 | if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 138)) { |
472 | ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedUInt64Parser(mutable_uint64_val(), ptr, ctx); |
473 | CHK_(ptr); |
474 | } else if (static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 136) { |
475 | add_uint64_val(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr)); |
476 | CHK_(ptr); |
477 | } else goto handle_unusual; |
478 | continue; |
479 | default: { |
480 | handle_unusual: |
481 | if ((tag & 7) == 4 || tag == 0) { |
482 | ctx->SetLastTag(tag); |
483 | goto success; |
484 | } |
485 | ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx); |
486 | CHK_(ptr != nullptr); |
487 | continue; |
488 | } |
489 | } // switch |
490 | } // while |
491 | success: |
492 | return ptr; |
493 | failure: |
494 | ptr = nullptr; |
495 | goto success; |
496 | #undef CHK_ |
497 | } |
498 | #else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER |
499 | bool TensorProto::MergePartialFromCodedStream( |
500 | ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) { |
501 | #define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure |
502 | ::PROTOBUF_NAMESPACE_ID::uint32 tag; |
503 | // @@protoc_insertion_point(parse_start:tensorflow.TensorProto) |
504 | for (;;) { |
505 | ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(16383u); |
506 | tag = p.first; |
507 | if (!p.second) goto handle_unusual; |
508 | switch (::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::GetTagFieldNumber(tag)) { |
509 | // .tensorflow.DataType dtype = 1; |
510 | case 1: { |
511 | if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (8 & 0xFF)) { |
512 | int value = 0; |
513 | DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< |
514 | int, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_ENUM>( |
515 | input, &value))); |
516 | set_dtype(static_cast< ::tensorflow::DataType >(value)); |
517 | } else { |
518 | goto handle_unusual; |
519 | } |
520 | break; |
521 | } |
522 | |
523 | // .tensorflow.TensorShapeProto tensor_shape = 2; |
524 | case 2: { |
525 | if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (18 & 0xFF)) { |
526 | DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage( |
527 | input, mutable_tensor_shape())); |
528 | } else { |
529 | goto handle_unusual; |
530 | } |
531 | break; |
532 | } |
533 | |
534 | // int32 version_number = 3; |
535 | case 3: { |
536 | if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (24 & 0xFF)) { |
537 | |
538 | DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< |
539 | ::PROTOBUF_NAMESPACE_ID::int32, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT32>( |
540 | input, &version_number_))); |
541 | } else { |
542 | goto handle_unusual; |
543 | } |
544 | break; |
545 | } |
546 | |
547 | // bytes tensor_content = 4; |
548 | case 4: { |
549 | if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (34 & 0xFF)) { |
550 | DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadBytes( |
551 | input, this->mutable_tensor_content())); |
552 | } else { |
553 | goto handle_unusual; |
554 | } |
555 | break; |
556 | } |
557 | |
558 | // repeated float float_val = 5 [packed = true]; |
559 | case 5: { |
560 | if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (42 & 0xFF)) { |
561 | DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPackedPrimitive< |
562 | float, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_FLOAT>( |
563 | input, this->mutable_float_val()))); |
564 | } else if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (45 & 0xFF)) { |
565 | DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< |
566 | float, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_FLOAT>( |
567 | 1, 42u, input, this->mutable_float_val()))); |
568 | } else { |
569 | goto handle_unusual; |
570 | } |
571 | break; |
572 | } |
573 | |
574 | // repeated double double_val = 6 [packed = true]; |
575 | case 6: { |
576 | if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (50 & 0xFF)) { |
577 | DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPackedPrimitive< |
578 | double, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_DOUBLE>( |
579 | input, this->mutable_double_val()))); |
580 | } else if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (49 & 0xFF)) { |
581 | DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< |
582 | double, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_DOUBLE>( |
583 | 1, 50u, input, this->mutable_double_val()))); |
584 | } else { |
585 | goto handle_unusual; |
586 | } |
587 | break; |
588 | } |
589 | |
590 | // repeated int32 int_val = 7 [packed = true]; |
591 | case 7: { |
592 | if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (58 & 0xFF)) { |
593 | DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPackedPrimitive< |
594 | ::PROTOBUF_NAMESPACE_ID::int32, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT32>( |
595 | input, this->mutable_int_val()))); |
596 | } else if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (56 & 0xFF)) { |
597 | DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< |
598 | ::PROTOBUF_NAMESPACE_ID::int32, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT32>( |
599 | 1, 58u, input, this->mutable_int_val()))); |
600 | } else { |
601 | goto handle_unusual; |
602 | } |
603 | break; |
604 | } |
605 | |
606 | // repeated bytes string_val = 8; |
607 | case 8: { |
608 | if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (66 & 0xFF)) { |
609 | DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadBytes( |
610 | input, this->add_string_val())); |
611 | } else { |
612 | goto handle_unusual; |
613 | } |
614 | break; |
615 | } |
616 | |
617 | // repeated float scomplex_val = 9 [packed = true]; |
618 | case 9: { |
619 | if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (74 & 0xFF)) { |
620 | DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPackedPrimitive< |
621 | float, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_FLOAT>( |
622 | input, this->mutable_scomplex_val()))); |
623 | } else if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (77 & 0xFF)) { |
624 | DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< |
625 | float, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_FLOAT>( |
626 | 1, 74u, input, this->mutable_scomplex_val()))); |
627 | } else { |
628 | goto handle_unusual; |
629 | } |
630 | break; |
631 | } |
632 | |
633 | // repeated int64 int64_val = 10 [packed = true]; |
634 | case 10: { |
635 | if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (82 & 0xFF)) { |
636 | DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPackedPrimitive< |
637 | ::PROTOBUF_NAMESPACE_ID::int64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT64>( |
638 | input, this->mutable_int64_val()))); |
639 | } else if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (80 & 0xFF)) { |
640 | DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< |
641 | ::PROTOBUF_NAMESPACE_ID::int64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT64>( |
642 | 1, 82u, input, this->mutable_int64_val()))); |
643 | } else { |
644 | goto handle_unusual; |
645 | } |
646 | break; |
647 | } |
648 | |
649 | // repeated bool bool_val = 11 [packed = true]; |
650 | case 11: { |
651 | if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (90 & 0xFF)) { |
652 | DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPackedPrimitive< |
653 | bool, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_BOOL>( |
654 | input, this->mutable_bool_val()))); |
655 | } else if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (88 & 0xFF)) { |
656 | DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< |
657 | bool, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_BOOL>( |
658 | 1, 90u, input, this->mutable_bool_val()))); |
659 | } else { |
660 | goto handle_unusual; |
661 | } |
662 | break; |
663 | } |
664 | |
665 | // repeated double dcomplex_val = 12 [packed = true]; |
666 | case 12: { |
667 | if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (98 & 0xFF)) { |
668 | DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPackedPrimitive< |
669 | double, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_DOUBLE>( |
670 | input, this->mutable_dcomplex_val()))); |
671 | } else if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (97 & 0xFF)) { |
672 | DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< |
673 | double, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_DOUBLE>( |
674 | 1, 98u, input, this->mutable_dcomplex_val()))); |
675 | } else { |
676 | goto handle_unusual; |
677 | } |
678 | break; |
679 | } |
680 | |
681 | // repeated int32 half_val = 13 [packed = true]; |
682 | case 13: { |
683 | if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (106 & 0xFF)) { |
684 | DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPackedPrimitive< |
685 | ::PROTOBUF_NAMESPACE_ID::int32, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT32>( |
686 | input, this->mutable_half_val()))); |
687 | } else if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (104 & 0xFF)) { |
688 | DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< |
689 | ::PROTOBUF_NAMESPACE_ID::int32, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT32>( |
690 | 1, 106u, input, this->mutable_half_val()))); |
691 | } else { |
692 | goto handle_unusual; |
693 | } |
694 | break; |
695 | } |
696 | |
697 | // repeated .tensorflow.ResourceHandleProto resource_handle_val = 14; |
698 | case 14: { |
699 | if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (114 & 0xFF)) { |
700 | DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage( |
701 | input, add_resource_handle_val())); |
702 | } else { |
703 | goto handle_unusual; |
704 | } |
705 | break; |
706 | } |
707 | |
708 | // repeated .tensorflow.VariantTensorDataProto variant_val = 15; |
709 | case 15: { |
710 | if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (122 & 0xFF)) { |
711 | DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage( |
712 | input, add_variant_val())); |
713 | } else { |
714 | goto handle_unusual; |
715 | } |
716 | break; |
717 | } |
718 | |
719 | // repeated uint32 uint32_val = 16 [packed = true]; |
720 | case 16: { |
721 | if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (130 & 0xFF)) { |
722 | DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPackedPrimitive< |
723 | ::PROTOBUF_NAMESPACE_ID::uint32, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_UINT32>( |
724 | input, this->mutable_uint32_val()))); |
725 | } else if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (128 & 0xFF)) { |
726 | DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< |
727 | ::PROTOBUF_NAMESPACE_ID::uint32, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_UINT32>( |
728 | 2, 130u, input, this->mutable_uint32_val()))); |
729 | } else { |
730 | goto handle_unusual; |
731 | } |
732 | break; |
733 | } |
734 | |
735 | // repeated uint64 uint64_val = 17 [packed = true]; |
736 | case 17: { |
737 | if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (138 & 0xFF)) { |
738 | DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPackedPrimitive< |
739 | ::PROTOBUF_NAMESPACE_ID::uint64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_UINT64>( |
740 | input, this->mutable_uint64_val()))); |
741 | } else if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (136 & 0xFF)) { |
742 | DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< |
743 | ::PROTOBUF_NAMESPACE_ID::uint64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_UINT64>( |
744 | 2, 138u, input, this->mutable_uint64_val()))); |
745 | } else { |
746 | goto handle_unusual; |
747 | } |
748 | break; |
749 | } |
750 | |
751 | default: { |
752 | handle_unusual: |
753 | if (tag == 0) { |
754 | goto success; |
755 | } |
756 | DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SkipField( |
757 | input, tag, _internal_metadata_.mutable_unknown_fields())); |
758 | break; |
759 | } |
760 | } |
761 | } |
762 | success: |
763 | // @@protoc_insertion_point(parse_success:tensorflow.TensorProto) |
764 | return true; |
765 | failure: |
766 | // @@protoc_insertion_point(parse_failure:tensorflow.TensorProto) |
767 | return false; |
768 | #undef DO_ |
769 | } |
770 | #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER |
771 | |
772 | void TensorProto::SerializeWithCachedSizes( |
773 | ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const { |
774 | // @@protoc_insertion_point(serialize_start:tensorflow.TensorProto) |
775 | ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; |
776 | (void) cached_has_bits; |
777 | |
778 | // .tensorflow.DataType dtype = 1; |
779 | if (this->dtype() != 0) { |
780 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnum( |
781 | 1, this->dtype(), output); |
782 | } |
783 | |
784 | // .tensorflow.TensorShapeProto tensor_shape = 2; |
785 | if (this->has_tensor_shape()) { |
786 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray( |
787 | 2, _Internal::tensor_shape(this), output); |
788 | } |
789 | |
790 | // int32 version_number = 3; |
791 | if (this->version_number() != 0) { |
792 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32(3, this->version_number(), output); |
793 | } |
794 | |
795 | // bytes tensor_content = 4; |
796 | if (this->tensor_content().size() > 0) { |
797 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBytesMaybeAliased( |
798 | 4, this->tensor_content(), output); |
799 | } |
800 | |
801 | // repeated float float_val = 5 [packed = true]; |
802 | if (this->float_val_size() > 0) { |
803 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteTag(5, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); |
804 | output->WriteVarint32(_float_val_cached_byte_size_.load( |
805 | std::memory_order_relaxed)); |
806 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatArray( |
807 | this->float_val().data(), this->float_val_size(), output); |
808 | } |
809 | |
810 | // repeated double double_val = 6 [packed = true]; |
811 | if (this->double_val_size() > 0) { |
812 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteTag(6, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); |
813 | output->WriteVarint32(_double_val_cached_byte_size_.load( |
814 | std::memory_order_relaxed)); |
815 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteDoubleArray( |
816 | this->double_val().data(), this->double_val_size(), output); |
817 | } |
818 | |
819 | // repeated int32 int_val = 7 [packed = true]; |
820 | if (this->int_val_size() > 0) { |
821 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteTag(7, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); |
822 | output->WriteVarint32(_int_val_cached_byte_size_.load( |
823 | std::memory_order_relaxed)); |
824 | } |
825 | for (int i = 0, n = this->int_val_size(); i < n; i++) { |
826 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32NoTag( |
827 | this->int_val(i), output); |
828 | } |
829 | |
830 | // repeated bytes string_val = 8; |
831 | for (int i = 0, n = this->string_val_size(); i < n; i++) { |
832 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBytes( |
833 | 8, this->string_val(i), output); |
834 | } |
835 | |
836 | // repeated float scomplex_val = 9 [packed = true]; |
837 | if (this->scomplex_val_size() > 0) { |
838 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteTag(9, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); |
839 | output->WriteVarint32(_scomplex_val_cached_byte_size_.load( |
840 | std::memory_order_relaxed)); |
841 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatArray( |
842 | this->scomplex_val().data(), this->scomplex_val_size(), output); |
843 | } |
844 | |
845 | // repeated int64 int64_val = 10 [packed = true]; |
846 | if (this->int64_val_size() > 0) { |
847 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteTag(10, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); |
848 | output->WriteVarint32(_int64_val_cached_byte_size_.load( |
849 | std::memory_order_relaxed)); |
850 | } |
851 | for (int i = 0, n = this->int64_val_size(); i < n; i++) { |
852 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64NoTag( |
853 | this->int64_val(i), output); |
854 | } |
855 | |
856 | // repeated bool bool_val = 11 [packed = true]; |
857 | if (this->bool_val_size() > 0) { |
858 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteTag(11, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); |
859 | output->WriteVarint32(_bool_val_cached_byte_size_.load( |
860 | std::memory_order_relaxed)); |
861 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolArray( |
862 | this->bool_val().data(), this->bool_val_size(), output); |
863 | } |
864 | |
865 | // repeated double dcomplex_val = 12 [packed = true]; |
866 | if (this->dcomplex_val_size() > 0) { |
867 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteTag(12, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); |
868 | output->WriteVarint32(_dcomplex_val_cached_byte_size_.load( |
869 | std::memory_order_relaxed)); |
870 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteDoubleArray( |
871 | this->dcomplex_val().data(), this->dcomplex_val_size(), output); |
872 | } |
873 | |
874 | // repeated int32 half_val = 13 [packed = true]; |
875 | if (this->half_val_size() > 0) { |
876 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteTag(13, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); |
877 | output->WriteVarint32(_half_val_cached_byte_size_.load( |
878 | std::memory_order_relaxed)); |
879 | } |
880 | for (int i = 0, n = this->half_val_size(); i < n; i++) { |
881 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32NoTag( |
882 | this->half_val(i), output); |
883 | } |
884 | |
885 | // repeated .tensorflow.ResourceHandleProto resource_handle_val = 14; |
886 | for (unsigned int i = 0, |
887 | n = static_cast<unsigned int>(this->resource_handle_val_size()); i < n; i++) { |
888 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray( |
889 | 14, |
890 | this->resource_handle_val(static_cast<int>(i)), |
891 | output); |
892 | } |
893 | |
894 | // repeated .tensorflow.VariantTensorDataProto variant_val = 15; |
895 | for (unsigned int i = 0, |
896 | n = static_cast<unsigned int>(this->variant_val_size()); i < n; i++) { |
897 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray( |
898 | 15, |
899 | this->variant_val(static_cast<int>(i)), |
900 | output); |
901 | } |
902 | |
903 | // repeated uint32 uint32_val = 16 [packed = true]; |
904 | if (this->uint32_val_size() > 0) { |
905 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteTag(16, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); |
906 | output->WriteVarint32(_uint32_val_cached_byte_size_.load( |
907 | std::memory_order_relaxed)); |
908 | } |
909 | for (int i = 0, n = this->uint32_val_size(); i < n; i++) { |
910 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32NoTag( |
911 | this->uint32_val(i), output); |
912 | } |
913 | |
914 | // repeated uint64 uint64_val = 17 [packed = true]; |
915 | if (this->uint64_val_size() > 0) { |
916 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteTag(17, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); |
917 | output->WriteVarint32(_uint64_val_cached_byte_size_.load( |
918 | std::memory_order_relaxed)); |
919 | } |
920 | for (int i = 0, n = this->uint64_val_size(); i < n; i++) { |
921 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt64NoTag( |
922 | this->uint64_val(i), output); |
923 | } |
924 | |
925 | if (_internal_metadata_.have_unknown_fields()) { |
926 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields( |
927 | _internal_metadata_.unknown_fields(), output); |
928 | } |
929 | // @@protoc_insertion_point(serialize_end:tensorflow.TensorProto) |
930 | } |
931 | |
932 | ::PROTOBUF_NAMESPACE_ID::uint8* TensorProto::InternalSerializeWithCachedSizesToArray( |
933 | ::PROTOBUF_NAMESPACE_ID::uint8* target) const { |
934 | // @@protoc_insertion_point(serialize_to_array_start:tensorflow.TensorProto) |
935 | ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; |
936 | (void) cached_has_bits; |
937 | |
938 | // .tensorflow.DataType dtype = 1; |
939 | if (this->dtype() != 0) { |
940 | target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray( |
941 | 1, this->dtype(), target); |
942 | } |
943 | |
944 | // .tensorflow.TensorShapeProto tensor_shape = 2; |
945 | if (this->has_tensor_shape()) { |
946 | target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: |
947 | InternalWriteMessageToArray( |
948 | 2, _Internal::tensor_shape(this), target); |
949 | } |
950 | |
951 | // int32 version_number = 3; |
952 | if (this->version_number() != 0) { |
953 | target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(3, this->version_number(), target); |
954 | } |
955 | |
956 | // bytes tensor_content = 4; |
957 | if (this->tensor_content().size() > 0) { |
958 | target = |
959 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBytesToArray( |
960 | 4, this->tensor_content(), target); |
961 | } |
962 | |
963 | // repeated float float_val = 5 [packed = true]; |
964 | if (this->float_val_size() > 0) { |
965 | target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteTagToArray( |
966 | 5, |
967 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, |
968 | target); |
969 | target = ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream::WriteVarint32ToArray( |
970 | _float_val_cached_byte_size_.load(std::memory_order_relaxed), |
971 | target); |
972 | target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: |
973 | WriteFloatNoTagToArray(this->float_val_, target); |
974 | } |
975 | |
976 | // repeated double double_val = 6 [packed = true]; |
977 | if (this->double_val_size() > 0) { |
978 | target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteTagToArray( |
979 | 6, |
980 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, |
981 | target); |
982 | target = ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream::WriteVarint32ToArray( |
983 | _double_val_cached_byte_size_.load(std::memory_order_relaxed), |
984 | target); |
985 | target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: |
986 | WriteDoubleNoTagToArray(this->double_val_, target); |
987 | } |
988 | |
989 | // repeated int32 int_val = 7 [packed = true]; |
990 | if (this->int_val_size() > 0) { |
991 | target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteTagToArray( |
992 | 7, |
993 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, |
994 | target); |
995 | target = ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream::WriteVarint32ToArray( |
996 | _int_val_cached_byte_size_.load(std::memory_order_relaxed), |
997 | target); |
998 | target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: |
999 | WriteInt32NoTagToArray(this->int_val_, target); |
1000 | } |
1001 | |
1002 | // repeated bytes string_val = 8; |
1003 | for (int i = 0, n = this->string_val_size(); i < n; i++) { |
1004 | target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: |
1005 | WriteBytesToArray(8, this->string_val(i), target); |
1006 | } |
1007 | |
1008 | // repeated float scomplex_val = 9 [packed = true]; |
1009 | if (this->scomplex_val_size() > 0) { |
1010 | target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteTagToArray( |
1011 | 9, |
1012 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, |
1013 | target); |
1014 | target = ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream::WriteVarint32ToArray( |
1015 | _scomplex_val_cached_byte_size_.load(std::memory_order_relaxed), |
1016 | target); |
1017 | target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: |
1018 | WriteFloatNoTagToArray(this->scomplex_val_, target); |
1019 | } |
1020 | |
1021 | // repeated int64 int64_val = 10 [packed = true]; |
1022 | if (this->int64_val_size() > 0) { |
1023 | target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteTagToArray( |
1024 | 10, |
1025 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, |
1026 | target); |
1027 | target = ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream::WriteVarint32ToArray( |
1028 | _int64_val_cached_byte_size_.load(std::memory_order_relaxed), |
1029 | target); |
1030 | target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: |
1031 | WriteInt64NoTagToArray(this->int64_val_, target); |
1032 | } |
1033 | |
1034 | // repeated bool bool_val = 11 [packed = true]; |
1035 | if (this->bool_val_size() > 0) { |
1036 | target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteTagToArray( |
1037 | 11, |
1038 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, |
1039 | target); |
1040 | target = ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream::WriteVarint32ToArray( |
1041 | _bool_val_cached_byte_size_.load(std::memory_order_relaxed), |
1042 | target); |
1043 | target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: |
1044 | WriteBoolNoTagToArray(this->bool_val_, target); |
1045 | } |
1046 | |
1047 | // repeated double dcomplex_val = 12 [packed = true]; |
1048 | if (this->dcomplex_val_size() > 0) { |
1049 | target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteTagToArray( |
1050 | 12, |
1051 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, |
1052 | target); |
1053 | target = ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream::WriteVarint32ToArray( |
1054 | _dcomplex_val_cached_byte_size_.load(std::memory_order_relaxed), |
1055 | target); |
1056 | target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: |
1057 | WriteDoubleNoTagToArray(this->dcomplex_val_, target); |
1058 | } |
1059 | |
1060 | // repeated int32 half_val = 13 [packed = true]; |
1061 | if (this->half_val_size() > 0) { |
1062 | target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteTagToArray( |
1063 | 13, |
1064 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, |
1065 | target); |
1066 | target = ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream::WriteVarint32ToArray( |
1067 | _half_val_cached_byte_size_.load(std::memory_order_relaxed), |
1068 | target); |
1069 | target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: |
1070 | WriteInt32NoTagToArray(this->half_val_, target); |
1071 | } |
1072 | |
1073 | // repeated .tensorflow.ResourceHandleProto resource_handle_val = 14; |
1074 | for (unsigned int i = 0, |
1075 | n = static_cast<unsigned int>(this->resource_handle_val_size()); i < n; i++) { |
1076 | target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: |
1077 | InternalWriteMessageToArray( |
1078 | 14, this->resource_handle_val(static_cast<int>(i)), target); |
1079 | } |
1080 | |
1081 | // repeated .tensorflow.VariantTensorDataProto variant_val = 15; |
1082 | for (unsigned int i = 0, |
1083 | n = static_cast<unsigned int>(this->variant_val_size()); i < n; i++) { |
1084 | target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: |
1085 | InternalWriteMessageToArray( |
1086 | 15, this->variant_val(static_cast<int>(i)), target); |
1087 | } |
1088 | |
1089 | // repeated uint32 uint32_val = 16 [packed = true]; |
1090 | if (this->uint32_val_size() > 0) { |
1091 | target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteTagToArray( |
1092 | 16, |
1093 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, |
1094 | target); |
1095 | target = ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream::WriteVarint32ToArray( |
1096 | _uint32_val_cached_byte_size_.load(std::memory_order_relaxed), |
1097 | target); |
1098 | target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: |
1099 | WriteUInt32NoTagToArray(this->uint32_val_, target); |
1100 | } |
1101 | |
1102 | // repeated uint64 uint64_val = 17 [packed = true]; |
1103 | if (this->uint64_val_size() > 0) { |
1104 | target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteTagToArray( |
1105 | 17, |
1106 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, |
1107 | target); |
1108 | target = ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream::WriteVarint32ToArray( |
1109 | _uint64_val_cached_byte_size_.load(std::memory_order_relaxed), |
1110 | target); |
1111 | target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: |
1112 | WriteUInt64NoTagToArray(this->uint64_val_, target); |
1113 | } |
1114 | |
1115 | if (_internal_metadata_.have_unknown_fields()) { |
1116 | target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray( |
1117 | _internal_metadata_.unknown_fields(), target); |
1118 | } |
1119 | // @@protoc_insertion_point(serialize_to_array_end:tensorflow.TensorProto) |
1120 | return target; |
1121 | } |
1122 | |
1123 | size_t TensorProto::ByteSizeLong() const { |
1124 | // @@protoc_insertion_point(message_byte_size_start:tensorflow.TensorProto) |
1125 | size_t total_size = 0; |
1126 | |
1127 | if (_internal_metadata_.have_unknown_fields()) { |
1128 | total_size += |
1129 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::ComputeUnknownFieldsSize( |
1130 | _internal_metadata_.unknown_fields()); |
1131 | } |
1132 | ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; |
1133 | // Prevent compiler warnings about cached_has_bits being unused |
1134 | (void) cached_has_bits; |
1135 | |
1136 | // repeated float float_val = 5 [packed = true]; |
1137 | { |
1138 | unsigned int count = static_cast<unsigned int>(this->float_val_size()); |
1139 | size_t data_size = 4UL * count; |
1140 | if (data_size > 0) { |
1141 | total_size += 1 + |
1142 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size( |
1143 | static_cast<::PROTOBUF_NAMESPACE_ID::int32>(data_size)); |
1144 | } |
1145 | int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(data_size); |
1146 | _float_val_cached_byte_size_.store(cached_size, |
1147 | std::memory_order_relaxed); |
1148 | total_size += data_size; |
1149 | } |
1150 | |
1151 | // repeated double double_val = 6 [packed = true]; |
1152 | { |
1153 | unsigned int count = static_cast<unsigned int>(this->double_val_size()); |
1154 | size_t data_size = 8UL * count; |
1155 | if (data_size > 0) { |
1156 | total_size += 1 + |
1157 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size( |
1158 | static_cast<::PROTOBUF_NAMESPACE_ID::int32>(data_size)); |
1159 | } |
1160 | int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(data_size); |
1161 | _double_val_cached_byte_size_.store(cached_size, |
1162 | std::memory_order_relaxed); |
1163 | total_size += data_size; |
1164 | } |
1165 | |
1166 | // repeated int32 int_val = 7 [packed = true]; |
1167 | { |
1168 | size_t data_size = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: |
1169 | Int32Size(this->int_val_); |
1170 | if (data_size > 0) { |
1171 | total_size += 1 + |
1172 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size( |
1173 | static_cast<::PROTOBUF_NAMESPACE_ID::int32>(data_size)); |
1174 | } |
1175 | int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(data_size); |
1176 | _int_val_cached_byte_size_.store(cached_size, |
1177 | std::memory_order_relaxed); |
1178 | total_size += data_size; |
1179 | } |
1180 | |
1181 | // repeated bytes string_val = 8; |
1182 | total_size += 1 * |
1183 | ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(this->string_val_size()); |
1184 | for (int i = 0, n = this->string_val_size(); i < n; i++) { |
1185 | total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( |
1186 | this->string_val(i)); |
1187 | } |
1188 | |
1189 | // repeated float scomplex_val = 9 [packed = true]; |
1190 | { |
1191 | unsigned int count = static_cast<unsigned int>(this->scomplex_val_size()); |
1192 | size_t data_size = 4UL * count; |
1193 | if (data_size > 0) { |
1194 | total_size += 1 + |
1195 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size( |
1196 | static_cast<::PROTOBUF_NAMESPACE_ID::int32>(data_size)); |
1197 | } |
1198 | int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(data_size); |
1199 | _scomplex_val_cached_byte_size_.store(cached_size, |
1200 | std::memory_order_relaxed); |
1201 | total_size += data_size; |
1202 | } |
1203 | |
1204 | // repeated int64 int64_val = 10 [packed = true]; |
1205 | { |
1206 | size_t data_size = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: |
1207 | Int64Size(this->int64_val_); |
1208 | if (data_size > 0) { |
1209 | total_size += 1 + |
1210 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size( |
1211 | static_cast<::PROTOBUF_NAMESPACE_ID::int32>(data_size)); |
1212 | } |
1213 | int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(data_size); |
1214 | _int64_val_cached_byte_size_.store(cached_size, |
1215 | std::memory_order_relaxed); |
1216 | total_size += data_size; |
1217 | } |
1218 | |
1219 | // repeated bool bool_val = 11 [packed = true]; |
1220 | { |
1221 | unsigned int count = static_cast<unsigned int>(this->bool_val_size()); |
1222 | size_t data_size = 1UL * count; |
1223 | if (data_size > 0) { |
1224 | total_size += 1 + |
1225 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size( |
1226 | static_cast<::PROTOBUF_NAMESPACE_ID::int32>(data_size)); |
1227 | } |
1228 | int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(data_size); |
1229 | _bool_val_cached_byte_size_.store(cached_size, |
1230 | std::memory_order_relaxed); |
1231 | total_size += data_size; |
1232 | } |
1233 | |
1234 | // repeated double dcomplex_val = 12 [packed = true]; |
1235 | { |
1236 | unsigned int count = static_cast<unsigned int>(this->dcomplex_val_size()); |
1237 | size_t data_size = 8UL * count; |
1238 | if (data_size > 0) { |
1239 | total_size += 1 + |
1240 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size( |
1241 | static_cast<::PROTOBUF_NAMESPACE_ID::int32>(data_size)); |
1242 | } |
1243 | int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(data_size); |
1244 | _dcomplex_val_cached_byte_size_.store(cached_size, |
1245 | std::memory_order_relaxed); |
1246 | total_size += data_size; |
1247 | } |
1248 | |
1249 | // repeated int32 half_val = 13 [packed = true]; |
1250 | { |
1251 | size_t data_size = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: |
1252 | Int32Size(this->half_val_); |
1253 | if (data_size > 0) { |
1254 | total_size += 1 + |
1255 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size( |
1256 | static_cast<::PROTOBUF_NAMESPACE_ID::int32>(data_size)); |
1257 | } |
1258 | int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(data_size); |
1259 | _half_val_cached_byte_size_.store(cached_size, |
1260 | std::memory_order_relaxed); |
1261 | total_size += data_size; |
1262 | } |
1263 | |
1264 | // repeated .tensorflow.ResourceHandleProto resource_handle_val = 14; |
1265 | { |
1266 | unsigned int count = static_cast<unsigned int>(this->resource_handle_val_size()); |
1267 | total_size += 1UL * count; |
1268 | for (unsigned int i = 0; i < count; i++) { |
1269 | total_size += |
1270 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( |
1271 | this->resource_handle_val(static_cast<int>(i))); |
1272 | } |
1273 | } |
1274 | |
1275 | // repeated .tensorflow.VariantTensorDataProto variant_val = 15; |
1276 | { |
1277 | unsigned int count = static_cast<unsigned int>(this->variant_val_size()); |
1278 | total_size += 1UL * count; |
1279 | for (unsigned int i = 0; i < count; i++) { |
1280 | total_size += |
1281 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( |
1282 | this->variant_val(static_cast<int>(i))); |
1283 | } |
1284 | } |
1285 | |
1286 | // repeated uint32 uint32_val = 16 [packed = true]; |
1287 | { |
1288 | size_t data_size = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: |
1289 | UInt32Size(this->uint32_val_); |
1290 | if (data_size > 0) { |
1291 | total_size += 2 + |
1292 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size( |
1293 | static_cast<::PROTOBUF_NAMESPACE_ID::int32>(data_size)); |
1294 | } |
1295 | int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(data_size); |
1296 | _uint32_val_cached_byte_size_.store(cached_size, |
1297 | std::memory_order_relaxed); |
1298 | total_size += data_size; |
1299 | } |
1300 | |
1301 | // repeated uint64 uint64_val = 17 [packed = true]; |
1302 | { |
1303 | size_t data_size = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: |
1304 | UInt64Size(this->uint64_val_); |
1305 | if (data_size > 0) { |
1306 | total_size += 2 + |
1307 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size( |
1308 | static_cast<::PROTOBUF_NAMESPACE_ID::int32>(data_size)); |
1309 | } |
1310 | int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(data_size); |
1311 | _uint64_val_cached_byte_size_.store(cached_size, |
1312 | std::memory_order_relaxed); |
1313 | total_size += data_size; |
1314 | } |
1315 | |
1316 | // bytes tensor_content = 4; |
1317 | if (this->tensor_content().size() > 0) { |
1318 | total_size += 1 + |
1319 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( |
1320 | this->tensor_content()); |
1321 | } |
1322 | |
1323 | // .tensorflow.TensorShapeProto tensor_shape = 2; |
1324 | if (this->has_tensor_shape()) { |
1325 | total_size += 1 + |
1326 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( |
1327 | *tensor_shape_); |
1328 | } |
1329 | |
1330 | // .tensorflow.DataType dtype = 1; |
1331 | if (this->dtype() != 0) { |
1332 | total_size += 1 + |
1333 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->dtype()); |
1334 | } |
1335 | |
1336 | // int32 version_number = 3; |
1337 | if (this->version_number() != 0) { |
1338 | total_size += 1 + |
1339 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size( |
1340 | this->version_number()); |
1341 | } |
1342 | |
1343 | int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); |
1344 | SetCachedSize(cached_size); |
1345 | return total_size; |
1346 | } |
1347 | |
1348 | void TensorProto::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { |
1349 | // @@protoc_insertion_point(generalized_merge_from_start:tensorflow.TensorProto) |
1350 | GOOGLE_DCHECK_NE(&from, this); |
1351 | const TensorProto* source = |
1352 | ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<TensorProto>( |
1353 | &from); |
1354 | if (source == nullptr) { |
1355 | // @@protoc_insertion_point(generalized_merge_from_cast_fail:tensorflow.TensorProto) |
1356 | ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); |
1357 | } else { |
1358 | // @@protoc_insertion_point(generalized_merge_from_cast_success:tensorflow.TensorProto) |
1359 | MergeFrom(*source); |
1360 | } |
1361 | } |
1362 | |
1363 | void TensorProto::MergeFrom(const TensorProto& from) { |
1364 | // @@protoc_insertion_point(class_specific_merge_from_start:tensorflow.TensorProto) |
1365 | GOOGLE_DCHECK_NE(&from, this); |
1366 | _internal_metadata_.MergeFrom(from._internal_metadata_); |
1367 | ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; |
1368 | (void) cached_has_bits; |
1369 | |
1370 | float_val_.MergeFrom(from.float_val_); |
1371 | double_val_.MergeFrom(from.double_val_); |
1372 | int_val_.MergeFrom(from.int_val_); |
1373 | string_val_.MergeFrom(from.string_val_); |
1374 | scomplex_val_.MergeFrom(from.scomplex_val_); |
1375 | int64_val_.MergeFrom(from.int64_val_); |
1376 | bool_val_.MergeFrom(from.bool_val_); |
1377 | dcomplex_val_.MergeFrom(from.dcomplex_val_); |
1378 | half_val_.MergeFrom(from.half_val_); |
1379 | resource_handle_val_.MergeFrom(from.resource_handle_val_); |
1380 | variant_val_.MergeFrom(from.variant_val_); |
1381 | uint32_val_.MergeFrom(from.uint32_val_); |
1382 | uint64_val_.MergeFrom(from.uint64_val_); |
1383 | if (from.tensor_content().size() > 0) { |
1384 | set_tensor_content(from.tensor_content()); |
1385 | } |
1386 | if (from.has_tensor_shape()) { |
1387 | mutable_tensor_shape()->::tensorflow::TensorShapeProto::MergeFrom(from.tensor_shape()); |
1388 | } |
1389 | if (from.dtype() != 0) { |
1390 | set_dtype(from.dtype()); |
1391 | } |
1392 | if (from.version_number() != 0) { |
1393 | set_version_number(from.version_number()); |
1394 | } |
1395 | } |
1396 | |
1397 | void TensorProto::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { |
1398 | // @@protoc_insertion_point(generalized_copy_from_start:tensorflow.TensorProto) |
1399 | if (&from == this) return; |
1400 | Clear(); |
1401 | MergeFrom(from); |
1402 | } |
1403 | |
1404 | void TensorProto::CopyFrom(const TensorProto& from) { |
1405 | // @@protoc_insertion_point(class_specific_copy_from_start:tensorflow.TensorProto) |
1406 | if (&from == this) return; |
1407 | Clear(); |
1408 | MergeFrom(from); |
1409 | } |
1410 | |
1411 | bool TensorProto::IsInitialized() const { |
1412 | return true; |
1413 | } |
1414 | |
1415 | void TensorProto::InternalSwap(TensorProto* other) { |
1416 | using std::swap; |
1417 | _internal_metadata_.Swap(&other->_internal_metadata_); |
1418 | float_val_.InternalSwap(&other->float_val_); |
1419 | double_val_.InternalSwap(&other->double_val_); |
1420 | int_val_.InternalSwap(&other->int_val_); |
1421 | string_val_.InternalSwap(CastToBase(&other->string_val_)); |
1422 | scomplex_val_.InternalSwap(&other->scomplex_val_); |
1423 | int64_val_.InternalSwap(&other->int64_val_); |
1424 | bool_val_.InternalSwap(&other->bool_val_); |
1425 | dcomplex_val_.InternalSwap(&other->dcomplex_val_); |
1426 | half_val_.InternalSwap(&other->half_val_); |
1427 | CastToBase(&resource_handle_val_)->InternalSwap(CastToBase(&other->resource_handle_val_)); |
1428 | CastToBase(&variant_val_)->InternalSwap(CastToBase(&other->variant_val_)); |
1429 | uint32_val_.InternalSwap(&other->uint32_val_); |
1430 | uint64_val_.InternalSwap(&other->uint64_val_); |
1431 | tensor_content_.Swap(&other->tensor_content_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), |
1432 | GetArenaNoVirtual()); |
1433 | swap(tensor_shape_, other->tensor_shape_); |
1434 | swap(dtype_, other->dtype_); |
1435 | swap(version_number_, other->version_number_); |
1436 | } |
1437 | |
1438 | ::PROTOBUF_NAMESPACE_ID::Metadata TensorProto::GetMetadata() const { |
1439 | return GetMetadataStatic(); |
1440 | } |
1441 | |
1442 | |
1443 | // =================================================================== |
1444 | |
1445 | void VariantTensorDataProto::InitAsDefaultInstance() { |
1446 | } |
1447 | class VariantTensorDataProto::_Internal { |
1448 | public: |
1449 | }; |
1450 | |
1451 | VariantTensorDataProto::VariantTensorDataProto() |
1452 | : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) { |
1453 | SharedCtor(); |
1454 | // @@protoc_insertion_point(constructor:tensorflow.VariantTensorDataProto) |
1455 | } |
1456 | VariantTensorDataProto::VariantTensorDataProto(::PROTOBUF_NAMESPACE_ID::Arena* arena) |
1457 | : ::PROTOBUF_NAMESPACE_ID::Message(), |
1458 | _internal_metadata_(arena), |
1459 | tensors_(arena) { |
1460 | SharedCtor(); |
1461 | RegisterArenaDtor(arena); |
1462 | // @@protoc_insertion_point(arena_constructor:tensorflow.VariantTensorDataProto) |
1463 | } |
1464 | VariantTensorDataProto::VariantTensorDataProto(const VariantTensorDataProto& from) |
1465 | : ::PROTOBUF_NAMESPACE_ID::Message(), |
1466 | _internal_metadata_(nullptr), |
1467 | tensors_(from.tensors_) { |
1468 | _internal_metadata_.MergeFrom(from._internal_metadata_); |
1469 | type_name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); |
1470 | if (!from.type_name().empty()) { |
1471 | type_name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.type_name(), |
1472 | GetArenaNoVirtual()); |
1473 | } |
1474 | metadata_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); |
1475 | if (!from.metadata().empty()) { |
1476 | metadata_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.metadata(), |
1477 | GetArenaNoVirtual()); |
1478 | } |
1479 | // @@protoc_insertion_point(copy_constructor:tensorflow.VariantTensorDataProto) |
1480 | } |
1481 | |
1482 | void VariantTensorDataProto::SharedCtor() { |
1483 | ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_TensorProto_tensorflow_2fcore_2fframework_2ftensor_2eproto.base); |
1484 | type_name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); |
1485 | metadata_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); |
1486 | } |
1487 | |
1488 | VariantTensorDataProto::~VariantTensorDataProto() { |
1489 | // @@protoc_insertion_point(destructor:tensorflow.VariantTensorDataProto) |
1490 | SharedDtor(); |
1491 | } |
1492 | |
1493 | void VariantTensorDataProto::SharedDtor() { |
1494 | GOOGLE_DCHECK(GetArenaNoVirtual() == nullptr); |
1495 | type_name_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); |
1496 | metadata_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); |
1497 | } |
1498 | |
1499 | void VariantTensorDataProto::ArenaDtor(void* object) { |
1500 | VariantTensorDataProto* _this = reinterpret_cast< VariantTensorDataProto* >(object); |
1501 | (void)_this; |
1502 | } |
1503 | void VariantTensorDataProto::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { |
1504 | } |
1505 | void VariantTensorDataProto::SetCachedSize(int size) const { |
1506 | _cached_size_.Set(size); |
1507 | } |
1508 | const VariantTensorDataProto& VariantTensorDataProto::default_instance() { |
1509 | ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_TensorProto_tensorflow_2fcore_2fframework_2ftensor_2eproto.base); |
1510 | return *internal_default_instance(); |
1511 | } |
1512 | |
1513 | |
1514 | void VariantTensorDataProto::Clear() { |
1515 | // @@protoc_insertion_point(message_clear_start:tensorflow.VariantTensorDataProto) |
1516 | ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; |
1517 | // Prevent compiler warnings about cached_has_bits being unused |
1518 | (void) cached_has_bits; |
1519 | |
1520 | tensors_.Clear(); |
1521 | type_name_.ClearToEmpty(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); |
1522 | metadata_.ClearToEmpty(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); |
1523 | _internal_metadata_.Clear(); |
1524 | } |
1525 | |
1526 | #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER |
1527 | const char* VariantTensorDataProto::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { |
1528 | #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure |
1529 | ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArenaNoVirtual(); (void)arena; |
1530 | while (!ctx->Done(&ptr)) { |
1531 | ::PROTOBUF_NAMESPACE_ID::uint32 tag; |
1532 | ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); |
1533 | CHK_(ptr); |
1534 | switch (tag >> 3) { |
1535 | // string type_name = 1; |
1536 | case 1: |
1537 | if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { |
1538 | ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParserUTF8(mutable_type_name(), ptr, ctx, "tensorflow.VariantTensorDataProto.type_name" ); |
1539 | CHK_(ptr); |
1540 | } else goto handle_unusual; |
1541 | continue; |
1542 | // bytes metadata = 2; |
1543 | case 2: |
1544 | if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { |
1545 | ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(mutable_metadata(), ptr, ctx); |
1546 | CHK_(ptr); |
1547 | } else goto handle_unusual; |
1548 | continue; |
1549 | // repeated .tensorflow.TensorProto tensors = 3; |
1550 | case 3: |
1551 | if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26)) { |
1552 | ptr -= 1; |
1553 | do { |
1554 | ptr += 1; |
1555 | ptr = ctx->ParseMessage(add_tensors(), ptr); |
1556 | CHK_(ptr); |
1557 | if (!ctx->DataAvailable(ptr)) break; |
1558 | } while (::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<::PROTOBUF_NAMESPACE_ID::uint8>(ptr) == 26); |
1559 | } else goto handle_unusual; |
1560 | continue; |
1561 | default: { |
1562 | handle_unusual: |
1563 | if ((tag & 7) == 4 || tag == 0) { |
1564 | ctx->SetLastTag(tag); |
1565 | goto success; |
1566 | } |
1567 | ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx); |
1568 | CHK_(ptr != nullptr); |
1569 | continue; |
1570 | } |
1571 | } // switch |
1572 | } // while |
1573 | success: |
1574 | return ptr; |
1575 | failure: |
1576 | ptr = nullptr; |
1577 | goto success; |
1578 | #undef CHK_ |
1579 | } |
1580 | #else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER |
1581 | bool VariantTensorDataProto::MergePartialFromCodedStream( |
1582 | ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) { |
1583 | #define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure |
1584 | ::PROTOBUF_NAMESPACE_ID::uint32 tag; |
1585 | // @@protoc_insertion_point(parse_start:tensorflow.VariantTensorDataProto) |
1586 | for (;;) { |
1587 | ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); |
1588 | tag = p.first; |
1589 | if (!p.second) goto handle_unusual; |
1590 | switch (::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::GetTagFieldNumber(tag)) { |
1591 | // string type_name = 1; |
1592 | case 1: { |
1593 | if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (10 & 0xFF)) { |
1594 | DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadString( |
1595 | input, this->mutable_type_name())); |
1596 | DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( |
1597 | this->type_name().data(), static_cast<int>(this->type_name().length()), |
1598 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::PARSE, |
1599 | "tensorflow.VariantTensorDataProto.type_name" )); |
1600 | } else { |
1601 | goto handle_unusual; |
1602 | } |
1603 | break; |
1604 | } |
1605 | |
1606 | // bytes metadata = 2; |
1607 | case 2: { |
1608 | if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (18 & 0xFF)) { |
1609 | DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadBytes( |
1610 | input, this->mutable_metadata())); |
1611 | } else { |
1612 | goto handle_unusual; |
1613 | } |
1614 | break; |
1615 | } |
1616 | |
1617 | // repeated .tensorflow.TensorProto tensors = 3; |
1618 | case 3: { |
1619 | if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (26 & 0xFF)) { |
1620 | DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage( |
1621 | input, add_tensors())); |
1622 | } else { |
1623 | goto handle_unusual; |
1624 | } |
1625 | break; |
1626 | } |
1627 | |
1628 | default: { |
1629 | handle_unusual: |
1630 | if (tag == 0) { |
1631 | goto success; |
1632 | } |
1633 | DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SkipField( |
1634 | input, tag, _internal_metadata_.mutable_unknown_fields())); |
1635 | break; |
1636 | } |
1637 | } |
1638 | } |
1639 | success: |
1640 | // @@protoc_insertion_point(parse_success:tensorflow.VariantTensorDataProto) |
1641 | return true; |
1642 | failure: |
1643 | // @@protoc_insertion_point(parse_failure:tensorflow.VariantTensorDataProto) |
1644 | return false; |
1645 | #undef DO_ |
1646 | } |
1647 | #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER |
1648 | |
1649 | void VariantTensorDataProto::SerializeWithCachedSizes( |
1650 | ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const { |
1651 | // @@protoc_insertion_point(serialize_start:tensorflow.VariantTensorDataProto) |
1652 | ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; |
1653 | (void) cached_has_bits; |
1654 | |
1655 | // string type_name = 1; |
1656 | if (this->type_name().size() > 0) { |
1657 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( |
1658 | this->type_name().data(), static_cast<int>(this->type_name().length()), |
1659 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, |
1660 | "tensorflow.VariantTensorDataProto.type_name" ); |
1661 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringMaybeAliased( |
1662 | 1, this->type_name(), output); |
1663 | } |
1664 | |
1665 | // bytes metadata = 2; |
1666 | if (this->metadata().size() > 0) { |
1667 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBytesMaybeAliased( |
1668 | 2, this->metadata(), output); |
1669 | } |
1670 | |
1671 | // repeated .tensorflow.TensorProto tensors = 3; |
1672 | for (unsigned int i = 0, |
1673 | n = static_cast<unsigned int>(this->tensors_size()); i < n; i++) { |
1674 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray( |
1675 | 3, |
1676 | this->tensors(static_cast<int>(i)), |
1677 | output); |
1678 | } |
1679 | |
1680 | if (_internal_metadata_.have_unknown_fields()) { |
1681 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields( |
1682 | _internal_metadata_.unknown_fields(), output); |
1683 | } |
1684 | // @@protoc_insertion_point(serialize_end:tensorflow.VariantTensorDataProto) |
1685 | } |
1686 | |
1687 | ::PROTOBUF_NAMESPACE_ID::uint8* VariantTensorDataProto::InternalSerializeWithCachedSizesToArray( |
1688 | ::PROTOBUF_NAMESPACE_ID::uint8* target) const { |
1689 | // @@protoc_insertion_point(serialize_to_array_start:tensorflow.VariantTensorDataProto) |
1690 | ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; |
1691 | (void) cached_has_bits; |
1692 | |
1693 | // string type_name = 1; |
1694 | if (this->type_name().size() > 0) { |
1695 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( |
1696 | this->type_name().data(), static_cast<int>(this->type_name().length()), |
1697 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, |
1698 | "tensorflow.VariantTensorDataProto.type_name" ); |
1699 | target = |
1700 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringToArray( |
1701 | 1, this->type_name(), target); |
1702 | } |
1703 | |
1704 | // bytes metadata = 2; |
1705 | if (this->metadata().size() > 0) { |
1706 | target = |
1707 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBytesToArray( |
1708 | 2, this->metadata(), target); |
1709 | } |
1710 | |
1711 | // repeated .tensorflow.TensorProto tensors = 3; |
1712 | for (unsigned int i = 0, |
1713 | n = static_cast<unsigned int>(this->tensors_size()); i < n; i++) { |
1714 | target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: |
1715 | InternalWriteMessageToArray( |
1716 | 3, this->tensors(static_cast<int>(i)), target); |
1717 | } |
1718 | |
1719 | if (_internal_metadata_.have_unknown_fields()) { |
1720 | target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray( |
1721 | _internal_metadata_.unknown_fields(), target); |
1722 | } |
1723 | // @@protoc_insertion_point(serialize_to_array_end:tensorflow.VariantTensorDataProto) |
1724 | return target; |
1725 | } |
1726 | |
1727 | size_t VariantTensorDataProto::ByteSizeLong() const { |
1728 | // @@protoc_insertion_point(message_byte_size_start:tensorflow.VariantTensorDataProto) |
1729 | size_t total_size = 0; |
1730 | |
1731 | if (_internal_metadata_.have_unknown_fields()) { |
1732 | total_size += |
1733 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::ComputeUnknownFieldsSize( |
1734 | _internal_metadata_.unknown_fields()); |
1735 | } |
1736 | ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; |
1737 | // Prevent compiler warnings about cached_has_bits being unused |
1738 | (void) cached_has_bits; |
1739 | |
1740 | // repeated .tensorflow.TensorProto tensors = 3; |
1741 | { |
1742 | unsigned int count = static_cast<unsigned int>(this->tensors_size()); |
1743 | total_size += 1UL * count; |
1744 | for (unsigned int i = 0; i < count; i++) { |
1745 | total_size += |
1746 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( |
1747 | this->tensors(static_cast<int>(i))); |
1748 | } |
1749 | } |
1750 | |
1751 | // string type_name = 1; |
1752 | if (this->type_name().size() > 0) { |
1753 | total_size += 1 + |
1754 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( |
1755 | this->type_name()); |
1756 | } |
1757 | |
1758 | // bytes metadata = 2; |
1759 | if (this->metadata().size() > 0) { |
1760 | total_size += 1 + |
1761 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( |
1762 | this->metadata()); |
1763 | } |
1764 | |
1765 | int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); |
1766 | SetCachedSize(cached_size); |
1767 | return total_size; |
1768 | } |
1769 | |
1770 | void VariantTensorDataProto::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { |
1771 | // @@protoc_insertion_point(generalized_merge_from_start:tensorflow.VariantTensorDataProto) |
1772 | GOOGLE_DCHECK_NE(&from, this); |
1773 | const VariantTensorDataProto* source = |
1774 | ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<VariantTensorDataProto>( |
1775 | &from); |
1776 | if (source == nullptr) { |
1777 | // @@protoc_insertion_point(generalized_merge_from_cast_fail:tensorflow.VariantTensorDataProto) |
1778 | ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); |
1779 | } else { |
1780 | // @@protoc_insertion_point(generalized_merge_from_cast_success:tensorflow.VariantTensorDataProto) |
1781 | MergeFrom(*source); |
1782 | } |
1783 | } |
1784 | |
1785 | void VariantTensorDataProto::MergeFrom(const VariantTensorDataProto& from) { |
1786 | // @@protoc_insertion_point(class_specific_merge_from_start:tensorflow.VariantTensorDataProto) |
1787 | GOOGLE_DCHECK_NE(&from, this); |
1788 | _internal_metadata_.MergeFrom(from._internal_metadata_); |
1789 | ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; |
1790 | (void) cached_has_bits; |
1791 | |
1792 | tensors_.MergeFrom(from.tensors_); |
1793 | if (from.type_name().size() > 0) { |
1794 | set_type_name(from.type_name()); |
1795 | } |
1796 | if (from.metadata().size() > 0) { |
1797 | set_metadata(from.metadata()); |
1798 | } |
1799 | } |
1800 | |
1801 | void VariantTensorDataProto::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { |
1802 | // @@protoc_insertion_point(generalized_copy_from_start:tensorflow.VariantTensorDataProto) |
1803 | if (&from == this) return; |
1804 | Clear(); |
1805 | MergeFrom(from); |
1806 | } |
1807 | |
1808 | void VariantTensorDataProto::CopyFrom(const VariantTensorDataProto& from) { |
1809 | // @@protoc_insertion_point(class_specific_copy_from_start:tensorflow.VariantTensorDataProto) |
1810 | if (&from == this) return; |
1811 | Clear(); |
1812 | MergeFrom(from); |
1813 | } |
1814 | |
1815 | bool VariantTensorDataProto::IsInitialized() const { |
1816 | return true; |
1817 | } |
1818 | |
1819 | void VariantTensorDataProto::InternalSwap(VariantTensorDataProto* other) { |
1820 | using std::swap; |
1821 | _internal_metadata_.Swap(&other->_internal_metadata_); |
1822 | CastToBase(&tensors_)->InternalSwap(CastToBase(&other->tensors_)); |
1823 | type_name_.Swap(&other->type_name_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), |
1824 | GetArenaNoVirtual()); |
1825 | metadata_.Swap(&other->metadata_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), |
1826 | GetArenaNoVirtual()); |
1827 | } |
1828 | |
1829 | ::PROTOBUF_NAMESPACE_ID::Metadata VariantTensorDataProto::GetMetadata() const { |
1830 | return GetMetadataStatic(); |
1831 | } |
1832 | |
1833 | |
1834 | // @@protoc_insertion_point(namespace_scope) |
1835 | } // namespace tensorflow |
1836 | PROTOBUF_NAMESPACE_OPEN |
1837 | template<> PROTOBUF_NOINLINE ::tensorflow::TensorProto* Arena::CreateMaybeMessage< ::tensorflow::TensorProto >(Arena* arena) { |
1838 | return Arena::CreateMessageInternal< ::tensorflow::TensorProto >(arena); |
1839 | } |
1840 | template<> PROTOBUF_NOINLINE ::tensorflow::VariantTensorDataProto* Arena::CreateMaybeMessage< ::tensorflow::VariantTensorDataProto >(Arena* arena) { |
1841 | return Arena::CreateMessageInternal< ::tensorflow::VariantTensorDataProto >(arena); |
1842 | } |
1843 | PROTOBUF_NAMESPACE_CLOSE |
1844 | |
1845 | // @@protoc_insertion_point(global_scope) |
1846 | #include <google/protobuf/port_undef.inc> |
1847 | |