1// Generated by the protocol buffer compiler. DO NOT EDIT!
2// source: tensorflow/core/framework/attr_value.proto
3
4#include "tensorflow/core/framework/attr_value.pb.h"
5
6#include <algorithm>
7
8#include <google/protobuf/stubs/common.h>
9#include <google/protobuf/io/coded_stream.h>
10#include <google/protobuf/extension_set.h>
11#include <google/protobuf/wire_format_lite.h>
12#include <google/protobuf/descriptor.h>
13#include <google/protobuf/generated_message_reflection.h>
14#include <google/protobuf/reflection_ops.h>
15#include <google/protobuf/wire_format.h>
16// @@protoc_insertion_point(includes)
17#include <google/protobuf/port_def.inc>
18extern PROTOBUF_INTERNAL_EXPORT_tensorflow_2fcore_2fframework_2fattr_5fvalue_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<2> scc_info_AttrValue_tensorflow_2fcore_2fframework_2fattr_5fvalue_2eproto;
19extern PROTOBUF_INTERNAL_EXPORT_tensorflow_2fcore_2fframework_2ftensor_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<2> scc_info_TensorProto_tensorflow_2fcore_2fframework_2ftensor_2eproto;
20extern PROTOBUF_INTERNAL_EXPORT_tensorflow_2fcore_2fframework_2ftensor_5fshape_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_TensorShapeProto_tensorflow_2fcore_2fframework_2ftensor_5fshape_2eproto;
21namespace tensorflow {
22class AttrValue_ListValueDefaultTypeInternal {
23 public:
24 ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<AttrValue_ListValue> _instance;
25} _AttrValue_ListValue_default_instance_;
26class AttrValueDefaultTypeInternal {
27 public:
28 ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<AttrValue> _instance;
29 ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr s_;
30 ::PROTOBUF_NAMESPACE_ID::int64 i_;
31 float f_;
32 bool b_;
33 int type_;
34 const ::tensorflow::TensorShapeProto* shape_;
35 const ::tensorflow::TensorProto* tensor_;
36 const ::tensorflow::AttrValue_ListValue* list_;
37 const ::tensorflow::NameAttrList* func_;
38 ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr placeholder_;
39} _AttrValue_default_instance_;
40class NameAttrList_AttrEntry_DoNotUseDefaultTypeInternal {
41 public:
42 ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<NameAttrList_AttrEntry_DoNotUse> _instance;
43} _NameAttrList_AttrEntry_DoNotUse_default_instance_;
44class NameAttrListDefaultTypeInternal {
45 public:
46 ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<NameAttrList> _instance;
47} _NameAttrList_default_instance_;
48} // namespace tensorflow
49static void InitDefaultsscc_info_AttrValue_tensorflow_2fcore_2fframework_2fattr_5fvalue_2eproto() {
50 GOOGLE_PROTOBUF_VERIFY_VERSION;
51
52 {
53 void* ptr = &::tensorflow::_AttrValue_ListValue_default_instance_;
54 new (ptr) ::tensorflow::AttrValue_ListValue();
55 ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
56 }
57 {
58 void* ptr = &::tensorflow::_AttrValue_default_instance_;
59 new (ptr) ::tensorflow::AttrValue();
60 ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
61 }
62 {
63 void* ptr = &::tensorflow::_NameAttrList_AttrEntry_DoNotUse_default_instance_;
64 new (ptr) ::tensorflow::NameAttrList_AttrEntry_DoNotUse();
65 }
66 {
67 void* ptr = &::tensorflow::_NameAttrList_default_instance_;
68 new (ptr) ::tensorflow::NameAttrList();
69 ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
70 }
71 ::tensorflow::AttrValue_ListValue::InitAsDefaultInstance();
72 ::tensorflow::AttrValue::InitAsDefaultInstance();
73 ::tensorflow::NameAttrList_AttrEntry_DoNotUse::InitAsDefaultInstance();
74 ::tensorflow::NameAttrList::InitAsDefaultInstance();
75}
76
77::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<2> scc_info_AttrValue_tensorflow_2fcore_2fframework_2fattr_5fvalue_2eproto =
78 {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 2, InitDefaultsscc_info_AttrValue_tensorflow_2fcore_2fframework_2fattr_5fvalue_2eproto}, {
79 &scc_info_TensorShapeProto_tensorflow_2fcore_2fframework_2ftensor_5fshape_2eproto.base,
80 &scc_info_TensorProto_tensorflow_2fcore_2fframework_2ftensor_2eproto.base,}};
81
82static ::PROTOBUF_NAMESPACE_ID::Metadata file_level_metadata_tensorflow_2fcore_2fframework_2fattr_5fvalue_2eproto[4];
83static constexpr ::PROTOBUF_NAMESPACE_ID::EnumDescriptor const** file_level_enum_descriptors_tensorflow_2fcore_2fframework_2fattr_5fvalue_2eproto = nullptr;
84static constexpr ::PROTOBUF_NAMESPACE_ID::ServiceDescriptor const** file_level_service_descriptors_tensorflow_2fcore_2fframework_2fattr_5fvalue_2eproto = nullptr;
85
86const ::PROTOBUF_NAMESPACE_ID::uint32 TableStruct_tensorflow_2fcore_2fframework_2fattr_5fvalue_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
87 ~0u, // no _has_bits_
88 PROTOBUF_FIELD_OFFSET(::tensorflow::AttrValue_ListValue, _internal_metadata_),
89 ~0u, // no _extensions_
90 ~0u, // no _oneof_case_
91 ~0u, // no _weak_field_map_
92 PROTOBUF_FIELD_OFFSET(::tensorflow::AttrValue_ListValue, s_),
93 PROTOBUF_FIELD_OFFSET(::tensorflow::AttrValue_ListValue, i_),
94 PROTOBUF_FIELD_OFFSET(::tensorflow::AttrValue_ListValue, f_),
95 PROTOBUF_FIELD_OFFSET(::tensorflow::AttrValue_ListValue, b_),
96 PROTOBUF_FIELD_OFFSET(::tensorflow::AttrValue_ListValue, type_),
97 PROTOBUF_FIELD_OFFSET(::tensorflow::AttrValue_ListValue, shape_),
98 PROTOBUF_FIELD_OFFSET(::tensorflow::AttrValue_ListValue, tensor_),
99 PROTOBUF_FIELD_OFFSET(::tensorflow::AttrValue_ListValue, func_),
100 ~0u, // no _has_bits_
101 PROTOBUF_FIELD_OFFSET(::tensorflow::AttrValue, _internal_metadata_),
102 ~0u, // no _extensions_
103 PROTOBUF_FIELD_OFFSET(::tensorflow::AttrValue, _oneof_case_[0]),
104 ~0u, // no _weak_field_map_
105 offsetof(::tensorflow::AttrValueDefaultTypeInternal, s_),
106 offsetof(::tensorflow::AttrValueDefaultTypeInternal, i_),
107 offsetof(::tensorflow::AttrValueDefaultTypeInternal, f_),
108 offsetof(::tensorflow::AttrValueDefaultTypeInternal, b_),
109 offsetof(::tensorflow::AttrValueDefaultTypeInternal, type_),
110 offsetof(::tensorflow::AttrValueDefaultTypeInternal, shape_),
111 offsetof(::tensorflow::AttrValueDefaultTypeInternal, tensor_),
112 offsetof(::tensorflow::AttrValueDefaultTypeInternal, list_),
113 offsetof(::tensorflow::AttrValueDefaultTypeInternal, func_),
114 offsetof(::tensorflow::AttrValueDefaultTypeInternal, placeholder_),
115 PROTOBUF_FIELD_OFFSET(::tensorflow::AttrValue, value_),
116 PROTOBUF_FIELD_OFFSET(::tensorflow::NameAttrList_AttrEntry_DoNotUse, _has_bits_),
117 PROTOBUF_FIELD_OFFSET(::tensorflow::NameAttrList_AttrEntry_DoNotUse, _internal_metadata_),
118 ~0u, // no _extensions_
119 ~0u, // no _oneof_case_
120 ~0u, // no _weak_field_map_
121 PROTOBUF_FIELD_OFFSET(::tensorflow::NameAttrList_AttrEntry_DoNotUse, key_),
122 PROTOBUF_FIELD_OFFSET(::tensorflow::NameAttrList_AttrEntry_DoNotUse, value_),
123 0,
124 1,
125 ~0u, // no _has_bits_
126 PROTOBUF_FIELD_OFFSET(::tensorflow::NameAttrList, _internal_metadata_),
127 ~0u, // no _extensions_
128 ~0u, // no _oneof_case_
129 ~0u, // no _weak_field_map_
130 PROTOBUF_FIELD_OFFSET(::tensorflow::NameAttrList, name_),
131 PROTOBUF_FIELD_OFFSET(::tensorflow::NameAttrList, attr_),
132};
133static const ::PROTOBUF_NAMESPACE_ID::internal::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
134 { 0, -1, sizeof(::tensorflow::AttrValue_ListValue)},
135 { 13, -1, sizeof(::tensorflow::AttrValue)},
136 { 29, 36, sizeof(::tensorflow::NameAttrList_AttrEntry_DoNotUse)},
137 { 38, -1, sizeof(::tensorflow::NameAttrList)},
138};
139
140static ::PROTOBUF_NAMESPACE_ID::Message const * const file_default_instances[] = {
141 reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::tensorflow::_AttrValue_ListValue_default_instance_),
142 reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::tensorflow::_AttrValue_default_instance_),
143 reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::tensorflow::_NameAttrList_AttrEntry_DoNotUse_default_instance_),
144 reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::tensorflow::_NameAttrList_default_instance_),
145};
146
147const char descriptor_table_protodef_tensorflow_2fcore_2fframework_2fattr_5fvalue_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) =
148 "\n*tensorflow/core/framework/attr_value.p"
149 "roto\022\ntensorflow\032&tensorflow/core/framew"
150 "ork/tensor.proto\032,tensorflow/core/framew"
151 "ork/tensor_shape.proto\032%tensorflow/core/"
152 "framework/types.proto\"\246\004\n\tAttrValue\022\013\n\001s"
153 "\030\002 \001(\014H\000\022\013\n\001i\030\003 \001(\003H\000\022\013\n\001f\030\004 \001(\002H\000\022\013\n\001b\030"
154 "\005 \001(\010H\000\022$\n\004type\030\006 \001(\0162\024.tensorflow.DataT"
155 "ypeH\000\022-\n\005shape\030\007 \001(\0132\034.tensorflow.Tensor"
156 "ShapeProtoH\000\022)\n\006tensor\030\010 \001(\0132\027.tensorflo"
157 "w.TensorProtoH\000\022/\n\004list\030\001 \001(\0132\037.tensorfl"
158 "ow.AttrValue.ListValueH\000\022(\n\004func\030\n \001(\0132\030"
159 ".tensorflow.NameAttrListH\000\022\025\n\013placeholde"
160 "r\030\t \001(\tH\000\032\351\001\n\tListValue\022\t\n\001s\030\002 \003(\014\022\r\n\001i\030"
161 "\003 \003(\003B\002\020\001\022\r\n\001f\030\004 \003(\002B\002\020\001\022\r\n\001b\030\005 \003(\010B\002\020\001\022"
162 "&\n\004type\030\006 \003(\0162\024.tensorflow.DataTypeB\002\020\001\022"
163 "+\n\005shape\030\007 \003(\0132\034.tensorflow.TensorShapeP"
164 "roto\022\'\n\006tensor\030\010 \003(\0132\027.tensorflow.Tensor"
165 "Proto\022&\n\004func\030\t \003(\0132\030.tensorflow.NameAtt"
166 "rListB\007\n\005value\"\222\001\n\014NameAttrList\022\014\n\004name\030"
167 "\001 \001(\t\0220\n\004attr\030\002 \003(\0132\".tensorflow.NameAtt"
168 "rList.AttrEntry\032B\n\tAttrEntry\022\013\n\003key\030\001 \001("
169 "\t\022$\n\005value\030\002 \001(\0132\025.tensorflow.AttrValue:"
170 "\0028\001B\203\001\n\030org.tensorflow.frameworkB\017AttrVa"
171 "lueProtosP\001ZQgithub.com/tensorflow/tenso"
172 "rflow/tensorflow/go/core/framework/attr_"
173 "value_go_proto\370\001\001b\006proto3"
174 ;
175static const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable*const descriptor_table_tensorflow_2fcore_2fframework_2fattr_5fvalue_2eproto_deps[3] = {
176 &::descriptor_table_tensorflow_2fcore_2fframework_2ftensor_2eproto,
177 &::descriptor_table_tensorflow_2fcore_2fframework_2ftensor_5fshape_2eproto,
178 &::descriptor_table_tensorflow_2fcore_2fframework_2ftypes_2eproto,
179};
180static ::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase*const descriptor_table_tensorflow_2fcore_2fframework_2fattr_5fvalue_2eproto_sccs[1] = {
181 &scc_info_AttrValue_tensorflow_2fcore_2fframework_2fattr_5fvalue_2eproto.base,
182};
183static ::PROTOBUF_NAMESPACE_ID::internal::once_flag descriptor_table_tensorflow_2fcore_2fframework_2fattr_5fvalue_2eproto_once;
184static bool descriptor_table_tensorflow_2fcore_2fframework_2fattr_5fvalue_2eproto_initialized = false;
185const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_tensorflow_2fcore_2fframework_2fattr_5fvalue_2eproto = {
186 &descriptor_table_tensorflow_2fcore_2fframework_2fattr_5fvalue_2eproto_initialized, descriptor_table_protodef_tensorflow_2fcore_2fframework_2fattr_5fvalue_2eproto, "tensorflow/core/framework/attr_value.proto", 1025,
187 &descriptor_table_tensorflow_2fcore_2fframework_2fattr_5fvalue_2eproto_once, descriptor_table_tensorflow_2fcore_2fframework_2fattr_5fvalue_2eproto_sccs, descriptor_table_tensorflow_2fcore_2fframework_2fattr_5fvalue_2eproto_deps, 1, 3,
188 schemas, file_default_instances, TableStruct_tensorflow_2fcore_2fframework_2fattr_5fvalue_2eproto::offsets,
189 file_level_metadata_tensorflow_2fcore_2fframework_2fattr_5fvalue_2eproto, 4, file_level_enum_descriptors_tensorflow_2fcore_2fframework_2fattr_5fvalue_2eproto, file_level_service_descriptors_tensorflow_2fcore_2fframework_2fattr_5fvalue_2eproto,
190};
191
192// Force running AddDescriptors() at dynamic initialization time.
193static bool dynamic_init_dummy_tensorflow_2fcore_2fframework_2fattr_5fvalue_2eproto = ( ::PROTOBUF_NAMESPACE_ID::internal::AddDescriptors(&descriptor_table_tensorflow_2fcore_2fframework_2fattr_5fvalue_2eproto), true);
194namespace tensorflow {
195
196// ===================================================================
197
198void AttrValue_ListValue::InitAsDefaultInstance() {
199}
200class AttrValue_ListValue::_Internal {
201 public:
202};
203
204void AttrValue_ListValue::clear_shape() {
205 shape_.Clear();
206}
207void AttrValue_ListValue::clear_tensor() {
208 tensor_.Clear();
209}
210AttrValue_ListValue::AttrValue_ListValue()
211 : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
212 SharedCtor();
213 // @@protoc_insertion_point(constructor:tensorflow.AttrValue.ListValue)
214}
215AttrValue_ListValue::AttrValue_ListValue(::PROTOBUF_NAMESPACE_ID::Arena* arena)
216 : ::PROTOBUF_NAMESPACE_ID::Message(),
217 _internal_metadata_(arena),
218 s_(arena),
219 i_(arena),
220 f_(arena),
221 b_(arena),
222 type_(arena),
223 shape_(arena),
224 tensor_(arena),
225 func_(arena) {
226 SharedCtor();
227 RegisterArenaDtor(arena);
228 // @@protoc_insertion_point(arena_constructor:tensorflow.AttrValue.ListValue)
229}
230AttrValue_ListValue::AttrValue_ListValue(const AttrValue_ListValue& from)
231 : ::PROTOBUF_NAMESPACE_ID::Message(),
232 _internal_metadata_(nullptr),
233 s_(from.s_),
234 i_(from.i_),
235 f_(from.f_),
236 b_(from.b_),
237 type_(from.type_),
238 shape_(from.shape_),
239 tensor_(from.tensor_),
240 func_(from.func_) {
241 _internal_metadata_.MergeFrom(from._internal_metadata_);
242 // @@protoc_insertion_point(copy_constructor:tensorflow.AttrValue.ListValue)
243}
244
245void AttrValue_ListValue::SharedCtor() {
246 ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_AttrValue_tensorflow_2fcore_2fframework_2fattr_5fvalue_2eproto.base);
247}
248
249AttrValue_ListValue::~AttrValue_ListValue() {
250 // @@protoc_insertion_point(destructor:tensorflow.AttrValue.ListValue)
251 SharedDtor();
252}
253
254void AttrValue_ListValue::SharedDtor() {
255 GOOGLE_DCHECK(GetArenaNoVirtual() == nullptr);
256}
257
258void AttrValue_ListValue::ArenaDtor(void* object) {
259 AttrValue_ListValue* _this = reinterpret_cast< AttrValue_ListValue* >(object);
260 (void)_this;
261}
262void AttrValue_ListValue::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
263}
264void AttrValue_ListValue::SetCachedSize(int size) const {
265 _cached_size_.Set(size);
266}
267const AttrValue_ListValue& AttrValue_ListValue::default_instance() {
268 ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_AttrValue_tensorflow_2fcore_2fframework_2fattr_5fvalue_2eproto.base);
269 return *internal_default_instance();
270}
271
272
273void AttrValue_ListValue::Clear() {
274// @@protoc_insertion_point(message_clear_start:tensorflow.AttrValue.ListValue)
275 ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
276 // Prevent compiler warnings about cached_has_bits being unused
277 (void) cached_has_bits;
278
279 s_.Clear();
280 i_.Clear();
281 f_.Clear();
282 b_.Clear();
283 type_.Clear();
284 shape_.Clear();
285 tensor_.Clear();
286 func_.Clear();
287 _internal_metadata_.Clear();
288}
289
290#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
291const char* AttrValue_ListValue::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
292#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
293 ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArenaNoVirtual(); (void)arena;
294 while (!ctx->Done(&ptr)) {
295 ::PROTOBUF_NAMESPACE_ID::uint32 tag;
296 ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
297 CHK_(ptr);
298 switch (tag >> 3) {
299 // repeated bytes s = 2;
300 case 2:
301 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) {
302 ptr -= 1;
303 do {
304 ptr += 1;
305 ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(add_s(), ptr, ctx);
306 CHK_(ptr);
307 if (!ctx->DataAvailable(ptr)) break;
308 } while (::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<::PROTOBUF_NAMESPACE_ID::uint8>(ptr) == 18);
309 } else goto handle_unusual;
310 continue;
311 // repeated int64 i = 3 [packed = true];
312 case 3:
313 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26)) {
314 ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedInt64Parser(mutable_i(), ptr, ctx);
315 CHK_(ptr);
316 } else if (static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24) {
317 add_i(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr));
318 CHK_(ptr);
319 } else goto handle_unusual;
320 continue;
321 // repeated float f = 4 [packed = true];
322 case 4:
323 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 34)) {
324 ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedFloatParser(mutable_f(), ptr, ctx);
325 CHK_(ptr);
326 } else if (static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 37) {
327 add_f(::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr));
328 ptr += sizeof(float);
329 } else goto handle_unusual;
330 continue;
331 // repeated bool b = 5 [packed = true];
332 case 5:
333 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 42)) {
334 ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedBoolParser(mutable_b(), ptr, ctx);
335 CHK_(ptr);
336 } else if (static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 40) {
337 add_b(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr));
338 CHK_(ptr);
339 } else goto handle_unusual;
340 continue;
341 // repeated .tensorflow.DataType type = 6 [packed = true];
342 case 6:
343 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 50)) {
344 ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedEnumParser(mutable_type(), ptr, ctx);
345 CHK_(ptr);
346 } else if (static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 48) {
347 ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
348 CHK_(ptr);
349 add_type(static_cast<::tensorflow::DataType>(val));
350 } else goto handle_unusual;
351 continue;
352 // repeated .tensorflow.TensorShapeProto shape = 7;
353 case 7:
354 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 58)) {
355 ptr -= 1;
356 do {
357 ptr += 1;
358 ptr = ctx->ParseMessage(add_shape(), ptr);
359 CHK_(ptr);
360 if (!ctx->DataAvailable(ptr)) break;
361 } while (::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<::PROTOBUF_NAMESPACE_ID::uint8>(ptr) == 58);
362 } else goto handle_unusual;
363 continue;
364 // repeated .tensorflow.TensorProto tensor = 8;
365 case 8:
366 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 66)) {
367 ptr -= 1;
368 do {
369 ptr += 1;
370 ptr = ctx->ParseMessage(add_tensor(), ptr);
371 CHK_(ptr);
372 if (!ctx->DataAvailable(ptr)) break;
373 } while (::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<::PROTOBUF_NAMESPACE_ID::uint8>(ptr) == 66);
374 } else goto handle_unusual;
375 continue;
376 // repeated .tensorflow.NameAttrList func = 9;
377 case 9:
378 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 74)) {
379 ptr -= 1;
380 do {
381 ptr += 1;
382 ptr = ctx->ParseMessage(add_func(), ptr);
383 CHK_(ptr);
384 if (!ctx->DataAvailable(ptr)) break;
385 } while (::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<::PROTOBUF_NAMESPACE_ID::uint8>(ptr) == 74);
386 } else goto handle_unusual;
387 continue;
388 default: {
389 handle_unusual:
390 if ((tag & 7) == 4 || tag == 0) {
391 ctx->SetLastTag(tag);
392 goto success;
393 }
394 ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
395 CHK_(ptr != nullptr);
396 continue;
397 }
398 } // switch
399 } // while
400success:
401 return ptr;
402failure:
403 ptr = nullptr;
404 goto success;
405#undef CHK_
406}
407#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
408bool AttrValue_ListValue::MergePartialFromCodedStream(
409 ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) {
410#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure
411 ::PROTOBUF_NAMESPACE_ID::uint32 tag;
412 // @@protoc_insertion_point(parse_start:tensorflow.AttrValue.ListValue)
413 for (;;) {
414 ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
415 tag = p.first;
416 if (!p.second) goto handle_unusual;
417 switch (::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::GetTagFieldNumber(tag)) {
418 // repeated bytes s = 2;
419 case 2: {
420 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (18 & 0xFF)) {
421 DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadBytes(
422 input, this->add_s()));
423 } else {
424 goto handle_unusual;
425 }
426 break;
427 }
428
429 // repeated int64 i = 3 [packed = true];
430 case 3: {
431 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (26 & 0xFF)) {
432 DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPackedPrimitive<
433 ::PROTOBUF_NAMESPACE_ID::int64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT64>(
434 input, this->mutable_i())));
435 } else if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (24 & 0xFF)) {
436 DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline<
437 ::PROTOBUF_NAMESPACE_ID::int64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT64>(
438 1, 26u, input, this->mutable_i())));
439 } else {
440 goto handle_unusual;
441 }
442 break;
443 }
444
445 // repeated float f = 4 [packed = true];
446 case 4: {
447 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (34 & 0xFF)) {
448 DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPackedPrimitive<
449 float, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_FLOAT>(
450 input, this->mutable_f())));
451 } else if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (37 & 0xFF)) {
452 DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline<
453 float, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_FLOAT>(
454 1, 34u, input, this->mutable_f())));
455 } else {
456 goto handle_unusual;
457 }
458 break;
459 }
460
461 // repeated bool b = 5 [packed = true];
462 case 5: {
463 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (42 & 0xFF)) {
464 DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPackedPrimitive<
465 bool, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_BOOL>(
466 input, this->mutable_b())));
467 } else if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (40 & 0xFF)) {
468 DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline<
469 bool, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_BOOL>(
470 1, 42u, input, this->mutable_b())));
471 } else {
472 goto handle_unusual;
473 }
474 break;
475 }
476
477 // repeated .tensorflow.DataType type = 6 [packed = true];
478 case 6: {
479 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (50 & 0xFF)) {
480 ::PROTOBUF_NAMESPACE_ID::uint32 length;
481 DO_(input->ReadVarint32(&length));
482 ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream::Limit limit = input->PushLimit(static_cast<int>(length));
483 while (input->BytesUntilLimit() > 0) {
484 int value = 0;
485 DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
486 int, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_ENUM>(
487 input, &value)));
488 add_type(static_cast< ::tensorflow::DataType >(value));
489 }
490 input->PopLimit(limit);
491 } else if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (48 & 0xFF)) {
492 int value = 0;
493 DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
494 int, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_ENUM>(
495 input, &value)));
496 add_type(static_cast< ::tensorflow::DataType >(value));
497 } else {
498 goto handle_unusual;
499 }
500 break;
501 }
502
503 // repeated .tensorflow.TensorShapeProto shape = 7;
504 case 7: {
505 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (58 & 0xFF)) {
506 DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage(
507 input, add_shape()));
508 } else {
509 goto handle_unusual;
510 }
511 break;
512 }
513
514 // repeated .tensorflow.TensorProto tensor = 8;
515 case 8: {
516 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (66 & 0xFF)) {
517 DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage(
518 input, add_tensor()));
519 } else {
520 goto handle_unusual;
521 }
522 break;
523 }
524
525 // repeated .tensorflow.NameAttrList func = 9;
526 case 9: {
527 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (74 & 0xFF)) {
528 DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage(
529 input, add_func()));
530 } else {
531 goto handle_unusual;
532 }
533 break;
534 }
535
536 default: {
537 handle_unusual:
538 if (tag == 0) {
539 goto success;
540 }
541 DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SkipField(
542 input, tag, _internal_metadata_.mutable_unknown_fields()));
543 break;
544 }
545 }
546 }
547success:
548 // @@protoc_insertion_point(parse_success:tensorflow.AttrValue.ListValue)
549 return true;
550failure:
551 // @@protoc_insertion_point(parse_failure:tensorflow.AttrValue.ListValue)
552 return false;
553#undef DO_
554}
555#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
556
557void AttrValue_ListValue::SerializeWithCachedSizes(
558 ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const {
559 // @@protoc_insertion_point(serialize_start:tensorflow.AttrValue.ListValue)
560 ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
561 (void) cached_has_bits;
562
563 // repeated bytes s = 2;
564 for (int i = 0, n = this->s_size(); i < n; i++) {
565 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBytes(
566 2, this->s(i), output);
567 }
568
569 // repeated int64 i = 3 [packed = true];
570 if (this->i_size() > 0) {
571 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteTag(3, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output);
572 output->WriteVarint32(_i_cached_byte_size_.load(
573 std::memory_order_relaxed));
574 }
575 for (int i = 0, n = this->i_size(); i < n; i++) {
576 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64NoTag(
577 this->i(i), output);
578 }
579
580 // repeated float f = 4 [packed = true];
581 if (this->f_size() > 0) {
582 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteTag(4, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output);
583 output->WriteVarint32(_f_cached_byte_size_.load(
584 std::memory_order_relaxed));
585 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatArray(
586 this->f().data(), this->f_size(), output);
587 }
588
589 // repeated bool b = 5 [packed = true];
590 if (this->b_size() > 0) {
591 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteTag(5, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output);
592 output->WriteVarint32(_b_cached_byte_size_.load(
593 std::memory_order_relaxed));
594 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolArray(
595 this->b().data(), this->b_size(), output);
596 }
597
598 // repeated .tensorflow.DataType type = 6 [packed = true];
599 if (this->type_size() > 0) {
600 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteTag(
601 6,
602 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED,
603 output);
604 output->WriteVarint32(_type_cached_byte_size_.load(
605 std::memory_order_relaxed));
606 }
607 for (int i = 0, n = this->type_size(); i < n; i++) {
608 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumNoTag(
609 this->type(i), output);
610 }
611
612 // repeated .tensorflow.TensorShapeProto shape = 7;
613 for (unsigned int i = 0,
614 n = static_cast<unsigned int>(this->shape_size()); i < n; i++) {
615 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray(
616 7,
617 this->shape(static_cast<int>(i)),
618 output);
619 }
620
621 // repeated .tensorflow.TensorProto tensor = 8;
622 for (unsigned int i = 0,
623 n = static_cast<unsigned int>(this->tensor_size()); i < n; i++) {
624 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray(
625 8,
626 this->tensor(static_cast<int>(i)),
627 output);
628 }
629
630 // repeated .tensorflow.NameAttrList func = 9;
631 for (unsigned int i = 0,
632 n = static_cast<unsigned int>(this->func_size()); i < n; i++) {
633 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray(
634 9,
635 this->func(static_cast<int>(i)),
636 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.AttrValue.ListValue)
644}
645
646::PROTOBUF_NAMESPACE_ID::uint8* AttrValue_ListValue::InternalSerializeWithCachedSizesToArray(
647 ::PROTOBUF_NAMESPACE_ID::uint8* target) const {
648 // @@protoc_insertion_point(serialize_to_array_start:tensorflow.AttrValue.ListValue)
649 ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
650 (void) cached_has_bits;
651
652 // repeated bytes s = 2;
653 for (int i = 0, n = this->s_size(); i < n; i++) {
654 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
655 WriteBytesToArray(2, this->s(i), target);
656 }
657
658 // repeated int64 i = 3 [packed = true];
659 if (this->i_size() > 0) {
660 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteTagToArray(
661 3,
662 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED,
663 target);
664 target = ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream::WriteVarint32ToArray(
665 _i_cached_byte_size_.load(std::memory_order_relaxed),
666 target);
667 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
668 WriteInt64NoTagToArray(this->i_, target);
669 }
670
671 // repeated float f = 4 [packed = true];
672 if (this->f_size() > 0) {
673 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteTagToArray(
674 4,
675 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED,
676 target);
677 target = ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream::WriteVarint32ToArray(
678 _f_cached_byte_size_.load(std::memory_order_relaxed),
679 target);
680 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
681 WriteFloatNoTagToArray(this->f_, target);
682 }
683
684 // repeated bool b = 5 [packed = true];
685 if (this->b_size() > 0) {
686 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteTagToArray(
687 5,
688 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED,
689 target);
690 target = ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream::WriteVarint32ToArray(
691 _b_cached_byte_size_.load(std::memory_order_relaxed),
692 target);
693 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
694 WriteBoolNoTagToArray(this->b_, target);
695 }
696
697 // repeated .tensorflow.DataType type = 6 [packed = true];
698 if (this->type_size() > 0) {
699 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteTagToArray(
700 6,
701 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED,
702 target);
703 target = ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream::WriteVarint32ToArray( _type_cached_byte_size_.load(std::memory_order_relaxed),
704 target);
705 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumNoTagToArray(
706 this->type_, target);
707 }
708
709 // repeated .tensorflow.TensorShapeProto shape = 7;
710 for (unsigned int i = 0,
711 n = static_cast<unsigned int>(this->shape_size()); i < n; i++) {
712 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
713 InternalWriteMessageToArray(
714 7, this->shape(static_cast<int>(i)), target);
715 }
716
717 // repeated .tensorflow.TensorProto tensor = 8;
718 for (unsigned int i = 0,
719 n = static_cast<unsigned int>(this->tensor_size()); i < n; i++) {
720 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
721 InternalWriteMessageToArray(
722 8, this->tensor(static_cast<int>(i)), target);
723 }
724
725 // repeated .tensorflow.NameAttrList func = 9;
726 for (unsigned int i = 0,
727 n = static_cast<unsigned int>(this->func_size()); i < n; i++) {
728 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
729 InternalWriteMessageToArray(
730 9, this->func(static_cast<int>(i)), target);
731 }
732
733 if (_internal_metadata_.have_unknown_fields()) {
734 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray(
735 _internal_metadata_.unknown_fields(), target);
736 }
737 // @@protoc_insertion_point(serialize_to_array_end:tensorflow.AttrValue.ListValue)
738 return target;
739}
740
741size_t AttrValue_ListValue::ByteSizeLong() const {
742// @@protoc_insertion_point(message_byte_size_start:tensorflow.AttrValue.ListValue)
743 size_t total_size = 0;
744
745 if (_internal_metadata_.have_unknown_fields()) {
746 total_size +=
747 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::ComputeUnknownFieldsSize(
748 _internal_metadata_.unknown_fields());
749 }
750 ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
751 // Prevent compiler warnings about cached_has_bits being unused
752 (void) cached_has_bits;
753
754 // repeated bytes s = 2;
755 total_size += 1 *
756 ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(this->s_size());
757 for (int i = 0, n = this->s_size(); i < n; i++) {
758 total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize(
759 this->s(i));
760 }
761
762 // repeated int64 i = 3 [packed = true];
763 {
764 size_t data_size = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
765 Int64Size(this->i_);
766 if (data_size > 0) {
767 total_size += 1 +
768 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
769 static_cast<::PROTOBUF_NAMESPACE_ID::int32>(data_size));
770 }
771 int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(data_size);
772 _i_cached_byte_size_.store(cached_size,
773 std::memory_order_relaxed);
774 total_size += data_size;
775 }
776
777 // repeated float f = 4 [packed = true];
778 {
779 unsigned int count = static_cast<unsigned int>(this->f_size());
780 size_t data_size = 4UL * count;
781 if (data_size > 0) {
782 total_size += 1 +
783 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
784 static_cast<::PROTOBUF_NAMESPACE_ID::int32>(data_size));
785 }
786 int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(data_size);
787 _f_cached_byte_size_.store(cached_size,
788 std::memory_order_relaxed);
789 total_size += data_size;
790 }
791
792 // repeated bool b = 5 [packed = true];
793 {
794 unsigned int count = static_cast<unsigned int>(this->b_size());
795 size_t data_size = 1UL * count;
796 if (data_size > 0) {
797 total_size += 1 +
798 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
799 static_cast<::PROTOBUF_NAMESPACE_ID::int32>(data_size));
800 }
801 int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(data_size);
802 _b_cached_byte_size_.store(cached_size,
803 std::memory_order_relaxed);
804 total_size += data_size;
805 }
806
807 // repeated .tensorflow.DataType type = 6 [packed = true];
808 {
809 size_t data_size = 0;
810 unsigned int count = static_cast<unsigned int>(this->type_size());for (unsigned int i = 0; i < count; i++) {
811 data_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(
812 this->type(static_cast<int>(i)));
813 }
814 if (data_size > 0) {
815 total_size += 1 +
816 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
817 static_cast<::PROTOBUF_NAMESPACE_ID::int32>(data_size));
818 }
819 int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(data_size);
820 _type_cached_byte_size_.store(cached_size,
821 std::memory_order_relaxed);
822 total_size += data_size;
823 }
824
825 // repeated .tensorflow.TensorShapeProto shape = 7;
826 {
827 unsigned int count = static_cast<unsigned int>(this->shape_size());
828 total_size += 1UL * count;
829 for (unsigned int i = 0; i < count; i++) {
830 total_size +=
831 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
832 this->shape(static_cast<int>(i)));
833 }
834 }
835
836 // repeated .tensorflow.TensorProto tensor = 8;
837 {
838 unsigned int count = static_cast<unsigned int>(this->tensor_size());
839 total_size += 1UL * count;
840 for (unsigned int i = 0; i < count; i++) {
841 total_size +=
842 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
843 this->tensor(static_cast<int>(i)));
844 }
845 }
846
847 // repeated .tensorflow.NameAttrList func = 9;
848 {
849 unsigned int count = static_cast<unsigned int>(this->func_size());
850 total_size += 1UL * count;
851 for (unsigned int i = 0; i < count; i++) {
852 total_size +=
853 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
854 this->func(static_cast<int>(i)));
855 }
856 }
857
858 int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
859 SetCachedSize(cached_size);
860 return total_size;
861}
862
863void AttrValue_ListValue::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
864// @@protoc_insertion_point(generalized_merge_from_start:tensorflow.AttrValue.ListValue)
865 GOOGLE_DCHECK_NE(&from, this);
866 const AttrValue_ListValue* source =
867 ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<AttrValue_ListValue>(
868 &from);
869 if (source == nullptr) {
870 // @@protoc_insertion_point(generalized_merge_from_cast_fail:tensorflow.AttrValue.ListValue)
871 ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
872 } else {
873 // @@protoc_insertion_point(generalized_merge_from_cast_success:tensorflow.AttrValue.ListValue)
874 MergeFrom(*source);
875 }
876}
877
878void AttrValue_ListValue::MergeFrom(const AttrValue_ListValue& from) {
879// @@protoc_insertion_point(class_specific_merge_from_start:tensorflow.AttrValue.ListValue)
880 GOOGLE_DCHECK_NE(&from, this);
881 _internal_metadata_.MergeFrom(from._internal_metadata_);
882 ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
883 (void) cached_has_bits;
884
885 s_.MergeFrom(from.s_);
886 i_.MergeFrom(from.i_);
887 f_.MergeFrom(from.f_);
888 b_.MergeFrom(from.b_);
889 type_.MergeFrom(from.type_);
890 shape_.MergeFrom(from.shape_);
891 tensor_.MergeFrom(from.tensor_);
892 func_.MergeFrom(from.func_);
893}
894
895void AttrValue_ListValue::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
896// @@protoc_insertion_point(generalized_copy_from_start:tensorflow.AttrValue.ListValue)
897 if (&from == this) return;
898 Clear();
899 MergeFrom(from);
900}
901
902void AttrValue_ListValue::CopyFrom(const AttrValue_ListValue& from) {
903// @@protoc_insertion_point(class_specific_copy_from_start:tensorflow.AttrValue.ListValue)
904 if (&from == this) return;
905 Clear();
906 MergeFrom(from);
907}
908
909bool AttrValue_ListValue::IsInitialized() const {
910 return true;
911}
912
913void AttrValue_ListValue::InternalSwap(AttrValue_ListValue* other) {
914 using std::swap;
915 _internal_metadata_.Swap(&other->_internal_metadata_);
916 s_.InternalSwap(CastToBase(&other->s_));
917 i_.InternalSwap(&other->i_);
918 f_.InternalSwap(&other->f_);
919 b_.InternalSwap(&other->b_);
920 type_.InternalSwap(&other->type_);
921 CastToBase(&shape_)->InternalSwap(CastToBase(&other->shape_));
922 CastToBase(&tensor_)->InternalSwap(CastToBase(&other->tensor_));
923 CastToBase(&func_)->InternalSwap(CastToBase(&other->func_));
924}
925
926::PROTOBUF_NAMESPACE_ID::Metadata AttrValue_ListValue::GetMetadata() const {
927 return GetMetadataStatic();
928}
929
930
931// ===================================================================
932
933void AttrValue::InitAsDefaultInstance() {
934 ::tensorflow::_AttrValue_default_instance_.s_.UnsafeSetDefault(
935 &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
936 ::tensorflow::_AttrValue_default_instance_.i_ = PROTOBUF_LONGLONG(0);
937 ::tensorflow::_AttrValue_default_instance_.f_ = 0;
938 ::tensorflow::_AttrValue_default_instance_.b_ = false;
939 ::tensorflow::_AttrValue_default_instance_.type_ = 0;
940 ::tensorflow::_AttrValue_default_instance_.shape_ = const_cast< ::tensorflow::TensorShapeProto*>(
941 ::tensorflow::TensorShapeProto::internal_default_instance());
942 ::tensorflow::_AttrValue_default_instance_.tensor_ = const_cast< ::tensorflow::TensorProto*>(
943 ::tensorflow::TensorProto::internal_default_instance());
944 ::tensorflow::_AttrValue_default_instance_.list_ = const_cast< ::tensorflow::AttrValue_ListValue*>(
945 ::tensorflow::AttrValue_ListValue::internal_default_instance());
946 ::tensorflow::_AttrValue_default_instance_.func_ = const_cast< ::tensorflow::NameAttrList*>(
947 ::tensorflow::NameAttrList::internal_default_instance());
948 ::tensorflow::_AttrValue_default_instance_.placeholder_.UnsafeSetDefault(
949 &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
950}
951class AttrValue::_Internal {
952 public:
953 static const ::tensorflow::TensorShapeProto& shape(const AttrValue* msg);
954 static const ::tensorflow::TensorProto& tensor(const AttrValue* msg);
955 static const ::tensorflow::AttrValue_ListValue& list(const AttrValue* msg);
956 static const ::tensorflow::NameAttrList& func(const AttrValue* msg);
957};
958
959const ::tensorflow::TensorShapeProto&
960AttrValue::_Internal::shape(const AttrValue* msg) {
961 return *msg->value_.shape_;
962}
963const ::tensorflow::TensorProto&
964AttrValue::_Internal::tensor(const AttrValue* msg) {
965 return *msg->value_.tensor_;
966}
967const ::tensorflow::AttrValue_ListValue&
968AttrValue::_Internal::list(const AttrValue* msg) {
969 return *msg->value_.list_;
970}
971const ::tensorflow::NameAttrList&
972AttrValue::_Internal::func(const AttrValue* msg) {
973 return *msg->value_.func_;
974}
975void AttrValue::set_allocated_shape(::tensorflow::TensorShapeProto* shape) {
976 ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaNoVirtual();
977 clear_value();
978 if (shape) {
979 ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
980 reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(shape)->GetArena();
981 if (message_arena != submessage_arena) {
982 shape = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
983 message_arena, shape, submessage_arena);
984 }
985 set_has_shape();
986 value_.shape_ = shape;
987 }
988 // @@protoc_insertion_point(field_set_allocated:tensorflow.AttrValue.shape)
989}
990void AttrValue::clear_shape() {
991 if (has_shape()) {
992 if (GetArenaNoVirtual() == nullptr) {
993 delete value_.shape_;
994 }
995 clear_has_value();
996 }
997}
998void AttrValue::set_allocated_tensor(::tensorflow::TensorProto* tensor) {
999 ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaNoVirtual();
1000 clear_value();
1001 if (tensor) {
1002 ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
1003 reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(tensor)->GetArena();
1004 if (message_arena != submessage_arena) {
1005 tensor = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
1006 message_arena, tensor, submessage_arena);
1007 }
1008 set_has_tensor();
1009 value_.tensor_ = tensor;
1010 }
1011 // @@protoc_insertion_point(field_set_allocated:tensorflow.AttrValue.tensor)
1012}
1013void AttrValue::clear_tensor() {
1014 if (has_tensor()) {
1015 if (GetArenaNoVirtual() == nullptr) {
1016 delete value_.tensor_;
1017 }
1018 clear_has_value();
1019 }
1020}
1021void AttrValue::set_allocated_list(::tensorflow::AttrValue_ListValue* list) {
1022 ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaNoVirtual();
1023 clear_value();
1024 if (list) {
1025 ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
1026 ::PROTOBUF_NAMESPACE_ID::Arena::GetArena(list);
1027 if (message_arena != submessage_arena) {
1028 list = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
1029 message_arena, list, submessage_arena);
1030 }
1031 set_has_list();
1032 value_.list_ = list;
1033 }
1034 // @@protoc_insertion_point(field_set_allocated:tensorflow.AttrValue.list)
1035}
1036void AttrValue::set_allocated_func(::tensorflow::NameAttrList* func) {
1037 ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaNoVirtual();
1038 clear_value();
1039 if (func) {
1040 ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
1041 ::PROTOBUF_NAMESPACE_ID::Arena::GetArena(func);
1042 if (message_arena != submessage_arena) {
1043 func = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
1044 message_arena, func, submessage_arena);
1045 }
1046 set_has_func();
1047 value_.func_ = func;
1048 }
1049 // @@protoc_insertion_point(field_set_allocated:tensorflow.AttrValue.func)
1050}
1051AttrValue::AttrValue()
1052 : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
1053 SharedCtor();
1054 // @@protoc_insertion_point(constructor:tensorflow.AttrValue)
1055}
1056AttrValue::AttrValue(::PROTOBUF_NAMESPACE_ID::Arena* arena)
1057 : ::PROTOBUF_NAMESPACE_ID::Message(),
1058 _internal_metadata_(arena) {
1059 SharedCtor();
1060 RegisterArenaDtor(arena);
1061 // @@protoc_insertion_point(arena_constructor:tensorflow.AttrValue)
1062}
1063AttrValue::AttrValue(const AttrValue& from)
1064 : ::PROTOBUF_NAMESPACE_ID::Message(),
1065 _internal_metadata_(nullptr) {
1066 _internal_metadata_.MergeFrom(from._internal_metadata_);
1067 clear_has_value();
1068 switch (from.value_case()) {
1069 case kS: {
1070 set_s(from.s());
1071 break;
1072 }
1073 case kI: {
1074 set_i(from.i());
1075 break;
1076 }
1077 case kF: {
1078 set_f(from.f());
1079 break;
1080 }
1081 case kB: {
1082 set_b(from.b());
1083 break;
1084 }
1085 case kType: {
1086 set_type(from.type());
1087 break;
1088 }
1089 case kShape: {
1090 mutable_shape()->::tensorflow::TensorShapeProto::MergeFrom(from.shape());
1091 break;
1092 }
1093 case kTensor: {
1094 mutable_tensor()->::tensorflow::TensorProto::MergeFrom(from.tensor());
1095 break;
1096 }
1097 case kList: {
1098 mutable_list()->::tensorflow::AttrValue_ListValue::MergeFrom(from.list());
1099 break;
1100 }
1101 case kFunc: {
1102 mutable_func()->::tensorflow::NameAttrList::MergeFrom(from.func());
1103 break;
1104 }
1105 case kPlaceholder: {
1106 set_placeholder(from.placeholder());
1107 break;
1108 }
1109 case VALUE_NOT_SET: {
1110 break;
1111 }
1112 }
1113 // @@protoc_insertion_point(copy_constructor:tensorflow.AttrValue)
1114}
1115
1116void AttrValue::SharedCtor() {
1117 ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_AttrValue_tensorflow_2fcore_2fframework_2fattr_5fvalue_2eproto.base);
1118 clear_has_value();
1119}
1120
1121AttrValue::~AttrValue() {
1122 // @@protoc_insertion_point(destructor:tensorflow.AttrValue)
1123 SharedDtor();
1124}
1125
1126void AttrValue::SharedDtor() {
1127 GOOGLE_DCHECK(GetArenaNoVirtual() == nullptr);
1128 if (has_value()) {
1129 clear_value();
1130 }
1131}
1132
1133void AttrValue::ArenaDtor(void* object) {
1134 AttrValue* _this = reinterpret_cast< AttrValue* >(object);
1135 (void)_this;
1136}
1137void AttrValue::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
1138}
1139void AttrValue::SetCachedSize(int size) const {
1140 _cached_size_.Set(size);
1141}
1142const AttrValue& AttrValue::default_instance() {
1143 ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_AttrValue_tensorflow_2fcore_2fframework_2fattr_5fvalue_2eproto.base);
1144 return *internal_default_instance();
1145}
1146
1147
1148void AttrValue::clear_value() {
1149// @@protoc_insertion_point(one_of_clear_start:tensorflow.AttrValue)
1150 switch (value_case()) {
1151 case kS: {
1152 value_.s_.Destroy(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
1153 GetArenaNoVirtual());
1154 break;
1155 }
1156 case kI: {
1157 // No need to clear
1158 break;
1159 }
1160 case kF: {
1161 // No need to clear
1162 break;
1163 }
1164 case kB: {
1165 // No need to clear
1166 break;
1167 }
1168 case kType: {
1169 // No need to clear
1170 break;
1171 }
1172 case kShape: {
1173 if (GetArenaNoVirtual() == nullptr) {
1174 delete value_.shape_;
1175 }
1176 break;
1177 }
1178 case kTensor: {
1179 if (GetArenaNoVirtual() == nullptr) {
1180 delete value_.tensor_;
1181 }
1182 break;
1183 }
1184 case kList: {
1185 if (GetArenaNoVirtual() == nullptr) {
1186 delete value_.list_;
1187 }
1188 break;
1189 }
1190 case kFunc: {
1191 if (GetArenaNoVirtual() == nullptr) {
1192 delete value_.func_;
1193 }
1194 break;
1195 }
1196 case kPlaceholder: {
1197 value_.placeholder_.Destroy(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
1198 GetArenaNoVirtual());
1199 break;
1200 }
1201 case VALUE_NOT_SET: {
1202 break;
1203 }
1204 }
1205 _oneof_case_[0] = VALUE_NOT_SET;
1206}
1207
1208
1209void AttrValue::Clear() {
1210// @@protoc_insertion_point(message_clear_start:tensorflow.AttrValue)
1211 ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
1212 // Prevent compiler warnings about cached_has_bits being unused
1213 (void) cached_has_bits;
1214
1215 clear_value();
1216 _internal_metadata_.Clear();
1217}
1218
1219#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
1220const char* AttrValue::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
1221#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
1222 ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArenaNoVirtual(); (void)arena;
1223 while (!ctx->Done(&ptr)) {
1224 ::PROTOBUF_NAMESPACE_ID::uint32 tag;
1225 ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
1226 CHK_(ptr);
1227 switch (tag >> 3) {
1228 // .tensorflow.AttrValue.ListValue list = 1;
1229 case 1:
1230 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) {
1231 ptr = ctx->ParseMessage(mutable_list(), ptr);
1232 CHK_(ptr);
1233 } else goto handle_unusual;
1234 continue;
1235 // bytes s = 2;
1236 case 2:
1237 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) {
1238 ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(mutable_s(), ptr, ctx);
1239 CHK_(ptr);
1240 } else goto handle_unusual;
1241 continue;
1242 // int64 i = 3;
1243 case 3:
1244 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24)) {
1245 set_i(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr));
1246 CHK_(ptr);
1247 } else goto handle_unusual;
1248 continue;
1249 // float f = 4;
1250 case 4:
1251 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 37)) {
1252 set_f(::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr));
1253 ptr += sizeof(float);
1254 } else goto handle_unusual;
1255 continue;
1256 // bool b = 5;
1257 case 5:
1258 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 40)) {
1259 set_b(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr));
1260 CHK_(ptr);
1261 } else goto handle_unusual;
1262 continue;
1263 // .tensorflow.DataType type = 6;
1264 case 6:
1265 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 48)) {
1266 ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
1267 CHK_(ptr);
1268 set_type(static_cast<::tensorflow::DataType>(val));
1269 } else goto handle_unusual;
1270 continue;
1271 // .tensorflow.TensorShapeProto shape = 7;
1272 case 7:
1273 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 58)) {
1274 ptr = ctx->ParseMessage(mutable_shape(), ptr);
1275 CHK_(ptr);
1276 } else goto handle_unusual;
1277 continue;
1278 // .tensorflow.TensorProto tensor = 8;
1279 case 8:
1280 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 66)) {
1281 ptr = ctx->ParseMessage(mutable_tensor(), ptr);
1282 CHK_(ptr);
1283 } else goto handle_unusual;
1284 continue;
1285 // string placeholder = 9;
1286 case 9:
1287 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 74)) {
1288 ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParserUTF8(mutable_placeholder(), ptr, ctx, "tensorflow.AttrValue.placeholder");
1289 CHK_(ptr);
1290 } else goto handle_unusual;
1291 continue;
1292 // .tensorflow.NameAttrList func = 10;
1293 case 10:
1294 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 82)) {
1295 ptr = ctx->ParseMessage(mutable_func(), ptr);
1296 CHK_(ptr);
1297 } else goto handle_unusual;
1298 continue;
1299 default: {
1300 handle_unusual:
1301 if ((tag & 7) == 4 || tag == 0) {
1302 ctx->SetLastTag(tag);
1303 goto success;
1304 }
1305 ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
1306 CHK_(ptr != nullptr);
1307 continue;
1308 }
1309 } // switch
1310 } // while
1311success:
1312 return ptr;
1313failure:
1314 ptr = nullptr;
1315 goto success;
1316#undef CHK_
1317}
1318#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
1319bool AttrValue::MergePartialFromCodedStream(
1320 ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) {
1321#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure
1322 ::PROTOBUF_NAMESPACE_ID::uint32 tag;
1323 // @@protoc_insertion_point(parse_start:tensorflow.AttrValue)
1324 for (;;) {
1325 ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
1326 tag = p.first;
1327 if (!p.second) goto handle_unusual;
1328 switch (::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::GetTagFieldNumber(tag)) {
1329 // .tensorflow.AttrValue.ListValue list = 1;
1330 case 1: {
1331 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (10 & 0xFF)) {
1332 DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage(
1333 input, mutable_list()));
1334 } else {
1335 goto handle_unusual;
1336 }
1337 break;
1338 }
1339
1340 // bytes s = 2;
1341 case 2: {
1342 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (18 & 0xFF)) {
1343 DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadBytes(
1344 input, this->mutable_s()));
1345 } else {
1346 goto handle_unusual;
1347 }
1348 break;
1349 }
1350
1351 // int64 i = 3;
1352 case 3: {
1353 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (24 & 0xFF)) {
1354 clear_value();
1355 DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
1356 ::PROTOBUF_NAMESPACE_ID::int64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT64>(
1357 input, &value_.i_)));
1358 set_has_i();
1359 } else {
1360 goto handle_unusual;
1361 }
1362 break;
1363 }
1364
1365 // float f = 4;
1366 case 4: {
1367 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (37 & 0xFF)) {
1368 clear_value();
1369 DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
1370 float, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_FLOAT>(
1371 input, &value_.f_)));
1372 set_has_f();
1373 } else {
1374 goto handle_unusual;
1375 }
1376 break;
1377 }
1378
1379 // bool b = 5;
1380 case 5: {
1381 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (40 & 0xFF)) {
1382 clear_value();
1383 DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
1384 bool, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_BOOL>(
1385 input, &value_.b_)));
1386 set_has_b();
1387 } else {
1388 goto handle_unusual;
1389 }
1390 break;
1391 }
1392
1393 // .tensorflow.DataType type = 6;
1394 case 6: {
1395 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (48 & 0xFF)) {
1396 int value = 0;
1397 DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
1398 int, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_ENUM>(
1399 input, &value)));
1400 set_type(static_cast< ::tensorflow::DataType >(value));
1401 } else {
1402 goto handle_unusual;
1403 }
1404 break;
1405 }
1406
1407 // .tensorflow.TensorShapeProto shape = 7;
1408 case 7: {
1409 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (58 & 0xFF)) {
1410 DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage(
1411 input, mutable_shape()));
1412 } else {
1413 goto handle_unusual;
1414 }
1415 break;
1416 }
1417
1418 // .tensorflow.TensorProto tensor = 8;
1419 case 8: {
1420 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (66 & 0xFF)) {
1421 DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage(
1422 input, mutable_tensor()));
1423 } else {
1424 goto handle_unusual;
1425 }
1426 break;
1427 }
1428
1429 // string placeholder = 9;
1430 case 9: {
1431 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (74 & 0xFF)) {
1432 DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadString(
1433 input, this->mutable_placeholder()));
1434 DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
1435 this->placeholder().data(), static_cast<int>(this->placeholder().length()),
1436 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::PARSE,
1437 "tensorflow.AttrValue.placeholder"));
1438 } else {
1439 goto handle_unusual;
1440 }
1441 break;
1442 }
1443
1444 // .tensorflow.NameAttrList func = 10;
1445 case 10: {
1446 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (82 & 0xFF)) {
1447 DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage(
1448 input, mutable_func()));
1449 } else {
1450 goto handle_unusual;
1451 }
1452 break;
1453 }
1454
1455 default: {
1456 handle_unusual:
1457 if (tag == 0) {
1458 goto success;
1459 }
1460 DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SkipField(
1461 input, tag, _internal_metadata_.mutable_unknown_fields()));
1462 break;
1463 }
1464 }
1465 }
1466success:
1467 // @@protoc_insertion_point(parse_success:tensorflow.AttrValue)
1468 return true;
1469failure:
1470 // @@protoc_insertion_point(parse_failure:tensorflow.AttrValue)
1471 return false;
1472#undef DO_
1473}
1474#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
1475
1476void AttrValue::SerializeWithCachedSizes(
1477 ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const {
1478 // @@protoc_insertion_point(serialize_start:tensorflow.AttrValue)
1479 ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
1480 (void) cached_has_bits;
1481
1482 // .tensorflow.AttrValue.ListValue list = 1;
1483 if (has_list()) {
1484 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray(
1485 1, _Internal::list(this), output);
1486 }
1487
1488 // bytes s = 2;
1489 if (has_s()) {
1490 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBytesMaybeAliased(
1491 2, this->s(), output);
1492 }
1493
1494 // int64 i = 3;
1495 if (has_i()) {
1496 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64(3, this->i(), output);
1497 }
1498
1499 // float f = 4;
1500 if (has_f()) {
1501 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloat(4, this->f(), output);
1502 }
1503
1504 // bool b = 5;
1505 if (has_b()) {
1506 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBool(5, this->b(), output);
1507 }
1508
1509 // .tensorflow.DataType type = 6;
1510 if (has_type()) {
1511 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnum(
1512 6, this->type(), output);
1513 }
1514
1515 // .tensorflow.TensorShapeProto shape = 7;
1516 if (has_shape()) {
1517 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray(
1518 7, _Internal::shape(this), output);
1519 }
1520
1521 // .tensorflow.TensorProto tensor = 8;
1522 if (has_tensor()) {
1523 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray(
1524 8, _Internal::tensor(this), output);
1525 }
1526
1527 // string placeholder = 9;
1528 if (has_placeholder()) {
1529 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
1530 this->placeholder().data(), static_cast<int>(this->placeholder().length()),
1531 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
1532 "tensorflow.AttrValue.placeholder");
1533 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringMaybeAliased(
1534 9, this->placeholder(), output);
1535 }
1536
1537 // .tensorflow.NameAttrList func = 10;
1538 if (has_func()) {
1539 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray(
1540 10, _Internal::func(this), output);
1541 }
1542
1543 if (_internal_metadata_.have_unknown_fields()) {
1544 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields(
1545 _internal_metadata_.unknown_fields(), output);
1546 }
1547 // @@protoc_insertion_point(serialize_end:tensorflow.AttrValue)
1548}
1549
1550::PROTOBUF_NAMESPACE_ID::uint8* AttrValue::InternalSerializeWithCachedSizesToArray(
1551 ::PROTOBUF_NAMESPACE_ID::uint8* target) const {
1552 // @@protoc_insertion_point(serialize_to_array_start:tensorflow.AttrValue)
1553 ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
1554 (void) cached_has_bits;
1555
1556 // .tensorflow.AttrValue.ListValue list = 1;
1557 if (has_list()) {
1558 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
1559 InternalWriteMessageToArray(
1560 1, _Internal::list(this), target);
1561 }
1562
1563 // bytes s = 2;
1564 if (has_s()) {
1565 target =
1566 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBytesToArray(
1567 2, this->s(), target);
1568 }
1569
1570 // int64 i = 3;
1571 if (has_i()) {
1572 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(3, this->i(), target);
1573 }
1574
1575 // float f = 4;
1576 if (has_f()) {
1577 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(4, this->f(), target);
1578 }
1579
1580 // bool b = 5;
1581 if (has_b()) {
1582 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(5, this->b(), target);
1583 }
1584
1585 // .tensorflow.DataType type = 6;
1586 if (has_type()) {
1587 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
1588 6, this->type(), target);
1589 }
1590
1591 // .tensorflow.TensorShapeProto shape = 7;
1592 if (has_shape()) {
1593 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
1594 InternalWriteMessageToArray(
1595 7, _Internal::shape(this), target);
1596 }
1597
1598 // .tensorflow.TensorProto tensor = 8;
1599 if (has_tensor()) {
1600 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
1601 InternalWriteMessageToArray(
1602 8, _Internal::tensor(this), target);
1603 }
1604
1605 // string placeholder = 9;
1606 if (has_placeholder()) {
1607 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
1608 this->placeholder().data(), static_cast<int>(this->placeholder().length()),
1609 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
1610 "tensorflow.AttrValue.placeholder");
1611 target =
1612 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringToArray(
1613 9, this->placeholder(), target);
1614 }
1615
1616 // .tensorflow.NameAttrList func = 10;
1617 if (has_func()) {
1618 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
1619 InternalWriteMessageToArray(
1620 10, _Internal::func(this), target);
1621 }
1622
1623 if (_internal_metadata_.have_unknown_fields()) {
1624 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray(
1625 _internal_metadata_.unknown_fields(), target);
1626 }
1627 // @@protoc_insertion_point(serialize_to_array_end:tensorflow.AttrValue)
1628 return target;
1629}
1630
1631size_t AttrValue::ByteSizeLong() const {
1632// @@protoc_insertion_point(message_byte_size_start:tensorflow.AttrValue)
1633 size_t total_size = 0;
1634
1635 if (_internal_metadata_.have_unknown_fields()) {
1636 total_size +=
1637 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::ComputeUnknownFieldsSize(
1638 _internal_metadata_.unknown_fields());
1639 }
1640 ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
1641 // Prevent compiler warnings about cached_has_bits being unused
1642 (void) cached_has_bits;
1643
1644 switch (value_case()) {
1645 // bytes s = 2;
1646 case kS: {
1647 total_size += 1 +
1648 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize(
1649 this->s());
1650 break;
1651 }
1652 // int64 i = 3;
1653 case kI: {
1654 total_size += 1 +
1655 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64Size(
1656 this->i());
1657 break;
1658 }
1659 // float f = 4;
1660 case kF: {
1661 total_size += 1 + 4;
1662 break;
1663 }
1664 // bool b = 5;
1665 case kB: {
1666 total_size += 1 + 1;
1667 break;
1668 }
1669 // .tensorflow.DataType type = 6;
1670 case kType: {
1671 total_size += 1 +
1672 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->type());
1673 break;
1674 }
1675 // .tensorflow.TensorShapeProto shape = 7;
1676 case kShape: {
1677 total_size += 1 +
1678 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
1679 *value_.shape_);
1680 break;
1681 }
1682 // .tensorflow.TensorProto tensor = 8;
1683 case kTensor: {
1684 total_size += 1 +
1685 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
1686 *value_.tensor_);
1687 break;
1688 }
1689 // .tensorflow.AttrValue.ListValue list = 1;
1690 case kList: {
1691 total_size += 1 +
1692 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
1693 *value_.list_);
1694 break;
1695 }
1696 // .tensorflow.NameAttrList func = 10;
1697 case kFunc: {
1698 total_size += 1 +
1699 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
1700 *value_.func_);
1701 break;
1702 }
1703 // string placeholder = 9;
1704 case kPlaceholder: {
1705 total_size += 1 +
1706 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
1707 this->placeholder());
1708 break;
1709 }
1710 case VALUE_NOT_SET: {
1711 break;
1712 }
1713 }
1714 int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
1715 SetCachedSize(cached_size);
1716 return total_size;
1717}
1718
1719void AttrValue::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
1720// @@protoc_insertion_point(generalized_merge_from_start:tensorflow.AttrValue)
1721 GOOGLE_DCHECK_NE(&from, this);
1722 const AttrValue* source =
1723 ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<AttrValue>(
1724 &from);
1725 if (source == nullptr) {
1726 // @@protoc_insertion_point(generalized_merge_from_cast_fail:tensorflow.AttrValue)
1727 ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
1728 } else {
1729 // @@protoc_insertion_point(generalized_merge_from_cast_success:tensorflow.AttrValue)
1730 MergeFrom(*source);
1731 }
1732}
1733
1734void AttrValue::MergeFrom(const AttrValue& from) {
1735// @@protoc_insertion_point(class_specific_merge_from_start:tensorflow.AttrValue)
1736 GOOGLE_DCHECK_NE(&from, this);
1737 _internal_metadata_.MergeFrom(from._internal_metadata_);
1738 ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
1739 (void) cached_has_bits;
1740
1741 switch (from.value_case()) {
1742 case kS: {
1743 set_s(from.s());
1744 break;
1745 }
1746 case kI: {
1747 set_i(from.i());
1748 break;
1749 }
1750 case kF: {
1751 set_f(from.f());
1752 break;
1753 }
1754 case kB: {
1755 set_b(from.b());
1756 break;
1757 }
1758 case kType: {
1759 set_type(from.type());
1760 break;
1761 }
1762 case kShape: {
1763 mutable_shape()->::tensorflow::TensorShapeProto::MergeFrom(from.shape());
1764 break;
1765 }
1766 case kTensor: {
1767 mutable_tensor()->::tensorflow::TensorProto::MergeFrom(from.tensor());
1768 break;
1769 }
1770 case kList: {
1771 mutable_list()->::tensorflow::AttrValue_ListValue::MergeFrom(from.list());
1772 break;
1773 }
1774 case kFunc: {
1775 mutable_func()->::tensorflow::NameAttrList::MergeFrom(from.func());
1776 break;
1777 }
1778 case kPlaceholder: {
1779 set_placeholder(from.placeholder());
1780 break;
1781 }
1782 case VALUE_NOT_SET: {
1783 break;
1784 }
1785 }
1786}
1787
1788void AttrValue::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
1789// @@protoc_insertion_point(generalized_copy_from_start:tensorflow.AttrValue)
1790 if (&from == this) return;
1791 Clear();
1792 MergeFrom(from);
1793}
1794
1795void AttrValue::CopyFrom(const AttrValue& from) {
1796// @@protoc_insertion_point(class_specific_copy_from_start:tensorflow.AttrValue)
1797 if (&from == this) return;
1798 Clear();
1799 MergeFrom(from);
1800}
1801
1802bool AttrValue::IsInitialized() const {
1803 return true;
1804}
1805
1806void AttrValue::InternalSwap(AttrValue* other) {
1807 using std::swap;
1808 _internal_metadata_.Swap(&other->_internal_metadata_);
1809 swap(value_, other->value_);
1810 swap(_oneof_case_[0], other->_oneof_case_[0]);
1811}
1812
1813::PROTOBUF_NAMESPACE_ID::Metadata AttrValue::GetMetadata() const {
1814 return GetMetadataStatic();
1815}
1816
1817
1818// ===================================================================
1819
1820NameAttrList_AttrEntry_DoNotUse::NameAttrList_AttrEntry_DoNotUse() {}
1821NameAttrList_AttrEntry_DoNotUse::NameAttrList_AttrEntry_DoNotUse(::PROTOBUF_NAMESPACE_ID::Arena* arena)
1822 : SuperType(arena) {}
1823void NameAttrList_AttrEntry_DoNotUse::MergeFrom(const NameAttrList_AttrEntry_DoNotUse& other) {
1824 MergeFromInternal(other);
1825}
1826::PROTOBUF_NAMESPACE_ID::Metadata NameAttrList_AttrEntry_DoNotUse::GetMetadata() const {
1827 return GetMetadataStatic();
1828}
1829void NameAttrList_AttrEntry_DoNotUse::MergeFrom(
1830 const ::PROTOBUF_NAMESPACE_ID::Message& other) {
1831 ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom(other);
1832}
1833
1834
1835// ===================================================================
1836
1837void NameAttrList::InitAsDefaultInstance() {
1838}
1839class NameAttrList::_Internal {
1840 public:
1841};
1842
1843NameAttrList::NameAttrList()
1844 : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
1845 SharedCtor();
1846 // @@protoc_insertion_point(constructor:tensorflow.NameAttrList)
1847}
1848NameAttrList::NameAttrList(::PROTOBUF_NAMESPACE_ID::Arena* arena)
1849 : ::PROTOBUF_NAMESPACE_ID::Message(),
1850 _internal_metadata_(arena),
1851 attr_(arena) {
1852 SharedCtor();
1853 RegisterArenaDtor(arena);
1854 // @@protoc_insertion_point(arena_constructor:tensorflow.NameAttrList)
1855}
1856NameAttrList::NameAttrList(const NameAttrList& from)
1857 : ::PROTOBUF_NAMESPACE_ID::Message(),
1858 _internal_metadata_(nullptr) {
1859 _internal_metadata_.MergeFrom(from._internal_metadata_);
1860 attr_.MergeFrom(from.attr_);
1861 name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
1862 if (!from.name().empty()) {
1863 name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.name(),
1864 GetArenaNoVirtual());
1865 }
1866 // @@protoc_insertion_point(copy_constructor:tensorflow.NameAttrList)
1867}
1868
1869void NameAttrList::SharedCtor() {
1870 ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_AttrValue_tensorflow_2fcore_2fframework_2fattr_5fvalue_2eproto.base);
1871 name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
1872}
1873
1874NameAttrList::~NameAttrList() {
1875 // @@protoc_insertion_point(destructor:tensorflow.NameAttrList)
1876 SharedDtor();
1877}
1878
1879void NameAttrList::SharedDtor() {
1880 GOOGLE_DCHECK(GetArenaNoVirtual() == nullptr);
1881 name_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
1882}
1883
1884void NameAttrList::ArenaDtor(void* object) {
1885 NameAttrList* _this = reinterpret_cast< NameAttrList* >(object);
1886 (void)_this;
1887}
1888void NameAttrList::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
1889}
1890void NameAttrList::SetCachedSize(int size) const {
1891 _cached_size_.Set(size);
1892}
1893const NameAttrList& NameAttrList::default_instance() {
1894 ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_AttrValue_tensorflow_2fcore_2fframework_2fattr_5fvalue_2eproto.base);
1895 return *internal_default_instance();
1896}
1897
1898
1899void NameAttrList::Clear() {
1900// @@protoc_insertion_point(message_clear_start:tensorflow.NameAttrList)
1901 ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
1902 // Prevent compiler warnings about cached_has_bits being unused
1903 (void) cached_has_bits;
1904
1905 attr_.Clear();
1906 name_.ClearToEmpty(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
1907 _internal_metadata_.Clear();
1908}
1909
1910#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
1911const char* NameAttrList::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
1912#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
1913 ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArenaNoVirtual(); (void)arena;
1914 while (!ctx->Done(&ptr)) {
1915 ::PROTOBUF_NAMESPACE_ID::uint32 tag;
1916 ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
1917 CHK_(ptr);
1918 switch (tag >> 3) {
1919 // string name = 1;
1920 case 1:
1921 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) {
1922 ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParserUTF8(mutable_name(), ptr, ctx, "tensorflow.NameAttrList.name");
1923 CHK_(ptr);
1924 } else goto handle_unusual;
1925 continue;
1926 // map<string, .tensorflow.AttrValue> attr = 2;
1927 case 2:
1928 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) {
1929 ptr -= 1;
1930 do {
1931 ptr += 1;
1932 ptr = ctx->ParseMessage(&attr_, ptr);
1933 CHK_(ptr);
1934 if (!ctx->DataAvailable(ptr)) break;
1935 } while (::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<::PROTOBUF_NAMESPACE_ID::uint8>(ptr) == 18);
1936 } else goto handle_unusual;
1937 continue;
1938 default: {
1939 handle_unusual:
1940 if ((tag & 7) == 4 || tag == 0) {
1941 ctx->SetLastTag(tag);
1942 goto success;
1943 }
1944 ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
1945 CHK_(ptr != nullptr);
1946 continue;
1947 }
1948 } // switch
1949 } // while
1950success:
1951 return ptr;
1952failure:
1953 ptr = nullptr;
1954 goto success;
1955#undef CHK_
1956}
1957#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
1958bool NameAttrList::MergePartialFromCodedStream(
1959 ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) {
1960#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure
1961 ::PROTOBUF_NAMESPACE_ID::uint32 tag;
1962 // @@protoc_insertion_point(parse_start:tensorflow.NameAttrList)
1963 for (;;) {
1964 ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
1965 tag = p.first;
1966 if (!p.second) goto handle_unusual;
1967 switch (::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::GetTagFieldNumber(tag)) {
1968 // string name = 1;
1969 case 1: {
1970 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (10 & 0xFF)) {
1971 DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadString(
1972 input, this->mutable_name()));
1973 DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
1974 this->name().data(), static_cast<int>(this->name().length()),
1975 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::PARSE,
1976 "tensorflow.NameAttrList.name"));
1977 } else {
1978 goto handle_unusual;
1979 }
1980 break;
1981 }
1982
1983 // map<string, .tensorflow.AttrValue> attr = 2;
1984 case 2: {
1985 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (18 & 0xFF)) {
1986 NameAttrList_AttrEntry_DoNotUse::Parser< ::PROTOBUF_NAMESPACE_ID::internal::MapField<
1987 NameAttrList_AttrEntry_DoNotUse,
1988 std::string, ::tensorflow::AttrValue,
1989 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_STRING,
1990 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_MESSAGE,
1991 0 >,
1992 ::PROTOBUF_NAMESPACE_ID::Map< std::string, ::tensorflow::AttrValue > > parser(&attr_);
1993 DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessageNoVirtual(
1994 input, &parser));
1995 DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
1996 parser.key().data(), static_cast<int>(parser.key().length()),
1997 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::PARSE,
1998 "tensorflow.NameAttrList.AttrEntry.key"));
1999 } else {
2000 goto handle_unusual;
2001 }
2002 break;
2003 }
2004
2005 default: {
2006 handle_unusual:
2007 if (tag == 0) {
2008 goto success;
2009 }
2010 DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SkipField(
2011 input, tag, _internal_metadata_.mutable_unknown_fields()));
2012 break;
2013 }
2014 }
2015 }
2016success:
2017 // @@protoc_insertion_point(parse_success:tensorflow.NameAttrList)
2018 return true;
2019failure:
2020 // @@protoc_insertion_point(parse_failure:tensorflow.NameAttrList)
2021 return false;
2022#undef DO_
2023}
2024#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
2025
2026void NameAttrList::SerializeWithCachedSizes(
2027 ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const {
2028 // @@protoc_insertion_point(serialize_start:tensorflow.NameAttrList)
2029 ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
2030 (void) cached_has_bits;
2031
2032 // string name = 1;
2033 if (this->name().size() > 0) {
2034 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
2035 this->name().data(), static_cast<int>(this->name().length()),
2036 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
2037 "tensorflow.NameAttrList.name");
2038 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringMaybeAliased(
2039 1, this->name(), output);
2040 }
2041
2042 // map<string, .tensorflow.AttrValue> attr = 2;
2043 if (!this->attr().empty()) {
2044 typedef ::PROTOBUF_NAMESPACE_ID::Map< std::string, ::tensorflow::AttrValue >::const_pointer
2045 ConstPtr;
2046 typedef ConstPtr SortItem;
2047 typedef ::PROTOBUF_NAMESPACE_ID::internal::CompareByDerefFirst<SortItem> Less;
2048 struct Utf8Check {
2049 static void Check(ConstPtr p) {
2050 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
2051 p->first.data(), static_cast<int>(p->first.length()),
2052 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
2053 "tensorflow.NameAttrList.AttrEntry.key");
2054 }
2055 };
2056
2057 if (output->IsSerializationDeterministic() &&
2058 this->attr().size() > 1) {
2059 ::std::unique_ptr<SortItem[]> items(
2060 new SortItem[this->attr().size()]);
2061 typedef ::PROTOBUF_NAMESPACE_ID::Map< std::string, ::tensorflow::AttrValue >::size_type size_type;
2062 size_type n = 0;
2063 for (::PROTOBUF_NAMESPACE_ID::Map< std::string, ::tensorflow::AttrValue >::const_iterator
2064 it = this->attr().begin();
2065 it != this->attr().end(); ++it, ++n) {
2066 items[static_cast<ptrdiff_t>(n)] = SortItem(&*it);
2067 }
2068 ::std::sort(&items[0], &items[static_cast<ptrdiff_t>(n)], Less());
2069 for (size_type i = 0; i < n; i++) {
2070 NameAttrList_AttrEntry_DoNotUse::Funcs::SerializeToCodedStream(2, items[static_cast<ptrdiff_t>(i)]->first, items[static_cast<ptrdiff_t>(i)]->second, output);
2071 Utf8Check::Check(&(*items[static_cast<ptrdiff_t>(i)]));
2072 }
2073 } else {
2074 for (::PROTOBUF_NAMESPACE_ID::Map< std::string, ::tensorflow::AttrValue >::const_iterator
2075 it = this->attr().begin();
2076 it != this->attr().end(); ++it) {
2077 NameAttrList_AttrEntry_DoNotUse::Funcs::SerializeToCodedStream(2, it->first, it->second, output);
2078 Utf8Check::Check(&(*it));
2079 }
2080 }
2081 }
2082
2083 if (_internal_metadata_.have_unknown_fields()) {
2084 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields(
2085 _internal_metadata_.unknown_fields(), output);
2086 }
2087 // @@protoc_insertion_point(serialize_end:tensorflow.NameAttrList)
2088}
2089
2090::PROTOBUF_NAMESPACE_ID::uint8* NameAttrList::InternalSerializeWithCachedSizesToArray(
2091 ::PROTOBUF_NAMESPACE_ID::uint8* target) const {
2092 // @@protoc_insertion_point(serialize_to_array_start:tensorflow.NameAttrList)
2093 ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
2094 (void) cached_has_bits;
2095
2096 // string name = 1;
2097 if (this->name().size() > 0) {
2098 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
2099 this->name().data(), static_cast<int>(this->name().length()),
2100 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
2101 "tensorflow.NameAttrList.name");
2102 target =
2103 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringToArray(
2104 1, this->name(), target);
2105 }
2106
2107 // map<string, .tensorflow.AttrValue> attr = 2;
2108 if (!this->attr().empty()) {
2109 typedef ::PROTOBUF_NAMESPACE_ID::Map< std::string, ::tensorflow::AttrValue >::const_pointer
2110 ConstPtr;
2111 typedef ConstPtr SortItem;
2112 typedef ::PROTOBUF_NAMESPACE_ID::internal::CompareByDerefFirst<SortItem> Less;
2113 struct Utf8Check {
2114 static void Check(ConstPtr p) {
2115 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
2116 p->first.data(), static_cast<int>(p->first.length()),
2117 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
2118 "tensorflow.NameAttrList.AttrEntry.key");
2119 }
2120 };
2121
2122 if (false &&
2123 this->attr().size() > 1) {
2124 ::std::unique_ptr<SortItem[]> items(
2125 new SortItem[this->attr().size()]);
2126 typedef ::PROTOBUF_NAMESPACE_ID::Map< std::string, ::tensorflow::AttrValue >::size_type size_type;
2127 size_type n = 0;
2128 for (::PROTOBUF_NAMESPACE_ID::Map< std::string, ::tensorflow::AttrValue >::const_iterator
2129 it = this->attr().begin();
2130 it != this->attr().end(); ++it, ++n) {
2131 items[static_cast<ptrdiff_t>(n)] = SortItem(&*it);
2132 }
2133 ::std::sort(&items[0], &items[static_cast<ptrdiff_t>(n)], Less());
2134 for (size_type i = 0; i < n; i++) {
2135 target = NameAttrList_AttrEntry_DoNotUse::Funcs::SerializeToArray(2, items[static_cast<ptrdiff_t>(i)]->first, items[static_cast<ptrdiff_t>(i)]->second, target);
2136 Utf8Check::Check(&(*items[static_cast<ptrdiff_t>(i)]));
2137 }
2138 } else {
2139 for (::PROTOBUF_NAMESPACE_ID::Map< std::string, ::tensorflow::AttrValue >::const_iterator
2140 it = this->attr().begin();
2141 it != this->attr().end(); ++it) {
2142 target = NameAttrList_AttrEntry_DoNotUse::Funcs::SerializeToArray(2, it->first, it->second, target);
2143 Utf8Check::Check(&(*it));
2144 }
2145 }
2146 }
2147
2148 if (_internal_metadata_.have_unknown_fields()) {
2149 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray(
2150 _internal_metadata_.unknown_fields(), target);
2151 }
2152 // @@protoc_insertion_point(serialize_to_array_end:tensorflow.NameAttrList)
2153 return target;
2154}
2155
2156size_t NameAttrList::ByteSizeLong() const {
2157// @@protoc_insertion_point(message_byte_size_start:tensorflow.NameAttrList)
2158 size_t total_size = 0;
2159
2160 if (_internal_metadata_.have_unknown_fields()) {
2161 total_size +=
2162 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::ComputeUnknownFieldsSize(
2163 _internal_metadata_.unknown_fields());
2164 }
2165 ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
2166 // Prevent compiler warnings about cached_has_bits being unused
2167 (void) cached_has_bits;
2168
2169 // map<string, .tensorflow.AttrValue> attr = 2;
2170 total_size += 1 *
2171 ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(this->attr_size());
2172 for (::PROTOBUF_NAMESPACE_ID::Map< std::string, ::tensorflow::AttrValue >::const_iterator
2173 it = this->attr().begin();
2174 it != this->attr().end(); ++it) {
2175 total_size += NameAttrList_AttrEntry_DoNotUse::Funcs::ByteSizeLong(it->first, it->second);
2176 }
2177
2178 // string name = 1;
2179 if (this->name().size() > 0) {
2180 total_size += 1 +
2181 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
2182 this->name());
2183 }
2184
2185 int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
2186 SetCachedSize(cached_size);
2187 return total_size;
2188}
2189
2190void NameAttrList::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
2191// @@protoc_insertion_point(generalized_merge_from_start:tensorflow.NameAttrList)
2192 GOOGLE_DCHECK_NE(&from, this);
2193 const NameAttrList* source =
2194 ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<NameAttrList>(
2195 &from);
2196 if (source == nullptr) {
2197 // @@protoc_insertion_point(generalized_merge_from_cast_fail:tensorflow.NameAttrList)
2198 ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
2199 } else {
2200 // @@protoc_insertion_point(generalized_merge_from_cast_success:tensorflow.NameAttrList)
2201 MergeFrom(*source);
2202 }
2203}
2204
2205void NameAttrList::MergeFrom(const NameAttrList& from) {
2206// @@protoc_insertion_point(class_specific_merge_from_start:tensorflow.NameAttrList)
2207 GOOGLE_DCHECK_NE(&from, this);
2208 _internal_metadata_.MergeFrom(from._internal_metadata_);
2209 ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
2210 (void) cached_has_bits;
2211
2212 attr_.MergeFrom(from.attr_);
2213 if (from.name().size() > 0) {
2214 set_name(from.name());
2215 }
2216}
2217
2218void NameAttrList::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
2219// @@protoc_insertion_point(generalized_copy_from_start:tensorflow.NameAttrList)
2220 if (&from == this) return;
2221 Clear();
2222 MergeFrom(from);
2223}
2224
2225void NameAttrList::CopyFrom(const NameAttrList& from) {
2226// @@protoc_insertion_point(class_specific_copy_from_start:tensorflow.NameAttrList)
2227 if (&from == this) return;
2228 Clear();
2229 MergeFrom(from);
2230}
2231
2232bool NameAttrList::IsInitialized() const {
2233 return true;
2234}
2235
2236void NameAttrList::InternalSwap(NameAttrList* other) {
2237 using std::swap;
2238 _internal_metadata_.Swap(&other->_internal_metadata_);
2239 attr_.Swap(&other->attr_);
2240 name_.Swap(&other->name_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
2241 GetArenaNoVirtual());
2242}
2243
2244::PROTOBUF_NAMESPACE_ID::Metadata NameAttrList::GetMetadata() const {
2245 return GetMetadataStatic();
2246}
2247
2248
2249// @@protoc_insertion_point(namespace_scope)
2250} // namespace tensorflow
2251PROTOBUF_NAMESPACE_OPEN
2252template<> PROTOBUF_NOINLINE ::tensorflow::AttrValue_ListValue* Arena::CreateMaybeMessage< ::tensorflow::AttrValue_ListValue >(Arena* arena) {
2253 return Arena::CreateMessageInternal< ::tensorflow::AttrValue_ListValue >(arena);
2254}
2255template<> PROTOBUF_NOINLINE ::tensorflow::AttrValue* Arena::CreateMaybeMessage< ::tensorflow::AttrValue >(Arena* arena) {
2256 return Arena::CreateMessageInternal< ::tensorflow::AttrValue >(arena);
2257}
2258template<> PROTOBUF_NOINLINE ::tensorflow::NameAttrList_AttrEntry_DoNotUse* Arena::CreateMaybeMessage< ::tensorflow::NameAttrList_AttrEntry_DoNotUse >(Arena* arena) {
2259 return Arena::CreateMessageInternal< ::tensorflow::NameAttrList_AttrEntry_DoNotUse >(arena);
2260}
2261template<> PROTOBUF_NOINLINE ::tensorflow::NameAttrList* Arena::CreateMaybeMessage< ::tensorflow::NameAttrList >(Arena* arena) {
2262 return Arena::CreateMessageInternal< ::tensorflow::NameAttrList >(arena);
2263}
2264PROTOBUF_NAMESPACE_CLOSE
2265
2266// @@protoc_insertion_point(global_scope)
2267#include <google/protobuf/port_undef.inc>
2268