1 // Generated by the protocol buffer compiler. DO NOT EDIT!
2 // source: tensorflow/core/framework/graph.proto
3
4 #include "tensorflow/core/framework/graph.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 {
GraphDef(::_pbi::ConstantInitialized)22 PROTOBUF_CONSTEXPR GraphDef::GraphDef(
23 ::_pbi::ConstantInitialized): _impl_{
24 /*decltype(_impl_.node_)*/{}
25 , /*decltype(_impl_.library_)*/nullptr
26 , /*decltype(_impl_.versions_)*/nullptr
27 , /*decltype(_impl_.version_)*/0
28 , /*decltype(_impl_._cached_size_)*/{}} {}
29 struct GraphDefDefaultTypeInternal {
GraphDefDefaultTypeInternaltensorflow::GraphDefDefaultTypeInternal30 PROTOBUF_CONSTEXPR GraphDefDefaultTypeInternal()
31 : _instance(::_pbi::ConstantInitialized{}) {}
~GraphDefDefaultTypeInternaltensorflow::GraphDefDefaultTypeInternal32 ~GraphDefDefaultTypeInternal() {}
33 union { // NOLINT(misc-non-private-member-variables-in-classes)
34 GraphDef _instance;
35 };
36 };
37 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 GraphDefDefaultTypeInternal _GraphDef_default_instance_;
38 } // namespace tensorflow
39 namespace tensorflow {
40
41 // ===================================================================
42
43 class GraphDef::_Internal {
44 public:
45 static const ::tensorflow::VersionDef& versions(const GraphDef* msg);
46 static const ::tensorflow::FunctionDefLibrary& library(const GraphDef* msg);
47 };
48
49 const ::tensorflow::VersionDef&
versions(const GraphDef * msg)50 GraphDef::_Internal::versions(const GraphDef* msg) {
51 return *msg->_impl_.versions_;
52 }
53 const ::tensorflow::FunctionDefLibrary&
library(const GraphDef * msg)54 GraphDef::_Internal::library(const GraphDef* msg) {
55 return *msg->_impl_.library_;
56 }
clear_node()57 void GraphDef::clear_node() {
58 _impl_.node_.Clear();
59 }
clear_versions()60 void GraphDef::clear_versions() {
61 if (GetArenaForAllocation() == nullptr && _impl_.versions_ != nullptr) {
62 delete _impl_.versions_;
63 }
64 _impl_.versions_ = nullptr;
65 }
clear_library()66 void GraphDef::clear_library() {
67 if (GetArenaForAllocation() == nullptr && _impl_.library_ != nullptr) {
68 delete _impl_.library_;
69 }
70 _impl_.library_ = nullptr;
71 }
GraphDef(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)72 GraphDef::GraphDef(::PROTOBUF_NAMESPACE_ID::Arena* arena,
73 bool is_message_owned)
74 : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
75 SharedCtor(arena, is_message_owned);
76 // @@protoc_insertion_point(arena_constructor:tensorflow.GraphDef)
77 }
GraphDef(const GraphDef & from)78 GraphDef::GraphDef(const GraphDef& from)
79 : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
80 GraphDef* const _this = this; (void)_this;
81 new (&_impl_) Impl_{
82 decltype(_impl_.node_){from._impl_.node_}
83 , decltype(_impl_.library_){nullptr}
84 , decltype(_impl_.versions_){nullptr}
85 , decltype(_impl_.version_){}
86 , /*decltype(_impl_._cached_size_)*/{}};
87
88 _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
89 if (from._internal_has_library()) {
90 _this->_impl_.library_ = new ::tensorflow::FunctionDefLibrary(*from._impl_.library_);
91 }
92 if (from._internal_has_versions()) {
93 _this->_impl_.versions_ = new ::tensorflow::VersionDef(*from._impl_.versions_);
94 }
95 _this->_impl_.version_ = from._impl_.version_;
96 // @@protoc_insertion_point(copy_constructor:tensorflow.GraphDef)
97 }
98
SharedCtor(::_pb::Arena * arena,bool is_message_owned)99 inline void GraphDef::SharedCtor(
100 ::_pb::Arena* arena, bool is_message_owned) {
101 (void)arena;
102 (void)is_message_owned;
103 new (&_impl_) Impl_{
104 decltype(_impl_.node_){arena}
105 , decltype(_impl_.library_){nullptr}
106 , decltype(_impl_.versions_){nullptr}
107 , decltype(_impl_.version_){0}
108 , /*decltype(_impl_._cached_size_)*/{}
109 };
110 }
111
~GraphDef()112 GraphDef::~GraphDef() {
113 // @@protoc_insertion_point(destructor:tensorflow.GraphDef)
114 if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
115 (void)arena;
116 return;
117 }
118 SharedDtor();
119 }
120
SharedDtor()121 inline void GraphDef::SharedDtor() {
122 GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
123 _impl_.node_.~RepeatedPtrField();
124 if (this != internal_default_instance()) delete _impl_.library_;
125 if (this != internal_default_instance()) delete _impl_.versions_;
126 }
127
SetCachedSize(int size) const128 void GraphDef::SetCachedSize(int size) const {
129 _impl_._cached_size_.Set(size);
130 }
131
Clear()132 void GraphDef::Clear() {
133 // @@protoc_insertion_point(message_clear_start:tensorflow.GraphDef)
134 ::uint32_t cached_has_bits = 0;
135 // Prevent compiler warnings about cached_has_bits being unused
136 (void) cached_has_bits;
137
138 _impl_.node_.Clear();
139 if (GetArenaForAllocation() == nullptr && _impl_.library_ != nullptr) {
140 delete _impl_.library_;
141 }
142 _impl_.library_ = nullptr;
143 if (GetArenaForAllocation() == nullptr && _impl_.versions_ != nullptr) {
144 delete _impl_.versions_;
145 }
146 _impl_.versions_ = nullptr;
147 _impl_.version_ = 0;
148 _internal_metadata_.Clear<std::string>();
149 }
150
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)151 const char* GraphDef::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
152 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
153 while (!ctx->Done(&ptr)) {
154 ::uint32_t tag;
155 ptr = ::_pbi::ReadTag(ptr, &tag);
156 switch (tag >> 3) {
157 // repeated .tensorflow.NodeDef node = 1;
158 case 1:
159 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 10)) {
160 ptr -= 1;
161 do {
162 ptr += 1;
163 ptr = ctx->ParseMessage(_internal_add_node(), ptr);
164 CHK_(ptr);
165 if (!ctx->DataAvailable(ptr)) break;
166 } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<10>(ptr));
167 } else {
168 goto handle_unusual;
169 }
170 continue;
171 // .tensorflow.FunctionDefLibrary library = 2;
172 case 2:
173 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 18)) {
174 ptr = ctx->ParseMessage(_internal_mutable_library(), ptr);
175 CHK_(ptr);
176 } else {
177 goto handle_unusual;
178 }
179 continue;
180 // int32 version = 3 [deprecated = true];
181 case 3:
182 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 24)) {
183 _impl_.version_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
184 CHK_(ptr);
185 } else {
186 goto handle_unusual;
187 }
188 continue;
189 // .tensorflow.VersionDef versions = 4;
190 case 4:
191 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 34)) {
192 ptr = ctx->ParseMessage(_internal_mutable_versions(), ptr);
193 CHK_(ptr);
194 } else {
195 goto handle_unusual;
196 }
197 continue;
198 default:
199 goto handle_unusual;
200 } // switch
201 handle_unusual:
202 if ((tag == 0) || ((tag & 7) == 4)) {
203 CHK_(ptr);
204 ctx->SetLastTag(tag);
205 goto message_done;
206 }
207 ptr = UnknownFieldParse(
208 tag,
209 _internal_metadata_.mutable_unknown_fields<std::string>(),
210 ptr, ctx);
211 CHK_(ptr != nullptr);
212 } // while
213 message_done:
214 return ptr;
215 failure:
216 ptr = nullptr;
217 goto message_done;
218 #undef CHK_
219 }
220
_InternalSerialize(::uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const221 ::uint8_t* GraphDef::_InternalSerialize(
222 ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
223 // @@protoc_insertion_point(serialize_to_array_start:tensorflow.GraphDef)
224 ::uint32_t cached_has_bits = 0;
225 (void) cached_has_bits;
226
227 // repeated .tensorflow.NodeDef node = 1;
228 for (unsigned i = 0,
229 n = static_cast<unsigned>(this->_internal_node_size()); i < n; i++) {
230 const auto& repfield = this->_internal_node(i);
231 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
232 InternalWriteMessage(1, repfield, repfield.GetCachedSize(), target, stream);
233 }
234
235 // .tensorflow.FunctionDefLibrary library = 2;
236 if (this->_internal_has_library()) {
237 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
238 InternalWriteMessage(2, _Internal::library(this),
239 _Internal::library(this).GetCachedSize(), target, stream);
240 }
241
242 // int32 version = 3 [deprecated = true];
243 if (this->_internal_version() != 0) {
244 target = stream->EnsureSpace(target);
245 target = ::_pbi::WireFormatLite::WriteInt32ToArray(3, this->_internal_version(), target);
246 }
247
248 // .tensorflow.VersionDef versions = 4;
249 if (this->_internal_has_versions()) {
250 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
251 InternalWriteMessage(4, _Internal::versions(this),
252 _Internal::versions(this).GetCachedSize(), target, stream);
253 }
254
255 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
256 target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
257 static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
258 }
259 // @@protoc_insertion_point(serialize_to_array_end:tensorflow.GraphDef)
260 return target;
261 }
262
ByteSizeLong() const263 size_t GraphDef::ByteSizeLong() const {
264 // @@protoc_insertion_point(message_byte_size_start:tensorflow.GraphDef)
265 size_t total_size = 0;
266
267 ::uint32_t cached_has_bits = 0;
268 // Prevent compiler warnings about cached_has_bits being unused
269 (void) cached_has_bits;
270
271 // repeated .tensorflow.NodeDef node = 1;
272 total_size += 1UL * this->_internal_node_size();
273 for (const auto& msg : this->_impl_.node_) {
274 total_size +=
275 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
276 }
277
278 // .tensorflow.FunctionDefLibrary library = 2;
279 if (this->_internal_has_library()) {
280 total_size += 1 +
281 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
282 *_impl_.library_);
283 }
284
285 // .tensorflow.VersionDef versions = 4;
286 if (this->_internal_has_versions()) {
287 total_size += 1 +
288 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
289 *_impl_.versions_);
290 }
291
292 // int32 version = 3 [deprecated = true];
293 if (this->_internal_version() != 0) {
294 total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_version());
295 }
296
297 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
298 total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
299 }
300 int cached_size = ::_pbi::ToCachedSize(total_size);
301 SetCachedSize(cached_size);
302 return total_size;
303 }
304
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)305 void GraphDef::CheckTypeAndMergeFrom(
306 const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
307 MergeFrom(*::_pbi::DownCast<const GraphDef*>(
308 &from));
309 }
310
MergeFrom(const GraphDef & from)311 void GraphDef::MergeFrom(const GraphDef& from) {
312 GraphDef* const _this = this;
313 // @@protoc_insertion_point(class_specific_merge_from_start:tensorflow.GraphDef)
314 GOOGLE_DCHECK_NE(&from, _this);
315 ::uint32_t cached_has_bits = 0;
316 (void) cached_has_bits;
317
318 _this->_impl_.node_.MergeFrom(from._impl_.node_);
319 if (from._internal_has_library()) {
320 _this->_internal_mutable_library()->::tensorflow::FunctionDefLibrary::MergeFrom(
321 from._internal_library());
322 }
323 if (from._internal_has_versions()) {
324 _this->_internal_mutable_versions()->::tensorflow::VersionDef::MergeFrom(
325 from._internal_versions());
326 }
327 if (from._internal_version() != 0) {
328 _this->_internal_set_version(from._internal_version());
329 }
330 _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
331 }
332
CopyFrom(const GraphDef & from)333 void GraphDef::CopyFrom(const GraphDef& from) {
334 // @@protoc_insertion_point(class_specific_copy_from_start:tensorflow.GraphDef)
335 if (&from == this) return;
336 Clear();
337 MergeFrom(from);
338 }
339
IsInitialized() const340 bool GraphDef::IsInitialized() const {
341 return true;
342 }
343
InternalSwap(GraphDef * other)344 void GraphDef::InternalSwap(GraphDef* other) {
345 using std::swap;
346 _internal_metadata_.InternalSwap(&other->_internal_metadata_);
347 _impl_.node_.InternalSwap(&other->_impl_.node_);
348 ::PROTOBUF_NAMESPACE_ID::internal::memswap<
349 PROTOBUF_FIELD_OFFSET(GraphDef, _impl_.version_)
350 + sizeof(GraphDef::_impl_.version_) // NOLINT
351 - PROTOBUF_FIELD_OFFSET(GraphDef, _impl_.library_)>(
352 reinterpret_cast<char*>(&_impl_.library_),
353 reinterpret_cast<char*>(&other->_impl_.library_));
354 }
355
GetTypeName() const356 std::string GraphDef::GetTypeName() const {
357 return "tensorflow.GraphDef";
358 }
359
360
361 // @@protoc_insertion_point(namespace_scope)
362 } // namespace tensorflow
363 PROTOBUF_NAMESPACE_OPEN
364 template<> PROTOBUF_NOINLINE ::tensorflow::GraphDef*
CreateMaybeMessage(Arena * arena)365 Arena::CreateMaybeMessage< ::tensorflow::GraphDef >(Arena* arena) {
366 return Arena::CreateMessageInternal< ::tensorflow::GraphDef >(arena);
367 }
368 PROTOBUF_NAMESPACE_CLOSE
369
370 // @@protoc_insertion_point(global_scope)
371 #include <google/protobuf/port_undef.inc>
372