1// Generated by the protocol buffer compiler. DO NOT EDIT!
2// source: tensorflow/core/framework/tensor_description.proto
3
4#include "tensorflow/core/framework/tensor_description.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_2fallocation_5fdescription_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_AllocationDescription_tensorflow_2fcore_2fframework_2fallocation_5fdescription_2eproto;
19extern PROTOBUF_INTERNAL_EXPORT_tensorflow_2fcore_2fframework_2ftensor_5fshape_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_TensorShapeProto_tensorflow_2fcore_2fframework_2ftensor_5fshape_2eproto;
20namespace tensorflow {
21class TensorDescriptionDefaultTypeInternal {
22 public:
23 ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<TensorDescription> _instance;
24} _TensorDescription_default_instance_;
25} // namespace tensorflow
26static void InitDefaultsscc_info_TensorDescription_tensorflow_2fcore_2fframework_2ftensor_5fdescription_2eproto() {
27 GOOGLE_PROTOBUF_VERIFY_VERSION;
28
29 {
30 void* ptr = &::tensorflow::_TensorDescription_default_instance_;
31 new (ptr) ::tensorflow::TensorDescription();
32 ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
33 }
34 ::tensorflow::TensorDescription::InitAsDefaultInstance();
35}
36
37::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<2> scc_info_TensorDescription_tensorflow_2fcore_2fframework_2ftensor_5fdescription_2eproto =
38 {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 2, InitDefaultsscc_info_TensorDescription_tensorflow_2fcore_2fframework_2ftensor_5fdescription_2eproto}, {
39 &scc_info_TensorShapeProto_tensorflow_2fcore_2fframework_2ftensor_5fshape_2eproto.base,
40 &scc_info_AllocationDescription_tensorflow_2fcore_2fframework_2fallocation_5fdescription_2eproto.base,}};
41
42static ::PROTOBUF_NAMESPACE_ID::Metadata file_level_metadata_tensorflow_2fcore_2fframework_2ftensor_5fdescription_2eproto[1];
43static constexpr ::PROTOBUF_NAMESPACE_ID::EnumDescriptor const** file_level_enum_descriptors_tensorflow_2fcore_2fframework_2ftensor_5fdescription_2eproto = nullptr;
44static constexpr ::PROTOBUF_NAMESPACE_ID::ServiceDescriptor const** file_level_service_descriptors_tensorflow_2fcore_2fframework_2ftensor_5fdescription_2eproto = nullptr;
45
46const ::PROTOBUF_NAMESPACE_ID::uint32 TableStruct_tensorflow_2fcore_2fframework_2ftensor_5fdescription_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
47 ~0u, // no _has_bits_
48 PROTOBUF_FIELD_OFFSET(::tensorflow::TensorDescription, _internal_metadata_),
49 ~0u, // no _extensions_
50 ~0u, // no _oneof_case_
51 ~0u, // no _weak_field_map_
52 PROTOBUF_FIELD_OFFSET(::tensorflow::TensorDescription, dtype_),
53 PROTOBUF_FIELD_OFFSET(::tensorflow::TensorDescription, shape_),
54 PROTOBUF_FIELD_OFFSET(::tensorflow::TensorDescription, allocation_description_),
55};
56static const ::PROTOBUF_NAMESPACE_ID::internal::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
57 { 0, -1, sizeof(::tensorflow::TensorDescription)},
58};
59
60static ::PROTOBUF_NAMESPACE_ID::Message const * const file_default_instances[] = {
61 reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::tensorflow::_TensorDescription_default_instance_),
62};
63
64const char descriptor_table_protodef_tensorflow_2fcore_2fframework_2ftensor_5fdescription_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) =
65 "\n2tensorflow/core/framework/tensor_descr"
66 "iption.proto\022\ntensorflow\0326tensorflow/cor"
67 "e/framework/allocation_description.proto"
68 "\032,tensorflow/core/framework/tensor_shape"
69 ".proto\032%tensorflow/core/framework/types."
70 "proto\"\250\001\n\021TensorDescription\022#\n\005dtype\030\001 \001"
71 "(\0162\024.tensorflow.DataType\022+\n\005shape\030\002 \001(\0132"
72 "\034.tensorflow.TensorShapeProto\022A\n\026allocat"
73 "ion_description\030\004 \001(\0132!.tensorflow.Alloc"
74 "ationDescriptionB\223\001\n\030org.tensorflow.fram"
75 "eworkB\027TensorDescriptionProtosP\001ZYgithub"
76 ".com/tensorflow/tensorflow/tensorflow/go"
77 "/core/framework/tensor_description_go_pr"
78 "oto\370\001\001b\006proto3"
79 ;
80static const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable*const descriptor_table_tensorflow_2fcore_2fframework_2ftensor_5fdescription_2eproto_deps[3] = {
81 &::descriptor_table_tensorflow_2fcore_2fframework_2fallocation_5fdescription_2eproto,
82 &::descriptor_table_tensorflow_2fcore_2fframework_2ftensor_5fshape_2eproto,
83 &::descriptor_table_tensorflow_2fcore_2fframework_2ftypes_2eproto,
84};
85static ::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase*const descriptor_table_tensorflow_2fcore_2fframework_2ftensor_5fdescription_2eproto_sccs[1] = {
86 &scc_info_TensorDescription_tensorflow_2fcore_2fframework_2ftensor_5fdescription_2eproto.base,
87};
88static ::PROTOBUF_NAMESPACE_ID::internal::once_flag descriptor_table_tensorflow_2fcore_2fframework_2ftensor_5fdescription_2eproto_once;
89static bool descriptor_table_tensorflow_2fcore_2fframework_2ftensor_5fdescription_2eproto_initialized = false;
90const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_tensorflow_2fcore_2fframework_2ftensor_5fdescription_2eproto = {
91 &descriptor_table_tensorflow_2fcore_2fframework_2ftensor_5fdescription_2eproto_initialized, descriptor_table_protodef_tensorflow_2fcore_2fframework_2ftensor_5fdescription_2eproto, "tensorflow/core/framework/tensor_description.proto", 534,
92 &descriptor_table_tensorflow_2fcore_2fframework_2ftensor_5fdescription_2eproto_once, descriptor_table_tensorflow_2fcore_2fframework_2ftensor_5fdescription_2eproto_sccs, descriptor_table_tensorflow_2fcore_2fframework_2ftensor_5fdescription_2eproto_deps, 1, 3,
93 schemas, file_default_instances, TableStruct_tensorflow_2fcore_2fframework_2ftensor_5fdescription_2eproto::offsets,
94 file_level_metadata_tensorflow_2fcore_2fframework_2ftensor_5fdescription_2eproto, 1, file_level_enum_descriptors_tensorflow_2fcore_2fframework_2ftensor_5fdescription_2eproto, file_level_service_descriptors_tensorflow_2fcore_2fframework_2ftensor_5fdescription_2eproto,
95};
96
97// Force running AddDescriptors() at dynamic initialization time.
98static bool dynamic_init_dummy_tensorflow_2fcore_2fframework_2ftensor_5fdescription_2eproto = ( ::PROTOBUF_NAMESPACE_ID::internal::AddDescriptors(&descriptor_table_tensorflow_2fcore_2fframework_2ftensor_5fdescription_2eproto), true);
99namespace tensorflow {
100
101// ===================================================================
102
103void TensorDescription::InitAsDefaultInstance() {
104 ::tensorflow::_TensorDescription_default_instance_._instance.get_mutable()->shape_ = const_cast< ::tensorflow::TensorShapeProto*>(
105 ::tensorflow::TensorShapeProto::internal_default_instance());
106 ::tensorflow::_TensorDescription_default_instance_._instance.get_mutable()->allocation_description_ = const_cast< ::tensorflow::AllocationDescription*>(
107 ::tensorflow::AllocationDescription::internal_default_instance());
108}
109class TensorDescription::_Internal {
110 public:
111 static const ::tensorflow::TensorShapeProto& shape(const TensorDescription* msg);
112 static const ::tensorflow::AllocationDescription& allocation_description(const TensorDescription* msg);
113};
114
115const ::tensorflow::TensorShapeProto&
116TensorDescription::_Internal::shape(const TensorDescription* msg) {
117 return *msg->shape_;
118}
119const ::tensorflow::AllocationDescription&
120TensorDescription::_Internal::allocation_description(const TensorDescription* msg) {
121 return *msg->allocation_description_;
122}
123void TensorDescription::unsafe_arena_set_allocated_shape(
124 ::tensorflow::TensorShapeProto* shape) {
125 if (GetArenaNoVirtual() == nullptr) {
126 delete shape_;
127 }
128 shape_ = shape;
129 if (shape) {
130
131 } else {
132
133 }
134 // @@protoc_insertion_point(field_unsafe_arena_set_allocated:tensorflow.TensorDescription.shape)
135}
136void TensorDescription::clear_shape() {
137 if (GetArenaNoVirtual() == nullptr && shape_ != nullptr) {
138 delete shape_;
139 }
140 shape_ = nullptr;
141}
142void TensorDescription::unsafe_arena_set_allocated_allocation_description(
143 ::tensorflow::AllocationDescription* allocation_description) {
144 if (GetArenaNoVirtual() == nullptr) {
145 delete allocation_description_;
146 }
147 allocation_description_ = allocation_description;
148 if (allocation_description) {
149
150 } else {
151
152 }
153 // @@protoc_insertion_point(field_unsafe_arena_set_allocated:tensorflow.TensorDescription.allocation_description)
154}
155void TensorDescription::clear_allocation_description() {
156 if (GetArenaNoVirtual() == nullptr && allocation_description_ != nullptr) {
157 delete allocation_description_;
158 }
159 allocation_description_ = nullptr;
160}
161TensorDescription::TensorDescription()
162 : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
163 SharedCtor();
164 // @@protoc_insertion_point(constructor:tensorflow.TensorDescription)
165}
166TensorDescription::TensorDescription(::PROTOBUF_NAMESPACE_ID::Arena* arena)
167 : ::PROTOBUF_NAMESPACE_ID::Message(),
168 _internal_metadata_(arena) {
169 SharedCtor();
170 RegisterArenaDtor(arena);
171 // @@protoc_insertion_point(arena_constructor:tensorflow.TensorDescription)
172}
173TensorDescription::TensorDescription(const TensorDescription& from)
174 : ::PROTOBUF_NAMESPACE_ID::Message(),
175 _internal_metadata_(nullptr) {
176 _internal_metadata_.MergeFrom(from._internal_metadata_);
177 if (from.has_shape()) {
178 shape_ = new ::tensorflow::TensorShapeProto(*from.shape_);
179 } else {
180 shape_ = nullptr;
181 }
182 if (from.has_allocation_description()) {
183 allocation_description_ = new ::tensorflow::AllocationDescription(*from.allocation_description_);
184 } else {
185 allocation_description_ = nullptr;
186 }
187 dtype_ = from.dtype_;
188 // @@protoc_insertion_point(copy_constructor:tensorflow.TensorDescription)
189}
190
191void TensorDescription::SharedCtor() {
192 ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_TensorDescription_tensorflow_2fcore_2fframework_2ftensor_5fdescription_2eproto.base);
193 ::memset(&shape_, 0, static_cast<size_t>(
194 reinterpret_cast<char*>(&dtype_) -
195 reinterpret_cast<char*>(&shape_)) + sizeof(dtype_));
196}
197
198TensorDescription::~TensorDescription() {
199 // @@protoc_insertion_point(destructor:tensorflow.TensorDescription)
200 SharedDtor();
201}
202
203void TensorDescription::SharedDtor() {
204 GOOGLE_DCHECK(GetArenaNoVirtual() == nullptr);
205 if (this != internal_default_instance()) delete shape_;
206 if (this != internal_default_instance()) delete allocation_description_;
207}
208
209void TensorDescription::ArenaDtor(void* object) {
210 TensorDescription* _this = reinterpret_cast< TensorDescription* >(object);
211 (void)_this;
212}
213void TensorDescription::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
214}
215void TensorDescription::SetCachedSize(int size) const {
216 _cached_size_.Set(size);
217}
218const TensorDescription& TensorDescription::default_instance() {
219 ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_TensorDescription_tensorflow_2fcore_2fframework_2ftensor_5fdescription_2eproto.base);
220 return *internal_default_instance();
221}
222
223
224void TensorDescription::Clear() {
225// @@protoc_insertion_point(message_clear_start:tensorflow.TensorDescription)
226 ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
227 // Prevent compiler warnings about cached_has_bits being unused
228 (void) cached_has_bits;
229
230 if (GetArenaNoVirtual() == nullptr && shape_ != nullptr) {
231 delete shape_;
232 }
233 shape_ = nullptr;
234 if (GetArenaNoVirtual() == nullptr && allocation_description_ != nullptr) {
235 delete allocation_description_;
236 }
237 allocation_description_ = nullptr;
238 dtype_ = 0;
239 _internal_metadata_.Clear();
240}
241
242#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
243const char* TensorDescription::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
244#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
245 ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArenaNoVirtual(); (void)arena;
246 while (!ctx->Done(&ptr)) {
247 ::PROTOBUF_NAMESPACE_ID::uint32 tag;
248 ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
249 CHK_(ptr);
250 switch (tag >> 3) {
251 // .tensorflow.DataType dtype = 1;
252 case 1:
253 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) {
254 ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
255 CHK_(ptr);
256 set_dtype(static_cast<::tensorflow::DataType>(val));
257 } else goto handle_unusual;
258 continue;
259 // .tensorflow.TensorShapeProto shape = 2;
260 case 2:
261 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) {
262 ptr = ctx->ParseMessage(mutable_shape(), ptr);
263 CHK_(ptr);
264 } else goto handle_unusual;
265 continue;
266 // .tensorflow.AllocationDescription allocation_description = 4;
267 case 4:
268 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 34)) {
269 ptr = ctx->ParseMessage(mutable_allocation_description(), ptr);
270 CHK_(ptr);
271 } else goto handle_unusual;
272 continue;
273 default: {
274 handle_unusual:
275 if ((tag & 7) == 4 || tag == 0) {
276 ctx->SetLastTag(tag);
277 goto success;
278 }
279 ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
280 CHK_(ptr != nullptr);
281 continue;
282 }
283 } // switch
284 } // while
285success:
286 return ptr;
287failure:
288 ptr = nullptr;
289 goto success;
290#undef CHK_
291}
292#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
293bool TensorDescription::MergePartialFromCodedStream(
294 ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) {
295#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure
296 ::PROTOBUF_NAMESPACE_ID::uint32 tag;
297 // @@protoc_insertion_point(parse_start:tensorflow.TensorDescription)
298 for (;;) {
299 ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
300 tag = p.first;
301 if (!p.second) goto handle_unusual;
302 switch (::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::GetTagFieldNumber(tag)) {
303 // .tensorflow.DataType dtype = 1;
304 case 1: {
305 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (8 & 0xFF)) {
306 int value = 0;
307 DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
308 int, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_ENUM>(
309 input, &value)));
310 set_dtype(static_cast< ::tensorflow::DataType >(value));
311 } else {
312 goto handle_unusual;
313 }
314 break;
315 }
316
317 // .tensorflow.TensorShapeProto shape = 2;
318 case 2: {
319 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (18 & 0xFF)) {
320 DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage(
321 input, mutable_shape()));
322 } else {
323 goto handle_unusual;
324 }
325 break;
326 }
327
328 // .tensorflow.AllocationDescription allocation_description = 4;
329 case 4: {
330 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (34 & 0xFF)) {
331 DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage(
332 input, mutable_allocation_description()));
333 } else {
334 goto handle_unusual;
335 }
336 break;
337 }
338
339 default: {
340 handle_unusual:
341 if (tag == 0) {
342 goto success;
343 }
344 DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SkipField(
345 input, tag, _internal_metadata_.mutable_unknown_fields()));
346 break;
347 }
348 }
349 }
350success:
351 // @@protoc_insertion_point(parse_success:tensorflow.TensorDescription)
352 return true;
353failure:
354 // @@protoc_insertion_point(parse_failure:tensorflow.TensorDescription)
355 return false;
356#undef DO_
357}
358#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
359
360void TensorDescription::SerializeWithCachedSizes(
361 ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const {
362 // @@protoc_insertion_point(serialize_start:tensorflow.TensorDescription)
363 ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
364 (void) cached_has_bits;
365
366 // .tensorflow.DataType dtype = 1;
367 if (this->dtype() != 0) {
368 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnum(
369 1, this->dtype(), output);
370 }
371
372 // .tensorflow.TensorShapeProto shape = 2;
373 if (this->has_shape()) {
374 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray(
375 2, _Internal::shape(this), output);
376 }
377
378 // .tensorflow.AllocationDescription allocation_description = 4;
379 if (this->has_allocation_description()) {
380 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray(
381 4, _Internal::allocation_description(this), output);
382 }
383
384 if (_internal_metadata_.have_unknown_fields()) {
385 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields(
386 _internal_metadata_.unknown_fields(), output);
387 }
388 // @@protoc_insertion_point(serialize_end:tensorflow.TensorDescription)
389}
390
391::PROTOBUF_NAMESPACE_ID::uint8* TensorDescription::InternalSerializeWithCachedSizesToArray(
392 ::PROTOBUF_NAMESPACE_ID::uint8* target) const {
393 // @@protoc_insertion_point(serialize_to_array_start:tensorflow.TensorDescription)
394 ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
395 (void) cached_has_bits;
396
397 // .tensorflow.DataType dtype = 1;
398 if (this->dtype() != 0) {
399 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
400 1, this->dtype(), target);
401 }
402
403 // .tensorflow.TensorShapeProto shape = 2;
404 if (this->has_shape()) {
405 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
406 InternalWriteMessageToArray(
407 2, _Internal::shape(this), target);
408 }
409
410 // .tensorflow.AllocationDescription allocation_description = 4;
411 if (this->has_allocation_description()) {
412 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
413 InternalWriteMessageToArray(
414 4, _Internal::allocation_description(this), target);
415 }
416
417 if (_internal_metadata_.have_unknown_fields()) {
418 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray(
419 _internal_metadata_.unknown_fields(), target);
420 }
421 // @@protoc_insertion_point(serialize_to_array_end:tensorflow.TensorDescription)
422 return target;
423}
424
425size_t TensorDescription::ByteSizeLong() const {
426// @@protoc_insertion_point(message_byte_size_start:tensorflow.TensorDescription)
427 size_t total_size = 0;
428
429 if (_internal_metadata_.have_unknown_fields()) {
430 total_size +=
431 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::ComputeUnknownFieldsSize(
432 _internal_metadata_.unknown_fields());
433 }
434 ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
435 // Prevent compiler warnings about cached_has_bits being unused
436 (void) cached_has_bits;
437
438 // .tensorflow.TensorShapeProto shape = 2;
439 if (this->has_shape()) {
440 total_size += 1 +
441 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
442 *shape_);
443 }
444
445 // .tensorflow.AllocationDescription allocation_description = 4;
446 if (this->has_allocation_description()) {
447 total_size += 1 +
448 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
449 *allocation_description_);
450 }
451
452 // .tensorflow.DataType dtype = 1;
453 if (this->dtype() != 0) {
454 total_size += 1 +
455 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->dtype());
456 }
457
458 int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
459 SetCachedSize(cached_size);
460 return total_size;
461}
462
463void TensorDescription::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
464// @@protoc_insertion_point(generalized_merge_from_start:tensorflow.TensorDescription)
465 GOOGLE_DCHECK_NE(&from, this);
466 const TensorDescription* source =
467 ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<TensorDescription>(
468 &from);
469 if (source == nullptr) {
470 // @@protoc_insertion_point(generalized_merge_from_cast_fail:tensorflow.TensorDescription)
471 ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
472 } else {
473 // @@protoc_insertion_point(generalized_merge_from_cast_success:tensorflow.TensorDescription)
474 MergeFrom(*source);
475 }
476}
477
478void TensorDescription::MergeFrom(const TensorDescription& from) {
479// @@protoc_insertion_point(class_specific_merge_from_start:tensorflow.TensorDescription)
480 GOOGLE_DCHECK_NE(&from, this);
481 _internal_metadata_.MergeFrom(from._internal_metadata_);
482 ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
483 (void) cached_has_bits;
484
485 if (from.has_shape()) {
486 mutable_shape()->::tensorflow::TensorShapeProto::MergeFrom(from.shape());
487 }
488 if (from.has_allocation_description()) {
489 mutable_allocation_description()->::tensorflow::AllocationDescription::MergeFrom(from.allocation_description());
490 }
491 if (from.dtype() != 0) {
492 set_dtype(from.dtype());
493 }
494}
495
496void TensorDescription::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
497// @@protoc_insertion_point(generalized_copy_from_start:tensorflow.TensorDescription)
498 if (&from == this) return;
499 Clear();
500 MergeFrom(from);
501}
502
503void TensorDescription::CopyFrom(const TensorDescription& from) {
504// @@protoc_insertion_point(class_specific_copy_from_start:tensorflow.TensorDescription)
505 if (&from == this) return;
506 Clear();
507 MergeFrom(from);
508}
509
510bool TensorDescription::IsInitialized() const {
511 return true;
512}
513
514void TensorDescription::InternalSwap(TensorDescription* other) {
515 using std::swap;
516 _internal_metadata_.Swap(&other->_internal_metadata_);
517 swap(shape_, other->shape_);
518 swap(allocation_description_, other->allocation_description_);
519 swap(dtype_, other->dtype_);
520}
521
522::PROTOBUF_NAMESPACE_ID::Metadata TensorDescription::GetMetadata() const {
523 return GetMetadataStatic();
524}
525
526
527// @@protoc_insertion_point(namespace_scope)
528} // namespace tensorflow
529PROTOBUF_NAMESPACE_OPEN
530template<> PROTOBUF_NOINLINE ::tensorflow::TensorDescription* Arena::CreateMaybeMessage< ::tensorflow::TensorDescription >(Arena* arena) {
531 return Arena::CreateMessageInternal< ::tensorflow::TensorDescription >(arena);
532}
533PROTOBUF_NAMESPACE_CLOSE
534
535// @@protoc_insertion_point(global_scope)
536#include <google/protobuf/port_undef.inc>
537