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