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