Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Tetragramm
GitHub Repository: Tetragramm/opencv
Path: blob/master/modules/dnn/misc/tensorflow/tensor.pb.cc
16358 views
1
// Generated by the protocol buffer compiler. DO NOT EDIT!
2
// source: tensor.proto
3
4
#include "tensor.pb.h"
5
6
#include <algorithm>
7
8
#include <google/protobuf/stubs/common.h>
9
#include <google/protobuf/stubs/port.h>
10
#include <google/protobuf/stubs/once.h>
11
#include <google/protobuf/io/coded_stream.h>
12
#include <google/protobuf/wire_format_lite_inl.h>
13
#include <google/protobuf/descriptor.h>
14
#include <google/protobuf/generated_message_reflection.h>
15
#include <google/protobuf/reflection_ops.h>
16
#include <google/protobuf/wire_format.h>
17
// This is a temporary google only hack
18
#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
19
#include "third_party/protobuf/version.h"
20
#endif
21
// @@protoc_insertion_point(includes)
22
namespace opencv_tensorflow {
23
class TensorProtoDefaultTypeInternal {
24
public:
25
::google::protobuf::internal::ExplicitlyConstructed<TensorProto>
26
_instance;
27
} _TensorProto_default_instance_;
28
} // namespace opencv_tensorflow
29
namespace protobuf_tensor_2eproto {
30
void InitDefaultsTensorProtoImpl() {
31
GOOGLE_PROTOBUF_VERIFY_VERSION;
32
33
#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
34
::google::protobuf::internal::InitProtobufDefaultsForceUnique();
35
#else
36
::google::protobuf::internal::InitProtobufDefaults();
37
#endif // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
38
protobuf_tensor_5fshape_2eproto::InitDefaultsTensorShapeProto();
39
{
40
void* ptr = &::opencv_tensorflow::_TensorProto_default_instance_;
41
new (ptr) ::opencv_tensorflow::TensorProto();
42
::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
43
}
44
::opencv_tensorflow::TensorProto::InitAsDefaultInstance();
45
}
46
47
void InitDefaultsTensorProto() {
48
static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
49
::google::protobuf::GoogleOnceInit(&once, &InitDefaultsTensorProtoImpl);
50
}
51
52
::google::protobuf::Metadata file_level_metadata[1];
53
54
const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
55
~0u, // no _has_bits_
56
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::TensorProto, _internal_metadata_),
57
~0u, // no _extensions_
58
~0u, // no _oneof_case_
59
~0u, // no _weak_field_map_
60
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::TensorProto, dtype_),
61
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::TensorProto, tensor_shape_),
62
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::TensorProto, version_number_),
63
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::TensorProto, tensor_content_),
64
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::TensorProto, half_val_),
65
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::TensorProto, float_val_),
66
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::TensorProto, double_val_),
67
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::TensorProto, int_val_),
68
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::TensorProto, string_val_),
69
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::TensorProto, scomplex_val_),
70
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::TensorProto, int64_val_),
71
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::TensorProto, bool_val_),
72
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::TensorProto, dcomplex_val_),
73
};
74
static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
75
{ 0, -1, sizeof(::opencv_tensorflow::TensorProto)},
76
};
77
78
static ::google::protobuf::Message const * const file_default_instances[] = {
79
reinterpret_cast<const ::google::protobuf::Message*>(&::opencv_tensorflow::_TensorProto_default_instance_),
80
};
81
82
void protobuf_AssignDescriptors() {
83
AddDescriptors();
84
::google::protobuf::MessageFactory* factory = NULL;
85
AssignDescriptors(
86
"tensor.proto", schemas, file_default_instances, TableStruct::offsets, factory,
87
file_level_metadata, NULL, NULL);
88
}
89
90
void protobuf_AssignDescriptorsOnce() {
91
static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
92
::google::protobuf::GoogleOnceInit(&once, &protobuf_AssignDescriptors);
93
}
94
95
void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD;
96
void protobuf_RegisterTypes(const ::std::string&) {
97
protobuf_AssignDescriptorsOnce();
98
::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 1);
99
}
100
101
void AddDescriptorsImpl() {
102
InitDefaults();
103
static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
104
"\n\014tensor.proto\022\021opencv_tensorflow\032\022tenso"
105
"r_shape.proto\032\013types.proto\"\363\002\n\013TensorPro"
106
"to\022*\n\005dtype\030\001 \001(\0162\033.opencv_tensorflow.Da"
107
"taType\0229\n\014tensor_shape\030\002 \001(\0132#.opencv_te"
108
"nsorflow.TensorShapeProto\022\026\n\016version_num"
109
"ber\030\003 \001(\005\022\026\n\016tensor_content\030\004 \001(\014\022\024\n\010hal"
110
"f_val\030\r \003(\005B\002\020\001\022\025\n\tfloat_val\030\005 \003(\002B\002\020\001\022\026"
111
"\n\ndouble_val\030\006 \003(\001B\002\020\001\022\023\n\007int_val\030\007 \003(\005B"
112
"\002\020\001\022\022\n\nstring_val\030\010 \003(\014\022\030\n\014scomplex_val\030"
113
"\t \003(\002B\002\020\001\022\025\n\tint64_val\030\n \003(\003B\002\020\001\022\024\n\010bool"
114
"_val\030\013 \003(\010B\002\020\001\022\030\n\014dcomplex_val\030\014 \003(\001B\002\020\001"
115
"B-\n\030org.tensorflow.frameworkB\014TensorProt"
116
"osP\001\370\001\001b\006proto3"
117
};
118
::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
119
descriptor, 495);
120
::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
121
"tensor.proto", &protobuf_RegisterTypes);
122
::protobuf_tensor_5fshape_2eproto::AddDescriptors();
123
::protobuf_types_2eproto::AddDescriptors();
124
}
125
126
void AddDescriptors() {
127
static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
128
::google::protobuf::GoogleOnceInit(&once, &AddDescriptorsImpl);
129
}
130
// Force AddDescriptors() to be called at dynamic initialization time.
131
struct StaticDescriptorInitializer {
132
StaticDescriptorInitializer() {
133
AddDescriptors();
134
}
135
} static_descriptor_initializer;
136
} // namespace protobuf_tensor_2eproto
137
namespace opencv_tensorflow {
138
139
// ===================================================================
140
141
void TensorProto::InitAsDefaultInstance() {
142
::opencv_tensorflow::_TensorProto_default_instance_._instance.get_mutable()->tensor_shape_ = const_cast< ::opencv_tensorflow::TensorShapeProto*>(
143
::opencv_tensorflow::TensorShapeProto::internal_default_instance());
144
}
145
void TensorProto::_slow_mutable_tensor_shape() {
146
tensor_shape_ = ::google::protobuf::Arena::CreateMessage< ::opencv_tensorflow::TensorShapeProto >(
147
GetArenaNoVirtual());
148
}
149
void TensorProto::unsafe_arena_set_allocated_tensor_shape(
150
::opencv_tensorflow::TensorShapeProto* tensor_shape) {
151
if (GetArenaNoVirtual() == NULL) {
152
delete tensor_shape_;
153
}
154
tensor_shape_ = tensor_shape;
155
if (tensor_shape) {
156
157
} else {
158
159
}
160
// @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_tensorflow.TensorProto.tensor_shape)
161
}
162
void TensorProto::clear_tensor_shape() {
163
if (GetArenaNoVirtual() == NULL && tensor_shape_ != NULL) {
164
delete tensor_shape_;
165
}
166
tensor_shape_ = NULL;
167
}
168
#if !defined(_MSC_VER) || _MSC_VER >= 1900
169
const int TensorProto::kDtypeFieldNumber;
170
const int TensorProto::kTensorShapeFieldNumber;
171
const int TensorProto::kVersionNumberFieldNumber;
172
const int TensorProto::kTensorContentFieldNumber;
173
const int TensorProto::kHalfValFieldNumber;
174
const int TensorProto::kFloatValFieldNumber;
175
const int TensorProto::kDoubleValFieldNumber;
176
const int TensorProto::kIntValFieldNumber;
177
const int TensorProto::kStringValFieldNumber;
178
const int TensorProto::kScomplexValFieldNumber;
179
const int TensorProto::kInt64ValFieldNumber;
180
const int TensorProto::kBoolValFieldNumber;
181
const int TensorProto::kDcomplexValFieldNumber;
182
#endif // !defined(_MSC_VER) || _MSC_VER >= 1900
183
184
TensorProto::TensorProto()
185
: ::google::protobuf::Message(), _internal_metadata_(NULL) {
186
if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
187
::protobuf_tensor_2eproto::InitDefaultsTensorProto();
188
}
189
SharedCtor();
190
// @@protoc_insertion_point(constructor:opencv_tensorflow.TensorProto)
191
}
192
TensorProto::TensorProto(::google::protobuf::Arena* arena)
193
: ::google::protobuf::Message(),
194
_internal_metadata_(arena),
195
float_val_(arena),
196
double_val_(arena),
197
int_val_(arena),
198
string_val_(arena),
199
scomplex_val_(arena),
200
int64_val_(arena),
201
bool_val_(arena),
202
dcomplex_val_(arena),
203
half_val_(arena) {
204
::protobuf_tensor_2eproto::InitDefaultsTensorProto();
205
SharedCtor();
206
RegisterArenaDtor(arena);
207
// @@protoc_insertion_point(arena_constructor:opencv_tensorflow.TensorProto)
208
}
209
TensorProto::TensorProto(const TensorProto& from)
210
: ::google::protobuf::Message(),
211
_internal_metadata_(NULL),
212
float_val_(from.float_val_),
213
double_val_(from.double_val_),
214
int_val_(from.int_val_),
215
string_val_(from.string_val_),
216
scomplex_val_(from.scomplex_val_),
217
int64_val_(from.int64_val_),
218
bool_val_(from.bool_val_),
219
dcomplex_val_(from.dcomplex_val_),
220
half_val_(from.half_val_),
221
_cached_size_(0) {
222
_internal_metadata_.MergeFrom(from._internal_metadata_);
223
tensor_content_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
224
if (from.tensor_content().size() > 0) {
225
tensor_content_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.tensor_content(),
226
GetArenaNoVirtual());
227
}
228
if (from.has_tensor_shape()) {
229
tensor_shape_ = new ::opencv_tensorflow::TensorShapeProto(*from.tensor_shape_);
230
} else {
231
tensor_shape_ = NULL;
232
}
233
::memcpy(&dtype_, &from.dtype_,
234
static_cast<size_t>(reinterpret_cast<char*>(&version_number_) -
235
reinterpret_cast<char*>(&dtype_)) + sizeof(version_number_));
236
// @@protoc_insertion_point(copy_constructor:opencv_tensorflow.TensorProto)
237
}
238
239
void TensorProto::SharedCtor() {
240
tensor_content_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
241
::memset(&tensor_shape_, 0, static_cast<size_t>(
242
reinterpret_cast<char*>(&version_number_) -
243
reinterpret_cast<char*>(&tensor_shape_)) + sizeof(version_number_));
244
_cached_size_ = 0;
245
}
246
247
TensorProto::~TensorProto() {
248
// @@protoc_insertion_point(destructor:opencv_tensorflow.TensorProto)
249
SharedDtor();
250
}
251
252
void TensorProto::SharedDtor() {
253
GOOGLE_DCHECK(GetArenaNoVirtual() == NULL);
254
tensor_content_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
255
if (this != internal_default_instance()) delete tensor_shape_;
256
}
257
258
void TensorProto::ArenaDtor(void* object) {
259
TensorProto* _this = reinterpret_cast< TensorProto* >(object);
260
(void)_this;
261
}
262
void TensorProto::RegisterArenaDtor(::google::protobuf::Arena* arena) {
263
}
264
void TensorProto::SetCachedSize(int size) const {
265
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
266
_cached_size_ = size;
267
GOOGLE_SAFE_CONCURRENT_WRITES_END();
268
}
269
const ::google::protobuf::Descriptor* TensorProto::descriptor() {
270
::protobuf_tensor_2eproto::protobuf_AssignDescriptorsOnce();
271
return ::protobuf_tensor_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
272
}
273
274
const TensorProto& TensorProto::default_instance() {
275
::protobuf_tensor_2eproto::InitDefaultsTensorProto();
276
return *internal_default_instance();
277
}
278
279
TensorProto* TensorProto::New(::google::protobuf::Arena* arena) const {
280
return ::google::protobuf::Arena::CreateMessage<TensorProto>(arena);
281
}
282
283
void TensorProto::Clear() {
284
// @@protoc_insertion_point(message_clear_start:opencv_tensorflow.TensorProto)
285
::google::protobuf::uint32 cached_has_bits = 0;
286
// Prevent compiler warnings about cached_has_bits being unused
287
(void) cached_has_bits;
288
289
float_val_.Clear();
290
double_val_.Clear();
291
int_val_.Clear();
292
string_val_.Clear();
293
scomplex_val_.Clear();
294
int64_val_.Clear();
295
bool_val_.Clear();
296
dcomplex_val_.Clear();
297
half_val_.Clear();
298
tensor_content_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
299
if (GetArenaNoVirtual() == NULL && tensor_shape_ != NULL) {
300
delete tensor_shape_;
301
}
302
tensor_shape_ = NULL;
303
::memset(&dtype_, 0, static_cast<size_t>(
304
reinterpret_cast<char*>(&version_number_) -
305
reinterpret_cast<char*>(&dtype_)) + sizeof(version_number_));
306
_internal_metadata_.Clear();
307
}
308
309
bool TensorProto::MergePartialFromCodedStream(
310
::google::protobuf::io::CodedInputStream* input) {
311
#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
312
::google::protobuf::uint32 tag;
313
// @@protoc_insertion_point(parse_start:opencv_tensorflow.TensorProto)
314
for (;;) {
315
::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
316
tag = p.first;
317
if (!p.second) goto handle_unusual;
318
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
319
// .opencv_tensorflow.DataType dtype = 1;
320
case 1: {
321
if (static_cast< ::google::protobuf::uint8>(tag) ==
322
static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) {
323
int value;
324
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
325
int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
326
input, &value)));
327
set_dtype(static_cast< ::opencv_tensorflow::DataType >(value));
328
} else {
329
goto handle_unusual;
330
}
331
break;
332
}
333
334
// .opencv_tensorflow.TensorShapeProto tensor_shape = 2;
335
case 2: {
336
if (static_cast< ::google::protobuf::uint8>(tag) ==
337
static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) {
338
DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
339
input, mutable_tensor_shape()));
340
} else {
341
goto handle_unusual;
342
}
343
break;
344
}
345
346
// int32 version_number = 3;
347
case 3: {
348
if (static_cast< ::google::protobuf::uint8>(tag) ==
349
static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) {
350
351
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
352
::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
353
input, &version_number_)));
354
} else {
355
goto handle_unusual;
356
}
357
break;
358
}
359
360
// bytes tensor_content = 4;
361
case 4: {
362
if (static_cast< ::google::protobuf::uint8>(tag) ==
363
static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) {
364
DO_(::google::protobuf::internal::WireFormatLite::ReadBytes(
365
input, this->mutable_tensor_content()));
366
} else {
367
goto handle_unusual;
368
}
369
break;
370
}
371
372
// repeated float float_val = 5 [packed = true];
373
case 5: {
374
if (static_cast< ::google::protobuf::uint8>(tag) ==
375
static_cast< ::google::protobuf::uint8>(42u /* 42 & 0xFF */)) {
376
DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive<
377
float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
378
input, this->mutable_float_val())));
379
} else if (
380
static_cast< ::google::protobuf::uint8>(tag) ==
381
static_cast< ::google::protobuf::uint8>(45u /* 45 & 0xFF */)) {
382
DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline<
383
float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
384
1, 42u, input, this->mutable_float_val())));
385
} else {
386
goto handle_unusual;
387
}
388
break;
389
}
390
391
// repeated double double_val = 6 [packed = true];
392
case 6: {
393
if (static_cast< ::google::protobuf::uint8>(tag) ==
394
static_cast< ::google::protobuf::uint8>(50u /* 50 & 0xFF */)) {
395
DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive<
396
double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>(
397
input, this->mutable_double_val())));
398
} else if (
399
static_cast< ::google::protobuf::uint8>(tag) ==
400
static_cast< ::google::protobuf::uint8>(49u /* 49 & 0xFF */)) {
401
DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline<
402
double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>(
403
1, 50u, input, this->mutable_double_val())));
404
} else {
405
goto handle_unusual;
406
}
407
break;
408
}
409
410
// repeated int32 int_val = 7 [packed = true];
411
case 7: {
412
if (static_cast< ::google::protobuf::uint8>(tag) ==
413
static_cast< ::google::protobuf::uint8>(58u /* 58 & 0xFF */)) {
414
DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive<
415
::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
416
input, this->mutable_int_val())));
417
} else if (
418
static_cast< ::google::protobuf::uint8>(tag) ==
419
static_cast< ::google::protobuf::uint8>(56u /* 56 & 0xFF */)) {
420
DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline<
421
::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
422
1, 58u, input, this->mutable_int_val())));
423
} else {
424
goto handle_unusual;
425
}
426
break;
427
}
428
429
// repeated bytes string_val = 8;
430
case 8: {
431
if (static_cast< ::google::protobuf::uint8>(tag) ==
432
static_cast< ::google::protobuf::uint8>(66u /* 66 & 0xFF */)) {
433
DO_(::google::protobuf::internal::WireFormatLite::ReadBytes(
434
input, this->add_string_val()));
435
} else {
436
goto handle_unusual;
437
}
438
break;
439
}
440
441
// repeated float scomplex_val = 9 [packed = true];
442
case 9: {
443
if (static_cast< ::google::protobuf::uint8>(tag) ==
444
static_cast< ::google::protobuf::uint8>(74u /* 74 & 0xFF */)) {
445
DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive<
446
float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
447
input, this->mutable_scomplex_val())));
448
} else if (
449
static_cast< ::google::protobuf::uint8>(tag) ==
450
static_cast< ::google::protobuf::uint8>(77u /* 77 & 0xFF */)) {
451
DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline<
452
float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
453
1, 74u, input, this->mutable_scomplex_val())));
454
} else {
455
goto handle_unusual;
456
}
457
break;
458
}
459
460
// repeated int64 int64_val = 10 [packed = true];
461
case 10: {
462
if (static_cast< ::google::protobuf::uint8>(tag) ==
463
static_cast< ::google::protobuf::uint8>(82u /* 82 & 0xFF */)) {
464
DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive<
465
::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>(
466
input, this->mutable_int64_val())));
467
} else if (
468
static_cast< ::google::protobuf::uint8>(tag) ==
469
static_cast< ::google::protobuf::uint8>(80u /* 80 & 0xFF */)) {
470
DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline<
471
::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>(
472
1, 82u, input, this->mutable_int64_val())));
473
} else {
474
goto handle_unusual;
475
}
476
break;
477
}
478
479
// repeated bool bool_val = 11 [packed = true];
480
case 11: {
481
if (static_cast< ::google::protobuf::uint8>(tag) ==
482
static_cast< ::google::protobuf::uint8>(90u /* 90 & 0xFF */)) {
483
DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive<
484
bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
485
input, this->mutable_bool_val())));
486
} else if (
487
static_cast< ::google::protobuf::uint8>(tag) ==
488
static_cast< ::google::protobuf::uint8>(88u /* 88 & 0xFF */)) {
489
DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline<
490
bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
491
1, 90u, input, this->mutable_bool_val())));
492
} else {
493
goto handle_unusual;
494
}
495
break;
496
}
497
498
// repeated double dcomplex_val = 12 [packed = true];
499
case 12: {
500
if (static_cast< ::google::protobuf::uint8>(tag) ==
501
static_cast< ::google::protobuf::uint8>(98u /* 98 & 0xFF */)) {
502
DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive<
503
double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>(
504
input, this->mutable_dcomplex_val())));
505
} else if (
506
static_cast< ::google::protobuf::uint8>(tag) ==
507
static_cast< ::google::protobuf::uint8>(97u /* 97 & 0xFF */)) {
508
DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline<
509
double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>(
510
1, 98u, input, this->mutable_dcomplex_val())));
511
} else {
512
goto handle_unusual;
513
}
514
break;
515
}
516
517
// repeated int32 half_val = 13 [packed = true];
518
case 13: {
519
if (static_cast< ::google::protobuf::uint8>(tag) ==
520
static_cast< ::google::protobuf::uint8>(106u /* 106 & 0xFF */)) {
521
DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive<
522
::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
523
input, this->mutable_half_val())));
524
} else if (
525
static_cast< ::google::protobuf::uint8>(tag) ==
526
static_cast< ::google::protobuf::uint8>(104u /* 104 & 0xFF */)) {
527
DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline<
528
::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
529
1, 106u, input, this->mutable_half_val())));
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_(::google::protobuf::internal::WireFormat::SkipField(
542
input, tag, _internal_metadata_.mutable_unknown_fields()));
543
break;
544
}
545
}
546
}
547
success:
548
// @@protoc_insertion_point(parse_success:opencv_tensorflow.TensorProto)
549
return true;
550
failure:
551
// @@protoc_insertion_point(parse_failure:opencv_tensorflow.TensorProto)
552
return false;
553
#undef DO_
554
}
555
556
void TensorProto::SerializeWithCachedSizes(
557
::google::protobuf::io::CodedOutputStream* output) const {
558
// @@protoc_insertion_point(serialize_start:opencv_tensorflow.TensorProto)
559
::google::protobuf::uint32 cached_has_bits = 0;
560
(void) cached_has_bits;
561
562
// .opencv_tensorflow.DataType dtype = 1;
563
if (this->dtype() != 0) {
564
::google::protobuf::internal::WireFormatLite::WriteEnum(
565
1, this->dtype(), output);
566
}
567
568
// .opencv_tensorflow.TensorShapeProto tensor_shape = 2;
569
if (this->has_tensor_shape()) {
570
::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
571
2, *this->tensor_shape_, output);
572
}
573
574
// int32 version_number = 3;
575
if (this->version_number() != 0) {
576
::google::protobuf::internal::WireFormatLite::WriteInt32(3, this->version_number(), output);
577
}
578
579
// bytes tensor_content = 4;
580
if (this->tensor_content().size() > 0) {
581
::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased(
582
4, this->tensor_content(), output);
583
}
584
585
// repeated float float_val = 5 [packed = true];
586
if (this->float_val_size() > 0) {
587
::google::protobuf::internal::WireFormatLite::WriteTag(5, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output);
588
output->WriteVarint32(static_cast< ::google::protobuf::uint32>(
589
_float_val_cached_byte_size_));
590
::google::protobuf::internal::WireFormatLite::WriteFloatArray(
591
this->float_val().data(), this->float_val_size(), output);
592
}
593
594
// repeated double double_val = 6 [packed = true];
595
if (this->double_val_size() > 0) {
596
::google::protobuf::internal::WireFormatLite::WriteTag(6, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output);
597
output->WriteVarint32(static_cast< ::google::protobuf::uint32>(
598
_double_val_cached_byte_size_));
599
::google::protobuf::internal::WireFormatLite::WriteDoubleArray(
600
this->double_val().data(), this->double_val_size(), output);
601
}
602
603
// repeated int32 int_val = 7 [packed = true];
604
if (this->int_val_size() > 0) {
605
::google::protobuf::internal::WireFormatLite::WriteTag(7, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output);
606
output->WriteVarint32(static_cast< ::google::protobuf::uint32>(
607
_int_val_cached_byte_size_));
608
}
609
for (int i = 0, n = this->int_val_size(); i < n; i++) {
610
::google::protobuf::internal::WireFormatLite::WriteInt32NoTag(
611
this->int_val(i), output);
612
}
613
614
// repeated bytes string_val = 8;
615
for (int i = 0, n = this->string_val_size(); i < n; i++) {
616
::google::protobuf::internal::WireFormatLite::WriteBytes(
617
8, this->string_val(i), output);
618
}
619
620
// repeated float scomplex_val = 9 [packed = true];
621
if (this->scomplex_val_size() > 0) {
622
::google::protobuf::internal::WireFormatLite::WriteTag(9, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output);
623
output->WriteVarint32(static_cast< ::google::protobuf::uint32>(
624
_scomplex_val_cached_byte_size_));
625
::google::protobuf::internal::WireFormatLite::WriteFloatArray(
626
this->scomplex_val().data(), this->scomplex_val_size(), output);
627
}
628
629
// repeated int64 int64_val = 10 [packed = true];
630
if (this->int64_val_size() > 0) {
631
::google::protobuf::internal::WireFormatLite::WriteTag(10, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output);
632
output->WriteVarint32(static_cast< ::google::protobuf::uint32>(
633
_int64_val_cached_byte_size_));
634
}
635
for (int i = 0, n = this->int64_val_size(); i < n; i++) {
636
::google::protobuf::internal::WireFormatLite::WriteInt64NoTag(
637
this->int64_val(i), output);
638
}
639
640
// repeated bool bool_val = 11 [packed = true];
641
if (this->bool_val_size() > 0) {
642
::google::protobuf::internal::WireFormatLite::WriteTag(11, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output);
643
output->WriteVarint32(static_cast< ::google::protobuf::uint32>(
644
_bool_val_cached_byte_size_));
645
::google::protobuf::internal::WireFormatLite::WriteBoolArray(
646
this->bool_val().data(), this->bool_val_size(), output);
647
}
648
649
// repeated double dcomplex_val = 12 [packed = true];
650
if (this->dcomplex_val_size() > 0) {
651
::google::protobuf::internal::WireFormatLite::WriteTag(12, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output);
652
output->WriteVarint32(static_cast< ::google::protobuf::uint32>(
653
_dcomplex_val_cached_byte_size_));
654
::google::protobuf::internal::WireFormatLite::WriteDoubleArray(
655
this->dcomplex_val().data(), this->dcomplex_val_size(), output);
656
}
657
658
// repeated int32 half_val = 13 [packed = true];
659
if (this->half_val_size() > 0) {
660
::google::protobuf::internal::WireFormatLite::WriteTag(13, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output);
661
output->WriteVarint32(static_cast< ::google::protobuf::uint32>(
662
_half_val_cached_byte_size_));
663
}
664
for (int i = 0, n = this->half_val_size(); i < n; i++) {
665
::google::protobuf::internal::WireFormatLite::WriteInt32NoTag(
666
this->half_val(i), output);
667
}
668
669
if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
670
::google::protobuf::internal::WireFormat::SerializeUnknownFields(
671
(::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output);
672
}
673
// @@protoc_insertion_point(serialize_end:opencv_tensorflow.TensorProto)
674
}
675
676
::google::protobuf::uint8* TensorProto::InternalSerializeWithCachedSizesToArray(
677
bool deterministic, ::google::protobuf::uint8* target) const {
678
(void)deterministic; // Unused
679
// @@protoc_insertion_point(serialize_to_array_start:opencv_tensorflow.TensorProto)
680
::google::protobuf::uint32 cached_has_bits = 0;
681
(void) cached_has_bits;
682
683
// .opencv_tensorflow.DataType dtype = 1;
684
if (this->dtype() != 0) {
685
target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
686
1, this->dtype(), target);
687
}
688
689
// .opencv_tensorflow.TensorShapeProto tensor_shape = 2;
690
if (this->has_tensor_shape()) {
691
target = ::google::protobuf::internal::WireFormatLite::
692
InternalWriteMessageToArray(
693
2, *this->tensor_shape_, deterministic, target);
694
}
695
696
// int32 version_number = 3;
697
if (this->version_number() != 0) {
698
target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(3, this->version_number(), target);
699
}
700
701
// bytes tensor_content = 4;
702
if (this->tensor_content().size() > 0) {
703
target =
704
::google::protobuf::internal::WireFormatLite::WriteBytesToArray(
705
4, this->tensor_content(), target);
706
}
707
708
// repeated float float_val = 5 [packed = true];
709
if (this->float_val_size() > 0) {
710
target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray(
711
5,
712
::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED,
713
target);
714
target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray(
715
static_cast< ::google::protobuf::int32>(
716
_float_val_cached_byte_size_), target);
717
target = ::google::protobuf::internal::WireFormatLite::
718
WriteFloatNoTagToArray(this->float_val_, target);
719
}
720
721
// repeated double double_val = 6 [packed = true];
722
if (this->double_val_size() > 0) {
723
target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray(
724
6,
725
::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED,
726
target);
727
target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray(
728
static_cast< ::google::protobuf::int32>(
729
_double_val_cached_byte_size_), target);
730
target = ::google::protobuf::internal::WireFormatLite::
731
WriteDoubleNoTagToArray(this->double_val_, target);
732
}
733
734
// repeated int32 int_val = 7 [packed = true];
735
if (this->int_val_size() > 0) {
736
target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray(
737
7,
738
::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED,
739
target);
740
target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray(
741
static_cast< ::google::protobuf::int32>(
742
_int_val_cached_byte_size_), target);
743
target = ::google::protobuf::internal::WireFormatLite::
744
WriteInt32NoTagToArray(this->int_val_, target);
745
}
746
747
// repeated bytes string_val = 8;
748
for (int i = 0, n = this->string_val_size(); i < n; i++) {
749
target = ::google::protobuf::internal::WireFormatLite::
750
WriteBytesToArray(8, this->string_val(i), target);
751
}
752
753
// repeated float scomplex_val = 9 [packed = true];
754
if (this->scomplex_val_size() > 0) {
755
target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray(
756
9,
757
::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED,
758
target);
759
target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray(
760
static_cast< ::google::protobuf::int32>(
761
_scomplex_val_cached_byte_size_), target);
762
target = ::google::protobuf::internal::WireFormatLite::
763
WriteFloatNoTagToArray(this->scomplex_val_, target);
764
}
765
766
// repeated int64 int64_val = 10 [packed = true];
767
if (this->int64_val_size() > 0) {
768
target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray(
769
10,
770
::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED,
771
target);
772
target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray(
773
static_cast< ::google::protobuf::int32>(
774
_int64_val_cached_byte_size_), target);
775
target = ::google::protobuf::internal::WireFormatLite::
776
WriteInt64NoTagToArray(this->int64_val_, target);
777
}
778
779
// repeated bool bool_val = 11 [packed = true];
780
if (this->bool_val_size() > 0) {
781
target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray(
782
11,
783
::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED,
784
target);
785
target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray(
786
static_cast< ::google::protobuf::int32>(
787
_bool_val_cached_byte_size_), target);
788
target = ::google::protobuf::internal::WireFormatLite::
789
WriteBoolNoTagToArray(this->bool_val_, target);
790
}
791
792
// repeated double dcomplex_val = 12 [packed = true];
793
if (this->dcomplex_val_size() > 0) {
794
target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray(
795
12,
796
::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED,
797
target);
798
target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray(
799
static_cast< ::google::protobuf::int32>(
800
_dcomplex_val_cached_byte_size_), target);
801
target = ::google::protobuf::internal::WireFormatLite::
802
WriteDoubleNoTagToArray(this->dcomplex_val_, target);
803
}
804
805
// repeated int32 half_val = 13 [packed = true];
806
if (this->half_val_size() > 0) {
807
target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray(
808
13,
809
::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED,
810
target);
811
target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray(
812
static_cast< ::google::protobuf::int32>(
813
_half_val_cached_byte_size_), target);
814
target = ::google::protobuf::internal::WireFormatLite::
815
WriteInt32NoTagToArray(this->half_val_, target);
816
}
817
818
if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
819
target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
820
(::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target);
821
}
822
// @@protoc_insertion_point(serialize_to_array_end:opencv_tensorflow.TensorProto)
823
return target;
824
}
825
826
size_t TensorProto::ByteSizeLong() const {
827
// @@protoc_insertion_point(message_byte_size_start:opencv_tensorflow.TensorProto)
828
size_t total_size = 0;
829
830
if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
831
total_size +=
832
::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
833
(::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()));
834
}
835
// repeated float float_val = 5 [packed = true];
836
{
837
unsigned int count = static_cast<unsigned int>(this->float_val_size());
838
size_t data_size = 4UL * count;
839
if (data_size > 0) {
840
total_size += 1 +
841
::google::protobuf::internal::WireFormatLite::Int32Size(
842
static_cast< ::google::protobuf::int32>(data_size));
843
}
844
int cached_size = ::google::protobuf::internal::ToCachedSize(data_size);
845
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
846
_float_val_cached_byte_size_ = cached_size;
847
GOOGLE_SAFE_CONCURRENT_WRITES_END();
848
total_size += data_size;
849
}
850
851
// repeated double double_val = 6 [packed = true];
852
{
853
unsigned int count = static_cast<unsigned int>(this->double_val_size());
854
size_t data_size = 8UL * count;
855
if (data_size > 0) {
856
total_size += 1 +
857
::google::protobuf::internal::WireFormatLite::Int32Size(
858
static_cast< ::google::protobuf::int32>(data_size));
859
}
860
int cached_size = ::google::protobuf::internal::ToCachedSize(data_size);
861
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
862
_double_val_cached_byte_size_ = cached_size;
863
GOOGLE_SAFE_CONCURRENT_WRITES_END();
864
total_size += data_size;
865
}
866
867
// repeated int32 int_val = 7 [packed = true];
868
{
869
size_t data_size = ::google::protobuf::internal::WireFormatLite::
870
Int32Size(this->int_val_);
871
if (data_size > 0) {
872
total_size += 1 +
873
::google::protobuf::internal::WireFormatLite::Int32Size(
874
static_cast< ::google::protobuf::int32>(data_size));
875
}
876
int cached_size = ::google::protobuf::internal::ToCachedSize(data_size);
877
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
878
_int_val_cached_byte_size_ = cached_size;
879
GOOGLE_SAFE_CONCURRENT_WRITES_END();
880
total_size += data_size;
881
}
882
883
// repeated bytes string_val = 8;
884
total_size += 1 *
885
::google::protobuf::internal::FromIntSize(this->string_val_size());
886
for (int i = 0, n = this->string_val_size(); i < n; i++) {
887
total_size += ::google::protobuf::internal::WireFormatLite::BytesSize(
888
this->string_val(i));
889
}
890
891
// repeated float scomplex_val = 9 [packed = true];
892
{
893
unsigned int count = static_cast<unsigned int>(this->scomplex_val_size());
894
size_t data_size = 4UL * count;
895
if (data_size > 0) {
896
total_size += 1 +
897
::google::protobuf::internal::WireFormatLite::Int32Size(
898
static_cast< ::google::protobuf::int32>(data_size));
899
}
900
int cached_size = ::google::protobuf::internal::ToCachedSize(data_size);
901
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
902
_scomplex_val_cached_byte_size_ = cached_size;
903
GOOGLE_SAFE_CONCURRENT_WRITES_END();
904
total_size += data_size;
905
}
906
907
// repeated int64 int64_val = 10 [packed = true];
908
{
909
size_t data_size = ::google::protobuf::internal::WireFormatLite::
910
Int64Size(this->int64_val_);
911
if (data_size > 0) {
912
total_size += 1 +
913
::google::protobuf::internal::WireFormatLite::Int32Size(
914
static_cast< ::google::protobuf::int32>(data_size));
915
}
916
int cached_size = ::google::protobuf::internal::ToCachedSize(data_size);
917
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
918
_int64_val_cached_byte_size_ = cached_size;
919
GOOGLE_SAFE_CONCURRENT_WRITES_END();
920
total_size += data_size;
921
}
922
923
// repeated bool bool_val = 11 [packed = true];
924
{
925
unsigned int count = static_cast<unsigned int>(this->bool_val_size());
926
size_t data_size = 1UL * count;
927
if (data_size > 0) {
928
total_size += 1 +
929
::google::protobuf::internal::WireFormatLite::Int32Size(
930
static_cast< ::google::protobuf::int32>(data_size));
931
}
932
int cached_size = ::google::protobuf::internal::ToCachedSize(data_size);
933
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
934
_bool_val_cached_byte_size_ = cached_size;
935
GOOGLE_SAFE_CONCURRENT_WRITES_END();
936
total_size += data_size;
937
}
938
939
// repeated double dcomplex_val = 12 [packed = true];
940
{
941
unsigned int count = static_cast<unsigned int>(this->dcomplex_val_size());
942
size_t data_size = 8UL * count;
943
if (data_size > 0) {
944
total_size += 1 +
945
::google::protobuf::internal::WireFormatLite::Int32Size(
946
static_cast< ::google::protobuf::int32>(data_size));
947
}
948
int cached_size = ::google::protobuf::internal::ToCachedSize(data_size);
949
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
950
_dcomplex_val_cached_byte_size_ = cached_size;
951
GOOGLE_SAFE_CONCURRENT_WRITES_END();
952
total_size += data_size;
953
}
954
955
// repeated int32 half_val = 13 [packed = true];
956
{
957
size_t data_size = ::google::protobuf::internal::WireFormatLite::
958
Int32Size(this->half_val_);
959
if (data_size > 0) {
960
total_size += 1 +
961
::google::protobuf::internal::WireFormatLite::Int32Size(
962
static_cast< ::google::protobuf::int32>(data_size));
963
}
964
int cached_size = ::google::protobuf::internal::ToCachedSize(data_size);
965
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
966
_half_val_cached_byte_size_ = cached_size;
967
GOOGLE_SAFE_CONCURRENT_WRITES_END();
968
total_size += data_size;
969
}
970
971
// bytes tensor_content = 4;
972
if (this->tensor_content().size() > 0) {
973
total_size += 1 +
974
::google::protobuf::internal::WireFormatLite::BytesSize(
975
this->tensor_content());
976
}
977
978
// .opencv_tensorflow.TensorShapeProto tensor_shape = 2;
979
if (this->has_tensor_shape()) {
980
total_size += 1 +
981
::google::protobuf::internal::WireFormatLite::MessageSize(
982
*this->tensor_shape_);
983
}
984
985
// .opencv_tensorflow.DataType dtype = 1;
986
if (this->dtype() != 0) {
987
total_size += 1 +
988
::google::protobuf::internal::WireFormatLite::EnumSize(this->dtype());
989
}
990
991
// int32 version_number = 3;
992
if (this->version_number() != 0) {
993
total_size += 1 +
994
::google::protobuf::internal::WireFormatLite::Int32Size(
995
this->version_number());
996
}
997
998
int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
999
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
1000
_cached_size_ = cached_size;
1001
GOOGLE_SAFE_CONCURRENT_WRITES_END();
1002
return total_size;
1003
}
1004
1005
void TensorProto::MergeFrom(const ::google::protobuf::Message& from) {
1006
// @@protoc_insertion_point(generalized_merge_from_start:opencv_tensorflow.TensorProto)
1007
GOOGLE_DCHECK_NE(&from, this);
1008
const TensorProto* source =
1009
::google::protobuf::internal::DynamicCastToGenerated<const TensorProto>(
1010
&from);
1011
if (source == NULL) {
1012
// @@protoc_insertion_point(generalized_merge_from_cast_fail:opencv_tensorflow.TensorProto)
1013
::google::protobuf::internal::ReflectionOps::Merge(from, this);
1014
} else {
1015
// @@protoc_insertion_point(generalized_merge_from_cast_success:opencv_tensorflow.TensorProto)
1016
MergeFrom(*source);
1017
}
1018
}
1019
1020
void TensorProto::MergeFrom(const TensorProto& from) {
1021
// @@protoc_insertion_point(class_specific_merge_from_start:opencv_tensorflow.TensorProto)
1022
GOOGLE_DCHECK_NE(&from, this);
1023
_internal_metadata_.MergeFrom(from._internal_metadata_);
1024
::google::protobuf::uint32 cached_has_bits = 0;
1025
(void) cached_has_bits;
1026
1027
float_val_.MergeFrom(from.float_val_);
1028
double_val_.MergeFrom(from.double_val_);
1029
int_val_.MergeFrom(from.int_val_);
1030
string_val_.MergeFrom(from.string_val_);
1031
scomplex_val_.MergeFrom(from.scomplex_val_);
1032
int64_val_.MergeFrom(from.int64_val_);
1033
bool_val_.MergeFrom(from.bool_val_);
1034
dcomplex_val_.MergeFrom(from.dcomplex_val_);
1035
half_val_.MergeFrom(from.half_val_);
1036
if (from.tensor_content().size() > 0) {
1037
set_tensor_content(from.tensor_content());
1038
}
1039
if (from.has_tensor_shape()) {
1040
mutable_tensor_shape()->::opencv_tensorflow::TensorShapeProto::MergeFrom(from.tensor_shape());
1041
}
1042
if (from.dtype() != 0) {
1043
set_dtype(from.dtype());
1044
}
1045
if (from.version_number() != 0) {
1046
set_version_number(from.version_number());
1047
}
1048
}
1049
1050
void TensorProto::CopyFrom(const ::google::protobuf::Message& from) {
1051
// @@protoc_insertion_point(generalized_copy_from_start:opencv_tensorflow.TensorProto)
1052
if (&from == this) return;
1053
Clear();
1054
MergeFrom(from);
1055
}
1056
1057
void TensorProto::CopyFrom(const TensorProto& from) {
1058
// @@protoc_insertion_point(class_specific_copy_from_start:opencv_tensorflow.TensorProto)
1059
if (&from == this) return;
1060
Clear();
1061
MergeFrom(from);
1062
}
1063
1064
bool TensorProto::IsInitialized() const {
1065
return true;
1066
}
1067
1068
void TensorProto::Swap(TensorProto* other) {
1069
if (other == this) return;
1070
if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) {
1071
InternalSwap(other);
1072
} else {
1073
TensorProto* temp = New(GetArenaNoVirtual());
1074
temp->MergeFrom(*other);
1075
other->CopyFrom(*this);
1076
InternalSwap(temp);
1077
if (GetArenaNoVirtual() == NULL) {
1078
delete temp;
1079
}
1080
}
1081
}
1082
void TensorProto::UnsafeArenaSwap(TensorProto* other) {
1083
if (other == this) return;
1084
GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual());
1085
InternalSwap(other);
1086
}
1087
void TensorProto::InternalSwap(TensorProto* other) {
1088
using std::swap;
1089
float_val_.InternalSwap(&other->float_val_);
1090
double_val_.InternalSwap(&other->double_val_);
1091
int_val_.InternalSwap(&other->int_val_);
1092
string_val_.InternalSwap(&other->string_val_);
1093
scomplex_val_.InternalSwap(&other->scomplex_val_);
1094
int64_val_.InternalSwap(&other->int64_val_);
1095
bool_val_.InternalSwap(&other->bool_val_);
1096
dcomplex_val_.InternalSwap(&other->dcomplex_val_);
1097
half_val_.InternalSwap(&other->half_val_);
1098
tensor_content_.Swap(&other->tensor_content_);
1099
swap(tensor_shape_, other->tensor_shape_);
1100
swap(dtype_, other->dtype_);
1101
swap(version_number_, other->version_number_);
1102
_internal_metadata_.Swap(&other->_internal_metadata_);
1103
swap(_cached_size_, other->_cached_size_);
1104
}
1105
1106
::google::protobuf::Metadata TensorProto::GetMetadata() const {
1107
protobuf_tensor_2eproto::protobuf_AssignDescriptorsOnce();
1108
return ::protobuf_tensor_2eproto::file_level_metadata[kIndexInFileMessages];
1109
}
1110
1111
1112
// @@protoc_insertion_point(namespace_scope)
1113
} // namespace opencv_tensorflow
1114
1115
// @@protoc_insertion_point(global_scope)
1116
1117