1 // Generated by the protocol buffer compiler. DO NOT EDIT!
2 // source: tensorflow/core/framework/tensor_slice.proto
3
4 #include "tensorflow/core/framework/tensor_slice.pb.h"
5
6 #include <algorithm>
7 #include <cstdint>
8
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/io/zero_copy_stream_impl_lite.h>
13 // @@protoc_insertion_point(includes)
14 #include <google/protobuf/port_def.inc>
15
16 PROTOBUF_PRAGMA_INIT_SEG
17
18 namespace _pb = ::PROTOBUF_NAMESPACE_ID;
19 namespace _pbi = _pb::internal;
20
21 namespace tensorflow {
TensorSliceProto_Extent(::_pbi::ConstantInitialized)22 PROTOBUF_CONSTEXPR TensorSliceProto_Extent::TensorSliceProto_Extent(
23 ::_pbi::ConstantInitialized): _impl_{
24 /*decltype(_impl_.start_)*/::int64_t{0}
25 , /*decltype(_impl_.has_length_)*/{}
26 , /*decltype(_impl_._cached_size_)*/{}
27 , /*decltype(_impl_._oneof_case_)*/{}} {}
28 struct TensorSliceProto_ExtentDefaultTypeInternal {
TensorSliceProto_ExtentDefaultTypeInternaltensorflow::TensorSliceProto_ExtentDefaultTypeInternal29 PROTOBUF_CONSTEXPR TensorSliceProto_ExtentDefaultTypeInternal()
30 : _instance(::_pbi::ConstantInitialized{}) {}
~TensorSliceProto_ExtentDefaultTypeInternaltensorflow::TensorSliceProto_ExtentDefaultTypeInternal31 ~TensorSliceProto_ExtentDefaultTypeInternal() {}
32 union { // NOLINT(misc-non-private-member-variables-in-classes)
33 TensorSliceProto_Extent _instance;
34 };
35 };
36 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 TensorSliceProto_ExtentDefaultTypeInternal _TensorSliceProto_Extent_default_instance_;
TensorSliceProto(::_pbi::ConstantInitialized)37 PROTOBUF_CONSTEXPR TensorSliceProto::TensorSliceProto(
38 ::_pbi::ConstantInitialized): _impl_{
39 /*decltype(_impl_.extent_)*/{}
40 , /*decltype(_impl_._cached_size_)*/{}} {}
41 struct TensorSliceProtoDefaultTypeInternal {
TensorSliceProtoDefaultTypeInternaltensorflow::TensorSliceProtoDefaultTypeInternal42 PROTOBUF_CONSTEXPR TensorSliceProtoDefaultTypeInternal()
43 : _instance(::_pbi::ConstantInitialized{}) {}
~TensorSliceProtoDefaultTypeInternaltensorflow::TensorSliceProtoDefaultTypeInternal44 ~TensorSliceProtoDefaultTypeInternal() {}
45 union { // NOLINT(misc-non-private-member-variables-in-classes)
46 TensorSliceProto _instance;
47 };
48 };
49 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 TensorSliceProtoDefaultTypeInternal _TensorSliceProto_default_instance_;
50 } // namespace tensorflow
51 namespace tensorflow {
52
53 // ===================================================================
54
55 class TensorSliceProto_Extent::_Internal {
56 public:
57 };
58
TensorSliceProto_Extent(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)59 TensorSliceProto_Extent::TensorSliceProto_Extent(::PROTOBUF_NAMESPACE_ID::Arena* arena,
60 bool is_message_owned)
61 : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
62 SharedCtor(arena, is_message_owned);
63 // @@protoc_insertion_point(arena_constructor:tensorflow.TensorSliceProto.Extent)
64 }
TensorSliceProto_Extent(const TensorSliceProto_Extent & from)65 TensorSliceProto_Extent::TensorSliceProto_Extent(const TensorSliceProto_Extent& from)
66 : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
67 TensorSliceProto_Extent* const _this = this; (void)_this;
68 new (&_impl_) Impl_{
69 decltype(_impl_.start_){}
70 , decltype(_impl_.has_length_){}
71 , /*decltype(_impl_._cached_size_)*/{}
72 , /*decltype(_impl_._oneof_case_)*/{}};
73
74 _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
75 _this->_impl_.start_ = from._impl_.start_;
76 clear_has_has_length();
77 switch (from.has_length_case()) {
78 case kLength: {
79 _this->_internal_set_length(from._internal_length());
80 break;
81 }
82 case HAS_LENGTH_NOT_SET: {
83 break;
84 }
85 }
86 // @@protoc_insertion_point(copy_constructor:tensorflow.TensorSliceProto.Extent)
87 }
88
SharedCtor(::_pb::Arena * arena,bool is_message_owned)89 inline void TensorSliceProto_Extent::SharedCtor(
90 ::_pb::Arena* arena, bool is_message_owned) {
91 (void)arena;
92 (void)is_message_owned;
93 new (&_impl_) Impl_{
94 decltype(_impl_.start_){::int64_t{0}}
95 , decltype(_impl_.has_length_){}
96 , /*decltype(_impl_._cached_size_)*/{}
97 , /*decltype(_impl_._oneof_case_)*/{}
98 };
99 clear_has_has_length();
100 }
101
~TensorSliceProto_Extent()102 TensorSliceProto_Extent::~TensorSliceProto_Extent() {
103 // @@protoc_insertion_point(destructor:tensorflow.TensorSliceProto.Extent)
104 if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
105 (void)arena;
106 return;
107 }
108 SharedDtor();
109 }
110
SharedDtor()111 inline void TensorSliceProto_Extent::SharedDtor() {
112 GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
113 if (has_has_length()) {
114 clear_has_length();
115 }
116 }
117
SetCachedSize(int size) const118 void TensorSliceProto_Extent::SetCachedSize(int size) const {
119 _impl_._cached_size_.Set(size);
120 }
121
clear_has_length()122 void TensorSliceProto_Extent::clear_has_length() {
123 // @@protoc_insertion_point(one_of_clear_start:tensorflow.TensorSliceProto.Extent)
124 switch (has_length_case()) {
125 case kLength: {
126 // No need to clear
127 break;
128 }
129 case HAS_LENGTH_NOT_SET: {
130 break;
131 }
132 }
133 _impl_._oneof_case_[0] = HAS_LENGTH_NOT_SET;
134 }
135
136
Clear()137 void TensorSliceProto_Extent::Clear() {
138 // @@protoc_insertion_point(message_clear_start:tensorflow.TensorSliceProto.Extent)
139 ::uint32_t cached_has_bits = 0;
140 // Prevent compiler warnings about cached_has_bits being unused
141 (void) cached_has_bits;
142
143 _impl_.start_ = ::int64_t{0};
144 clear_has_length();
145 _internal_metadata_.Clear<std::string>();
146 }
147
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)148 const char* TensorSliceProto_Extent::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
149 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
150 while (!ctx->Done(&ptr)) {
151 ::uint32_t tag;
152 ptr = ::_pbi::ReadTag(ptr, &tag);
153 switch (tag >> 3) {
154 // int64 start = 1;
155 case 1:
156 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 8)) {
157 _impl_.start_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
158 CHK_(ptr);
159 } else {
160 goto handle_unusual;
161 }
162 continue;
163 // int64 length = 2;
164 case 2:
165 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 16)) {
166 _internal_set_length(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr));
167 CHK_(ptr);
168 } else {
169 goto handle_unusual;
170 }
171 continue;
172 default:
173 goto handle_unusual;
174 } // switch
175 handle_unusual:
176 if ((tag == 0) || ((tag & 7) == 4)) {
177 CHK_(ptr);
178 ctx->SetLastTag(tag);
179 goto message_done;
180 }
181 ptr = UnknownFieldParse(
182 tag,
183 _internal_metadata_.mutable_unknown_fields<std::string>(),
184 ptr, ctx);
185 CHK_(ptr != nullptr);
186 } // while
187 message_done:
188 return ptr;
189 failure:
190 ptr = nullptr;
191 goto message_done;
192 #undef CHK_
193 }
194
_InternalSerialize(::uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const195 ::uint8_t* TensorSliceProto_Extent::_InternalSerialize(
196 ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
197 // @@protoc_insertion_point(serialize_to_array_start:tensorflow.TensorSliceProto.Extent)
198 ::uint32_t cached_has_bits = 0;
199 (void) cached_has_bits;
200
201 // int64 start = 1;
202 if (this->_internal_start() != 0) {
203 target = stream->EnsureSpace(target);
204 target = ::_pbi::WireFormatLite::WriteInt64ToArray(1, this->_internal_start(), target);
205 }
206
207 // int64 length = 2;
208 if (_internal_has_length()) {
209 target = stream->EnsureSpace(target);
210 target = ::_pbi::WireFormatLite::WriteInt64ToArray(2, this->_internal_length(), target);
211 }
212
213 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
214 target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
215 static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
216 }
217 // @@protoc_insertion_point(serialize_to_array_end:tensorflow.TensorSliceProto.Extent)
218 return target;
219 }
220
ByteSizeLong() const221 size_t TensorSliceProto_Extent::ByteSizeLong() const {
222 // @@protoc_insertion_point(message_byte_size_start:tensorflow.TensorSliceProto.Extent)
223 size_t total_size = 0;
224
225 ::uint32_t cached_has_bits = 0;
226 // Prevent compiler warnings about cached_has_bits being unused
227 (void) cached_has_bits;
228
229 // int64 start = 1;
230 if (this->_internal_start() != 0) {
231 total_size += ::_pbi::WireFormatLite::Int64SizePlusOne(this->_internal_start());
232 }
233
234 switch (has_length_case()) {
235 // int64 length = 2;
236 case kLength: {
237 total_size += ::_pbi::WireFormatLite::Int64SizePlusOne(this->_internal_length());
238 break;
239 }
240 case HAS_LENGTH_NOT_SET: {
241 break;
242 }
243 }
244 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
245 total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
246 }
247 int cached_size = ::_pbi::ToCachedSize(total_size);
248 SetCachedSize(cached_size);
249 return total_size;
250 }
251
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)252 void TensorSliceProto_Extent::CheckTypeAndMergeFrom(
253 const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
254 MergeFrom(*::_pbi::DownCast<const TensorSliceProto_Extent*>(
255 &from));
256 }
257
MergeFrom(const TensorSliceProto_Extent & from)258 void TensorSliceProto_Extent::MergeFrom(const TensorSliceProto_Extent& from) {
259 TensorSliceProto_Extent* const _this = this;
260 // @@protoc_insertion_point(class_specific_merge_from_start:tensorflow.TensorSliceProto.Extent)
261 GOOGLE_DCHECK_NE(&from, _this);
262 ::uint32_t cached_has_bits = 0;
263 (void) cached_has_bits;
264
265 if (from._internal_start() != 0) {
266 _this->_internal_set_start(from._internal_start());
267 }
268 switch (from.has_length_case()) {
269 case kLength: {
270 _this->_internal_set_length(from._internal_length());
271 break;
272 }
273 case HAS_LENGTH_NOT_SET: {
274 break;
275 }
276 }
277 _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
278 }
279
CopyFrom(const TensorSliceProto_Extent & from)280 void TensorSliceProto_Extent::CopyFrom(const TensorSliceProto_Extent& from) {
281 // @@protoc_insertion_point(class_specific_copy_from_start:tensorflow.TensorSliceProto.Extent)
282 if (&from == this) return;
283 Clear();
284 MergeFrom(from);
285 }
286
IsInitialized() const287 bool TensorSliceProto_Extent::IsInitialized() const {
288 return true;
289 }
290
InternalSwap(TensorSliceProto_Extent * other)291 void TensorSliceProto_Extent::InternalSwap(TensorSliceProto_Extent* other) {
292 using std::swap;
293 _internal_metadata_.InternalSwap(&other->_internal_metadata_);
294 swap(_impl_.start_, other->_impl_.start_);
295 swap(_impl_.has_length_, other->_impl_.has_length_);
296 swap(_impl_._oneof_case_[0], other->_impl_._oneof_case_[0]);
297 }
298
GetTypeName() const299 std::string TensorSliceProto_Extent::GetTypeName() const {
300 return "tensorflow.TensorSliceProto.Extent";
301 }
302
303
304 // ===================================================================
305
306 class TensorSliceProto::_Internal {
307 public:
308 };
309
TensorSliceProto(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)310 TensorSliceProto::TensorSliceProto(::PROTOBUF_NAMESPACE_ID::Arena* arena,
311 bool is_message_owned)
312 : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
313 SharedCtor(arena, is_message_owned);
314 // @@protoc_insertion_point(arena_constructor:tensorflow.TensorSliceProto)
315 }
TensorSliceProto(const TensorSliceProto & from)316 TensorSliceProto::TensorSliceProto(const TensorSliceProto& from)
317 : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
318 TensorSliceProto* const _this = this; (void)_this;
319 new (&_impl_) Impl_{
320 decltype(_impl_.extent_){from._impl_.extent_}
321 , /*decltype(_impl_._cached_size_)*/{}};
322
323 _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
324 // @@protoc_insertion_point(copy_constructor:tensorflow.TensorSliceProto)
325 }
326
SharedCtor(::_pb::Arena * arena,bool is_message_owned)327 inline void TensorSliceProto::SharedCtor(
328 ::_pb::Arena* arena, bool is_message_owned) {
329 (void)arena;
330 (void)is_message_owned;
331 new (&_impl_) Impl_{
332 decltype(_impl_.extent_){arena}
333 , /*decltype(_impl_._cached_size_)*/{}
334 };
335 }
336
~TensorSliceProto()337 TensorSliceProto::~TensorSliceProto() {
338 // @@protoc_insertion_point(destructor:tensorflow.TensorSliceProto)
339 if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
340 (void)arena;
341 return;
342 }
343 SharedDtor();
344 }
345
SharedDtor()346 inline void TensorSliceProto::SharedDtor() {
347 GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
348 _impl_.extent_.~RepeatedPtrField();
349 }
350
SetCachedSize(int size) const351 void TensorSliceProto::SetCachedSize(int size) const {
352 _impl_._cached_size_.Set(size);
353 }
354
Clear()355 void TensorSliceProto::Clear() {
356 // @@protoc_insertion_point(message_clear_start:tensorflow.TensorSliceProto)
357 ::uint32_t cached_has_bits = 0;
358 // Prevent compiler warnings about cached_has_bits being unused
359 (void) cached_has_bits;
360
361 _impl_.extent_.Clear();
362 _internal_metadata_.Clear<std::string>();
363 }
364
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)365 const char* TensorSliceProto::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
366 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
367 while (!ctx->Done(&ptr)) {
368 ::uint32_t tag;
369 ptr = ::_pbi::ReadTag(ptr, &tag);
370 switch (tag >> 3) {
371 // repeated .tensorflow.TensorSliceProto.Extent extent = 1;
372 case 1:
373 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 10)) {
374 ptr -= 1;
375 do {
376 ptr += 1;
377 ptr = ctx->ParseMessage(_internal_add_extent(), ptr);
378 CHK_(ptr);
379 if (!ctx->DataAvailable(ptr)) break;
380 } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<10>(ptr));
381 } else {
382 goto handle_unusual;
383 }
384 continue;
385 default:
386 goto handle_unusual;
387 } // switch
388 handle_unusual:
389 if ((tag == 0) || ((tag & 7) == 4)) {
390 CHK_(ptr);
391 ctx->SetLastTag(tag);
392 goto message_done;
393 }
394 ptr = UnknownFieldParse(
395 tag,
396 _internal_metadata_.mutable_unknown_fields<std::string>(),
397 ptr, ctx);
398 CHK_(ptr != nullptr);
399 } // while
400 message_done:
401 return ptr;
402 failure:
403 ptr = nullptr;
404 goto message_done;
405 #undef CHK_
406 }
407
_InternalSerialize(::uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const408 ::uint8_t* TensorSliceProto::_InternalSerialize(
409 ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
410 // @@protoc_insertion_point(serialize_to_array_start:tensorflow.TensorSliceProto)
411 ::uint32_t cached_has_bits = 0;
412 (void) cached_has_bits;
413
414 // repeated .tensorflow.TensorSliceProto.Extent extent = 1;
415 for (unsigned i = 0,
416 n = static_cast<unsigned>(this->_internal_extent_size()); i < n; i++) {
417 const auto& repfield = this->_internal_extent(i);
418 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
419 InternalWriteMessage(1, repfield, repfield.GetCachedSize(), target, stream);
420 }
421
422 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
423 target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
424 static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
425 }
426 // @@protoc_insertion_point(serialize_to_array_end:tensorflow.TensorSliceProto)
427 return target;
428 }
429
ByteSizeLong() const430 size_t TensorSliceProto::ByteSizeLong() const {
431 // @@protoc_insertion_point(message_byte_size_start:tensorflow.TensorSliceProto)
432 size_t total_size = 0;
433
434 ::uint32_t cached_has_bits = 0;
435 // Prevent compiler warnings about cached_has_bits being unused
436 (void) cached_has_bits;
437
438 // repeated .tensorflow.TensorSliceProto.Extent extent = 1;
439 total_size += 1UL * this->_internal_extent_size();
440 for (const auto& msg : this->_impl_.extent_) {
441 total_size +=
442 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
443 }
444
445 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
446 total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
447 }
448 int cached_size = ::_pbi::ToCachedSize(total_size);
449 SetCachedSize(cached_size);
450 return total_size;
451 }
452
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)453 void TensorSliceProto::CheckTypeAndMergeFrom(
454 const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
455 MergeFrom(*::_pbi::DownCast<const TensorSliceProto*>(
456 &from));
457 }
458
MergeFrom(const TensorSliceProto & from)459 void TensorSliceProto::MergeFrom(const TensorSliceProto& from) {
460 TensorSliceProto* const _this = this;
461 // @@protoc_insertion_point(class_specific_merge_from_start:tensorflow.TensorSliceProto)
462 GOOGLE_DCHECK_NE(&from, _this);
463 ::uint32_t cached_has_bits = 0;
464 (void) cached_has_bits;
465
466 _this->_impl_.extent_.MergeFrom(from._impl_.extent_);
467 _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
468 }
469
CopyFrom(const TensorSliceProto & from)470 void TensorSliceProto::CopyFrom(const TensorSliceProto& from) {
471 // @@protoc_insertion_point(class_specific_copy_from_start:tensorflow.TensorSliceProto)
472 if (&from == this) return;
473 Clear();
474 MergeFrom(from);
475 }
476
IsInitialized() const477 bool TensorSliceProto::IsInitialized() const {
478 return true;
479 }
480
InternalSwap(TensorSliceProto * other)481 void TensorSliceProto::InternalSwap(TensorSliceProto* other) {
482 using std::swap;
483 _internal_metadata_.InternalSwap(&other->_internal_metadata_);
484 _impl_.extent_.InternalSwap(&other->_impl_.extent_);
485 }
486
GetTypeName() const487 std::string TensorSliceProto::GetTypeName() const {
488 return "tensorflow.TensorSliceProto";
489 }
490
491
492 // @@protoc_insertion_point(namespace_scope)
493 } // namespace tensorflow
494 PROTOBUF_NAMESPACE_OPEN
495 template<> PROTOBUF_NOINLINE ::tensorflow::TensorSliceProto_Extent*
CreateMaybeMessage(Arena * arena)496 Arena::CreateMaybeMessage< ::tensorflow::TensorSliceProto_Extent >(Arena* arena) {
497 return Arena::CreateMessageInternal< ::tensorflow::TensorSliceProto_Extent >(arena);
498 }
499 template<> PROTOBUF_NOINLINE ::tensorflow::TensorSliceProto*
CreateMaybeMessage(Arena * arena)500 Arena::CreateMaybeMessage< ::tensorflow::TensorSliceProto >(Arena* arena) {
501 return Arena::CreateMessageInternal< ::tensorflow::TensorSliceProto >(arena);
502 }
503 PROTOBUF_NAMESPACE_CLOSE
504
505 // @@protoc_insertion_point(global_scope)
506 #include <google/protobuf/port_undef.inc>
507