tensor.pb.cc 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751
  1. // Generated by the protocol buffer compiler. DO NOT EDIT!
  2. // source: tensor.proto
  3. #include "tensor.pb.h"
  4. #include <algorithm>
  5. #include <google/protobuf/io/coded_stream.h>
  6. #include <google/protobuf/extension_set.h>
  7. #include <google/protobuf/wire_format_lite.h>
  8. #include <google/protobuf/descriptor.h>
  9. #include <google/protobuf/generated_message_reflection.h>
  10. #include <google/protobuf/reflection_ops.h>
  11. #include <google/protobuf/wire_format.h>
  12. // @@protoc_insertion_point(includes)
  13. #include <google/protobuf/port_def.inc>
  14. PROTOBUF_PRAGMA_INIT_SEG
  15. namespace opencv_tensorflow {
  16. constexpr TensorProto::TensorProto(
  17. ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
  18. : float_val_()
  19. , double_val_()
  20. , int_val_()
  21. , _int_val_cached_byte_size_(0)
  22. , string_val_()
  23. , scomplex_val_()
  24. , int64_val_()
  25. , _int64_val_cached_byte_size_(0)
  26. , bool_val_()
  27. , dcomplex_val_()
  28. , half_val_()
  29. , _half_val_cached_byte_size_(0)
  30. , tensor_content_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
  31. , tensor_shape_(nullptr)
  32. , dtype_(0)
  33. , version_number_(0){}
  34. struct TensorProtoDefaultTypeInternal {
  35. constexpr TensorProtoDefaultTypeInternal()
  36. : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
  37. ~TensorProtoDefaultTypeInternal() {}
  38. union {
  39. TensorProto _instance;
  40. };
  41. };
  42. PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT TensorProtoDefaultTypeInternal _TensorProto_default_instance_;
  43. } // namespace opencv_tensorflow
  44. static ::PROTOBUF_NAMESPACE_ID::Metadata file_level_metadata_tensor_2eproto[1];
  45. static constexpr ::PROTOBUF_NAMESPACE_ID::EnumDescriptor const** file_level_enum_descriptors_tensor_2eproto = nullptr;
  46. static constexpr ::PROTOBUF_NAMESPACE_ID::ServiceDescriptor const** file_level_service_descriptors_tensor_2eproto = nullptr;
  47. const uint32_t TableStruct_tensor_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
  48. ~0u, // no _has_bits_
  49. PROTOBUF_FIELD_OFFSET(::opencv_tensorflow::TensorProto, _internal_metadata_),
  50. ~0u, // no _extensions_
  51. ~0u, // no _oneof_case_
  52. ~0u, // no _weak_field_map_
  53. ~0u, // no _inlined_string_donated_
  54. PROTOBUF_FIELD_OFFSET(::opencv_tensorflow::TensorProto, dtype_),
  55. PROTOBUF_FIELD_OFFSET(::opencv_tensorflow::TensorProto, tensor_shape_),
  56. PROTOBUF_FIELD_OFFSET(::opencv_tensorflow::TensorProto, version_number_),
  57. PROTOBUF_FIELD_OFFSET(::opencv_tensorflow::TensorProto, tensor_content_),
  58. PROTOBUF_FIELD_OFFSET(::opencv_tensorflow::TensorProto, half_val_),
  59. PROTOBUF_FIELD_OFFSET(::opencv_tensorflow::TensorProto, float_val_),
  60. PROTOBUF_FIELD_OFFSET(::opencv_tensorflow::TensorProto, double_val_),
  61. PROTOBUF_FIELD_OFFSET(::opencv_tensorflow::TensorProto, int_val_),
  62. PROTOBUF_FIELD_OFFSET(::opencv_tensorflow::TensorProto, string_val_),
  63. PROTOBUF_FIELD_OFFSET(::opencv_tensorflow::TensorProto, scomplex_val_),
  64. PROTOBUF_FIELD_OFFSET(::opencv_tensorflow::TensorProto, int64_val_),
  65. PROTOBUF_FIELD_OFFSET(::opencv_tensorflow::TensorProto, bool_val_),
  66. PROTOBUF_FIELD_OFFSET(::opencv_tensorflow::TensorProto, dcomplex_val_),
  67. };
  68. static const ::PROTOBUF_NAMESPACE_ID::internal::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
  69. { 0, -1, -1, sizeof(::opencv_tensorflow::TensorProto)},
  70. };
  71. static ::PROTOBUF_NAMESPACE_ID::Message const * const file_default_instances[] = {
  72. reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::opencv_tensorflow::_TensorProto_default_instance_),
  73. };
  74. const char descriptor_table_protodef_tensor_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) =
  75. "\n\014tensor.proto\022\021opencv_tensorflow\032\022tenso"
  76. "r_shape.proto\032\013types.proto\"\363\002\n\013TensorPro"
  77. "to\022*\n\005dtype\030\001 \001(\0162\033.opencv_tensorflow.Da"
  78. "taType\0229\n\014tensor_shape\030\002 \001(\0132#.opencv_te"
  79. "nsorflow.TensorShapeProto\022\026\n\016version_num"
  80. "ber\030\003 \001(\005\022\026\n\016tensor_content\030\004 \001(\014\022\024\n\010hal"
  81. "f_val\030\r \003(\005B\002\020\001\022\025\n\tfloat_val\030\005 \003(\002B\002\020\001\022\026"
  82. "\n\ndouble_val\030\006 \003(\001B\002\020\001\022\023\n\007int_val\030\007 \003(\005B"
  83. "\002\020\001\022\022\n\nstring_val\030\010 \003(\014\022\030\n\014scomplex_val\030"
  84. "\t \003(\002B\002\020\001\022\025\n\tint64_val\030\n \003(\003B\002\020\001\022\024\n\010bool"
  85. "_val\030\013 \003(\010B\002\020\001\022\030\n\014dcomplex_val\030\014 \003(\001B\002\020\001"
  86. "B-\n\030org.tensorflow.frameworkB\014TensorProt"
  87. "osP\001\370\001\001b\006proto3"
  88. ;
  89. static const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable*const descriptor_table_tensor_2eproto_deps[2] = {
  90. &::descriptor_table_tensor_5fshape_2eproto,
  91. &::descriptor_table_types_2eproto,
  92. };
  93. static ::PROTOBUF_NAMESPACE_ID::internal::once_flag descriptor_table_tensor_2eproto_once;
  94. const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_tensor_2eproto = {
  95. false, false, 495, descriptor_table_protodef_tensor_2eproto, "tensor.proto",
  96. &descriptor_table_tensor_2eproto_once, descriptor_table_tensor_2eproto_deps, 2, 1,
  97. schemas, file_default_instances, TableStruct_tensor_2eproto::offsets,
  98. file_level_metadata_tensor_2eproto, file_level_enum_descriptors_tensor_2eproto, file_level_service_descriptors_tensor_2eproto,
  99. };
  100. PROTOBUF_ATTRIBUTE_WEAK const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable* descriptor_table_tensor_2eproto_getter() {
  101. return &descriptor_table_tensor_2eproto;
  102. }
  103. // Force running AddDescriptors() at dynamic initialization time.
  104. PROTOBUF_ATTRIBUTE_INIT_PRIORITY static ::PROTOBUF_NAMESPACE_ID::internal::AddDescriptorsRunner dynamic_init_dummy_tensor_2eproto(&descriptor_table_tensor_2eproto);
  105. namespace opencv_tensorflow {
  106. // ===================================================================
  107. class TensorProto::_Internal {
  108. public:
  109. static const ::opencv_tensorflow::TensorShapeProto& tensor_shape(const TensorProto* msg);
  110. };
  111. const ::opencv_tensorflow::TensorShapeProto&
  112. TensorProto::_Internal::tensor_shape(const TensorProto* msg) {
  113. return *msg->tensor_shape_;
  114. }
  115. void TensorProto::clear_tensor_shape() {
  116. if (GetArenaForAllocation() == nullptr && tensor_shape_ != nullptr) {
  117. delete tensor_shape_;
  118. }
  119. tensor_shape_ = nullptr;
  120. }
  121. TensorProto::TensorProto(::PROTOBUF_NAMESPACE_ID::Arena* arena,
  122. bool is_message_owned)
  123. : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned),
  124. float_val_(arena),
  125. double_val_(arena),
  126. int_val_(arena),
  127. string_val_(arena),
  128. scomplex_val_(arena),
  129. int64_val_(arena),
  130. bool_val_(arena),
  131. dcomplex_val_(arena),
  132. half_val_(arena) {
  133. SharedCtor();
  134. if (!is_message_owned) {
  135. RegisterArenaDtor(arena);
  136. }
  137. // @@protoc_insertion_point(arena_constructor:opencv_tensorflow.TensorProto)
  138. }
  139. TensorProto::TensorProto(const TensorProto& from)
  140. : ::PROTOBUF_NAMESPACE_ID::Message(),
  141. float_val_(from.float_val_),
  142. double_val_(from.double_val_),
  143. int_val_(from.int_val_),
  144. string_val_(from.string_val_),
  145. scomplex_val_(from.scomplex_val_),
  146. int64_val_(from.int64_val_),
  147. bool_val_(from.bool_val_),
  148. dcomplex_val_(from.dcomplex_val_),
  149. half_val_(from.half_val_) {
  150. _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
  151. tensor_content_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  152. #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
  153. tensor_content_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
  154. #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  155. if (!from._internal_tensor_content().empty()) {
  156. tensor_content_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_tensor_content(),
  157. GetArenaForAllocation());
  158. }
  159. if (from._internal_has_tensor_shape()) {
  160. tensor_shape_ = new ::opencv_tensorflow::TensorShapeProto(*from.tensor_shape_);
  161. } else {
  162. tensor_shape_ = nullptr;
  163. }
  164. ::memcpy(&dtype_, &from.dtype_,
  165. static_cast<size_t>(reinterpret_cast<char*>(&version_number_) -
  166. reinterpret_cast<char*>(&dtype_)) + sizeof(version_number_));
  167. // @@protoc_insertion_point(copy_constructor:opencv_tensorflow.TensorProto)
  168. }
  169. inline void TensorProto::SharedCtor() {
  170. tensor_content_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  171. #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
  172. tensor_content_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
  173. #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  174. ::memset(reinterpret_cast<char*>(this) + static_cast<size_t>(
  175. reinterpret_cast<char*>(&tensor_shape_) - reinterpret_cast<char*>(this)),
  176. 0, static_cast<size_t>(reinterpret_cast<char*>(&version_number_) -
  177. reinterpret_cast<char*>(&tensor_shape_)) + sizeof(version_number_));
  178. }
  179. TensorProto::~TensorProto() {
  180. // @@protoc_insertion_point(destructor:opencv_tensorflow.TensorProto)
  181. if (GetArenaForAllocation() != nullptr) return;
  182. SharedDtor();
  183. _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
  184. }
  185. inline void TensorProto::SharedDtor() {
  186. GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
  187. tensor_content_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  188. if (this != internal_default_instance()) delete tensor_shape_;
  189. }
  190. void TensorProto::ArenaDtor(void* object) {
  191. TensorProto* _this = reinterpret_cast< TensorProto* >(object);
  192. (void)_this;
  193. }
  194. void TensorProto::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
  195. }
  196. void TensorProto::SetCachedSize(int size) const {
  197. _cached_size_.Set(size);
  198. }
  199. void TensorProto::Clear() {
  200. // @@protoc_insertion_point(message_clear_start:opencv_tensorflow.TensorProto)
  201. uint32_t cached_has_bits = 0;
  202. // Prevent compiler warnings about cached_has_bits being unused
  203. (void) cached_has_bits;
  204. float_val_.Clear();
  205. double_val_.Clear();
  206. int_val_.Clear();
  207. string_val_.Clear();
  208. scomplex_val_.Clear();
  209. int64_val_.Clear();
  210. bool_val_.Clear();
  211. dcomplex_val_.Clear();
  212. half_val_.Clear();
  213. tensor_content_.ClearToEmpty();
  214. if (GetArenaForAllocation() == nullptr && tensor_shape_ != nullptr) {
  215. delete tensor_shape_;
  216. }
  217. tensor_shape_ = nullptr;
  218. ::memset(&dtype_, 0, static_cast<size_t>(
  219. reinterpret_cast<char*>(&version_number_) -
  220. reinterpret_cast<char*>(&dtype_)) + sizeof(version_number_));
  221. _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
  222. }
  223. const char* TensorProto::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
  224. #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  225. while (!ctx->Done(&ptr)) {
  226. uint32_t tag;
  227. ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
  228. switch (tag >> 3) {
  229. // .opencv_tensorflow.DataType dtype = 1;
  230. case 1:
  231. if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
  232. uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
  233. CHK_(ptr);
  234. _internal_set_dtype(static_cast<::opencv_tensorflow::DataType>(val));
  235. } else
  236. goto handle_unusual;
  237. continue;
  238. // .opencv_tensorflow.TensorShapeProto tensor_shape = 2;
  239. case 2:
  240. if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 18)) {
  241. ptr = ctx->ParseMessage(_internal_mutable_tensor_shape(), ptr);
  242. CHK_(ptr);
  243. } else
  244. goto handle_unusual;
  245. continue;
  246. // int32 version_number = 3;
  247. case 3:
  248. if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 24)) {
  249. version_number_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
  250. CHK_(ptr);
  251. } else
  252. goto handle_unusual;
  253. continue;
  254. // bytes tensor_content = 4;
  255. case 4:
  256. if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 34)) {
  257. auto str = _internal_mutable_tensor_content();
  258. ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
  259. CHK_(ptr);
  260. } else
  261. goto handle_unusual;
  262. continue;
  263. // repeated float float_val = 5 [packed = true];
  264. case 5:
  265. if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 42)) {
  266. ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedFloatParser(_internal_mutable_float_val(), ptr, ctx);
  267. CHK_(ptr);
  268. } else if (static_cast<uint8_t>(tag) == 45) {
  269. _internal_add_float_val(::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr));
  270. ptr += sizeof(float);
  271. } else
  272. goto handle_unusual;
  273. continue;
  274. // repeated double double_val = 6 [packed = true];
  275. case 6:
  276. if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 50)) {
  277. ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedDoubleParser(_internal_mutable_double_val(), ptr, ctx);
  278. CHK_(ptr);
  279. } else if (static_cast<uint8_t>(tag) == 49) {
  280. _internal_add_double_val(::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<double>(ptr));
  281. ptr += sizeof(double);
  282. } else
  283. goto handle_unusual;
  284. continue;
  285. // repeated int32 int_val = 7 [packed = true];
  286. case 7:
  287. if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 58)) {
  288. ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedInt32Parser(_internal_mutable_int_val(), ptr, ctx);
  289. CHK_(ptr);
  290. } else if (static_cast<uint8_t>(tag) == 56) {
  291. _internal_add_int_val(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr));
  292. CHK_(ptr);
  293. } else
  294. goto handle_unusual;
  295. continue;
  296. // repeated bytes string_val = 8;
  297. case 8:
  298. if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 66)) {
  299. ptr -= 1;
  300. do {
  301. ptr += 1;
  302. auto str = _internal_add_string_val();
  303. ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
  304. CHK_(ptr);
  305. if (!ctx->DataAvailable(ptr)) break;
  306. } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<66>(ptr));
  307. } else
  308. goto handle_unusual;
  309. continue;
  310. // repeated float scomplex_val = 9 [packed = true];
  311. case 9:
  312. if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 74)) {
  313. ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedFloatParser(_internal_mutable_scomplex_val(), ptr, ctx);
  314. CHK_(ptr);
  315. } else if (static_cast<uint8_t>(tag) == 77) {
  316. _internal_add_scomplex_val(::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr));
  317. ptr += sizeof(float);
  318. } else
  319. goto handle_unusual;
  320. continue;
  321. // repeated int64 int64_val = 10 [packed = true];
  322. case 10:
  323. if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 82)) {
  324. ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedInt64Parser(_internal_mutable_int64_val(), ptr, ctx);
  325. CHK_(ptr);
  326. } else if (static_cast<uint8_t>(tag) == 80) {
  327. _internal_add_int64_val(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr));
  328. CHK_(ptr);
  329. } else
  330. goto handle_unusual;
  331. continue;
  332. // repeated bool bool_val = 11 [packed = true];
  333. case 11:
  334. if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 90)) {
  335. ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedBoolParser(_internal_mutable_bool_val(), ptr, ctx);
  336. CHK_(ptr);
  337. } else if (static_cast<uint8_t>(tag) == 88) {
  338. _internal_add_bool_val(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr));
  339. CHK_(ptr);
  340. } else
  341. goto handle_unusual;
  342. continue;
  343. // repeated double dcomplex_val = 12 [packed = true];
  344. case 12:
  345. if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 98)) {
  346. ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedDoubleParser(_internal_mutable_dcomplex_val(), ptr, ctx);
  347. CHK_(ptr);
  348. } else if (static_cast<uint8_t>(tag) == 97) {
  349. _internal_add_dcomplex_val(::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<double>(ptr));
  350. ptr += sizeof(double);
  351. } else
  352. goto handle_unusual;
  353. continue;
  354. // repeated int32 half_val = 13 [packed = true];
  355. case 13:
  356. if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 106)) {
  357. ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedInt32Parser(_internal_mutable_half_val(), ptr, ctx);
  358. CHK_(ptr);
  359. } else if (static_cast<uint8_t>(tag) == 104) {
  360. _internal_add_half_val(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr));
  361. CHK_(ptr);
  362. } else
  363. goto handle_unusual;
  364. continue;
  365. default:
  366. goto handle_unusual;
  367. } // switch
  368. handle_unusual:
  369. if ((tag == 0) || ((tag & 7) == 4)) {
  370. CHK_(ptr);
  371. ctx->SetLastTag(tag);
  372. goto message_done;
  373. }
  374. ptr = UnknownFieldParse(
  375. tag,
  376. _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
  377. ptr, ctx);
  378. CHK_(ptr != nullptr);
  379. } // while
  380. message_done:
  381. return ptr;
  382. failure:
  383. ptr = nullptr;
  384. goto message_done;
  385. #undef CHK_
  386. }
  387. uint8_t* TensorProto::_InternalSerialize(
  388. uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  389. // @@protoc_insertion_point(serialize_to_array_start:opencv_tensorflow.TensorProto)
  390. uint32_t cached_has_bits = 0;
  391. (void) cached_has_bits;
  392. // .opencv_tensorflow.DataType dtype = 1;
  393. if (this->_internal_dtype() != 0) {
  394. target = stream->EnsureSpace(target);
  395. target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
  396. 1, this->_internal_dtype(), target);
  397. }
  398. // .opencv_tensorflow.TensorShapeProto tensor_shape = 2;
  399. if (this->_internal_has_tensor_shape()) {
  400. target = stream->EnsureSpace(target);
  401. target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
  402. InternalWriteMessage(
  403. 2, _Internal::tensor_shape(this), target, stream);
  404. }
  405. // int32 version_number = 3;
  406. if (this->_internal_version_number() != 0) {
  407. target = stream->EnsureSpace(target);
  408. target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(3, this->_internal_version_number(), target);
  409. }
  410. // bytes tensor_content = 4;
  411. if (!this->_internal_tensor_content().empty()) {
  412. target = stream->WriteBytesMaybeAliased(
  413. 4, this->_internal_tensor_content(), target);
  414. }
  415. // repeated float float_val = 5 [packed = true];
  416. if (this->_internal_float_val_size() > 0) {
  417. target = stream->WriteFixedPacked(5, _internal_float_val(), target);
  418. }
  419. // repeated double double_val = 6 [packed = true];
  420. if (this->_internal_double_val_size() > 0) {
  421. target = stream->WriteFixedPacked(6, _internal_double_val(), target);
  422. }
  423. // repeated int32 int_val = 7 [packed = true];
  424. {
  425. int byte_size = _int_val_cached_byte_size_.load(std::memory_order_relaxed);
  426. if (byte_size > 0) {
  427. target = stream->WriteInt32Packed(
  428. 7, _internal_int_val(), byte_size, target);
  429. }
  430. }
  431. // repeated bytes string_val = 8;
  432. for (int i = 0, n = this->_internal_string_val_size(); i < n; i++) {
  433. const auto& s = this->_internal_string_val(i);
  434. target = stream->WriteBytes(8, s, target);
  435. }
  436. // repeated float scomplex_val = 9 [packed = true];
  437. if (this->_internal_scomplex_val_size() > 0) {
  438. target = stream->WriteFixedPacked(9, _internal_scomplex_val(), target);
  439. }
  440. // repeated int64 int64_val = 10 [packed = true];
  441. {
  442. int byte_size = _int64_val_cached_byte_size_.load(std::memory_order_relaxed);
  443. if (byte_size > 0) {
  444. target = stream->WriteInt64Packed(
  445. 10, _internal_int64_val(), byte_size, target);
  446. }
  447. }
  448. // repeated bool bool_val = 11 [packed = true];
  449. if (this->_internal_bool_val_size() > 0) {
  450. target = stream->WriteFixedPacked(11, _internal_bool_val(), target);
  451. }
  452. // repeated double dcomplex_val = 12 [packed = true];
  453. if (this->_internal_dcomplex_val_size() > 0) {
  454. target = stream->WriteFixedPacked(12, _internal_dcomplex_val(), target);
  455. }
  456. // repeated int32 half_val = 13 [packed = true];
  457. {
  458. int byte_size = _half_val_cached_byte_size_.load(std::memory_order_relaxed);
  459. if (byte_size > 0) {
  460. target = stream->WriteInt32Packed(
  461. 13, _internal_half_val(), byte_size, target);
  462. }
  463. }
  464. if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
  465. target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
  466. _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
  467. }
  468. // @@protoc_insertion_point(serialize_to_array_end:opencv_tensorflow.TensorProto)
  469. return target;
  470. }
  471. size_t TensorProto::ByteSizeLong() const {
  472. // @@protoc_insertion_point(message_byte_size_start:opencv_tensorflow.TensorProto)
  473. size_t total_size = 0;
  474. uint32_t cached_has_bits = 0;
  475. // Prevent compiler warnings about cached_has_bits being unused
  476. (void) cached_has_bits;
  477. // repeated float float_val = 5 [packed = true];
  478. {
  479. unsigned int count = static_cast<unsigned int>(this->_internal_float_val_size());
  480. size_t data_size = 4UL * count;
  481. if (data_size > 0) {
  482. total_size += 1 +
  483. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
  484. static_cast<int32_t>(data_size));
  485. }
  486. total_size += data_size;
  487. }
  488. // repeated double double_val = 6 [packed = true];
  489. {
  490. unsigned int count = static_cast<unsigned int>(this->_internal_double_val_size());
  491. size_t data_size = 8UL * count;
  492. if (data_size > 0) {
  493. total_size += 1 +
  494. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
  495. static_cast<int32_t>(data_size));
  496. }
  497. total_size += data_size;
  498. }
  499. // repeated int32 int_val = 7 [packed = true];
  500. {
  501. size_t data_size = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
  502. Int32Size(this->int_val_);
  503. if (data_size > 0) {
  504. total_size += 1 +
  505. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
  506. static_cast<int32_t>(data_size));
  507. }
  508. int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(data_size);
  509. _int_val_cached_byte_size_.store(cached_size,
  510. std::memory_order_relaxed);
  511. total_size += data_size;
  512. }
  513. // repeated bytes string_val = 8;
  514. total_size += 1 *
  515. ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(string_val_.size());
  516. for (int i = 0, n = string_val_.size(); i < n; i++) {
  517. total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize(
  518. string_val_.Get(i));
  519. }
  520. // repeated float scomplex_val = 9 [packed = true];
  521. {
  522. unsigned int count = static_cast<unsigned int>(this->_internal_scomplex_val_size());
  523. size_t data_size = 4UL * count;
  524. if (data_size > 0) {
  525. total_size += 1 +
  526. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
  527. static_cast<int32_t>(data_size));
  528. }
  529. total_size += data_size;
  530. }
  531. // repeated int64 int64_val = 10 [packed = true];
  532. {
  533. size_t data_size = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
  534. Int64Size(this->int64_val_);
  535. if (data_size > 0) {
  536. total_size += 1 +
  537. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
  538. static_cast<int32_t>(data_size));
  539. }
  540. int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(data_size);
  541. _int64_val_cached_byte_size_.store(cached_size,
  542. std::memory_order_relaxed);
  543. total_size += data_size;
  544. }
  545. // repeated bool bool_val = 11 [packed = true];
  546. {
  547. unsigned int count = static_cast<unsigned int>(this->_internal_bool_val_size());
  548. size_t data_size = 1UL * count;
  549. if (data_size > 0) {
  550. total_size += 1 +
  551. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
  552. static_cast<int32_t>(data_size));
  553. }
  554. total_size += data_size;
  555. }
  556. // repeated double dcomplex_val = 12 [packed = true];
  557. {
  558. unsigned int count = static_cast<unsigned int>(this->_internal_dcomplex_val_size());
  559. size_t data_size = 8UL * count;
  560. if (data_size > 0) {
  561. total_size += 1 +
  562. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
  563. static_cast<int32_t>(data_size));
  564. }
  565. total_size += data_size;
  566. }
  567. // repeated int32 half_val = 13 [packed = true];
  568. {
  569. size_t data_size = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
  570. Int32Size(this->half_val_);
  571. if (data_size > 0) {
  572. total_size += 1 +
  573. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
  574. static_cast<int32_t>(data_size));
  575. }
  576. int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(data_size);
  577. _half_val_cached_byte_size_.store(cached_size,
  578. std::memory_order_relaxed);
  579. total_size += data_size;
  580. }
  581. // bytes tensor_content = 4;
  582. if (!this->_internal_tensor_content().empty()) {
  583. total_size += 1 +
  584. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize(
  585. this->_internal_tensor_content());
  586. }
  587. // .opencv_tensorflow.TensorShapeProto tensor_shape = 2;
  588. if (this->_internal_has_tensor_shape()) {
  589. total_size += 1 +
  590. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
  591. *tensor_shape_);
  592. }
  593. // .opencv_tensorflow.DataType dtype = 1;
  594. if (this->_internal_dtype() != 0) {
  595. total_size += 1 +
  596. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_dtype());
  597. }
  598. // int32 version_number = 3;
  599. if (this->_internal_version_number() != 0) {
  600. total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32SizePlusOne(this->_internal_version_number());
  601. }
  602. return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
  603. }
  604. const ::PROTOBUF_NAMESPACE_ID::Message::ClassData TensorProto::_class_data_ = {
  605. ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
  606. TensorProto::MergeImpl
  607. };
  608. const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*TensorProto::GetClassData() const { return &_class_data_; }
  609. void TensorProto::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
  610. const ::PROTOBUF_NAMESPACE_ID::Message& from) {
  611. static_cast<TensorProto *>(to)->MergeFrom(
  612. static_cast<const TensorProto &>(from));
  613. }
  614. void TensorProto::MergeFrom(const TensorProto& from) {
  615. // @@protoc_insertion_point(class_specific_merge_from_start:opencv_tensorflow.TensorProto)
  616. GOOGLE_DCHECK_NE(&from, this);
  617. uint32_t cached_has_bits = 0;
  618. (void) cached_has_bits;
  619. float_val_.MergeFrom(from.float_val_);
  620. double_val_.MergeFrom(from.double_val_);
  621. int_val_.MergeFrom(from.int_val_);
  622. string_val_.MergeFrom(from.string_val_);
  623. scomplex_val_.MergeFrom(from.scomplex_val_);
  624. int64_val_.MergeFrom(from.int64_val_);
  625. bool_val_.MergeFrom(from.bool_val_);
  626. dcomplex_val_.MergeFrom(from.dcomplex_val_);
  627. half_val_.MergeFrom(from.half_val_);
  628. if (!from._internal_tensor_content().empty()) {
  629. _internal_set_tensor_content(from._internal_tensor_content());
  630. }
  631. if (from._internal_has_tensor_shape()) {
  632. _internal_mutable_tensor_shape()->::opencv_tensorflow::TensorShapeProto::MergeFrom(from._internal_tensor_shape());
  633. }
  634. if (from._internal_dtype() != 0) {
  635. _internal_set_dtype(from._internal_dtype());
  636. }
  637. if (from._internal_version_number() != 0) {
  638. _internal_set_version_number(from._internal_version_number());
  639. }
  640. _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
  641. }
  642. void TensorProto::CopyFrom(const TensorProto& from) {
  643. // @@protoc_insertion_point(class_specific_copy_from_start:opencv_tensorflow.TensorProto)
  644. if (&from == this) return;
  645. Clear();
  646. MergeFrom(from);
  647. }
  648. bool TensorProto::IsInitialized() const {
  649. return true;
  650. }
  651. void TensorProto::InternalSwap(TensorProto* other) {
  652. using std::swap;
  653. auto* lhs_arena = GetArenaForAllocation();
  654. auto* rhs_arena = other->GetArenaForAllocation();
  655. _internal_metadata_.InternalSwap(&other->_internal_metadata_);
  656. float_val_.InternalSwap(&other->float_val_);
  657. double_val_.InternalSwap(&other->double_val_);
  658. int_val_.InternalSwap(&other->int_val_);
  659. string_val_.InternalSwap(&other->string_val_);
  660. scomplex_val_.InternalSwap(&other->scomplex_val_);
  661. int64_val_.InternalSwap(&other->int64_val_);
  662. bool_val_.InternalSwap(&other->bool_val_);
  663. dcomplex_val_.InternalSwap(&other->dcomplex_val_);
  664. half_val_.InternalSwap(&other->half_val_);
  665. ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
  666. &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
  667. &tensor_content_, lhs_arena,
  668. &other->tensor_content_, rhs_arena
  669. );
  670. ::PROTOBUF_NAMESPACE_ID::internal::memswap<
  671. PROTOBUF_FIELD_OFFSET(TensorProto, version_number_)
  672. + sizeof(TensorProto::version_number_)
  673. - PROTOBUF_FIELD_OFFSET(TensorProto, tensor_shape_)>(
  674. reinterpret_cast<char*>(&tensor_shape_),
  675. reinterpret_cast<char*>(&other->tensor_shape_));
  676. }
  677. ::PROTOBUF_NAMESPACE_ID::Metadata TensorProto::GetMetadata() const {
  678. return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
  679. &descriptor_table_tensor_2eproto_getter, &descriptor_table_tensor_2eproto_once,
  680. file_level_metadata_tensor_2eproto[0]);
  681. }
  682. // @@protoc_insertion_point(namespace_scope)
  683. } // namespace opencv_tensorflow
  684. PROTOBUF_NAMESPACE_OPEN
  685. template<> PROTOBUF_NOINLINE ::opencv_tensorflow::TensorProto* Arena::CreateMaybeMessage< ::opencv_tensorflow::TensorProto >(Arena* arena) {
  686. return Arena::CreateMessageInternal< ::opencv_tensorflow::TensorProto >(arena);
  687. }
  688. PROTOBUF_NAMESPACE_CLOSE
  689. // @@protoc_insertion_point(global_scope)
  690. #include <google/protobuf/port_undef.inc>