1 | // Generated by the protocol buffer compiler. DO NOT EDIT! |
2 | // source: caffe2/proto/torch.proto |
3 | |
4 | #ifndef GOOGLE_PROTOBUF_INCLUDED_caffe2_2fproto_2ftorch_2eproto |
5 | #define GOOGLE_PROTOBUF_INCLUDED_caffe2_2fproto_2ftorch_2eproto |
6 | |
7 | #include <limits> |
8 | #include <string> |
9 | |
10 | #include <google/protobuf/port_def.inc> |
11 | #if PROTOBUF_VERSION < 3013000 |
12 | #error This file was generated by a newer version of protoc which is |
13 | #error incompatible with your Protocol Buffer headers. Please update |
14 | #error your headers. |
15 | #endif |
16 | #if 3013000 < PROTOBUF_MIN_PROTOC_VERSION |
17 | #error This file was generated by an older version of protoc which is |
18 | #error incompatible with your Protocol Buffer headers. Please |
19 | #error regenerate this file with a newer version of protoc. |
20 | #endif |
21 | |
22 | #include <google/protobuf/port_undef.inc> |
23 | #include <google/protobuf/io/coded_stream.h> |
24 | #include <google/protobuf/arena.h> |
25 | #include <google/protobuf/arenastring.h> |
26 | #include <google/protobuf/generated_message_table_driven.h> |
27 | #include <google/protobuf/generated_message_util.h> |
28 | #include <google/protobuf/inlined_string_field.h> |
29 | #include <google/protobuf/metadata_lite.h> |
30 | #include <google/protobuf/generated_message_reflection.h> |
31 | #include <google/protobuf/message.h> |
32 | #include <google/protobuf/repeated_field.h> // IWYU pragma: export |
33 | #include <google/protobuf/extension_set.h> // IWYU pragma: export |
34 | #include <google/protobuf/generated_enum_reflection.h> |
35 | #include <google/protobuf/unknown_field_set.h> |
36 | #include "caffe2/proto/caffe2.pb.h" |
37 | // @@protoc_insertion_point(includes) |
38 | #include <google/protobuf/port_def.inc> |
39 | #define PROTOBUF_INTERNAL_EXPORT_caffe2_2fproto_2ftorch_2eproto TORCH_API |
40 | PROTOBUF_NAMESPACE_OPEN |
41 | namespace internal { |
42 | class AnyMetadata; |
43 | } // namespace internal |
44 | PROTOBUF_NAMESPACE_CLOSE |
45 | |
46 | // Internal implementation detail -- do not use these members. |
47 | struct TORCH_API TableStruct_caffe2_2fproto_2ftorch_2eproto { |
48 | static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTableField entries[] |
49 | PROTOBUF_SECTION_VARIABLE(protodesc_cold); |
50 | static const ::PROTOBUF_NAMESPACE_ID::internal::AuxiliaryParseTableField aux[] |
51 | PROTOBUF_SECTION_VARIABLE(protodesc_cold); |
52 | static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTable schema[7] |
53 | PROTOBUF_SECTION_VARIABLE(protodesc_cold); |
54 | static const ::PROTOBUF_NAMESPACE_ID::internal::FieldMetadata field_metadata[]; |
55 | static const ::PROTOBUF_NAMESPACE_ID::internal::SerializationTable serialization_table[]; |
56 | static const ::PROTOBUF_NAMESPACE_ID::uint32 offsets[]; |
57 | }; |
58 | extern TORCH_API const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_caffe2_2fproto_2ftorch_2eproto; |
59 | namespace torch { const ::std::string& GetEmptyStringAlreadyInited(); |
60 | class AttributeDef; |
61 | class AttributeDefDefaultTypeInternal; |
62 | TORCH_API extern AttributeDefDefaultTypeInternal _AttributeDef_default_instance_; |
63 | class LibDef; |
64 | class LibDefDefaultTypeInternal; |
65 | TORCH_API extern LibDefDefaultTypeInternal _LibDef_default_instance_; |
66 | class ModelDef; |
67 | class ModelDefDefaultTypeInternal; |
68 | TORCH_API extern ModelDefDefaultTypeInternal _ModelDef_default_instance_; |
69 | class ModuleDef; |
70 | class ModuleDefDefaultTypeInternal; |
71 | TORCH_API extern ModuleDefDefaultTypeInternal _ModuleDef_default_instance_; |
72 | class ParameterDef; |
73 | class ParameterDefDefaultTypeInternal; |
74 | TORCH_API extern ParameterDefDefaultTypeInternal _ParameterDef_default_instance_; |
75 | class RecordRef; |
76 | class RecordRefDefaultTypeInternal; |
77 | TORCH_API extern RecordRefDefaultTypeInternal _RecordRef_default_instance_; |
78 | class TensorDef; |
79 | class TensorDefDefaultTypeInternal; |
80 | TORCH_API extern TensorDefDefaultTypeInternal _TensorDef_default_instance_; |
81 | } // namespace torch |
82 | PROTOBUF_NAMESPACE_OPEN |
83 | template<> TORCH_API ::torch::AttributeDef* Arena::CreateMaybeMessage<::torch::AttributeDef>(Arena*); |
84 | template<> TORCH_API ::torch::LibDef* Arena::CreateMaybeMessage<::torch::LibDef>(Arena*); |
85 | template<> TORCH_API ::torch::ModelDef* Arena::CreateMaybeMessage<::torch::ModelDef>(Arena*); |
86 | template<> TORCH_API ::torch::ModuleDef* Arena::CreateMaybeMessage<::torch::ModuleDef>(Arena*); |
87 | template<> TORCH_API ::torch::ParameterDef* Arena::CreateMaybeMessage<::torch::ParameterDef>(Arena*); |
88 | template<> TORCH_API ::torch::RecordRef* Arena::CreateMaybeMessage<::torch::RecordRef>(Arena*); |
89 | template<> TORCH_API ::torch::TensorDef* Arena::CreateMaybeMessage<::torch::TensorDef>(Arena*); |
90 | PROTOBUF_NAMESPACE_CLOSE |
91 | namespace torch { |
92 | |
93 | enum ProtoVersion : int { |
94 | PROTO_VERSION_NEWEST = 6 |
95 | }; |
96 | TORCH_API bool ProtoVersion_IsValid(int value); |
97 | constexpr ProtoVersion ProtoVersion_MIN = PROTO_VERSION_NEWEST; |
98 | constexpr ProtoVersion ProtoVersion_MAX = PROTO_VERSION_NEWEST; |
99 | constexpr int ProtoVersion_ARRAYSIZE = static_cast<int>(ProtoVersion_MAX) + 1; |
100 | |
101 | TORCH_API const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* ProtoVersion_descriptor(); |
102 | template<typename T> |
103 | inline const std::string& ProtoVersion_Name(T enum_t_value) { |
104 | static_assert(::std::is_same<T, ProtoVersion>::value || |
105 | ::std::is_integral<T>::value, |
106 | "Incorrect type passed to function ProtoVersion_Name." ); |
107 | return ::PROTOBUF_NAMESPACE_ID::internal::NameOfEnum( |
108 | ProtoVersion_descriptor(), enum_t_value); |
109 | } |
110 | inline bool ProtoVersion_Parse( |
111 | ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, ProtoVersion* value) { |
112 | return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum<ProtoVersion>( |
113 | ProtoVersion_descriptor(), name, value); |
114 | } |
115 | // =================================================================== |
116 | |
117 | class TORCH_API RecordRef PROTOBUF_FINAL : |
118 | public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:torch.RecordRef) */ { |
119 | public: |
120 | inline RecordRef() : RecordRef(nullptr) {} |
121 | virtual ~RecordRef(); |
122 | |
123 | RecordRef(const RecordRef& from); |
124 | RecordRef(RecordRef&& from) noexcept |
125 | : RecordRef() { |
126 | *this = ::std::move(from); |
127 | } |
128 | |
129 | inline RecordRef& operator=(const RecordRef& from) { |
130 | CopyFrom(from); |
131 | return *this; |
132 | } |
133 | inline RecordRef& operator=(RecordRef&& from) noexcept { |
134 | if (GetArena() == from.GetArena()) { |
135 | if (this != &from) InternalSwap(&from); |
136 | } else { |
137 | CopyFrom(from); |
138 | } |
139 | return *this; |
140 | } |
141 | |
142 | inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const { |
143 | return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance); |
144 | } |
145 | inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() { |
146 | return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); |
147 | } |
148 | |
149 | static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { |
150 | return GetDescriptor(); |
151 | } |
152 | static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { |
153 | return GetMetadataStatic().descriptor; |
154 | } |
155 | static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { |
156 | return GetMetadataStatic().reflection; |
157 | } |
158 | static const RecordRef& default_instance(); |
159 | |
160 | static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY |
161 | static inline const RecordRef* internal_default_instance() { |
162 | return reinterpret_cast<const RecordRef*>( |
163 | &_RecordRef_default_instance_); |
164 | } |
165 | static constexpr int kIndexInFileMessages = |
166 | 0; |
167 | |
168 | friend void swap(RecordRef& a, RecordRef& b) { |
169 | a.Swap(&b); |
170 | } |
171 | inline void Swap(RecordRef* other) { |
172 | if (other == this) return; |
173 | if (GetArena() == other->GetArena()) { |
174 | InternalSwap(other); |
175 | } else { |
176 | ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); |
177 | } |
178 | } |
179 | void UnsafeArenaSwap(RecordRef* other) { |
180 | if (other == this) return; |
181 | GOOGLE_DCHECK(GetArena() == other->GetArena()); |
182 | InternalSwap(other); |
183 | } |
184 | |
185 | // implements Message ---------------------------------------------- |
186 | |
187 | inline RecordRef* New() const final { |
188 | return CreateMaybeMessage<RecordRef>(nullptr); |
189 | } |
190 | |
191 | RecordRef* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { |
192 | return CreateMaybeMessage<RecordRef>(arena); |
193 | } |
194 | void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; |
195 | void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; |
196 | void CopyFrom(const RecordRef& from); |
197 | void MergeFrom(const RecordRef& from); |
198 | PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; |
199 | bool IsInitialized() const final; |
200 | |
201 | size_t ByteSizeLong() const final; |
202 | const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; |
203 | ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( |
204 | ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; |
205 | int GetCachedSize() const final { return _cached_size_.Get(); } |
206 | |
207 | private: |
208 | inline void SharedCtor(); |
209 | inline void SharedDtor(); |
210 | void SetCachedSize(int size) const final; |
211 | void InternalSwap(RecordRef* other); |
212 | friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; |
213 | static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { |
214 | return "torch.RecordRef" ; |
215 | } |
216 | protected: |
217 | explicit RecordRef(::PROTOBUF_NAMESPACE_ID::Arena* arena); |
218 | private: |
219 | static void ArenaDtor(void* object); |
220 | inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); |
221 | public: |
222 | |
223 | ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; |
224 | private: |
225 | static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { |
226 | ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_caffe2_2fproto_2ftorch_2eproto); |
227 | return ::descriptor_table_caffe2_2fproto_2ftorch_2eproto.file_level_metadata[kIndexInFileMessages]; |
228 | } |
229 | |
230 | public: |
231 | |
232 | // nested types ---------------------------------------------------- |
233 | |
234 | // accessors ------------------------------------------------------- |
235 | |
236 | enum : int { |
237 | kKeyFieldNumber = 1, |
238 | }; |
239 | // optional string key = 1; |
240 | bool has_key() const; |
241 | private: |
242 | bool _internal_has_key() const; |
243 | public: |
244 | void clear_key(); |
245 | const std::string& key() const; |
246 | void set_key(const std::string& value); |
247 | void set_key(std::string&& value); |
248 | void set_key(const char* value); |
249 | void set_key(const char* value, size_t size); |
250 | std::string* mutable_key(); |
251 | std::string* release_key(); |
252 | void set_allocated_key(std::string* key); |
253 | private: |
254 | const std::string& _internal_key() const; |
255 | void _internal_set_key(const std::string& value); |
256 | std::string* _internal_mutable_key(); |
257 | public: |
258 | |
259 | // @@protoc_insertion_point(class_scope:torch.RecordRef) |
260 | private: |
261 | class _Internal; |
262 | |
263 | template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; |
264 | typedef void InternalArenaConstructable_; |
265 | typedef void DestructorSkippable_; |
266 | ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; |
267 | mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; |
268 | ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr key_; |
269 | friend struct ::TableStruct_caffe2_2fproto_2ftorch_2eproto; |
270 | }; |
271 | // ------------------------------------------------------------------- |
272 | |
273 | class TORCH_API TensorDef PROTOBUF_FINAL : |
274 | public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:torch.TensorDef) */ { |
275 | public: |
276 | inline TensorDef() : TensorDef(nullptr) {} |
277 | virtual ~TensorDef(); |
278 | |
279 | TensorDef(const TensorDef& from); |
280 | TensorDef(TensorDef&& from) noexcept |
281 | : TensorDef() { |
282 | *this = ::std::move(from); |
283 | } |
284 | |
285 | inline TensorDef& operator=(const TensorDef& from) { |
286 | CopyFrom(from); |
287 | return *this; |
288 | } |
289 | inline TensorDef& operator=(TensorDef&& from) noexcept { |
290 | if (GetArena() == from.GetArena()) { |
291 | if (this != &from) InternalSwap(&from); |
292 | } else { |
293 | CopyFrom(from); |
294 | } |
295 | return *this; |
296 | } |
297 | |
298 | inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const { |
299 | return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance); |
300 | } |
301 | inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() { |
302 | return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); |
303 | } |
304 | |
305 | static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { |
306 | return GetDescriptor(); |
307 | } |
308 | static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { |
309 | return GetMetadataStatic().descriptor; |
310 | } |
311 | static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { |
312 | return GetMetadataStatic().reflection; |
313 | } |
314 | static const TensorDef& default_instance(); |
315 | |
316 | static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY |
317 | static inline const TensorDef* internal_default_instance() { |
318 | return reinterpret_cast<const TensorDef*>( |
319 | &_TensorDef_default_instance_); |
320 | } |
321 | static constexpr int kIndexInFileMessages = |
322 | 1; |
323 | |
324 | friend void swap(TensorDef& a, TensorDef& b) { |
325 | a.Swap(&b); |
326 | } |
327 | inline void Swap(TensorDef* other) { |
328 | if (other == this) return; |
329 | if (GetArena() == other->GetArena()) { |
330 | InternalSwap(other); |
331 | } else { |
332 | ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); |
333 | } |
334 | } |
335 | void UnsafeArenaSwap(TensorDef* other) { |
336 | if (other == this) return; |
337 | GOOGLE_DCHECK(GetArena() == other->GetArena()); |
338 | InternalSwap(other); |
339 | } |
340 | |
341 | // implements Message ---------------------------------------------- |
342 | |
343 | inline TensorDef* New() const final { |
344 | return CreateMaybeMessage<TensorDef>(nullptr); |
345 | } |
346 | |
347 | TensorDef* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { |
348 | return CreateMaybeMessage<TensorDef>(arena); |
349 | } |
350 | void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; |
351 | void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; |
352 | void CopyFrom(const TensorDef& from); |
353 | void MergeFrom(const TensorDef& from); |
354 | PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; |
355 | bool IsInitialized() const final; |
356 | |
357 | size_t ByteSizeLong() const final; |
358 | const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; |
359 | ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( |
360 | ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; |
361 | int GetCachedSize() const final { return _cached_size_.Get(); } |
362 | |
363 | private: |
364 | inline void SharedCtor(); |
365 | inline void SharedDtor(); |
366 | void SetCachedSize(int size) const final; |
367 | void InternalSwap(TensorDef* other); |
368 | friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; |
369 | static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { |
370 | return "torch.TensorDef" ; |
371 | } |
372 | protected: |
373 | explicit TensorDef(::PROTOBUF_NAMESPACE_ID::Arena* arena); |
374 | private: |
375 | static void ArenaDtor(void* object); |
376 | inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); |
377 | public: |
378 | |
379 | ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; |
380 | private: |
381 | static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { |
382 | ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_caffe2_2fproto_2ftorch_2eproto); |
383 | return ::descriptor_table_caffe2_2fproto_2ftorch_2eproto.file_level_metadata[kIndexInFileMessages]; |
384 | } |
385 | |
386 | public: |
387 | |
388 | // nested types ---------------------------------------------------- |
389 | |
390 | // accessors ------------------------------------------------------- |
391 | |
392 | enum : int { |
393 | kDimsFieldNumber = 1, |
394 | kStridesFieldNumber = 3, |
395 | kDeviceFieldNumber = 7, |
396 | kDataFieldNumber = 6, |
397 | kOffsetFieldNumber = 2, |
398 | kDataTypeFieldNumber = 5, |
399 | kRequiresGradFieldNumber = 4, |
400 | kIsQuantizedFieldNumber = 8, |
401 | kScaleFieldNumber = 9, |
402 | kZeroPointFieldNumber = 10, |
403 | }; |
404 | // repeated int64 dims = 1; |
405 | int dims_size() const; |
406 | private: |
407 | int _internal_dims_size() const; |
408 | public: |
409 | void clear_dims(); |
410 | private: |
411 | ::PROTOBUF_NAMESPACE_ID::int64 _internal_dims(int index) const; |
412 | const ::PROTOBUF_NAMESPACE_ID::RepeatedField< ::PROTOBUF_NAMESPACE_ID::int64 >& |
413 | _internal_dims() const; |
414 | void _internal_add_dims(::PROTOBUF_NAMESPACE_ID::int64 value); |
415 | ::PROTOBUF_NAMESPACE_ID::RepeatedField< ::PROTOBUF_NAMESPACE_ID::int64 >* |
416 | _internal_mutable_dims(); |
417 | public: |
418 | ::PROTOBUF_NAMESPACE_ID::int64 dims(int index) const; |
419 | void set_dims(int index, ::PROTOBUF_NAMESPACE_ID::int64 value); |
420 | void add_dims(::PROTOBUF_NAMESPACE_ID::int64 value); |
421 | const ::PROTOBUF_NAMESPACE_ID::RepeatedField< ::PROTOBUF_NAMESPACE_ID::int64 >& |
422 | dims() const; |
423 | ::PROTOBUF_NAMESPACE_ID::RepeatedField< ::PROTOBUF_NAMESPACE_ID::int64 >* |
424 | mutable_dims(); |
425 | |
426 | // repeated int64 strides = 3; |
427 | int strides_size() const; |
428 | private: |
429 | int _internal_strides_size() const; |
430 | public: |
431 | void clear_strides(); |
432 | private: |
433 | ::PROTOBUF_NAMESPACE_ID::int64 _internal_strides(int index) const; |
434 | const ::PROTOBUF_NAMESPACE_ID::RepeatedField< ::PROTOBUF_NAMESPACE_ID::int64 >& |
435 | _internal_strides() const; |
436 | void _internal_add_strides(::PROTOBUF_NAMESPACE_ID::int64 value); |
437 | ::PROTOBUF_NAMESPACE_ID::RepeatedField< ::PROTOBUF_NAMESPACE_ID::int64 >* |
438 | _internal_mutable_strides(); |
439 | public: |
440 | ::PROTOBUF_NAMESPACE_ID::int64 strides(int index) const; |
441 | void set_strides(int index, ::PROTOBUF_NAMESPACE_ID::int64 value); |
442 | void add_strides(::PROTOBUF_NAMESPACE_ID::int64 value); |
443 | const ::PROTOBUF_NAMESPACE_ID::RepeatedField< ::PROTOBUF_NAMESPACE_ID::int64 >& |
444 | strides() const; |
445 | ::PROTOBUF_NAMESPACE_ID::RepeatedField< ::PROTOBUF_NAMESPACE_ID::int64 >* |
446 | mutable_strides(); |
447 | |
448 | // optional string device = 7; |
449 | bool has_device() const; |
450 | private: |
451 | bool _internal_has_device() const; |
452 | public: |
453 | void clear_device(); |
454 | const std::string& device() const; |
455 | void set_device(const std::string& value); |
456 | void set_device(std::string&& value); |
457 | void set_device(const char* value); |
458 | void set_device(const char* value, size_t size); |
459 | std::string* mutable_device(); |
460 | std::string* release_device(); |
461 | void set_allocated_device(std::string* device); |
462 | private: |
463 | const std::string& _internal_device() const; |
464 | void _internal_set_device(const std::string& value); |
465 | std::string* _internal_mutable_device(); |
466 | public: |
467 | |
468 | // optional .torch.RecordRef data = 6; |
469 | bool has_data() const; |
470 | private: |
471 | bool _internal_has_data() const; |
472 | public: |
473 | void clear_data(); |
474 | const ::torch::RecordRef& data() const; |
475 | ::torch::RecordRef* release_data(); |
476 | ::torch::RecordRef* mutable_data(); |
477 | void set_allocated_data(::torch::RecordRef* data); |
478 | private: |
479 | const ::torch::RecordRef& _internal_data() const; |
480 | ::torch::RecordRef* _internal_mutable_data(); |
481 | public: |
482 | void unsafe_arena_set_allocated_data( |
483 | ::torch::RecordRef* data); |
484 | ::torch::RecordRef* unsafe_arena_release_data(); |
485 | |
486 | // optional int64 offset = 2; |
487 | bool has_offset() const; |
488 | private: |
489 | bool _internal_has_offset() const; |
490 | public: |
491 | void clear_offset(); |
492 | ::PROTOBUF_NAMESPACE_ID::int64 offset() const; |
493 | void set_offset(::PROTOBUF_NAMESPACE_ID::int64 value); |
494 | private: |
495 | ::PROTOBUF_NAMESPACE_ID::int64 _internal_offset() const; |
496 | void _internal_set_offset(::PROTOBUF_NAMESPACE_ID::int64 value); |
497 | public: |
498 | |
499 | // optional .caffe2.TensorProto.DataType data_type = 5; |
500 | bool has_data_type() const; |
501 | private: |
502 | bool _internal_has_data_type() const; |
503 | public: |
504 | void clear_data_type(); |
505 | ::caffe2::TensorProto_DataType data_type() const; |
506 | void set_data_type(::caffe2::TensorProto_DataType value); |
507 | private: |
508 | ::caffe2::TensorProto_DataType _internal_data_type() const; |
509 | void _internal_set_data_type(::caffe2::TensorProto_DataType value); |
510 | public: |
511 | |
512 | // optional bool requires_grad = 4; |
513 | bool has_requires_grad() const; |
514 | private: |
515 | bool _internal_has_requires_grad() const; |
516 | public: |
517 | void clear_requires_grad(); |
518 | bool requires_grad() const; |
519 | void set_requires_grad(bool value); |
520 | private: |
521 | bool _internal_requires_grad() const; |
522 | void _internal_set_requires_grad(bool value); |
523 | public: |
524 | |
525 | // optional bool is_quantized = 8; |
526 | bool has_is_quantized() const; |
527 | private: |
528 | bool _internal_has_is_quantized() const; |
529 | public: |
530 | void clear_is_quantized(); |
531 | bool is_quantized() const; |
532 | void set_is_quantized(bool value); |
533 | private: |
534 | bool _internal_is_quantized() const; |
535 | void _internal_set_is_quantized(bool value); |
536 | public: |
537 | |
538 | // optional double scale = 9; |
539 | bool has_scale() const; |
540 | private: |
541 | bool _internal_has_scale() const; |
542 | public: |
543 | void clear_scale(); |
544 | double scale() const; |
545 | void set_scale(double value); |
546 | private: |
547 | double _internal_scale() const; |
548 | void _internal_set_scale(double value); |
549 | public: |
550 | |
551 | // optional int64 zero_point = 10; |
552 | bool has_zero_point() const; |
553 | private: |
554 | bool _internal_has_zero_point() const; |
555 | public: |
556 | void clear_zero_point(); |
557 | ::PROTOBUF_NAMESPACE_ID::int64 zero_point() const; |
558 | void set_zero_point(::PROTOBUF_NAMESPACE_ID::int64 value); |
559 | private: |
560 | ::PROTOBUF_NAMESPACE_ID::int64 _internal_zero_point() const; |
561 | void _internal_set_zero_point(::PROTOBUF_NAMESPACE_ID::int64 value); |
562 | public: |
563 | |
564 | // @@protoc_insertion_point(class_scope:torch.TensorDef) |
565 | private: |
566 | class _Internal; |
567 | |
568 | template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; |
569 | typedef void InternalArenaConstructable_; |
570 | typedef void DestructorSkippable_; |
571 | ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; |
572 | mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; |
573 | ::PROTOBUF_NAMESPACE_ID::RepeatedField< ::PROTOBUF_NAMESPACE_ID::int64 > dims_; |
574 | ::PROTOBUF_NAMESPACE_ID::RepeatedField< ::PROTOBUF_NAMESPACE_ID::int64 > strides_; |
575 | ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr device_; |
576 | ::torch::RecordRef* data_; |
577 | ::PROTOBUF_NAMESPACE_ID::int64 offset_; |
578 | int data_type_; |
579 | bool requires_grad_; |
580 | bool is_quantized_; |
581 | double scale_; |
582 | ::PROTOBUF_NAMESPACE_ID::int64 zero_point_; |
583 | friend struct ::TableStruct_caffe2_2fproto_2ftorch_2eproto; |
584 | }; |
585 | // ------------------------------------------------------------------- |
586 | |
587 | class TORCH_API AttributeDef PROTOBUF_FINAL : |
588 | public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:torch.AttributeDef) */ { |
589 | public: |
590 | inline AttributeDef() : AttributeDef(nullptr) {} |
591 | virtual ~AttributeDef(); |
592 | |
593 | AttributeDef(const AttributeDef& from); |
594 | AttributeDef(AttributeDef&& from) noexcept |
595 | : AttributeDef() { |
596 | *this = ::std::move(from); |
597 | } |
598 | |
599 | inline AttributeDef& operator=(const AttributeDef& from) { |
600 | CopyFrom(from); |
601 | return *this; |
602 | } |
603 | inline AttributeDef& operator=(AttributeDef&& from) noexcept { |
604 | if (GetArena() == from.GetArena()) { |
605 | if (this != &from) InternalSwap(&from); |
606 | } else { |
607 | CopyFrom(from); |
608 | } |
609 | return *this; |
610 | } |
611 | |
612 | inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const { |
613 | return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance); |
614 | } |
615 | inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() { |
616 | return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); |
617 | } |
618 | |
619 | static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { |
620 | return GetDescriptor(); |
621 | } |
622 | static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { |
623 | return GetMetadataStatic().descriptor; |
624 | } |
625 | static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { |
626 | return GetMetadataStatic().reflection; |
627 | } |
628 | static const AttributeDef& default_instance(); |
629 | |
630 | static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY |
631 | static inline const AttributeDef* internal_default_instance() { |
632 | return reinterpret_cast<const AttributeDef*>( |
633 | &_AttributeDef_default_instance_); |
634 | } |
635 | static constexpr int kIndexInFileMessages = |
636 | 2; |
637 | |
638 | friend void swap(AttributeDef& a, AttributeDef& b) { |
639 | a.Swap(&b); |
640 | } |
641 | inline void Swap(AttributeDef* other) { |
642 | if (other == this) return; |
643 | if (GetArena() == other->GetArena()) { |
644 | InternalSwap(other); |
645 | } else { |
646 | ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); |
647 | } |
648 | } |
649 | void UnsafeArenaSwap(AttributeDef* other) { |
650 | if (other == this) return; |
651 | GOOGLE_DCHECK(GetArena() == other->GetArena()); |
652 | InternalSwap(other); |
653 | } |
654 | |
655 | // implements Message ---------------------------------------------- |
656 | |
657 | inline AttributeDef* New() const final { |
658 | return CreateMaybeMessage<AttributeDef>(nullptr); |
659 | } |
660 | |
661 | AttributeDef* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { |
662 | return CreateMaybeMessage<AttributeDef>(arena); |
663 | } |
664 | void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; |
665 | void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; |
666 | void CopyFrom(const AttributeDef& from); |
667 | void MergeFrom(const AttributeDef& from); |
668 | PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; |
669 | bool IsInitialized() const final; |
670 | |
671 | size_t ByteSizeLong() const final; |
672 | const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; |
673 | ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( |
674 | ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; |
675 | int GetCachedSize() const final { return _cached_size_.Get(); } |
676 | |
677 | private: |
678 | inline void SharedCtor(); |
679 | inline void SharedDtor(); |
680 | void SetCachedSize(int size) const final; |
681 | void InternalSwap(AttributeDef* other); |
682 | friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; |
683 | static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { |
684 | return "torch.AttributeDef" ; |
685 | } |
686 | protected: |
687 | explicit AttributeDef(::PROTOBUF_NAMESPACE_ID::Arena* arena); |
688 | private: |
689 | static void ArenaDtor(void* object); |
690 | inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); |
691 | public: |
692 | |
693 | ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; |
694 | private: |
695 | static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { |
696 | ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_caffe2_2fproto_2ftorch_2eproto); |
697 | return ::descriptor_table_caffe2_2fproto_2ftorch_2eproto.file_level_metadata[kIndexInFileMessages]; |
698 | } |
699 | |
700 | public: |
701 | |
702 | // nested types ---------------------------------------------------- |
703 | |
704 | // accessors ------------------------------------------------------- |
705 | |
706 | enum : int { |
707 | kTypeFieldNumber = 1, |
708 | kNameFieldNumber = 2, |
709 | kIdFieldNumber = 3, |
710 | }; |
711 | // required string type = 1; |
712 | bool has_type() const; |
713 | private: |
714 | bool _internal_has_type() const; |
715 | public: |
716 | void clear_type(); |
717 | const std::string& type() const; |
718 | void set_type(const std::string& value); |
719 | void set_type(std::string&& value); |
720 | void set_type(const char* value); |
721 | void set_type(const char* value, size_t size); |
722 | std::string* mutable_type(); |
723 | std::string* release_type(); |
724 | void set_allocated_type(std::string* type); |
725 | private: |
726 | const std::string& _internal_type() const; |
727 | void _internal_set_type(const std::string& value); |
728 | std::string* _internal_mutable_type(); |
729 | public: |
730 | |
731 | // required string name = 2; |
732 | bool has_name() const; |
733 | private: |
734 | bool _internal_has_name() const; |
735 | public: |
736 | void clear_name(); |
737 | const std::string& name() const; |
738 | void set_name(const std::string& value); |
739 | void set_name(std::string&& value); |
740 | void set_name(const char* value); |
741 | void set_name(const char* value, size_t size); |
742 | std::string* mutable_name(); |
743 | std::string* release_name(); |
744 | void set_allocated_name(std::string* name); |
745 | private: |
746 | const std::string& _internal_name() const; |
747 | void _internal_set_name(const std::string& value); |
748 | std::string* _internal_mutable_name(); |
749 | public: |
750 | |
751 | // required int64 id = 3; |
752 | bool has_id() const; |
753 | private: |
754 | bool _internal_has_id() const; |
755 | public: |
756 | void clear_id(); |
757 | ::PROTOBUF_NAMESPACE_ID::int64 id() const; |
758 | void set_id(::PROTOBUF_NAMESPACE_ID::int64 value); |
759 | private: |
760 | ::PROTOBUF_NAMESPACE_ID::int64 _internal_id() const; |
761 | void _internal_set_id(::PROTOBUF_NAMESPACE_ID::int64 value); |
762 | public: |
763 | |
764 | // @@protoc_insertion_point(class_scope:torch.AttributeDef) |
765 | private: |
766 | class _Internal; |
767 | |
768 | // helper for ByteSizeLong() |
769 | size_t RequiredFieldsByteSizeFallback() const; |
770 | |
771 | template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; |
772 | typedef void InternalArenaConstructable_; |
773 | typedef void DestructorSkippable_; |
774 | ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; |
775 | mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; |
776 | ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr type_; |
777 | ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr name_; |
778 | ::PROTOBUF_NAMESPACE_ID::int64 id_; |
779 | friend struct ::TableStruct_caffe2_2fproto_2ftorch_2eproto; |
780 | }; |
781 | // ------------------------------------------------------------------- |
782 | |
783 | class TORCH_API ParameterDef PROTOBUF_FINAL : |
784 | public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:torch.ParameterDef) */ { |
785 | public: |
786 | inline ParameterDef() : ParameterDef(nullptr) {} |
787 | virtual ~ParameterDef(); |
788 | |
789 | ParameterDef(const ParameterDef& from); |
790 | ParameterDef(ParameterDef&& from) noexcept |
791 | : ParameterDef() { |
792 | *this = ::std::move(from); |
793 | } |
794 | |
795 | inline ParameterDef& operator=(const ParameterDef& from) { |
796 | CopyFrom(from); |
797 | return *this; |
798 | } |
799 | inline ParameterDef& operator=(ParameterDef&& from) noexcept { |
800 | if (GetArena() == from.GetArena()) { |
801 | if (this != &from) InternalSwap(&from); |
802 | } else { |
803 | CopyFrom(from); |
804 | } |
805 | return *this; |
806 | } |
807 | |
808 | inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const { |
809 | return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance); |
810 | } |
811 | inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() { |
812 | return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); |
813 | } |
814 | |
815 | static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { |
816 | return GetDescriptor(); |
817 | } |
818 | static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { |
819 | return GetMetadataStatic().descriptor; |
820 | } |
821 | static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { |
822 | return GetMetadataStatic().reflection; |
823 | } |
824 | static const ParameterDef& default_instance(); |
825 | |
826 | static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY |
827 | static inline const ParameterDef* internal_default_instance() { |
828 | return reinterpret_cast<const ParameterDef*>( |
829 | &_ParameterDef_default_instance_); |
830 | } |
831 | static constexpr int kIndexInFileMessages = |
832 | 3; |
833 | |
834 | friend void swap(ParameterDef& a, ParameterDef& b) { |
835 | a.Swap(&b); |
836 | } |
837 | inline void Swap(ParameterDef* other) { |
838 | if (other == this) return; |
839 | if (GetArena() == other->GetArena()) { |
840 | InternalSwap(other); |
841 | } else { |
842 | ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); |
843 | } |
844 | } |
845 | void UnsafeArenaSwap(ParameterDef* other) { |
846 | if (other == this) return; |
847 | GOOGLE_DCHECK(GetArena() == other->GetArena()); |
848 | InternalSwap(other); |
849 | } |
850 | |
851 | // implements Message ---------------------------------------------- |
852 | |
853 | inline ParameterDef* New() const final { |
854 | return CreateMaybeMessage<ParameterDef>(nullptr); |
855 | } |
856 | |
857 | ParameterDef* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { |
858 | return CreateMaybeMessage<ParameterDef>(arena); |
859 | } |
860 | void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; |
861 | void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; |
862 | void CopyFrom(const ParameterDef& from); |
863 | void MergeFrom(const ParameterDef& from); |
864 | PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; |
865 | bool IsInitialized() const final; |
866 | |
867 | size_t ByteSizeLong() const final; |
868 | const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; |
869 | ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( |
870 | ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; |
871 | int GetCachedSize() const final { return _cached_size_.Get(); } |
872 | |
873 | private: |
874 | inline void SharedCtor(); |
875 | inline void SharedDtor(); |
876 | void SetCachedSize(int size) const final; |
877 | void InternalSwap(ParameterDef* other); |
878 | friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; |
879 | static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { |
880 | return "torch.ParameterDef" ; |
881 | } |
882 | protected: |
883 | explicit ParameterDef(::PROTOBUF_NAMESPACE_ID::Arena* arena); |
884 | private: |
885 | static void ArenaDtor(void* object); |
886 | inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); |
887 | public: |
888 | |
889 | ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; |
890 | private: |
891 | static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { |
892 | ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_caffe2_2fproto_2ftorch_2eproto); |
893 | return ::descriptor_table_caffe2_2fproto_2ftorch_2eproto.file_level_metadata[kIndexInFileMessages]; |
894 | } |
895 | |
896 | public: |
897 | |
898 | // nested types ---------------------------------------------------- |
899 | |
900 | // accessors ------------------------------------------------------- |
901 | |
902 | enum : int { |
903 | kNameFieldNumber = 3, |
904 | kTensorIdFieldNumber = 2, |
905 | kIsBufferFieldNumber = 1, |
906 | }; |
907 | // optional string name = 3; |
908 | bool has_name() const; |
909 | private: |
910 | bool _internal_has_name() const; |
911 | public: |
912 | void clear_name(); |
913 | const std::string& name() const; |
914 | void set_name(const std::string& value); |
915 | void set_name(std::string&& value); |
916 | void set_name(const char* value); |
917 | void set_name(const char* value, size_t size); |
918 | std::string* mutable_name(); |
919 | std::string* release_name(); |
920 | void set_allocated_name(std::string* name); |
921 | private: |
922 | const std::string& _internal_name() const; |
923 | void _internal_set_name(const std::string& value); |
924 | std::string* _internal_mutable_name(); |
925 | public: |
926 | |
927 | // optional int64 tensor_id = 2; |
928 | bool has_tensor_id() const; |
929 | private: |
930 | bool _internal_has_tensor_id() const; |
931 | public: |
932 | void clear_tensor_id(); |
933 | ::PROTOBUF_NAMESPACE_ID::int64 tensor_id() const; |
934 | void set_tensor_id(::PROTOBUF_NAMESPACE_ID::int64 value); |
935 | private: |
936 | ::PROTOBUF_NAMESPACE_ID::int64 _internal_tensor_id() const; |
937 | void _internal_set_tensor_id(::PROTOBUF_NAMESPACE_ID::int64 value); |
938 | public: |
939 | |
940 | // optional bool is_buffer = 1; |
941 | bool has_is_buffer() const; |
942 | private: |
943 | bool _internal_has_is_buffer() const; |
944 | public: |
945 | void clear_is_buffer(); |
946 | bool is_buffer() const; |
947 | void set_is_buffer(bool value); |
948 | private: |
949 | bool _internal_is_buffer() const; |
950 | void _internal_set_is_buffer(bool value); |
951 | public: |
952 | |
953 | // @@protoc_insertion_point(class_scope:torch.ParameterDef) |
954 | private: |
955 | class _Internal; |
956 | |
957 | template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; |
958 | typedef void InternalArenaConstructable_; |
959 | typedef void DestructorSkippable_; |
960 | ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; |
961 | mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; |
962 | ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr name_; |
963 | ::PROTOBUF_NAMESPACE_ID::int64 tensor_id_; |
964 | bool is_buffer_; |
965 | friend struct ::TableStruct_caffe2_2fproto_2ftorch_2eproto; |
966 | }; |
967 | // ------------------------------------------------------------------- |
968 | |
969 | class TORCH_API ModuleDef PROTOBUF_FINAL : |
970 | public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:torch.ModuleDef) */ { |
971 | public: |
972 | inline ModuleDef() : ModuleDef(nullptr) {} |
973 | virtual ~ModuleDef(); |
974 | |
975 | ModuleDef(const ModuleDef& from); |
976 | ModuleDef(ModuleDef&& from) noexcept |
977 | : ModuleDef() { |
978 | *this = ::std::move(from); |
979 | } |
980 | |
981 | inline ModuleDef& operator=(const ModuleDef& from) { |
982 | CopyFrom(from); |
983 | return *this; |
984 | } |
985 | inline ModuleDef& operator=(ModuleDef&& from) noexcept { |
986 | if (GetArena() == from.GetArena()) { |
987 | if (this != &from) InternalSwap(&from); |
988 | } else { |
989 | CopyFrom(from); |
990 | } |
991 | return *this; |
992 | } |
993 | |
994 | inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const { |
995 | return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance); |
996 | } |
997 | inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() { |
998 | return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); |
999 | } |
1000 | |
1001 | static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { |
1002 | return GetDescriptor(); |
1003 | } |
1004 | static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { |
1005 | return GetMetadataStatic().descriptor; |
1006 | } |
1007 | static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { |
1008 | return GetMetadataStatic().reflection; |
1009 | } |
1010 | static const ModuleDef& default_instance(); |
1011 | |
1012 | static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY |
1013 | static inline const ModuleDef* internal_default_instance() { |
1014 | return reinterpret_cast<const ModuleDef*>( |
1015 | &_ModuleDef_default_instance_); |
1016 | } |
1017 | static constexpr int kIndexInFileMessages = |
1018 | 4; |
1019 | |
1020 | friend void swap(ModuleDef& a, ModuleDef& b) { |
1021 | a.Swap(&b); |
1022 | } |
1023 | inline void Swap(ModuleDef* other) { |
1024 | if (other == this) return; |
1025 | if (GetArena() == other->GetArena()) { |
1026 | InternalSwap(other); |
1027 | } else { |
1028 | ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); |
1029 | } |
1030 | } |
1031 | void UnsafeArenaSwap(ModuleDef* other) { |
1032 | if (other == this) return; |
1033 | GOOGLE_DCHECK(GetArena() == other->GetArena()); |
1034 | InternalSwap(other); |
1035 | } |
1036 | |
1037 | // implements Message ---------------------------------------------- |
1038 | |
1039 | inline ModuleDef* New() const final { |
1040 | return CreateMaybeMessage<ModuleDef>(nullptr); |
1041 | } |
1042 | |
1043 | ModuleDef* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { |
1044 | return CreateMaybeMessage<ModuleDef>(arena); |
1045 | } |
1046 | void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; |
1047 | void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; |
1048 | void CopyFrom(const ModuleDef& from); |
1049 | void MergeFrom(const ModuleDef& from); |
1050 | PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; |
1051 | bool IsInitialized() const final; |
1052 | |
1053 | size_t ByteSizeLong() const final; |
1054 | const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; |
1055 | ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( |
1056 | ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; |
1057 | int GetCachedSize() const final { return _cached_size_.Get(); } |
1058 | |
1059 | private: |
1060 | inline void SharedCtor(); |
1061 | inline void SharedDtor(); |
1062 | void SetCachedSize(int size) const final; |
1063 | void InternalSwap(ModuleDef* other); |
1064 | friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; |
1065 | static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { |
1066 | return "torch.ModuleDef" ; |
1067 | } |
1068 | protected: |
1069 | explicit ModuleDef(::PROTOBUF_NAMESPACE_ID::Arena* arena); |
1070 | private: |
1071 | static void ArenaDtor(void* object); |
1072 | inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); |
1073 | public: |
1074 | |
1075 | ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; |
1076 | private: |
1077 | static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { |
1078 | ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_caffe2_2fproto_2ftorch_2eproto); |
1079 | return ::descriptor_table_caffe2_2fproto_2ftorch_2eproto.file_level_metadata[kIndexInFileMessages]; |
1080 | } |
1081 | |
1082 | public: |
1083 | |
1084 | // nested types ---------------------------------------------------- |
1085 | |
1086 | // accessors ------------------------------------------------------- |
1087 | |
1088 | enum : int { |
1089 | kSubmodulesFieldNumber = 1, |
1090 | kCaffe2NetsFieldNumber = 3, |
1091 | kParametersFieldNumber = 6, |
1092 | kAttributesFieldNumber = 9, |
1093 | kNameFieldNumber = 7, |
1094 | kTorchscriptArenaFieldNumber = 2, |
1095 | kPickleArenaFieldNumber = 4, |
1096 | kCppArenaFieldNumber = 5, |
1097 | kTorchscriptDebugArenaFieldNumber = 11, |
1098 | kGetStateAttributeIdFieldNumber = 10, |
1099 | kOptimizeFieldNumber = 8, |
1100 | }; |
1101 | // repeated .torch.ModuleDef submodules = 1; |
1102 | int submodules_size() const; |
1103 | private: |
1104 | int _internal_submodules_size() const; |
1105 | public: |
1106 | void clear_submodules(); |
1107 | ::torch::ModuleDef* mutable_submodules(int index); |
1108 | ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::torch::ModuleDef >* |
1109 | mutable_submodules(); |
1110 | private: |
1111 | const ::torch::ModuleDef& _internal_submodules(int index) const; |
1112 | ::torch::ModuleDef* _internal_add_submodules(); |
1113 | public: |
1114 | const ::torch::ModuleDef& submodules(int index) const; |
1115 | ::torch::ModuleDef* add_submodules(); |
1116 | const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::torch::ModuleDef >& |
1117 | submodules() const; |
1118 | |
1119 | // repeated .caffe2.NetDef caffe2_nets = 3; |
1120 | int caffe2_nets_size() const; |
1121 | private: |
1122 | int _internal_caffe2_nets_size() const; |
1123 | public: |
1124 | void clear_caffe2_nets(); |
1125 | ::caffe2::NetDef* mutable_caffe2_nets(int index); |
1126 | ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::caffe2::NetDef >* |
1127 | mutable_caffe2_nets(); |
1128 | private: |
1129 | const ::caffe2::NetDef& _internal_caffe2_nets(int index) const; |
1130 | ::caffe2::NetDef* _internal_add_caffe2_nets(); |
1131 | public: |
1132 | const ::caffe2::NetDef& caffe2_nets(int index) const; |
1133 | ::caffe2::NetDef* add_caffe2_nets(); |
1134 | const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::caffe2::NetDef >& |
1135 | caffe2_nets() const; |
1136 | |
1137 | // repeated .torch.ParameterDef parameters = 6; |
1138 | int parameters_size() const; |
1139 | private: |
1140 | int _internal_parameters_size() const; |
1141 | public: |
1142 | void clear_parameters(); |
1143 | ::torch::ParameterDef* mutable_parameters(int index); |
1144 | ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::torch::ParameterDef >* |
1145 | mutable_parameters(); |
1146 | private: |
1147 | const ::torch::ParameterDef& _internal_parameters(int index) const; |
1148 | ::torch::ParameterDef* _internal_add_parameters(); |
1149 | public: |
1150 | const ::torch::ParameterDef& parameters(int index) const; |
1151 | ::torch::ParameterDef* add_parameters(); |
1152 | const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::torch::ParameterDef >& |
1153 | parameters() const; |
1154 | |
1155 | // repeated .torch.AttributeDef attributes = 9; |
1156 | int attributes_size() const; |
1157 | private: |
1158 | int _internal_attributes_size() const; |
1159 | public: |
1160 | void clear_attributes(); |
1161 | ::torch::AttributeDef* mutable_attributes(int index); |
1162 | ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::torch::AttributeDef >* |
1163 | mutable_attributes(); |
1164 | private: |
1165 | const ::torch::AttributeDef& _internal_attributes(int index) const; |
1166 | ::torch::AttributeDef* _internal_add_attributes(); |
1167 | public: |
1168 | const ::torch::AttributeDef& attributes(int index) const; |
1169 | ::torch::AttributeDef* add_attributes(); |
1170 | const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::torch::AttributeDef >& |
1171 | attributes() const; |
1172 | |
1173 | // optional string name = 7; |
1174 | bool has_name() const; |
1175 | private: |
1176 | bool _internal_has_name() const; |
1177 | public: |
1178 | void clear_name(); |
1179 | const std::string& name() const; |
1180 | void set_name(const std::string& value); |
1181 | void set_name(std::string&& value); |
1182 | void set_name(const char* value); |
1183 | void set_name(const char* value, size_t size); |
1184 | std::string* mutable_name(); |
1185 | std::string* release_name(); |
1186 | void set_allocated_name(std::string* name); |
1187 | private: |
1188 | const std::string& _internal_name() const; |
1189 | void _internal_set_name(const std::string& value); |
1190 | std::string* _internal_mutable_name(); |
1191 | public: |
1192 | |
1193 | // optional .torch.RecordRef torchscript_arena = 2; |
1194 | bool has_torchscript_arena() const; |
1195 | private: |
1196 | bool _internal_has_torchscript_arena() const; |
1197 | public: |
1198 | void clear_torchscript_arena(); |
1199 | const ::torch::RecordRef& torchscript_arena() const; |
1200 | ::torch::RecordRef* release_torchscript_arena(); |
1201 | ::torch::RecordRef* mutable_torchscript_arena(); |
1202 | void set_allocated_torchscript_arena(::torch::RecordRef* torchscript_arena); |
1203 | private: |
1204 | const ::torch::RecordRef& _internal_torchscript_arena() const; |
1205 | ::torch::RecordRef* _internal_mutable_torchscript_arena(); |
1206 | public: |
1207 | void unsafe_arena_set_allocated_torchscript_arena( |
1208 | ::torch::RecordRef* torchscript_arena); |
1209 | ::torch::RecordRef* unsafe_arena_release_torchscript_arena(); |
1210 | |
1211 | // optional .torch.RecordRef pickle_arena = 4; |
1212 | bool has_pickle_arena() const; |
1213 | private: |
1214 | bool _internal_has_pickle_arena() const; |
1215 | public: |
1216 | void clear_pickle_arena(); |
1217 | const ::torch::RecordRef& pickle_arena() const; |
1218 | ::torch::RecordRef* release_pickle_arena(); |
1219 | ::torch::RecordRef* mutable_pickle_arena(); |
1220 | void set_allocated_pickle_arena(::torch::RecordRef* pickle_arena); |
1221 | private: |
1222 | const ::torch::RecordRef& _internal_pickle_arena() const; |
1223 | ::torch::RecordRef* _internal_mutable_pickle_arena(); |
1224 | public: |
1225 | void unsafe_arena_set_allocated_pickle_arena( |
1226 | ::torch::RecordRef* pickle_arena); |
1227 | ::torch::RecordRef* unsafe_arena_release_pickle_arena(); |
1228 | |
1229 | // optional .torch.RecordRef cpp_arena = 5; |
1230 | bool has_cpp_arena() const; |
1231 | private: |
1232 | bool _internal_has_cpp_arena() const; |
1233 | public: |
1234 | void clear_cpp_arena(); |
1235 | const ::torch::RecordRef& cpp_arena() const; |
1236 | ::torch::RecordRef* release_cpp_arena(); |
1237 | ::torch::RecordRef* mutable_cpp_arena(); |
1238 | void set_allocated_cpp_arena(::torch::RecordRef* cpp_arena); |
1239 | private: |
1240 | const ::torch::RecordRef& _internal_cpp_arena() const; |
1241 | ::torch::RecordRef* _internal_mutable_cpp_arena(); |
1242 | public: |
1243 | void unsafe_arena_set_allocated_cpp_arena( |
1244 | ::torch::RecordRef* cpp_arena); |
1245 | ::torch::RecordRef* unsafe_arena_release_cpp_arena(); |
1246 | |
1247 | // optional .torch.RecordRef torchscript_debug_arena = 11; |
1248 | bool has_torchscript_debug_arena() const; |
1249 | private: |
1250 | bool _internal_has_torchscript_debug_arena() const; |
1251 | public: |
1252 | void clear_torchscript_debug_arena(); |
1253 | const ::torch::RecordRef& torchscript_debug_arena() const; |
1254 | ::torch::RecordRef* release_torchscript_debug_arena(); |
1255 | ::torch::RecordRef* mutable_torchscript_debug_arena(); |
1256 | void set_allocated_torchscript_debug_arena(::torch::RecordRef* torchscript_debug_arena); |
1257 | private: |
1258 | const ::torch::RecordRef& _internal_torchscript_debug_arena() const; |
1259 | ::torch::RecordRef* _internal_mutable_torchscript_debug_arena(); |
1260 | public: |
1261 | void unsafe_arena_set_allocated_torchscript_debug_arena( |
1262 | ::torch::RecordRef* torchscript_debug_arena); |
1263 | ::torch::RecordRef* unsafe_arena_release_torchscript_debug_arena(); |
1264 | |
1265 | // optional int64 get_state_attribute_id = 10; |
1266 | bool has_get_state_attribute_id() const; |
1267 | private: |
1268 | bool _internal_has_get_state_attribute_id() const; |
1269 | public: |
1270 | void clear_get_state_attribute_id(); |
1271 | ::PROTOBUF_NAMESPACE_ID::int64 get_state_attribute_id() const; |
1272 | void set_get_state_attribute_id(::PROTOBUF_NAMESPACE_ID::int64 value); |
1273 | private: |
1274 | ::PROTOBUF_NAMESPACE_ID::int64 _internal_get_state_attribute_id() const; |
1275 | void _internal_set_get_state_attribute_id(::PROTOBUF_NAMESPACE_ID::int64 value); |
1276 | public: |
1277 | |
1278 | // optional bool optimize = 8; |
1279 | bool has_optimize() const; |
1280 | private: |
1281 | bool _internal_has_optimize() const; |
1282 | public: |
1283 | void clear_optimize(); |
1284 | bool optimize() const; |
1285 | void set_optimize(bool value); |
1286 | private: |
1287 | bool _internal_optimize() const; |
1288 | void _internal_set_optimize(bool value); |
1289 | public: |
1290 | |
1291 | // @@protoc_insertion_point(class_scope:torch.ModuleDef) |
1292 | private: |
1293 | class _Internal; |
1294 | |
1295 | template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; |
1296 | typedef void InternalArenaConstructable_; |
1297 | typedef void DestructorSkippable_; |
1298 | ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; |
1299 | mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; |
1300 | ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::torch::ModuleDef > submodules_; |
1301 | ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::caffe2::NetDef > caffe2_nets_; |
1302 | ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::torch::ParameterDef > parameters_; |
1303 | ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::torch::AttributeDef > attributes_; |
1304 | ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr name_; |
1305 | ::torch::RecordRef* torchscript_arena_; |
1306 | ::torch::RecordRef* pickle_arena_; |
1307 | ::torch::RecordRef* cpp_arena_; |
1308 | ::torch::RecordRef* torchscript_debug_arena_; |
1309 | ::PROTOBUF_NAMESPACE_ID::int64 get_state_attribute_id_; |
1310 | bool optimize_; |
1311 | friend struct ::TableStruct_caffe2_2fproto_2ftorch_2eproto; |
1312 | }; |
1313 | // ------------------------------------------------------------------- |
1314 | |
1315 | class TORCH_API LibDef PROTOBUF_FINAL : |
1316 | public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:torch.LibDef) */ { |
1317 | public: |
1318 | inline LibDef() : LibDef(nullptr) {} |
1319 | virtual ~LibDef(); |
1320 | |
1321 | LibDef(const LibDef& from); |
1322 | LibDef(LibDef&& from) noexcept |
1323 | : LibDef() { |
1324 | *this = ::std::move(from); |
1325 | } |
1326 | |
1327 | inline LibDef& operator=(const LibDef& from) { |
1328 | CopyFrom(from); |
1329 | return *this; |
1330 | } |
1331 | inline LibDef& operator=(LibDef&& from) noexcept { |
1332 | if (GetArena() == from.GetArena()) { |
1333 | if (this != &from) InternalSwap(&from); |
1334 | } else { |
1335 | CopyFrom(from); |
1336 | } |
1337 | return *this; |
1338 | } |
1339 | |
1340 | inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const { |
1341 | return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance); |
1342 | } |
1343 | inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() { |
1344 | return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); |
1345 | } |
1346 | |
1347 | static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { |
1348 | return GetDescriptor(); |
1349 | } |
1350 | static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { |
1351 | return GetMetadataStatic().descriptor; |
1352 | } |
1353 | static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { |
1354 | return GetMetadataStatic().reflection; |
1355 | } |
1356 | static const LibDef& default_instance(); |
1357 | |
1358 | static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY |
1359 | static inline const LibDef* internal_default_instance() { |
1360 | return reinterpret_cast<const LibDef*>( |
1361 | &_LibDef_default_instance_); |
1362 | } |
1363 | static constexpr int kIndexInFileMessages = |
1364 | 5; |
1365 | |
1366 | friend void swap(LibDef& a, LibDef& b) { |
1367 | a.Swap(&b); |
1368 | } |
1369 | inline void Swap(LibDef* other) { |
1370 | if (other == this) return; |
1371 | if (GetArena() == other->GetArena()) { |
1372 | InternalSwap(other); |
1373 | } else { |
1374 | ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); |
1375 | } |
1376 | } |
1377 | void UnsafeArenaSwap(LibDef* other) { |
1378 | if (other == this) return; |
1379 | GOOGLE_DCHECK(GetArena() == other->GetArena()); |
1380 | InternalSwap(other); |
1381 | } |
1382 | |
1383 | // implements Message ---------------------------------------------- |
1384 | |
1385 | inline LibDef* New() const final { |
1386 | return CreateMaybeMessage<LibDef>(nullptr); |
1387 | } |
1388 | |
1389 | LibDef* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { |
1390 | return CreateMaybeMessage<LibDef>(arena); |
1391 | } |
1392 | void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; |
1393 | void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; |
1394 | void CopyFrom(const LibDef& from); |
1395 | void MergeFrom(const LibDef& from); |
1396 | PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; |
1397 | bool IsInitialized() const final; |
1398 | |
1399 | size_t ByteSizeLong() const final; |
1400 | const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; |
1401 | ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( |
1402 | ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; |
1403 | int GetCachedSize() const final { return _cached_size_.Get(); } |
1404 | |
1405 | private: |
1406 | inline void SharedCtor(); |
1407 | inline void SharedDtor(); |
1408 | void SetCachedSize(int size) const final; |
1409 | void InternalSwap(LibDef* other); |
1410 | friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; |
1411 | static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { |
1412 | return "torch.LibDef" ; |
1413 | } |
1414 | protected: |
1415 | explicit LibDef(::PROTOBUF_NAMESPACE_ID::Arena* arena); |
1416 | private: |
1417 | static void ArenaDtor(void* object); |
1418 | inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); |
1419 | public: |
1420 | |
1421 | ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; |
1422 | private: |
1423 | static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { |
1424 | ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_caffe2_2fproto_2ftorch_2eproto); |
1425 | return ::descriptor_table_caffe2_2fproto_2ftorch_2eproto.file_level_metadata[kIndexInFileMessages]; |
1426 | } |
1427 | |
1428 | public: |
1429 | |
1430 | // nested types ---------------------------------------------------- |
1431 | |
1432 | // accessors ------------------------------------------------------- |
1433 | |
1434 | enum : int { |
1435 | kTorchscriptArenaFieldNumber = 1, |
1436 | }; |
1437 | // optional .torch.RecordRef torchscript_arena = 1; |
1438 | bool has_torchscript_arena() const; |
1439 | private: |
1440 | bool _internal_has_torchscript_arena() const; |
1441 | public: |
1442 | void clear_torchscript_arena(); |
1443 | const ::torch::RecordRef& torchscript_arena() const; |
1444 | ::torch::RecordRef* release_torchscript_arena(); |
1445 | ::torch::RecordRef* mutable_torchscript_arena(); |
1446 | void set_allocated_torchscript_arena(::torch::RecordRef* torchscript_arena); |
1447 | private: |
1448 | const ::torch::RecordRef& _internal_torchscript_arena() const; |
1449 | ::torch::RecordRef* _internal_mutable_torchscript_arena(); |
1450 | public: |
1451 | void unsafe_arena_set_allocated_torchscript_arena( |
1452 | ::torch::RecordRef* torchscript_arena); |
1453 | ::torch::RecordRef* unsafe_arena_release_torchscript_arena(); |
1454 | |
1455 | // @@protoc_insertion_point(class_scope:torch.LibDef) |
1456 | private: |
1457 | class _Internal; |
1458 | |
1459 | template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; |
1460 | typedef void InternalArenaConstructable_; |
1461 | typedef void DestructorSkippable_; |
1462 | ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; |
1463 | mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; |
1464 | ::torch::RecordRef* torchscript_arena_; |
1465 | friend struct ::TableStruct_caffe2_2fproto_2ftorch_2eproto; |
1466 | }; |
1467 | // ------------------------------------------------------------------- |
1468 | |
1469 | class TORCH_API ModelDef PROTOBUF_FINAL : |
1470 | public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:torch.ModelDef) */ { |
1471 | public: |
1472 | inline ModelDef() : ModelDef(nullptr) {} |
1473 | virtual ~ModelDef(); |
1474 | |
1475 | ModelDef(const ModelDef& from); |
1476 | ModelDef(ModelDef&& from) noexcept |
1477 | : ModelDef() { |
1478 | *this = ::std::move(from); |
1479 | } |
1480 | |
1481 | inline ModelDef& operator=(const ModelDef& from) { |
1482 | CopyFrom(from); |
1483 | return *this; |
1484 | } |
1485 | inline ModelDef& operator=(ModelDef&& from) noexcept { |
1486 | if (GetArena() == from.GetArena()) { |
1487 | if (this != &from) InternalSwap(&from); |
1488 | } else { |
1489 | CopyFrom(from); |
1490 | } |
1491 | return *this; |
1492 | } |
1493 | |
1494 | inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const { |
1495 | return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance); |
1496 | } |
1497 | inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() { |
1498 | return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); |
1499 | } |
1500 | |
1501 | static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { |
1502 | return GetDescriptor(); |
1503 | } |
1504 | static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { |
1505 | return GetMetadataStatic().descriptor; |
1506 | } |
1507 | static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { |
1508 | return GetMetadataStatic().reflection; |
1509 | } |
1510 | static const ModelDef& default_instance(); |
1511 | |
1512 | static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY |
1513 | static inline const ModelDef* internal_default_instance() { |
1514 | return reinterpret_cast<const ModelDef*>( |
1515 | &_ModelDef_default_instance_); |
1516 | } |
1517 | static constexpr int kIndexInFileMessages = |
1518 | 6; |
1519 | |
1520 | friend void swap(ModelDef& a, ModelDef& b) { |
1521 | a.Swap(&b); |
1522 | } |
1523 | inline void Swap(ModelDef* other) { |
1524 | if (other == this) return; |
1525 | if (GetArena() == other->GetArena()) { |
1526 | InternalSwap(other); |
1527 | } else { |
1528 | ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); |
1529 | } |
1530 | } |
1531 | void UnsafeArenaSwap(ModelDef* other) { |
1532 | if (other == this) return; |
1533 | GOOGLE_DCHECK(GetArena() == other->GetArena()); |
1534 | InternalSwap(other); |
1535 | } |
1536 | |
1537 | // implements Message ---------------------------------------------- |
1538 | |
1539 | inline ModelDef* New() const final { |
1540 | return CreateMaybeMessage<ModelDef>(nullptr); |
1541 | } |
1542 | |
1543 | ModelDef* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { |
1544 | return CreateMaybeMessage<ModelDef>(arena); |
1545 | } |
1546 | void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; |
1547 | void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; |
1548 | void CopyFrom(const ModelDef& from); |
1549 | void MergeFrom(const ModelDef& from); |
1550 | PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; |
1551 | bool IsInitialized() const final; |
1552 | |
1553 | size_t ByteSizeLong() const final; |
1554 | const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; |
1555 | ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( |
1556 | ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; |
1557 | int GetCachedSize() const final { return _cached_size_.Get(); } |
1558 | |
1559 | private: |
1560 | inline void SharedCtor(); |
1561 | inline void SharedDtor(); |
1562 | void SetCachedSize(int size) const final; |
1563 | void InternalSwap(ModelDef* other); |
1564 | friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; |
1565 | static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { |
1566 | return "torch.ModelDef" ; |
1567 | } |
1568 | protected: |
1569 | explicit ModelDef(::PROTOBUF_NAMESPACE_ID::Arena* arena); |
1570 | private: |
1571 | static void ArenaDtor(void* object); |
1572 | inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); |
1573 | public: |
1574 | |
1575 | ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; |
1576 | private: |
1577 | static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { |
1578 | ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_caffe2_2fproto_2ftorch_2eproto); |
1579 | return ::descriptor_table_caffe2_2fproto_2ftorch_2eproto.file_level_metadata[kIndexInFileMessages]; |
1580 | } |
1581 | |
1582 | public: |
1583 | |
1584 | // nested types ---------------------------------------------------- |
1585 | |
1586 | // accessors ------------------------------------------------------- |
1587 | |
1588 | enum : int { |
1589 | kTensorsFieldNumber = 5, |
1590 | kProducerNameFieldNumber = 3, |
1591 | kProducerVersionFieldNumber = 4, |
1592 | kMainModuleFieldNumber = 2, |
1593 | kProtoVersionFieldNumber = 1, |
1594 | }; |
1595 | // repeated .torch.TensorDef tensors = 5; |
1596 | int tensors_size() const; |
1597 | private: |
1598 | int _internal_tensors_size() const; |
1599 | public: |
1600 | void clear_tensors(); |
1601 | ::torch::TensorDef* mutable_tensors(int index); |
1602 | ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::torch::TensorDef >* |
1603 | mutable_tensors(); |
1604 | private: |
1605 | const ::torch::TensorDef& _internal_tensors(int index) const; |
1606 | ::torch::TensorDef* _internal_add_tensors(); |
1607 | public: |
1608 | const ::torch::TensorDef& tensors(int index) const; |
1609 | ::torch::TensorDef* add_tensors(); |
1610 | const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::torch::TensorDef >& |
1611 | tensors() const; |
1612 | |
1613 | // optional string producer_name = 3; |
1614 | bool has_producer_name() const; |
1615 | private: |
1616 | bool _internal_has_producer_name() const; |
1617 | public: |
1618 | void clear_producer_name(); |
1619 | const std::string& producer_name() const; |
1620 | void set_producer_name(const std::string& value); |
1621 | void set_producer_name(std::string&& value); |
1622 | void set_producer_name(const char* value); |
1623 | void set_producer_name(const char* value, size_t size); |
1624 | std::string* mutable_producer_name(); |
1625 | std::string* release_producer_name(); |
1626 | void set_allocated_producer_name(std::string* producer_name); |
1627 | private: |
1628 | const std::string& _internal_producer_name() const; |
1629 | void _internal_set_producer_name(const std::string& value); |
1630 | std::string* _internal_mutable_producer_name(); |
1631 | public: |
1632 | |
1633 | // optional string producer_version = 4; |
1634 | bool has_producer_version() const; |
1635 | private: |
1636 | bool _internal_has_producer_version() const; |
1637 | public: |
1638 | void clear_producer_version(); |
1639 | const std::string& producer_version() const; |
1640 | void set_producer_version(const std::string& value); |
1641 | void set_producer_version(std::string&& value); |
1642 | void set_producer_version(const char* value); |
1643 | void set_producer_version(const char* value, size_t size); |
1644 | std::string* mutable_producer_version(); |
1645 | std::string* release_producer_version(); |
1646 | void set_allocated_producer_version(std::string* producer_version); |
1647 | private: |
1648 | const std::string& _internal_producer_version() const; |
1649 | void _internal_set_producer_version(const std::string& value); |
1650 | std::string* _internal_mutable_producer_version(); |
1651 | public: |
1652 | |
1653 | // optional .torch.ModuleDef main_module = 2; |
1654 | bool has_main_module() const; |
1655 | private: |
1656 | bool _internal_has_main_module() const; |
1657 | public: |
1658 | void clear_main_module(); |
1659 | const ::torch::ModuleDef& main_module() const; |
1660 | ::torch::ModuleDef* release_main_module(); |
1661 | ::torch::ModuleDef* mutable_main_module(); |
1662 | void set_allocated_main_module(::torch::ModuleDef* main_module); |
1663 | private: |
1664 | const ::torch::ModuleDef& _internal_main_module() const; |
1665 | ::torch::ModuleDef* _internal_mutable_main_module(); |
1666 | public: |
1667 | void unsafe_arena_set_allocated_main_module( |
1668 | ::torch::ModuleDef* main_module); |
1669 | ::torch::ModuleDef* unsafe_arena_release_main_module(); |
1670 | |
1671 | // optional int64 proto_version = 1; |
1672 | bool has_proto_version() const; |
1673 | private: |
1674 | bool _internal_has_proto_version() const; |
1675 | public: |
1676 | void clear_proto_version(); |
1677 | ::PROTOBUF_NAMESPACE_ID::int64 proto_version() const; |
1678 | void set_proto_version(::PROTOBUF_NAMESPACE_ID::int64 value); |
1679 | private: |
1680 | ::PROTOBUF_NAMESPACE_ID::int64 _internal_proto_version() const; |
1681 | void _internal_set_proto_version(::PROTOBUF_NAMESPACE_ID::int64 value); |
1682 | public: |
1683 | |
1684 | // @@protoc_insertion_point(class_scope:torch.ModelDef) |
1685 | private: |
1686 | class _Internal; |
1687 | |
1688 | template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; |
1689 | typedef void InternalArenaConstructable_; |
1690 | typedef void DestructorSkippable_; |
1691 | ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; |
1692 | mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; |
1693 | ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::torch::TensorDef > tensors_; |
1694 | ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr producer_name_; |
1695 | ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr producer_version_; |
1696 | ::torch::ModuleDef* main_module_; |
1697 | ::PROTOBUF_NAMESPACE_ID::int64 proto_version_; |
1698 | friend struct ::TableStruct_caffe2_2fproto_2ftorch_2eproto; |
1699 | }; |
1700 | // =================================================================== |
1701 | |
1702 | |
1703 | // =================================================================== |
1704 | |
1705 | #ifdef __GNUC__ |
1706 | #pragma GCC diagnostic push |
1707 | #pragma GCC diagnostic ignored "-Wstrict-aliasing" |
1708 | #endif // __GNUC__ |
1709 | // RecordRef |
1710 | |
1711 | // optional string key = 1; |
1712 | inline bool RecordRef::_internal_has_key() const { |
1713 | bool value = (_has_bits_[0] & 0x00000001u) != 0; |
1714 | return value; |
1715 | } |
1716 | inline bool RecordRef::has_key() const { |
1717 | return _internal_has_key(); |
1718 | } |
1719 | inline void RecordRef::clear_key() { |
1720 | key_.ClearToEmpty(&GetEmptyStringAlreadyInited(), GetArena()); |
1721 | _has_bits_[0] &= ~0x00000001u; |
1722 | } |
1723 | inline const std::string& RecordRef::key() const { |
1724 | // @@protoc_insertion_point(field_get:torch.RecordRef.key) |
1725 | return _internal_key(); |
1726 | } |
1727 | inline void RecordRef::set_key(const std::string& value) { |
1728 | _internal_set_key(value); |
1729 | // @@protoc_insertion_point(field_set:torch.RecordRef.key) |
1730 | } |
1731 | inline std::string* RecordRef::mutable_key() { |
1732 | // @@protoc_insertion_point(field_mutable:torch.RecordRef.key) |
1733 | return _internal_mutable_key(); |
1734 | } |
1735 | inline const std::string& RecordRef::_internal_key() const { |
1736 | return key_.Get(); |
1737 | } |
1738 | inline void RecordRef::_internal_set_key(const std::string& value) { |
1739 | _has_bits_[0] |= 0x00000001u; |
1740 | key_.Set(&GetEmptyStringAlreadyInited(), value, GetArena()); |
1741 | } |
1742 | inline void RecordRef::set_key(std::string&& value) { |
1743 | _has_bits_[0] |= 0x00000001u; |
1744 | key_.Set( |
1745 | &GetEmptyStringAlreadyInited(), ::std::move(value), GetArena()); |
1746 | // @@protoc_insertion_point(field_set_rvalue:torch.RecordRef.key) |
1747 | } |
1748 | inline void RecordRef::set_key(const char* value) { |
1749 | GOOGLE_DCHECK(value != nullptr); |
1750 | _has_bits_[0] |= 0x00000001u; |
1751 | key_.Set(&GetEmptyStringAlreadyInited(), ::std::string(value), |
1752 | GetArena()); |
1753 | // @@protoc_insertion_point(field_set_char:torch.RecordRef.key) |
1754 | } |
1755 | inline void RecordRef::set_key(const char* value, |
1756 | size_t size) { |
1757 | _has_bits_[0] |= 0x00000001u; |
1758 | key_.Set(&GetEmptyStringAlreadyInited(), ::std::string( |
1759 | reinterpret_cast<const char*>(value), size), GetArena()); |
1760 | // @@protoc_insertion_point(field_set_pointer:torch.RecordRef.key) |
1761 | } |
1762 | inline std::string* RecordRef::_internal_mutable_key() { |
1763 | _has_bits_[0] |= 0x00000001u; |
1764 | return key_.Mutable(&GetEmptyStringAlreadyInited(), GetArena()); |
1765 | } |
1766 | inline std::string* RecordRef::release_key() { |
1767 | // @@protoc_insertion_point(field_release:torch.RecordRef.key) |
1768 | if (!_internal_has_key()) { |
1769 | return nullptr; |
1770 | } |
1771 | _has_bits_[0] &= ~0x00000001u; |
1772 | return key_.ReleaseNonDefault(&GetEmptyStringAlreadyInited(), GetArena()); |
1773 | } |
1774 | inline void RecordRef::set_allocated_key(std::string* key) { |
1775 | if (key != nullptr) { |
1776 | _has_bits_[0] |= 0x00000001u; |
1777 | } else { |
1778 | _has_bits_[0] &= ~0x00000001u; |
1779 | } |
1780 | key_.SetAllocated(&GetEmptyStringAlreadyInited(), key, |
1781 | GetArena()); |
1782 | // @@protoc_insertion_point(field_set_allocated:torch.RecordRef.key) |
1783 | } |
1784 | |
1785 | // ------------------------------------------------------------------- |
1786 | |
1787 | // TensorDef |
1788 | |
1789 | // repeated int64 dims = 1; |
1790 | inline int TensorDef::_internal_dims_size() const { |
1791 | return dims_.size(); |
1792 | } |
1793 | inline int TensorDef::dims_size() const { |
1794 | return _internal_dims_size(); |
1795 | } |
1796 | inline void TensorDef::clear_dims() { |
1797 | dims_.Clear(); |
1798 | } |
1799 | inline ::PROTOBUF_NAMESPACE_ID::int64 TensorDef::_internal_dims(int index) const { |
1800 | return dims_.Get(index); |
1801 | } |
1802 | inline ::PROTOBUF_NAMESPACE_ID::int64 TensorDef::dims(int index) const { |
1803 | // @@protoc_insertion_point(field_get:torch.TensorDef.dims) |
1804 | return _internal_dims(index); |
1805 | } |
1806 | inline void TensorDef::set_dims(int index, ::PROTOBUF_NAMESPACE_ID::int64 value) { |
1807 | dims_.Set(index, value); |
1808 | // @@protoc_insertion_point(field_set:torch.TensorDef.dims) |
1809 | } |
1810 | inline void TensorDef::_internal_add_dims(::PROTOBUF_NAMESPACE_ID::int64 value) { |
1811 | dims_.Add(value); |
1812 | } |
1813 | inline void TensorDef::add_dims(::PROTOBUF_NAMESPACE_ID::int64 value) { |
1814 | _internal_add_dims(value); |
1815 | // @@protoc_insertion_point(field_add:torch.TensorDef.dims) |
1816 | } |
1817 | inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< ::PROTOBUF_NAMESPACE_ID::int64 >& |
1818 | TensorDef::_internal_dims() const { |
1819 | return dims_; |
1820 | } |
1821 | inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< ::PROTOBUF_NAMESPACE_ID::int64 >& |
1822 | TensorDef::dims() const { |
1823 | // @@protoc_insertion_point(field_list:torch.TensorDef.dims) |
1824 | return _internal_dims(); |
1825 | } |
1826 | inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< ::PROTOBUF_NAMESPACE_ID::int64 >* |
1827 | TensorDef::_internal_mutable_dims() { |
1828 | return &dims_; |
1829 | } |
1830 | inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< ::PROTOBUF_NAMESPACE_ID::int64 >* |
1831 | TensorDef::mutable_dims() { |
1832 | // @@protoc_insertion_point(field_mutable_list:torch.TensorDef.dims) |
1833 | return _internal_mutable_dims(); |
1834 | } |
1835 | |
1836 | // optional int64 offset = 2; |
1837 | inline bool TensorDef::_internal_has_offset() const { |
1838 | bool value = (_has_bits_[0] & 0x00000004u) != 0; |
1839 | return value; |
1840 | } |
1841 | inline bool TensorDef::has_offset() const { |
1842 | return _internal_has_offset(); |
1843 | } |
1844 | inline void TensorDef::clear_offset() { |
1845 | offset_ = PROTOBUF_LONGLONG(0); |
1846 | _has_bits_[0] &= ~0x00000004u; |
1847 | } |
1848 | inline ::PROTOBUF_NAMESPACE_ID::int64 TensorDef::_internal_offset() const { |
1849 | return offset_; |
1850 | } |
1851 | inline ::PROTOBUF_NAMESPACE_ID::int64 TensorDef::offset() const { |
1852 | // @@protoc_insertion_point(field_get:torch.TensorDef.offset) |
1853 | return _internal_offset(); |
1854 | } |
1855 | inline void TensorDef::_internal_set_offset(::PROTOBUF_NAMESPACE_ID::int64 value) { |
1856 | _has_bits_[0] |= 0x00000004u; |
1857 | offset_ = value; |
1858 | } |
1859 | inline void TensorDef::set_offset(::PROTOBUF_NAMESPACE_ID::int64 value) { |
1860 | _internal_set_offset(value); |
1861 | // @@protoc_insertion_point(field_set:torch.TensorDef.offset) |
1862 | } |
1863 | |
1864 | // repeated int64 strides = 3; |
1865 | inline int TensorDef::_internal_strides_size() const { |
1866 | return strides_.size(); |
1867 | } |
1868 | inline int TensorDef::strides_size() const { |
1869 | return _internal_strides_size(); |
1870 | } |
1871 | inline void TensorDef::clear_strides() { |
1872 | strides_.Clear(); |
1873 | } |
1874 | inline ::PROTOBUF_NAMESPACE_ID::int64 TensorDef::_internal_strides(int index) const { |
1875 | return strides_.Get(index); |
1876 | } |
1877 | inline ::PROTOBUF_NAMESPACE_ID::int64 TensorDef::strides(int index) const { |
1878 | // @@protoc_insertion_point(field_get:torch.TensorDef.strides) |
1879 | return _internal_strides(index); |
1880 | } |
1881 | inline void TensorDef::set_strides(int index, ::PROTOBUF_NAMESPACE_ID::int64 value) { |
1882 | strides_.Set(index, value); |
1883 | // @@protoc_insertion_point(field_set:torch.TensorDef.strides) |
1884 | } |
1885 | inline void TensorDef::_internal_add_strides(::PROTOBUF_NAMESPACE_ID::int64 value) { |
1886 | strides_.Add(value); |
1887 | } |
1888 | inline void TensorDef::add_strides(::PROTOBUF_NAMESPACE_ID::int64 value) { |
1889 | _internal_add_strides(value); |
1890 | // @@protoc_insertion_point(field_add:torch.TensorDef.strides) |
1891 | } |
1892 | inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< ::PROTOBUF_NAMESPACE_ID::int64 >& |
1893 | TensorDef::_internal_strides() const { |
1894 | return strides_; |
1895 | } |
1896 | inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< ::PROTOBUF_NAMESPACE_ID::int64 >& |
1897 | TensorDef::strides() const { |
1898 | // @@protoc_insertion_point(field_list:torch.TensorDef.strides) |
1899 | return _internal_strides(); |
1900 | } |
1901 | inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< ::PROTOBUF_NAMESPACE_ID::int64 >* |
1902 | TensorDef::_internal_mutable_strides() { |
1903 | return &strides_; |
1904 | } |
1905 | inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< ::PROTOBUF_NAMESPACE_ID::int64 >* |
1906 | TensorDef::mutable_strides() { |
1907 | // @@protoc_insertion_point(field_mutable_list:torch.TensorDef.strides) |
1908 | return _internal_mutable_strides(); |
1909 | } |
1910 | |
1911 | // optional bool requires_grad = 4; |
1912 | inline bool TensorDef::_internal_has_requires_grad() const { |
1913 | bool value = (_has_bits_[0] & 0x00000010u) != 0; |
1914 | return value; |
1915 | } |
1916 | inline bool TensorDef::has_requires_grad() const { |
1917 | return _internal_has_requires_grad(); |
1918 | } |
1919 | inline void TensorDef::clear_requires_grad() { |
1920 | requires_grad_ = false; |
1921 | _has_bits_[0] &= ~0x00000010u; |
1922 | } |
1923 | inline bool TensorDef::_internal_requires_grad() const { |
1924 | return requires_grad_; |
1925 | } |
1926 | inline bool TensorDef::requires_grad() const { |
1927 | // @@protoc_insertion_point(field_get:torch.TensorDef.requires_grad) |
1928 | return _internal_requires_grad(); |
1929 | } |
1930 | inline void TensorDef::_internal_set_requires_grad(bool value) { |
1931 | _has_bits_[0] |= 0x00000010u; |
1932 | requires_grad_ = value; |
1933 | } |
1934 | inline void TensorDef::set_requires_grad(bool value) { |
1935 | _internal_set_requires_grad(value); |
1936 | // @@protoc_insertion_point(field_set:torch.TensorDef.requires_grad) |
1937 | } |
1938 | |
1939 | // optional .caffe2.TensorProto.DataType data_type = 5; |
1940 | inline bool TensorDef::_internal_has_data_type() const { |
1941 | bool value = (_has_bits_[0] & 0x00000008u) != 0; |
1942 | return value; |
1943 | } |
1944 | inline bool TensorDef::has_data_type() const { |
1945 | return _internal_has_data_type(); |
1946 | } |
1947 | inline void TensorDef::clear_data_type() { |
1948 | data_type_ = 0; |
1949 | _has_bits_[0] &= ~0x00000008u; |
1950 | } |
1951 | inline ::caffe2::TensorProto_DataType TensorDef::_internal_data_type() const { |
1952 | return static_cast< ::caffe2::TensorProto_DataType >(data_type_); |
1953 | } |
1954 | inline ::caffe2::TensorProto_DataType TensorDef::data_type() const { |
1955 | // @@protoc_insertion_point(field_get:torch.TensorDef.data_type) |
1956 | return _internal_data_type(); |
1957 | } |
1958 | inline void TensorDef::_internal_set_data_type(::caffe2::TensorProto_DataType value) { |
1959 | assert(::caffe2::TensorProto_DataType_IsValid(value)); |
1960 | _has_bits_[0] |= 0x00000008u; |
1961 | data_type_ = value; |
1962 | } |
1963 | inline void TensorDef::set_data_type(::caffe2::TensorProto_DataType value) { |
1964 | _internal_set_data_type(value); |
1965 | // @@protoc_insertion_point(field_set:torch.TensorDef.data_type) |
1966 | } |
1967 | |
1968 | // optional .torch.RecordRef data = 6; |
1969 | inline bool TensorDef::_internal_has_data() const { |
1970 | bool value = (_has_bits_[0] & 0x00000002u) != 0; |
1971 | PROTOBUF_ASSUME(!value || data_ != nullptr); |
1972 | return value; |
1973 | } |
1974 | inline bool TensorDef::has_data() const { |
1975 | return _internal_has_data(); |
1976 | } |
1977 | inline void TensorDef::clear_data() { |
1978 | if (data_ != nullptr) data_->Clear(); |
1979 | _has_bits_[0] &= ~0x00000002u; |
1980 | } |
1981 | inline const ::torch::RecordRef& TensorDef::_internal_data() const { |
1982 | const ::torch::RecordRef* p = data_; |
1983 | return p != nullptr ? *p : *reinterpret_cast<const ::torch::RecordRef*>( |
1984 | &::torch::_RecordRef_default_instance_); |
1985 | } |
1986 | inline const ::torch::RecordRef& TensorDef::data() const { |
1987 | // @@protoc_insertion_point(field_get:torch.TensorDef.data) |
1988 | return _internal_data(); |
1989 | } |
1990 | inline void TensorDef::unsafe_arena_set_allocated_data( |
1991 | ::torch::RecordRef* data) { |
1992 | if (GetArena() == nullptr) { |
1993 | delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(data_); |
1994 | } |
1995 | data_ = data; |
1996 | if (data) { |
1997 | _has_bits_[0] |= 0x00000002u; |
1998 | } else { |
1999 | _has_bits_[0] &= ~0x00000002u; |
2000 | } |
2001 | // @@protoc_insertion_point(field_unsafe_arena_set_allocated:torch.TensorDef.data) |
2002 | } |
2003 | inline ::torch::RecordRef* TensorDef::release_data() { |
2004 | _has_bits_[0] &= ~0x00000002u; |
2005 | ::torch::RecordRef* temp = data_; |
2006 | data_ = nullptr; |
2007 | if (GetArena() != nullptr) { |
2008 | temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); |
2009 | } |
2010 | return temp; |
2011 | } |
2012 | inline ::torch::RecordRef* TensorDef::unsafe_arena_release_data() { |
2013 | // @@protoc_insertion_point(field_release:torch.TensorDef.data) |
2014 | _has_bits_[0] &= ~0x00000002u; |
2015 | ::torch::RecordRef* temp = data_; |
2016 | data_ = nullptr; |
2017 | return temp; |
2018 | } |
2019 | inline ::torch::RecordRef* TensorDef::_internal_mutable_data() { |
2020 | _has_bits_[0] |= 0x00000002u; |
2021 | if (data_ == nullptr) { |
2022 | auto* p = CreateMaybeMessage<::torch::RecordRef>(GetArena()); |
2023 | data_ = p; |
2024 | } |
2025 | return data_; |
2026 | } |
2027 | inline ::torch::RecordRef* TensorDef::mutable_data() { |
2028 | // @@protoc_insertion_point(field_mutable:torch.TensorDef.data) |
2029 | return _internal_mutable_data(); |
2030 | } |
2031 | inline void TensorDef::set_allocated_data(::torch::RecordRef* data) { |
2032 | ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArena(); |
2033 | if (message_arena == nullptr) { |
2034 | delete data_; |
2035 | } |
2036 | if (data) { |
2037 | ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = |
2038 | ::PROTOBUF_NAMESPACE_ID::Arena::GetArena(data); |
2039 | if (message_arena != submessage_arena) { |
2040 | data = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( |
2041 | message_arena, data, submessage_arena); |
2042 | } |
2043 | _has_bits_[0] |= 0x00000002u; |
2044 | } else { |
2045 | _has_bits_[0] &= ~0x00000002u; |
2046 | } |
2047 | data_ = data; |
2048 | // @@protoc_insertion_point(field_set_allocated:torch.TensorDef.data) |
2049 | } |
2050 | |
2051 | // optional string device = 7; |
2052 | inline bool TensorDef::_internal_has_device() const { |
2053 | bool value = (_has_bits_[0] & 0x00000001u) != 0; |
2054 | return value; |
2055 | } |
2056 | inline bool TensorDef::has_device() const { |
2057 | return _internal_has_device(); |
2058 | } |
2059 | inline void TensorDef::clear_device() { |
2060 | device_.ClearToEmpty(&GetEmptyStringAlreadyInited(), GetArena()); |
2061 | _has_bits_[0] &= ~0x00000001u; |
2062 | } |
2063 | inline const std::string& TensorDef::device() const { |
2064 | // @@protoc_insertion_point(field_get:torch.TensorDef.device) |
2065 | return _internal_device(); |
2066 | } |
2067 | inline void TensorDef::set_device(const std::string& value) { |
2068 | _internal_set_device(value); |
2069 | // @@protoc_insertion_point(field_set:torch.TensorDef.device) |
2070 | } |
2071 | inline std::string* TensorDef::mutable_device() { |
2072 | // @@protoc_insertion_point(field_mutable:torch.TensorDef.device) |
2073 | return _internal_mutable_device(); |
2074 | } |
2075 | inline const std::string& TensorDef::_internal_device() const { |
2076 | return device_.Get(); |
2077 | } |
2078 | inline void TensorDef::_internal_set_device(const std::string& value) { |
2079 | _has_bits_[0] |= 0x00000001u; |
2080 | device_.Set(&GetEmptyStringAlreadyInited(), value, GetArena()); |
2081 | } |
2082 | inline void TensorDef::set_device(std::string&& value) { |
2083 | _has_bits_[0] |= 0x00000001u; |
2084 | device_.Set( |
2085 | &GetEmptyStringAlreadyInited(), ::std::move(value), GetArena()); |
2086 | // @@protoc_insertion_point(field_set_rvalue:torch.TensorDef.device) |
2087 | } |
2088 | inline void TensorDef::set_device(const char* value) { |
2089 | GOOGLE_DCHECK(value != nullptr); |
2090 | _has_bits_[0] |= 0x00000001u; |
2091 | device_.Set(&GetEmptyStringAlreadyInited(), ::std::string(value), |
2092 | GetArena()); |
2093 | // @@protoc_insertion_point(field_set_char:torch.TensorDef.device) |
2094 | } |
2095 | inline void TensorDef::set_device(const char* value, |
2096 | size_t size) { |
2097 | _has_bits_[0] |= 0x00000001u; |
2098 | device_.Set(&GetEmptyStringAlreadyInited(), ::std::string( |
2099 | reinterpret_cast<const char*>(value), size), GetArena()); |
2100 | // @@protoc_insertion_point(field_set_pointer:torch.TensorDef.device) |
2101 | } |
2102 | inline std::string* TensorDef::_internal_mutable_device() { |
2103 | _has_bits_[0] |= 0x00000001u; |
2104 | return device_.Mutable(&GetEmptyStringAlreadyInited(), GetArena()); |
2105 | } |
2106 | inline std::string* TensorDef::release_device() { |
2107 | // @@protoc_insertion_point(field_release:torch.TensorDef.device) |
2108 | if (!_internal_has_device()) { |
2109 | return nullptr; |
2110 | } |
2111 | _has_bits_[0] &= ~0x00000001u; |
2112 | return device_.ReleaseNonDefault(&GetEmptyStringAlreadyInited(), GetArena()); |
2113 | } |
2114 | inline void TensorDef::set_allocated_device(std::string* device) { |
2115 | if (device != nullptr) { |
2116 | _has_bits_[0] |= 0x00000001u; |
2117 | } else { |
2118 | _has_bits_[0] &= ~0x00000001u; |
2119 | } |
2120 | device_.SetAllocated(&GetEmptyStringAlreadyInited(), device, |
2121 | GetArena()); |
2122 | // @@protoc_insertion_point(field_set_allocated:torch.TensorDef.device) |
2123 | } |
2124 | |
2125 | // optional bool is_quantized = 8; |
2126 | inline bool TensorDef::_internal_has_is_quantized() const { |
2127 | bool value = (_has_bits_[0] & 0x00000020u) != 0; |
2128 | return value; |
2129 | } |
2130 | inline bool TensorDef::has_is_quantized() const { |
2131 | return _internal_has_is_quantized(); |
2132 | } |
2133 | inline void TensorDef::clear_is_quantized() { |
2134 | is_quantized_ = false; |
2135 | _has_bits_[0] &= ~0x00000020u; |
2136 | } |
2137 | inline bool TensorDef::_internal_is_quantized() const { |
2138 | return is_quantized_; |
2139 | } |
2140 | inline bool TensorDef::is_quantized() const { |
2141 | // @@protoc_insertion_point(field_get:torch.TensorDef.is_quantized) |
2142 | return _internal_is_quantized(); |
2143 | } |
2144 | inline void TensorDef::_internal_set_is_quantized(bool value) { |
2145 | _has_bits_[0] |= 0x00000020u; |
2146 | is_quantized_ = value; |
2147 | } |
2148 | inline void TensorDef::set_is_quantized(bool value) { |
2149 | _internal_set_is_quantized(value); |
2150 | // @@protoc_insertion_point(field_set:torch.TensorDef.is_quantized) |
2151 | } |
2152 | |
2153 | // optional double scale = 9; |
2154 | inline bool TensorDef::_internal_has_scale() const { |
2155 | bool value = (_has_bits_[0] & 0x00000040u) != 0; |
2156 | return value; |
2157 | } |
2158 | inline bool TensorDef::has_scale() const { |
2159 | return _internal_has_scale(); |
2160 | } |
2161 | inline void TensorDef::clear_scale() { |
2162 | scale_ = 0; |
2163 | _has_bits_[0] &= ~0x00000040u; |
2164 | } |
2165 | inline double TensorDef::_internal_scale() const { |
2166 | return scale_; |
2167 | } |
2168 | inline double TensorDef::scale() const { |
2169 | // @@protoc_insertion_point(field_get:torch.TensorDef.scale) |
2170 | return _internal_scale(); |
2171 | } |
2172 | inline void TensorDef::_internal_set_scale(double value) { |
2173 | _has_bits_[0] |= 0x00000040u; |
2174 | scale_ = value; |
2175 | } |
2176 | inline void TensorDef::set_scale(double value) { |
2177 | _internal_set_scale(value); |
2178 | // @@protoc_insertion_point(field_set:torch.TensorDef.scale) |
2179 | } |
2180 | |
2181 | // optional int64 zero_point = 10; |
2182 | inline bool TensorDef::_internal_has_zero_point() const { |
2183 | bool value = (_has_bits_[0] & 0x00000080u) != 0; |
2184 | return value; |
2185 | } |
2186 | inline bool TensorDef::has_zero_point() const { |
2187 | return _internal_has_zero_point(); |
2188 | } |
2189 | inline void TensorDef::clear_zero_point() { |
2190 | zero_point_ = PROTOBUF_LONGLONG(0); |
2191 | _has_bits_[0] &= ~0x00000080u; |
2192 | } |
2193 | inline ::PROTOBUF_NAMESPACE_ID::int64 TensorDef::_internal_zero_point() const { |
2194 | return zero_point_; |
2195 | } |
2196 | inline ::PROTOBUF_NAMESPACE_ID::int64 TensorDef::zero_point() const { |
2197 | // @@protoc_insertion_point(field_get:torch.TensorDef.zero_point) |
2198 | return _internal_zero_point(); |
2199 | } |
2200 | inline void TensorDef::_internal_set_zero_point(::PROTOBUF_NAMESPACE_ID::int64 value) { |
2201 | _has_bits_[0] |= 0x00000080u; |
2202 | zero_point_ = value; |
2203 | } |
2204 | inline void TensorDef::set_zero_point(::PROTOBUF_NAMESPACE_ID::int64 value) { |
2205 | _internal_set_zero_point(value); |
2206 | // @@protoc_insertion_point(field_set:torch.TensorDef.zero_point) |
2207 | } |
2208 | |
2209 | // ------------------------------------------------------------------- |
2210 | |
2211 | // AttributeDef |
2212 | |
2213 | // required string type = 1; |
2214 | inline bool AttributeDef::_internal_has_type() const { |
2215 | bool value = (_has_bits_[0] & 0x00000001u) != 0; |
2216 | return value; |
2217 | } |
2218 | inline bool AttributeDef::has_type() const { |
2219 | return _internal_has_type(); |
2220 | } |
2221 | inline void AttributeDef::clear_type() { |
2222 | type_.ClearToEmpty(&GetEmptyStringAlreadyInited(), GetArena()); |
2223 | _has_bits_[0] &= ~0x00000001u; |
2224 | } |
2225 | inline const std::string& AttributeDef::type() const { |
2226 | // @@protoc_insertion_point(field_get:torch.AttributeDef.type) |
2227 | return _internal_type(); |
2228 | } |
2229 | inline void AttributeDef::set_type(const std::string& value) { |
2230 | _internal_set_type(value); |
2231 | // @@protoc_insertion_point(field_set:torch.AttributeDef.type) |
2232 | } |
2233 | inline std::string* AttributeDef::mutable_type() { |
2234 | // @@protoc_insertion_point(field_mutable:torch.AttributeDef.type) |
2235 | return _internal_mutable_type(); |
2236 | } |
2237 | inline const std::string& AttributeDef::_internal_type() const { |
2238 | return type_.Get(); |
2239 | } |
2240 | inline void AttributeDef::_internal_set_type(const std::string& value) { |
2241 | _has_bits_[0] |= 0x00000001u; |
2242 | type_.Set(&GetEmptyStringAlreadyInited(), value, GetArena()); |
2243 | } |
2244 | inline void AttributeDef::set_type(std::string&& value) { |
2245 | _has_bits_[0] |= 0x00000001u; |
2246 | type_.Set( |
2247 | &GetEmptyStringAlreadyInited(), ::std::move(value), GetArena()); |
2248 | // @@protoc_insertion_point(field_set_rvalue:torch.AttributeDef.type) |
2249 | } |
2250 | inline void AttributeDef::set_type(const char* value) { |
2251 | GOOGLE_DCHECK(value != nullptr); |
2252 | _has_bits_[0] |= 0x00000001u; |
2253 | type_.Set(&GetEmptyStringAlreadyInited(), ::std::string(value), |
2254 | GetArena()); |
2255 | // @@protoc_insertion_point(field_set_char:torch.AttributeDef.type) |
2256 | } |
2257 | inline void AttributeDef::set_type(const char* value, |
2258 | size_t size) { |
2259 | _has_bits_[0] |= 0x00000001u; |
2260 | type_.Set(&GetEmptyStringAlreadyInited(), ::std::string( |
2261 | reinterpret_cast<const char*>(value), size), GetArena()); |
2262 | // @@protoc_insertion_point(field_set_pointer:torch.AttributeDef.type) |
2263 | } |
2264 | inline std::string* AttributeDef::_internal_mutable_type() { |
2265 | _has_bits_[0] |= 0x00000001u; |
2266 | return type_.Mutable(&GetEmptyStringAlreadyInited(), GetArena()); |
2267 | } |
2268 | inline std::string* AttributeDef::release_type() { |
2269 | // @@protoc_insertion_point(field_release:torch.AttributeDef.type) |
2270 | if (!_internal_has_type()) { |
2271 | return nullptr; |
2272 | } |
2273 | _has_bits_[0] &= ~0x00000001u; |
2274 | return type_.ReleaseNonDefault(&GetEmptyStringAlreadyInited(), GetArena()); |
2275 | } |
2276 | inline void AttributeDef::set_allocated_type(std::string* type) { |
2277 | if (type != nullptr) { |
2278 | _has_bits_[0] |= 0x00000001u; |
2279 | } else { |
2280 | _has_bits_[0] &= ~0x00000001u; |
2281 | } |
2282 | type_.SetAllocated(&GetEmptyStringAlreadyInited(), type, |
2283 | GetArena()); |
2284 | // @@protoc_insertion_point(field_set_allocated:torch.AttributeDef.type) |
2285 | } |
2286 | |
2287 | // required string name = 2; |
2288 | inline bool AttributeDef::_internal_has_name() const { |
2289 | bool value = (_has_bits_[0] & 0x00000002u) != 0; |
2290 | return value; |
2291 | } |
2292 | inline bool AttributeDef::has_name() const { |
2293 | return _internal_has_name(); |
2294 | } |
2295 | inline void AttributeDef::clear_name() { |
2296 | name_.ClearToEmpty(&GetEmptyStringAlreadyInited(), GetArena()); |
2297 | _has_bits_[0] &= ~0x00000002u; |
2298 | } |
2299 | inline const std::string& AttributeDef::name() const { |
2300 | // @@protoc_insertion_point(field_get:torch.AttributeDef.name) |
2301 | return _internal_name(); |
2302 | } |
2303 | inline void AttributeDef::set_name(const std::string& value) { |
2304 | _internal_set_name(value); |
2305 | // @@protoc_insertion_point(field_set:torch.AttributeDef.name) |
2306 | } |
2307 | inline std::string* AttributeDef::mutable_name() { |
2308 | // @@protoc_insertion_point(field_mutable:torch.AttributeDef.name) |
2309 | return _internal_mutable_name(); |
2310 | } |
2311 | inline const std::string& AttributeDef::_internal_name() const { |
2312 | return name_.Get(); |
2313 | } |
2314 | inline void AttributeDef::_internal_set_name(const std::string& value) { |
2315 | _has_bits_[0] |= 0x00000002u; |
2316 | name_.Set(&GetEmptyStringAlreadyInited(), value, GetArena()); |
2317 | } |
2318 | inline void AttributeDef::set_name(std::string&& value) { |
2319 | _has_bits_[0] |= 0x00000002u; |
2320 | name_.Set( |
2321 | &GetEmptyStringAlreadyInited(), ::std::move(value), GetArena()); |
2322 | // @@protoc_insertion_point(field_set_rvalue:torch.AttributeDef.name) |
2323 | } |
2324 | inline void AttributeDef::set_name(const char* value) { |
2325 | GOOGLE_DCHECK(value != nullptr); |
2326 | _has_bits_[0] |= 0x00000002u; |
2327 | name_.Set(&GetEmptyStringAlreadyInited(), ::std::string(value), |
2328 | GetArena()); |
2329 | // @@protoc_insertion_point(field_set_char:torch.AttributeDef.name) |
2330 | } |
2331 | inline void AttributeDef::set_name(const char* value, |
2332 | size_t size) { |
2333 | _has_bits_[0] |= 0x00000002u; |
2334 | name_.Set(&GetEmptyStringAlreadyInited(), ::std::string( |
2335 | reinterpret_cast<const char*>(value), size), GetArena()); |
2336 | // @@protoc_insertion_point(field_set_pointer:torch.AttributeDef.name) |
2337 | } |
2338 | inline std::string* AttributeDef::_internal_mutable_name() { |
2339 | _has_bits_[0] |= 0x00000002u; |
2340 | return name_.Mutable(&GetEmptyStringAlreadyInited(), GetArena()); |
2341 | } |
2342 | inline std::string* AttributeDef::release_name() { |
2343 | // @@protoc_insertion_point(field_release:torch.AttributeDef.name) |
2344 | if (!_internal_has_name()) { |
2345 | return nullptr; |
2346 | } |
2347 | _has_bits_[0] &= ~0x00000002u; |
2348 | return name_.ReleaseNonDefault(&GetEmptyStringAlreadyInited(), GetArena()); |
2349 | } |
2350 | inline void AttributeDef::set_allocated_name(std::string* name) { |
2351 | if (name != nullptr) { |
2352 | _has_bits_[0] |= 0x00000002u; |
2353 | } else { |
2354 | _has_bits_[0] &= ~0x00000002u; |
2355 | } |
2356 | name_.SetAllocated(&GetEmptyStringAlreadyInited(), name, |
2357 | GetArena()); |
2358 | // @@protoc_insertion_point(field_set_allocated:torch.AttributeDef.name) |
2359 | } |
2360 | |
2361 | // required int64 id = 3; |
2362 | inline bool AttributeDef::_internal_has_id() const { |
2363 | bool value = (_has_bits_[0] & 0x00000004u) != 0; |
2364 | return value; |
2365 | } |
2366 | inline bool AttributeDef::has_id() const { |
2367 | return _internal_has_id(); |
2368 | } |
2369 | inline void AttributeDef::clear_id() { |
2370 | id_ = PROTOBUF_LONGLONG(0); |
2371 | _has_bits_[0] &= ~0x00000004u; |
2372 | } |
2373 | inline ::PROTOBUF_NAMESPACE_ID::int64 AttributeDef::_internal_id() const { |
2374 | return id_; |
2375 | } |
2376 | inline ::PROTOBUF_NAMESPACE_ID::int64 AttributeDef::id() const { |
2377 | // @@protoc_insertion_point(field_get:torch.AttributeDef.id) |
2378 | return _internal_id(); |
2379 | } |
2380 | inline void AttributeDef::_internal_set_id(::PROTOBUF_NAMESPACE_ID::int64 value) { |
2381 | _has_bits_[0] |= 0x00000004u; |
2382 | id_ = value; |
2383 | } |
2384 | inline void AttributeDef::set_id(::PROTOBUF_NAMESPACE_ID::int64 value) { |
2385 | _internal_set_id(value); |
2386 | // @@protoc_insertion_point(field_set:torch.AttributeDef.id) |
2387 | } |
2388 | |
2389 | // ------------------------------------------------------------------- |
2390 | |
2391 | // ParameterDef |
2392 | |
2393 | // optional bool is_buffer = 1; |
2394 | inline bool ParameterDef::_internal_has_is_buffer() const { |
2395 | bool value = (_has_bits_[0] & 0x00000004u) != 0; |
2396 | return value; |
2397 | } |
2398 | inline bool ParameterDef::has_is_buffer() const { |
2399 | return _internal_has_is_buffer(); |
2400 | } |
2401 | inline void ParameterDef::clear_is_buffer() { |
2402 | is_buffer_ = false; |
2403 | _has_bits_[0] &= ~0x00000004u; |
2404 | } |
2405 | inline bool ParameterDef::_internal_is_buffer() const { |
2406 | return is_buffer_; |
2407 | } |
2408 | inline bool ParameterDef::is_buffer() const { |
2409 | // @@protoc_insertion_point(field_get:torch.ParameterDef.is_buffer) |
2410 | return _internal_is_buffer(); |
2411 | } |
2412 | inline void ParameterDef::_internal_set_is_buffer(bool value) { |
2413 | _has_bits_[0] |= 0x00000004u; |
2414 | is_buffer_ = value; |
2415 | } |
2416 | inline void ParameterDef::set_is_buffer(bool value) { |
2417 | _internal_set_is_buffer(value); |
2418 | // @@protoc_insertion_point(field_set:torch.ParameterDef.is_buffer) |
2419 | } |
2420 | |
2421 | // optional int64 tensor_id = 2; |
2422 | inline bool ParameterDef::_internal_has_tensor_id() const { |
2423 | bool value = (_has_bits_[0] & 0x00000002u) != 0; |
2424 | return value; |
2425 | } |
2426 | inline bool ParameterDef::has_tensor_id() const { |
2427 | return _internal_has_tensor_id(); |
2428 | } |
2429 | inline void ParameterDef::clear_tensor_id() { |
2430 | tensor_id_ = PROTOBUF_LONGLONG(0); |
2431 | _has_bits_[0] &= ~0x00000002u; |
2432 | } |
2433 | inline ::PROTOBUF_NAMESPACE_ID::int64 ParameterDef::_internal_tensor_id() const { |
2434 | return tensor_id_; |
2435 | } |
2436 | inline ::PROTOBUF_NAMESPACE_ID::int64 ParameterDef::tensor_id() const { |
2437 | // @@protoc_insertion_point(field_get:torch.ParameterDef.tensor_id) |
2438 | return _internal_tensor_id(); |
2439 | } |
2440 | inline void ParameterDef::_internal_set_tensor_id(::PROTOBUF_NAMESPACE_ID::int64 value) { |
2441 | _has_bits_[0] |= 0x00000002u; |
2442 | tensor_id_ = value; |
2443 | } |
2444 | inline void ParameterDef::set_tensor_id(::PROTOBUF_NAMESPACE_ID::int64 value) { |
2445 | _internal_set_tensor_id(value); |
2446 | // @@protoc_insertion_point(field_set:torch.ParameterDef.tensor_id) |
2447 | } |
2448 | |
2449 | // optional string name = 3; |
2450 | inline bool ParameterDef::_internal_has_name() const { |
2451 | bool value = (_has_bits_[0] & 0x00000001u) != 0; |
2452 | return value; |
2453 | } |
2454 | inline bool ParameterDef::has_name() const { |
2455 | return _internal_has_name(); |
2456 | } |
2457 | inline void ParameterDef::clear_name() { |
2458 | name_.ClearToEmpty(&GetEmptyStringAlreadyInited(), GetArena()); |
2459 | _has_bits_[0] &= ~0x00000001u; |
2460 | } |
2461 | inline const std::string& ParameterDef::name() const { |
2462 | // @@protoc_insertion_point(field_get:torch.ParameterDef.name) |
2463 | return _internal_name(); |
2464 | } |
2465 | inline void ParameterDef::set_name(const std::string& value) { |
2466 | _internal_set_name(value); |
2467 | // @@protoc_insertion_point(field_set:torch.ParameterDef.name) |
2468 | } |
2469 | inline std::string* ParameterDef::mutable_name() { |
2470 | // @@protoc_insertion_point(field_mutable:torch.ParameterDef.name) |
2471 | return _internal_mutable_name(); |
2472 | } |
2473 | inline const std::string& ParameterDef::_internal_name() const { |
2474 | return name_.Get(); |
2475 | } |
2476 | inline void ParameterDef::_internal_set_name(const std::string& value) { |
2477 | _has_bits_[0] |= 0x00000001u; |
2478 | name_.Set(&GetEmptyStringAlreadyInited(), value, GetArena()); |
2479 | } |
2480 | inline void ParameterDef::set_name(std::string&& value) { |
2481 | _has_bits_[0] |= 0x00000001u; |
2482 | name_.Set( |
2483 | &GetEmptyStringAlreadyInited(), ::std::move(value), GetArena()); |
2484 | // @@protoc_insertion_point(field_set_rvalue:torch.ParameterDef.name) |
2485 | } |
2486 | inline void ParameterDef::set_name(const char* value) { |
2487 | GOOGLE_DCHECK(value != nullptr); |
2488 | _has_bits_[0] |= 0x00000001u; |
2489 | name_.Set(&GetEmptyStringAlreadyInited(), ::std::string(value), |
2490 | GetArena()); |
2491 | // @@protoc_insertion_point(field_set_char:torch.ParameterDef.name) |
2492 | } |
2493 | inline void ParameterDef::set_name(const char* value, |
2494 | size_t size) { |
2495 | _has_bits_[0] |= 0x00000001u; |
2496 | name_.Set(&GetEmptyStringAlreadyInited(), ::std::string( |
2497 | reinterpret_cast<const char*>(value), size), GetArena()); |
2498 | // @@protoc_insertion_point(field_set_pointer:torch.ParameterDef.name) |
2499 | } |
2500 | inline std::string* ParameterDef::_internal_mutable_name() { |
2501 | _has_bits_[0] |= 0x00000001u; |
2502 | return name_.Mutable(&GetEmptyStringAlreadyInited(), GetArena()); |
2503 | } |
2504 | inline std::string* ParameterDef::release_name() { |
2505 | // @@protoc_insertion_point(field_release:torch.ParameterDef.name) |
2506 | if (!_internal_has_name()) { |
2507 | return nullptr; |
2508 | } |
2509 | _has_bits_[0] &= ~0x00000001u; |
2510 | return name_.ReleaseNonDefault(&GetEmptyStringAlreadyInited(), GetArena()); |
2511 | } |
2512 | inline void ParameterDef::set_allocated_name(std::string* name) { |
2513 | if (name != nullptr) { |
2514 | _has_bits_[0] |= 0x00000001u; |
2515 | } else { |
2516 | _has_bits_[0] &= ~0x00000001u; |
2517 | } |
2518 | name_.SetAllocated(&GetEmptyStringAlreadyInited(), name, |
2519 | GetArena()); |
2520 | // @@protoc_insertion_point(field_set_allocated:torch.ParameterDef.name) |
2521 | } |
2522 | |
2523 | // ------------------------------------------------------------------- |
2524 | |
2525 | // ModuleDef |
2526 | |
2527 | // repeated .torch.ModuleDef submodules = 1; |
2528 | inline int ModuleDef::_internal_submodules_size() const { |
2529 | return submodules_.size(); |
2530 | } |
2531 | inline int ModuleDef::submodules_size() const { |
2532 | return _internal_submodules_size(); |
2533 | } |
2534 | inline void ModuleDef::clear_submodules() { |
2535 | submodules_.Clear(); |
2536 | } |
2537 | inline ::torch::ModuleDef* ModuleDef::mutable_submodules(int index) { |
2538 | // @@protoc_insertion_point(field_mutable:torch.ModuleDef.submodules) |
2539 | return submodules_.Mutable(index); |
2540 | } |
2541 | inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::torch::ModuleDef >* |
2542 | ModuleDef::mutable_submodules() { |
2543 | // @@protoc_insertion_point(field_mutable_list:torch.ModuleDef.submodules) |
2544 | return &submodules_; |
2545 | } |
2546 | inline const ::torch::ModuleDef& ModuleDef::_internal_submodules(int index) const { |
2547 | return submodules_.Get(index); |
2548 | } |
2549 | inline const ::torch::ModuleDef& ModuleDef::submodules(int index) const { |
2550 | // @@protoc_insertion_point(field_get:torch.ModuleDef.submodules) |
2551 | return _internal_submodules(index); |
2552 | } |
2553 | inline ::torch::ModuleDef* ModuleDef::_internal_add_submodules() { |
2554 | return submodules_.Add(); |
2555 | } |
2556 | inline ::torch::ModuleDef* ModuleDef::add_submodules() { |
2557 | // @@protoc_insertion_point(field_add:torch.ModuleDef.submodules) |
2558 | return _internal_add_submodules(); |
2559 | } |
2560 | inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::torch::ModuleDef >& |
2561 | ModuleDef::submodules() const { |
2562 | // @@protoc_insertion_point(field_list:torch.ModuleDef.submodules) |
2563 | return submodules_; |
2564 | } |
2565 | |
2566 | // optional .torch.RecordRef torchscript_arena = 2; |
2567 | inline bool ModuleDef::_internal_has_torchscript_arena() const { |
2568 | bool value = (_has_bits_[0] & 0x00000002u) != 0; |
2569 | PROTOBUF_ASSUME(!value || torchscript_arena_ != nullptr); |
2570 | return value; |
2571 | } |
2572 | inline bool ModuleDef::has_torchscript_arena() const { |
2573 | return _internal_has_torchscript_arena(); |
2574 | } |
2575 | inline void ModuleDef::clear_torchscript_arena() { |
2576 | if (torchscript_arena_ != nullptr) torchscript_arena_->Clear(); |
2577 | _has_bits_[0] &= ~0x00000002u; |
2578 | } |
2579 | inline const ::torch::RecordRef& ModuleDef::_internal_torchscript_arena() const { |
2580 | const ::torch::RecordRef* p = torchscript_arena_; |
2581 | return p != nullptr ? *p : *reinterpret_cast<const ::torch::RecordRef*>( |
2582 | &::torch::_RecordRef_default_instance_); |
2583 | } |
2584 | inline const ::torch::RecordRef& ModuleDef::torchscript_arena() const { |
2585 | // @@protoc_insertion_point(field_get:torch.ModuleDef.torchscript_arena) |
2586 | return _internal_torchscript_arena(); |
2587 | } |
2588 | inline void ModuleDef::unsafe_arena_set_allocated_torchscript_arena( |
2589 | ::torch::RecordRef* torchscript_arena) { |
2590 | if (GetArena() == nullptr) { |
2591 | delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(torchscript_arena_); |
2592 | } |
2593 | torchscript_arena_ = torchscript_arena; |
2594 | if (torchscript_arena) { |
2595 | _has_bits_[0] |= 0x00000002u; |
2596 | } else { |
2597 | _has_bits_[0] &= ~0x00000002u; |
2598 | } |
2599 | // @@protoc_insertion_point(field_unsafe_arena_set_allocated:torch.ModuleDef.torchscript_arena) |
2600 | } |
2601 | inline ::torch::RecordRef* ModuleDef::release_torchscript_arena() { |
2602 | _has_bits_[0] &= ~0x00000002u; |
2603 | ::torch::RecordRef* temp = torchscript_arena_; |
2604 | torchscript_arena_ = nullptr; |
2605 | if (GetArena() != nullptr) { |
2606 | temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); |
2607 | } |
2608 | return temp; |
2609 | } |
2610 | inline ::torch::RecordRef* ModuleDef::unsafe_arena_release_torchscript_arena() { |
2611 | // @@protoc_insertion_point(field_release:torch.ModuleDef.torchscript_arena) |
2612 | _has_bits_[0] &= ~0x00000002u; |
2613 | ::torch::RecordRef* temp = torchscript_arena_; |
2614 | torchscript_arena_ = nullptr; |
2615 | return temp; |
2616 | } |
2617 | inline ::torch::RecordRef* ModuleDef::_internal_mutable_torchscript_arena() { |
2618 | _has_bits_[0] |= 0x00000002u; |
2619 | if (torchscript_arena_ == nullptr) { |
2620 | auto* p = CreateMaybeMessage<::torch::RecordRef>(GetArena()); |
2621 | torchscript_arena_ = p; |
2622 | } |
2623 | return torchscript_arena_; |
2624 | } |
2625 | inline ::torch::RecordRef* ModuleDef::mutable_torchscript_arena() { |
2626 | // @@protoc_insertion_point(field_mutable:torch.ModuleDef.torchscript_arena) |
2627 | return _internal_mutable_torchscript_arena(); |
2628 | } |
2629 | inline void ModuleDef::set_allocated_torchscript_arena(::torch::RecordRef* torchscript_arena) { |
2630 | ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArena(); |
2631 | if (message_arena == nullptr) { |
2632 | delete torchscript_arena_; |
2633 | } |
2634 | if (torchscript_arena) { |
2635 | ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = |
2636 | ::PROTOBUF_NAMESPACE_ID::Arena::GetArena(torchscript_arena); |
2637 | if (message_arena != submessage_arena) { |
2638 | torchscript_arena = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( |
2639 | message_arena, torchscript_arena, submessage_arena); |
2640 | } |
2641 | _has_bits_[0] |= 0x00000002u; |
2642 | } else { |
2643 | _has_bits_[0] &= ~0x00000002u; |
2644 | } |
2645 | torchscript_arena_ = torchscript_arena; |
2646 | // @@protoc_insertion_point(field_set_allocated:torch.ModuleDef.torchscript_arena) |
2647 | } |
2648 | |
2649 | // repeated .caffe2.NetDef caffe2_nets = 3; |
2650 | inline int ModuleDef::_internal_caffe2_nets_size() const { |
2651 | return caffe2_nets_.size(); |
2652 | } |
2653 | inline int ModuleDef::caffe2_nets_size() const { |
2654 | return _internal_caffe2_nets_size(); |
2655 | } |
2656 | inline ::caffe2::NetDef* ModuleDef::mutable_caffe2_nets(int index) { |
2657 | // @@protoc_insertion_point(field_mutable:torch.ModuleDef.caffe2_nets) |
2658 | return caffe2_nets_.Mutable(index); |
2659 | } |
2660 | inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::caffe2::NetDef >* |
2661 | ModuleDef::mutable_caffe2_nets() { |
2662 | // @@protoc_insertion_point(field_mutable_list:torch.ModuleDef.caffe2_nets) |
2663 | return &caffe2_nets_; |
2664 | } |
2665 | inline const ::caffe2::NetDef& ModuleDef::_internal_caffe2_nets(int index) const { |
2666 | return caffe2_nets_.Get(index); |
2667 | } |
2668 | inline const ::caffe2::NetDef& ModuleDef::caffe2_nets(int index) const { |
2669 | // @@protoc_insertion_point(field_get:torch.ModuleDef.caffe2_nets) |
2670 | return _internal_caffe2_nets(index); |
2671 | } |
2672 | inline ::caffe2::NetDef* ModuleDef::_internal_add_caffe2_nets() { |
2673 | return caffe2_nets_.Add(); |
2674 | } |
2675 | inline ::caffe2::NetDef* ModuleDef::add_caffe2_nets() { |
2676 | // @@protoc_insertion_point(field_add:torch.ModuleDef.caffe2_nets) |
2677 | return _internal_add_caffe2_nets(); |
2678 | } |
2679 | inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::caffe2::NetDef >& |
2680 | ModuleDef::caffe2_nets() const { |
2681 | // @@protoc_insertion_point(field_list:torch.ModuleDef.caffe2_nets) |
2682 | return caffe2_nets_; |
2683 | } |
2684 | |
2685 | // optional .torch.RecordRef pickle_arena = 4; |
2686 | inline bool ModuleDef::_internal_has_pickle_arena() const { |
2687 | bool value = (_has_bits_[0] & 0x00000004u) != 0; |
2688 | PROTOBUF_ASSUME(!value || pickle_arena_ != nullptr); |
2689 | return value; |
2690 | } |
2691 | inline bool ModuleDef::has_pickle_arena() const { |
2692 | return _internal_has_pickle_arena(); |
2693 | } |
2694 | inline void ModuleDef::clear_pickle_arena() { |
2695 | if (pickle_arena_ != nullptr) pickle_arena_->Clear(); |
2696 | _has_bits_[0] &= ~0x00000004u; |
2697 | } |
2698 | inline const ::torch::RecordRef& ModuleDef::_internal_pickle_arena() const { |
2699 | const ::torch::RecordRef* p = pickle_arena_; |
2700 | return p != nullptr ? *p : *reinterpret_cast<const ::torch::RecordRef*>( |
2701 | &::torch::_RecordRef_default_instance_); |
2702 | } |
2703 | inline const ::torch::RecordRef& ModuleDef::pickle_arena() const { |
2704 | // @@protoc_insertion_point(field_get:torch.ModuleDef.pickle_arena) |
2705 | return _internal_pickle_arena(); |
2706 | } |
2707 | inline void ModuleDef::unsafe_arena_set_allocated_pickle_arena( |
2708 | ::torch::RecordRef* pickle_arena) { |
2709 | if (GetArena() == nullptr) { |
2710 | delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(pickle_arena_); |
2711 | } |
2712 | pickle_arena_ = pickle_arena; |
2713 | if (pickle_arena) { |
2714 | _has_bits_[0] |= 0x00000004u; |
2715 | } else { |
2716 | _has_bits_[0] &= ~0x00000004u; |
2717 | } |
2718 | // @@protoc_insertion_point(field_unsafe_arena_set_allocated:torch.ModuleDef.pickle_arena) |
2719 | } |
2720 | inline ::torch::RecordRef* ModuleDef::release_pickle_arena() { |
2721 | _has_bits_[0] &= ~0x00000004u; |
2722 | ::torch::RecordRef* temp = pickle_arena_; |
2723 | pickle_arena_ = nullptr; |
2724 | if (GetArena() != nullptr) { |
2725 | temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); |
2726 | } |
2727 | return temp; |
2728 | } |
2729 | inline ::torch::RecordRef* ModuleDef::unsafe_arena_release_pickle_arena() { |
2730 | // @@protoc_insertion_point(field_release:torch.ModuleDef.pickle_arena) |
2731 | _has_bits_[0] &= ~0x00000004u; |
2732 | ::torch::RecordRef* temp = pickle_arena_; |
2733 | pickle_arena_ = nullptr; |
2734 | return temp; |
2735 | } |
2736 | inline ::torch::RecordRef* ModuleDef::_internal_mutable_pickle_arena() { |
2737 | _has_bits_[0] |= 0x00000004u; |
2738 | if (pickle_arena_ == nullptr) { |
2739 | auto* p = CreateMaybeMessage<::torch::RecordRef>(GetArena()); |
2740 | pickle_arena_ = p; |
2741 | } |
2742 | return pickle_arena_; |
2743 | } |
2744 | inline ::torch::RecordRef* ModuleDef::mutable_pickle_arena() { |
2745 | // @@protoc_insertion_point(field_mutable:torch.ModuleDef.pickle_arena) |
2746 | return _internal_mutable_pickle_arena(); |
2747 | } |
2748 | inline void ModuleDef::set_allocated_pickle_arena(::torch::RecordRef* pickle_arena) { |
2749 | ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArena(); |
2750 | if (message_arena == nullptr) { |
2751 | delete pickle_arena_; |
2752 | } |
2753 | if (pickle_arena) { |
2754 | ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = |
2755 | ::PROTOBUF_NAMESPACE_ID::Arena::GetArena(pickle_arena); |
2756 | if (message_arena != submessage_arena) { |
2757 | pickle_arena = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( |
2758 | message_arena, pickle_arena, submessage_arena); |
2759 | } |
2760 | _has_bits_[0] |= 0x00000004u; |
2761 | } else { |
2762 | _has_bits_[0] &= ~0x00000004u; |
2763 | } |
2764 | pickle_arena_ = pickle_arena; |
2765 | // @@protoc_insertion_point(field_set_allocated:torch.ModuleDef.pickle_arena) |
2766 | } |
2767 | |
2768 | // optional .torch.RecordRef cpp_arena = 5; |
2769 | inline bool ModuleDef::_internal_has_cpp_arena() const { |
2770 | bool value = (_has_bits_[0] & 0x00000008u) != 0; |
2771 | PROTOBUF_ASSUME(!value || cpp_arena_ != nullptr); |
2772 | return value; |
2773 | } |
2774 | inline bool ModuleDef::has_cpp_arena() const { |
2775 | return _internal_has_cpp_arena(); |
2776 | } |
2777 | inline void ModuleDef::clear_cpp_arena() { |
2778 | if (cpp_arena_ != nullptr) cpp_arena_->Clear(); |
2779 | _has_bits_[0] &= ~0x00000008u; |
2780 | } |
2781 | inline const ::torch::RecordRef& ModuleDef::_internal_cpp_arena() const { |
2782 | const ::torch::RecordRef* p = cpp_arena_; |
2783 | return p != nullptr ? *p : *reinterpret_cast<const ::torch::RecordRef*>( |
2784 | &::torch::_RecordRef_default_instance_); |
2785 | } |
2786 | inline const ::torch::RecordRef& ModuleDef::cpp_arena() const { |
2787 | // @@protoc_insertion_point(field_get:torch.ModuleDef.cpp_arena) |
2788 | return _internal_cpp_arena(); |
2789 | } |
2790 | inline void ModuleDef::unsafe_arena_set_allocated_cpp_arena( |
2791 | ::torch::RecordRef* cpp_arena) { |
2792 | if (GetArena() == nullptr) { |
2793 | delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(cpp_arena_); |
2794 | } |
2795 | cpp_arena_ = cpp_arena; |
2796 | if (cpp_arena) { |
2797 | _has_bits_[0] |= 0x00000008u; |
2798 | } else { |
2799 | _has_bits_[0] &= ~0x00000008u; |
2800 | } |
2801 | // @@protoc_insertion_point(field_unsafe_arena_set_allocated:torch.ModuleDef.cpp_arena) |
2802 | } |
2803 | inline ::torch::RecordRef* ModuleDef::release_cpp_arena() { |
2804 | _has_bits_[0] &= ~0x00000008u; |
2805 | ::torch::RecordRef* temp = cpp_arena_; |
2806 | cpp_arena_ = nullptr; |
2807 | if (GetArena() != nullptr) { |
2808 | temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); |
2809 | } |
2810 | return temp; |
2811 | } |
2812 | inline ::torch::RecordRef* ModuleDef::unsafe_arena_release_cpp_arena() { |
2813 | // @@protoc_insertion_point(field_release:torch.ModuleDef.cpp_arena) |
2814 | _has_bits_[0] &= ~0x00000008u; |
2815 | ::torch::RecordRef* temp = cpp_arena_; |
2816 | cpp_arena_ = nullptr; |
2817 | return temp; |
2818 | } |
2819 | inline ::torch::RecordRef* ModuleDef::_internal_mutable_cpp_arena() { |
2820 | _has_bits_[0] |= 0x00000008u; |
2821 | if (cpp_arena_ == nullptr) { |
2822 | auto* p = CreateMaybeMessage<::torch::RecordRef>(GetArena()); |
2823 | cpp_arena_ = p; |
2824 | } |
2825 | return cpp_arena_; |
2826 | } |
2827 | inline ::torch::RecordRef* ModuleDef::mutable_cpp_arena() { |
2828 | // @@protoc_insertion_point(field_mutable:torch.ModuleDef.cpp_arena) |
2829 | return _internal_mutable_cpp_arena(); |
2830 | } |
2831 | inline void ModuleDef::set_allocated_cpp_arena(::torch::RecordRef* cpp_arena) { |
2832 | ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArena(); |
2833 | if (message_arena == nullptr) { |
2834 | delete cpp_arena_; |
2835 | } |
2836 | if (cpp_arena) { |
2837 | ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = |
2838 | ::PROTOBUF_NAMESPACE_ID::Arena::GetArena(cpp_arena); |
2839 | if (message_arena != submessage_arena) { |
2840 | cpp_arena = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( |
2841 | message_arena, cpp_arena, submessage_arena); |
2842 | } |
2843 | _has_bits_[0] |= 0x00000008u; |
2844 | } else { |
2845 | _has_bits_[0] &= ~0x00000008u; |
2846 | } |
2847 | cpp_arena_ = cpp_arena; |
2848 | // @@protoc_insertion_point(field_set_allocated:torch.ModuleDef.cpp_arena) |
2849 | } |
2850 | |
2851 | // repeated .torch.ParameterDef parameters = 6; |
2852 | inline int ModuleDef::_internal_parameters_size() const { |
2853 | return parameters_.size(); |
2854 | } |
2855 | inline int ModuleDef::parameters_size() const { |
2856 | return _internal_parameters_size(); |
2857 | } |
2858 | inline void ModuleDef::clear_parameters() { |
2859 | parameters_.Clear(); |
2860 | } |
2861 | inline ::torch::ParameterDef* ModuleDef::mutable_parameters(int index) { |
2862 | // @@protoc_insertion_point(field_mutable:torch.ModuleDef.parameters) |
2863 | return parameters_.Mutable(index); |
2864 | } |
2865 | inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::torch::ParameterDef >* |
2866 | ModuleDef::mutable_parameters() { |
2867 | // @@protoc_insertion_point(field_mutable_list:torch.ModuleDef.parameters) |
2868 | return ¶meters_; |
2869 | } |
2870 | inline const ::torch::ParameterDef& ModuleDef::_internal_parameters(int index) const { |
2871 | return parameters_.Get(index); |
2872 | } |
2873 | inline const ::torch::ParameterDef& ModuleDef::parameters(int index) const { |
2874 | // @@protoc_insertion_point(field_get:torch.ModuleDef.parameters) |
2875 | return _internal_parameters(index); |
2876 | } |
2877 | inline ::torch::ParameterDef* ModuleDef::_internal_add_parameters() { |
2878 | return parameters_.Add(); |
2879 | } |
2880 | inline ::torch::ParameterDef* ModuleDef::add_parameters() { |
2881 | // @@protoc_insertion_point(field_add:torch.ModuleDef.parameters) |
2882 | return _internal_add_parameters(); |
2883 | } |
2884 | inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::torch::ParameterDef >& |
2885 | ModuleDef::parameters() const { |
2886 | // @@protoc_insertion_point(field_list:torch.ModuleDef.parameters) |
2887 | return parameters_; |
2888 | } |
2889 | |
2890 | // optional string name = 7; |
2891 | inline bool ModuleDef::_internal_has_name() const { |
2892 | bool value = (_has_bits_[0] & 0x00000001u) != 0; |
2893 | return value; |
2894 | } |
2895 | inline bool ModuleDef::has_name() const { |
2896 | return _internal_has_name(); |
2897 | } |
2898 | inline void ModuleDef::clear_name() { |
2899 | name_.ClearToEmpty(&GetEmptyStringAlreadyInited(), GetArena()); |
2900 | _has_bits_[0] &= ~0x00000001u; |
2901 | } |
2902 | inline const std::string& ModuleDef::name() const { |
2903 | // @@protoc_insertion_point(field_get:torch.ModuleDef.name) |
2904 | return _internal_name(); |
2905 | } |
2906 | inline void ModuleDef::set_name(const std::string& value) { |
2907 | _internal_set_name(value); |
2908 | // @@protoc_insertion_point(field_set:torch.ModuleDef.name) |
2909 | } |
2910 | inline std::string* ModuleDef::mutable_name() { |
2911 | // @@protoc_insertion_point(field_mutable:torch.ModuleDef.name) |
2912 | return _internal_mutable_name(); |
2913 | } |
2914 | inline const std::string& ModuleDef::_internal_name() const { |
2915 | return name_.Get(); |
2916 | } |
2917 | inline void ModuleDef::_internal_set_name(const std::string& value) { |
2918 | _has_bits_[0] |= 0x00000001u; |
2919 | name_.Set(&GetEmptyStringAlreadyInited(), value, GetArena()); |
2920 | } |
2921 | inline void ModuleDef::set_name(std::string&& value) { |
2922 | _has_bits_[0] |= 0x00000001u; |
2923 | name_.Set( |
2924 | &GetEmptyStringAlreadyInited(), ::std::move(value), GetArena()); |
2925 | // @@protoc_insertion_point(field_set_rvalue:torch.ModuleDef.name) |
2926 | } |
2927 | inline void ModuleDef::set_name(const char* value) { |
2928 | GOOGLE_DCHECK(value != nullptr); |
2929 | _has_bits_[0] |= 0x00000001u; |
2930 | name_.Set(&GetEmptyStringAlreadyInited(), ::std::string(value), |
2931 | GetArena()); |
2932 | // @@protoc_insertion_point(field_set_char:torch.ModuleDef.name) |
2933 | } |
2934 | inline void ModuleDef::set_name(const char* value, |
2935 | size_t size) { |
2936 | _has_bits_[0] |= 0x00000001u; |
2937 | name_.Set(&GetEmptyStringAlreadyInited(), ::std::string( |
2938 | reinterpret_cast<const char*>(value), size), GetArena()); |
2939 | // @@protoc_insertion_point(field_set_pointer:torch.ModuleDef.name) |
2940 | } |
2941 | inline std::string* ModuleDef::_internal_mutable_name() { |
2942 | _has_bits_[0] |= 0x00000001u; |
2943 | return name_.Mutable(&GetEmptyStringAlreadyInited(), GetArena()); |
2944 | } |
2945 | inline std::string* ModuleDef::release_name() { |
2946 | // @@protoc_insertion_point(field_release:torch.ModuleDef.name) |
2947 | if (!_internal_has_name()) { |
2948 | return nullptr; |
2949 | } |
2950 | _has_bits_[0] &= ~0x00000001u; |
2951 | return name_.ReleaseNonDefault(&GetEmptyStringAlreadyInited(), GetArena()); |
2952 | } |
2953 | inline void ModuleDef::set_allocated_name(std::string* name) { |
2954 | if (name != nullptr) { |
2955 | _has_bits_[0] |= 0x00000001u; |
2956 | } else { |
2957 | _has_bits_[0] &= ~0x00000001u; |
2958 | } |
2959 | name_.SetAllocated(&GetEmptyStringAlreadyInited(), name, |
2960 | GetArena()); |
2961 | // @@protoc_insertion_point(field_set_allocated:torch.ModuleDef.name) |
2962 | } |
2963 | |
2964 | // optional bool optimize = 8; |
2965 | inline bool ModuleDef::_internal_has_optimize() const { |
2966 | bool value = (_has_bits_[0] & 0x00000040u) != 0; |
2967 | return value; |
2968 | } |
2969 | inline bool ModuleDef::has_optimize() const { |
2970 | return _internal_has_optimize(); |
2971 | } |
2972 | inline void ModuleDef::clear_optimize() { |
2973 | optimize_ = false; |
2974 | _has_bits_[0] &= ~0x00000040u; |
2975 | } |
2976 | inline bool ModuleDef::_internal_optimize() const { |
2977 | return optimize_; |
2978 | } |
2979 | inline bool ModuleDef::optimize() const { |
2980 | // @@protoc_insertion_point(field_get:torch.ModuleDef.optimize) |
2981 | return _internal_optimize(); |
2982 | } |
2983 | inline void ModuleDef::_internal_set_optimize(bool value) { |
2984 | _has_bits_[0] |= 0x00000040u; |
2985 | optimize_ = value; |
2986 | } |
2987 | inline void ModuleDef::set_optimize(bool value) { |
2988 | _internal_set_optimize(value); |
2989 | // @@protoc_insertion_point(field_set:torch.ModuleDef.optimize) |
2990 | } |
2991 | |
2992 | // repeated .torch.AttributeDef attributes = 9; |
2993 | inline int ModuleDef::_internal_attributes_size() const { |
2994 | return attributes_.size(); |
2995 | } |
2996 | inline int ModuleDef::attributes_size() const { |
2997 | return _internal_attributes_size(); |
2998 | } |
2999 | inline void ModuleDef::clear_attributes() { |
3000 | attributes_.Clear(); |
3001 | } |
3002 | inline ::torch::AttributeDef* ModuleDef::mutable_attributes(int index) { |
3003 | // @@protoc_insertion_point(field_mutable:torch.ModuleDef.attributes) |
3004 | return attributes_.Mutable(index); |
3005 | } |
3006 | inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::torch::AttributeDef >* |
3007 | ModuleDef::mutable_attributes() { |
3008 | // @@protoc_insertion_point(field_mutable_list:torch.ModuleDef.attributes) |
3009 | return &attributes_; |
3010 | } |
3011 | inline const ::torch::AttributeDef& ModuleDef::_internal_attributes(int index) const { |
3012 | return attributes_.Get(index); |
3013 | } |
3014 | inline const ::torch::AttributeDef& ModuleDef::attributes(int index) const { |
3015 | // @@protoc_insertion_point(field_get:torch.ModuleDef.attributes) |
3016 | return _internal_attributes(index); |
3017 | } |
3018 | inline ::torch::AttributeDef* ModuleDef::_internal_add_attributes() { |
3019 | return attributes_.Add(); |
3020 | } |
3021 | inline ::torch::AttributeDef* ModuleDef::add_attributes() { |
3022 | // @@protoc_insertion_point(field_add:torch.ModuleDef.attributes) |
3023 | return _internal_add_attributes(); |
3024 | } |
3025 | inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::torch::AttributeDef >& |
3026 | ModuleDef::attributes() const { |
3027 | // @@protoc_insertion_point(field_list:torch.ModuleDef.attributes) |
3028 | return attributes_; |
3029 | } |
3030 | |
3031 | // optional int64 get_state_attribute_id = 10; |
3032 | inline bool ModuleDef::_internal_has_get_state_attribute_id() const { |
3033 | bool value = (_has_bits_[0] & 0x00000020u) != 0; |
3034 | return value; |
3035 | } |
3036 | inline bool ModuleDef::has_get_state_attribute_id() const { |
3037 | return _internal_has_get_state_attribute_id(); |
3038 | } |
3039 | inline void ModuleDef::clear_get_state_attribute_id() { |
3040 | get_state_attribute_id_ = PROTOBUF_LONGLONG(0); |
3041 | _has_bits_[0] &= ~0x00000020u; |
3042 | } |
3043 | inline ::PROTOBUF_NAMESPACE_ID::int64 ModuleDef::_internal_get_state_attribute_id() const { |
3044 | return get_state_attribute_id_; |
3045 | } |
3046 | inline ::PROTOBUF_NAMESPACE_ID::int64 ModuleDef::get_state_attribute_id() const { |
3047 | // @@protoc_insertion_point(field_get:torch.ModuleDef.get_state_attribute_id) |
3048 | return _internal_get_state_attribute_id(); |
3049 | } |
3050 | inline void ModuleDef::_internal_set_get_state_attribute_id(::PROTOBUF_NAMESPACE_ID::int64 value) { |
3051 | _has_bits_[0] |= 0x00000020u; |
3052 | get_state_attribute_id_ = value; |
3053 | } |
3054 | inline void ModuleDef::set_get_state_attribute_id(::PROTOBUF_NAMESPACE_ID::int64 value) { |
3055 | _internal_set_get_state_attribute_id(value); |
3056 | // @@protoc_insertion_point(field_set:torch.ModuleDef.get_state_attribute_id) |
3057 | } |
3058 | |
3059 | // optional .torch.RecordRef torchscript_debug_arena = 11; |
3060 | inline bool ModuleDef::_internal_has_torchscript_debug_arena() const { |
3061 | bool value = (_has_bits_[0] & 0x00000010u) != 0; |
3062 | PROTOBUF_ASSUME(!value || torchscript_debug_arena_ != nullptr); |
3063 | return value; |
3064 | } |
3065 | inline bool ModuleDef::has_torchscript_debug_arena() const { |
3066 | return _internal_has_torchscript_debug_arena(); |
3067 | } |
3068 | inline void ModuleDef::clear_torchscript_debug_arena() { |
3069 | if (torchscript_debug_arena_ != nullptr) torchscript_debug_arena_->Clear(); |
3070 | _has_bits_[0] &= ~0x00000010u; |
3071 | } |
3072 | inline const ::torch::RecordRef& ModuleDef::_internal_torchscript_debug_arena() const { |
3073 | const ::torch::RecordRef* p = torchscript_debug_arena_; |
3074 | return p != nullptr ? *p : *reinterpret_cast<const ::torch::RecordRef*>( |
3075 | &::torch::_RecordRef_default_instance_); |
3076 | } |
3077 | inline const ::torch::RecordRef& ModuleDef::torchscript_debug_arena() const { |
3078 | // @@protoc_insertion_point(field_get:torch.ModuleDef.torchscript_debug_arena) |
3079 | return _internal_torchscript_debug_arena(); |
3080 | } |
3081 | inline void ModuleDef::unsafe_arena_set_allocated_torchscript_debug_arena( |
3082 | ::torch::RecordRef* torchscript_debug_arena) { |
3083 | if (GetArena() == nullptr) { |
3084 | delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(torchscript_debug_arena_); |
3085 | } |
3086 | torchscript_debug_arena_ = torchscript_debug_arena; |
3087 | if (torchscript_debug_arena) { |
3088 | _has_bits_[0] |= 0x00000010u; |
3089 | } else { |
3090 | _has_bits_[0] &= ~0x00000010u; |
3091 | } |
3092 | // @@protoc_insertion_point(field_unsafe_arena_set_allocated:torch.ModuleDef.torchscript_debug_arena) |
3093 | } |
3094 | inline ::torch::RecordRef* ModuleDef::release_torchscript_debug_arena() { |
3095 | _has_bits_[0] &= ~0x00000010u; |
3096 | ::torch::RecordRef* temp = torchscript_debug_arena_; |
3097 | torchscript_debug_arena_ = nullptr; |
3098 | if (GetArena() != nullptr) { |
3099 | temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); |
3100 | } |
3101 | return temp; |
3102 | } |
3103 | inline ::torch::RecordRef* ModuleDef::unsafe_arena_release_torchscript_debug_arena() { |
3104 | // @@protoc_insertion_point(field_release:torch.ModuleDef.torchscript_debug_arena) |
3105 | _has_bits_[0] &= ~0x00000010u; |
3106 | ::torch::RecordRef* temp = torchscript_debug_arena_; |
3107 | torchscript_debug_arena_ = nullptr; |
3108 | return temp; |
3109 | } |
3110 | inline ::torch::RecordRef* ModuleDef::_internal_mutable_torchscript_debug_arena() { |
3111 | _has_bits_[0] |= 0x00000010u; |
3112 | if (torchscript_debug_arena_ == nullptr) { |
3113 | auto* p = CreateMaybeMessage<::torch::RecordRef>(GetArena()); |
3114 | torchscript_debug_arena_ = p; |
3115 | } |
3116 | return torchscript_debug_arena_; |
3117 | } |
3118 | inline ::torch::RecordRef* ModuleDef::mutable_torchscript_debug_arena() { |
3119 | // @@protoc_insertion_point(field_mutable:torch.ModuleDef.torchscript_debug_arena) |
3120 | return _internal_mutable_torchscript_debug_arena(); |
3121 | } |
3122 | inline void ModuleDef::set_allocated_torchscript_debug_arena(::torch::RecordRef* torchscript_debug_arena) { |
3123 | ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArena(); |
3124 | if (message_arena == nullptr) { |
3125 | delete torchscript_debug_arena_; |
3126 | } |
3127 | if (torchscript_debug_arena) { |
3128 | ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = |
3129 | ::PROTOBUF_NAMESPACE_ID::Arena::GetArena(torchscript_debug_arena); |
3130 | if (message_arena != submessage_arena) { |
3131 | torchscript_debug_arena = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( |
3132 | message_arena, torchscript_debug_arena, submessage_arena); |
3133 | } |
3134 | _has_bits_[0] |= 0x00000010u; |
3135 | } else { |
3136 | _has_bits_[0] &= ~0x00000010u; |
3137 | } |
3138 | torchscript_debug_arena_ = torchscript_debug_arena; |
3139 | // @@protoc_insertion_point(field_set_allocated:torch.ModuleDef.torchscript_debug_arena) |
3140 | } |
3141 | |
3142 | // ------------------------------------------------------------------- |
3143 | |
3144 | // LibDef |
3145 | |
3146 | // optional .torch.RecordRef torchscript_arena = 1; |
3147 | inline bool LibDef::_internal_has_torchscript_arena() const { |
3148 | bool value = (_has_bits_[0] & 0x00000001u) != 0; |
3149 | PROTOBUF_ASSUME(!value || torchscript_arena_ != nullptr); |
3150 | return value; |
3151 | } |
3152 | inline bool LibDef::has_torchscript_arena() const { |
3153 | return _internal_has_torchscript_arena(); |
3154 | } |
3155 | inline void LibDef::clear_torchscript_arena() { |
3156 | if (torchscript_arena_ != nullptr) torchscript_arena_->Clear(); |
3157 | _has_bits_[0] &= ~0x00000001u; |
3158 | } |
3159 | inline const ::torch::RecordRef& LibDef::_internal_torchscript_arena() const { |
3160 | const ::torch::RecordRef* p = torchscript_arena_; |
3161 | return p != nullptr ? *p : *reinterpret_cast<const ::torch::RecordRef*>( |
3162 | &::torch::_RecordRef_default_instance_); |
3163 | } |
3164 | inline const ::torch::RecordRef& LibDef::torchscript_arena() const { |
3165 | // @@protoc_insertion_point(field_get:torch.LibDef.torchscript_arena) |
3166 | return _internal_torchscript_arena(); |
3167 | } |
3168 | inline void LibDef::unsafe_arena_set_allocated_torchscript_arena( |
3169 | ::torch::RecordRef* torchscript_arena) { |
3170 | if (GetArena() == nullptr) { |
3171 | delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(torchscript_arena_); |
3172 | } |
3173 | torchscript_arena_ = torchscript_arena; |
3174 | if (torchscript_arena) { |
3175 | _has_bits_[0] |= 0x00000001u; |
3176 | } else { |
3177 | _has_bits_[0] &= ~0x00000001u; |
3178 | } |
3179 | // @@protoc_insertion_point(field_unsafe_arena_set_allocated:torch.LibDef.torchscript_arena) |
3180 | } |
3181 | inline ::torch::RecordRef* LibDef::release_torchscript_arena() { |
3182 | _has_bits_[0] &= ~0x00000001u; |
3183 | ::torch::RecordRef* temp = torchscript_arena_; |
3184 | torchscript_arena_ = nullptr; |
3185 | if (GetArena() != nullptr) { |
3186 | temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); |
3187 | } |
3188 | return temp; |
3189 | } |
3190 | inline ::torch::RecordRef* LibDef::unsafe_arena_release_torchscript_arena() { |
3191 | // @@protoc_insertion_point(field_release:torch.LibDef.torchscript_arena) |
3192 | _has_bits_[0] &= ~0x00000001u; |
3193 | ::torch::RecordRef* temp = torchscript_arena_; |
3194 | torchscript_arena_ = nullptr; |
3195 | return temp; |
3196 | } |
3197 | inline ::torch::RecordRef* LibDef::_internal_mutable_torchscript_arena() { |
3198 | _has_bits_[0] |= 0x00000001u; |
3199 | if (torchscript_arena_ == nullptr) { |
3200 | auto* p = CreateMaybeMessage<::torch::RecordRef>(GetArena()); |
3201 | torchscript_arena_ = p; |
3202 | } |
3203 | return torchscript_arena_; |
3204 | } |
3205 | inline ::torch::RecordRef* LibDef::mutable_torchscript_arena() { |
3206 | // @@protoc_insertion_point(field_mutable:torch.LibDef.torchscript_arena) |
3207 | return _internal_mutable_torchscript_arena(); |
3208 | } |
3209 | inline void LibDef::set_allocated_torchscript_arena(::torch::RecordRef* torchscript_arena) { |
3210 | ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArena(); |
3211 | if (message_arena == nullptr) { |
3212 | delete torchscript_arena_; |
3213 | } |
3214 | if (torchscript_arena) { |
3215 | ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = |
3216 | ::PROTOBUF_NAMESPACE_ID::Arena::GetArena(torchscript_arena); |
3217 | if (message_arena != submessage_arena) { |
3218 | torchscript_arena = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( |
3219 | message_arena, torchscript_arena, submessage_arena); |
3220 | } |
3221 | _has_bits_[0] |= 0x00000001u; |
3222 | } else { |
3223 | _has_bits_[0] &= ~0x00000001u; |
3224 | } |
3225 | torchscript_arena_ = torchscript_arena; |
3226 | // @@protoc_insertion_point(field_set_allocated:torch.LibDef.torchscript_arena) |
3227 | } |
3228 | |
3229 | // ------------------------------------------------------------------- |
3230 | |
3231 | // ModelDef |
3232 | |
3233 | // optional int64 proto_version = 1; |
3234 | inline bool ModelDef::_internal_has_proto_version() const { |
3235 | bool value = (_has_bits_[0] & 0x00000008u) != 0; |
3236 | return value; |
3237 | } |
3238 | inline bool ModelDef::has_proto_version() const { |
3239 | return _internal_has_proto_version(); |
3240 | } |
3241 | inline void ModelDef::clear_proto_version() { |
3242 | proto_version_ = PROTOBUF_LONGLONG(0); |
3243 | _has_bits_[0] &= ~0x00000008u; |
3244 | } |
3245 | inline ::PROTOBUF_NAMESPACE_ID::int64 ModelDef::_internal_proto_version() const { |
3246 | return proto_version_; |
3247 | } |
3248 | inline ::PROTOBUF_NAMESPACE_ID::int64 ModelDef::proto_version() const { |
3249 | // @@protoc_insertion_point(field_get:torch.ModelDef.proto_version) |
3250 | return _internal_proto_version(); |
3251 | } |
3252 | inline void ModelDef::_internal_set_proto_version(::PROTOBUF_NAMESPACE_ID::int64 value) { |
3253 | _has_bits_[0] |= 0x00000008u; |
3254 | proto_version_ = value; |
3255 | } |
3256 | inline void ModelDef::set_proto_version(::PROTOBUF_NAMESPACE_ID::int64 value) { |
3257 | _internal_set_proto_version(value); |
3258 | // @@protoc_insertion_point(field_set:torch.ModelDef.proto_version) |
3259 | } |
3260 | |
3261 | // optional .torch.ModuleDef main_module = 2; |
3262 | inline bool ModelDef::_internal_has_main_module() const { |
3263 | bool value = (_has_bits_[0] & 0x00000004u) != 0; |
3264 | PROTOBUF_ASSUME(!value || main_module_ != nullptr); |
3265 | return value; |
3266 | } |
3267 | inline bool ModelDef::has_main_module() const { |
3268 | return _internal_has_main_module(); |
3269 | } |
3270 | inline void ModelDef::clear_main_module() { |
3271 | if (main_module_ != nullptr) main_module_->Clear(); |
3272 | _has_bits_[0] &= ~0x00000004u; |
3273 | } |
3274 | inline const ::torch::ModuleDef& ModelDef::_internal_main_module() const { |
3275 | const ::torch::ModuleDef* p = main_module_; |
3276 | return p != nullptr ? *p : *reinterpret_cast<const ::torch::ModuleDef*>( |
3277 | &::torch::_ModuleDef_default_instance_); |
3278 | } |
3279 | inline const ::torch::ModuleDef& ModelDef::main_module() const { |
3280 | // @@protoc_insertion_point(field_get:torch.ModelDef.main_module) |
3281 | return _internal_main_module(); |
3282 | } |
3283 | inline void ModelDef::unsafe_arena_set_allocated_main_module( |
3284 | ::torch::ModuleDef* main_module) { |
3285 | if (GetArena() == nullptr) { |
3286 | delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(main_module_); |
3287 | } |
3288 | main_module_ = main_module; |
3289 | if (main_module) { |
3290 | _has_bits_[0] |= 0x00000004u; |
3291 | } else { |
3292 | _has_bits_[0] &= ~0x00000004u; |
3293 | } |
3294 | // @@protoc_insertion_point(field_unsafe_arena_set_allocated:torch.ModelDef.main_module) |
3295 | } |
3296 | inline ::torch::ModuleDef* ModelDef::release_main_module() { |
3297 | _has_bits_[0] &= ~0x00000004u; |
3298 | ::torch::ModuleDef* temp = main_module_; |
3299 | main_module_ = nullptr; |
3300 | if (GetArena() != nullptr) { |
3301 | temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); |
3302 | } |
3303 | return temp; |
3304 | } |
3305 | inline ::torch::ModuleDef* ModelDef::unsafe_arena_release_main_module() { |
3306 | // @@protoc_insertion_point(field_release:torch.ModelDef.main_module) |
3307 | _has_bits_[0] &= ~0x00000004u; |
3308 | ::torch::ModuleDef* temp = main_module_; |
3309 | main_module_ = nullptr; |
3310 | return temp; |
3311 | } |
3312 | inline ::torch::ModuleDef* ModelDef::_internal_mutable_main_module() { |
3313 | _has_bits_[0] |= 0x00000004u; |
3314 | if (main_module_ == nullptr) { |
3315 | auto* p = CreateMaybeMessage<::torch::ModuleDef>(GetArena()); |
3316 | main_module_ = p; |
3317 | } |
3318 | return main_module_; |
3319 | } |
3320 | inline ::torch::ModuleDef* ModelDef::mutable_main_module() { |
3321 | // @@protoc_insertion_point(field_mutable:torch.ModelDef.main_module) |
3322 | return _internal_mutable_main_module(); |
3323 | } |
3324 | inline void ModelDef::set_allocated_main_module(::torch::ModuleDef* main_module) { |
3325 | ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArena(); |
3326 | if (message_arena == nullptr) { |
3327 | delete main_module_; |
3328 | } |
3329 | if (main_module) { |
3330 | ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = |
3331 | ::PROTOBUF_NAMESPACE_ID::Arena::GetArena(main_module); |
3332 | if (message_arena != submessage_arena) { |
3333 | main_module = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( |
3334 | message_arena, main_module, submessage_arena); |
3335 | } |
3336 | _has_bits_[0] |= 0x00000004u; |
3337 | } else { |
3338 | _has_bits_[0] &= ~0x00000004u; |
3339 | } |
3340 | main_module_ = main_module; |
3341 | // @@protoc_insertion_point(field_set_allocated:torch.ModelDef.main_module) |
3342 | } |
3343 | |
3344 | // optional string producer_name = 3; |
3345 | inline bool ModelDef::_internal_has_producer_name() const { |
3346 | bool value = (_has_bits_[0] & 0x00000001u) != 0; |
3347 | return value; |
3348 | } |
3349 | inline bool ModelDef::has_producer_name() const { |
3350 | return _internal_has_producer_name(); |
3351 | } |
3352 | inline void ModelDef::clear_producer_name() { |
3353 | producer_name_.ClearToEmpty(&GetEmptyStringAlreadyInited(), GetArena()); |
3354 | _has_bits_[0] &= ~0x00000001u; |
3355 | } |
3356 | inline const std::string& ModelDef::producer_name() const { |
3357 | // @@protoc_insertion_point(field_get:torch.ModelDef.producer_name) |
3358 | return _internal_producer_name(); |
3359 | } |
3360 | inline void ModelDef::set_producer_name(const std::string& value) { |
3361 | _internal_set_producer_name(value); |
3362 | // @@protoc_insertion_point(field_set:torch.ModelDef.producer_name) |
3363 | } |
3364 | inline std::string* ModelDef::mutable_producer_name() { |
3365 | // @@protoc_insertion_point(field_mutable:torch.ModelDef.producer_name) |
3366 | return _internal_mutable_producer_name(); |
3367 | } |
3368 | inline const std::string& ModelDef::_internal_producer_name() const { |
3369 | return producer_name_.Get(); |
3370 | } |
3371 | inline void ModelDef::_internal_set_producer_name(const std::string& value) { |
3372 | _has_bits_[0] |= 0x00000001u; |
3373 | producer_name_.Set(&GetEmptyStringAlreadyInited(), value, GetArena()); |
3374 | } |
3375 | inline void ModelDef::set_producer_name(std::string&& value) { |
3376 | _has_bits_[0] |= 0x00000001u; |
3377 | producer_name_.Set( |
3378 | &GetEmptyStringAlreadyInited(), ::std::move(value), GetArena()); |
3379 | // @@protoc_insertion_point(field_set_rvalue:torch.ModelDef.producer_name) |
3380 | } |
3381 | inline void ModelDef::set_producer_name(const char* value) { |
3382 | GOOGLE_DCHECK(value != nullptr); |
3383 | _has_bits_[0] |= 0x00000001u; |
3384 | producer_name_.Set(&GetEmptyStringAlreadyInited(), ::std::string(value), |
3385 | GetArena()); |
3386 | // @@protoc_insertion_point(field_set_char:torch.ModelDef.producer_name) |
3387 | } |
3388 | inline void ModelDef::set_producer_name(const char* value, |
3389 | size_t size) { |
3390 | _has_bits_[0] |= 0x00000001u; |
3391 | producer_name_.Set(&GetEmptyStringAlreadyInited(), ::std::string( |
3392 | reinterpret_cast<const char*>(value), size), GetArena()); |
3393 | // @@protoc_insertion_point(field_set_pointer:torch.ModelDef.producer_name) |
3394 | } |
3395 | inline std::string* ModelDef::_internal_mutable_producer_name() { |
3396 | _has_bits_[0] |= 0x00000001u; |
3397 | return producer_name_.Mutable(&GetEmptyStringAlreadyInited(), GetArena()); |
3398 | } |
3399 | inline std::string* ModelDef::release_producer_name() { |
3400 | // @@protoc_insertion_point(field_release:torch.ModelDef.producer_name) |
3401 | if (!_internal_has_producer_name()) { |
3402 | return nullptr; |
3403 | } |
3404 | _has_bits_[0] &= ~0x00000001u; |
3405 | return producer_name_.ReleaseNonDefault(&GetEmptyStringAlreadyInited(), GetArena()); |
3406 | } |
3407 | inline void ModelDef::set_allocated_producer_name(std::string* producer_name) { |
3408 | if (producer_name != nullptr) { |
3409 | _has_bits_[0] |= 0x00000001u; |
3410 | } else { |
3411 | _has_bits_[0] &= ~0x00000001u; |
3412 | } |
3413 | producer_name_.SetAllocated(&GetEmptyStringAlreadyInited(), producer_name, |
3414 | GetArena()); |
3415 | // @@protoc_insertion_point(field_set_allocated:torch.ModelDef.producer_name) |
3416 | } |
3417 | |
3418 | // optional string producer_version = 4; |
3419 | inline bool ModelDef::_internal_has_producer_version() const { |
3420 | bool value = (_has_bits_[0] & 0x00000002u) != 0; |
3421 | return value; |
3422 | } |
3423 | inline bool ModelDef::has_producer_version() const { |
3424 | return _internal_has_producer_version(); |
3425 | } |
3426 | inline void ModelDef::clear_producer_version() { |
3427 | producer_version_.ClearToEmpty(&GetEmptyStringAlreadyInited(), GetArena()); |
3428 | _has_bits_[0] &= ~0x00000002u; |
3429 | } |
3430 | inline const std::string& ModelDef::producer_version() const { |
3431 | // @@protoc_insertion_point(field_get:torch.ModelDef.producer_version) |
3432 | return _internal_producer_version(); |
3433 | } |
3434 | inline void ModelDef::set_producer_version(const std::string& value) { |
3435 | _internal_set_producer_version(value); |
3436 | // @@protoc_insertion_point(field_set:torch.ModelDef.producer_version) |
3437 | } |
3438 | inline std::string* ModelDef::mutable_producer_version() { |
3439 | // @@protoc_insertion_point(field_mutable:torch.ModelDef.producer_version) |
3440 | return _internal_mutable_producer_version(); |
3441 | } |
3442 | inline const std::string& ModelDef::_internal_producer_version() const { |
3443 | return producer_version_.Get(); |
3444 | } |
3445 | inline void ModelDef::_internal_set_producer_version(const std::string& value) { |
3446 | _has_bits_[0] |= 0x00000002u; |
3447 | producer_version_.Set(&GetEmptyStringAlreadyInited(), value, GetArena()); |
3448 | } |
3449 | inline void ModelDef::set_producer_version(std::string&& value) { |
3450 | _has_bits_[0] |= 0x00000002u; |
3451 | producer_version_.Set( |
3452 | &GetEmptyStringAlreadyInited(), ::std::move(value), GetArena()); |
3453 | // @@protoc_insertion_point(field_set_rvalue:torch.ModelDef.producer_version) |
3454 | } |
3455 | inline void ModelDef::set_producer_version(const char* value) { |
3456 | GOOGLE_DCHECK(value != nullptr); |
3457 | _has_bits_[0] |= 0x00000002u; |
3458 | producer_version_.Set(&GetEmptyStringAlreadyInited(), ::std::string(value), |
3459 | GetArena()); |
3460 | // @@protoc_insertion_point(field_set_char:torch.ModelDef.producer_version) |
3461 | } |
3462 | inline void ModelDef::set_producer_version(const char* value, |
3463 | size_t size) { |
3464 | _has_bits_[0] |= 0x00000002u; |
3465 | producer_version_.Set(&GetEmptyStringAlreadyInited(), ::std::string( |
3466 | reinterpret_cast<const char*>(value), size), GetArena()); |
3467 | // @@protoc_insertion_point(field_set_pointer:torch.ModelDef.producer_version) |
3468 | } |
3469 | inline std::string* ModelDef::_internal_mutable_producer_version() { |
3470 | _has_bits_[0] |= 0x00000002u; |
3471 | return producer_version_.Mutable(&GetEmptyStringAlreadyInited(), GetArena()); |
3472 | } |
3473 | inline std::string* ModelDef::release_producer_version() { |
3474 | // @@protoc_insertion_point(field_release:torch.ModelDef.producer_version) |
3475 | if (!_internal_has_producer_version()) { |
3476 | return nullptr; |
3477 | } |
3478 | _has_bits_[0] &= ~0x00000002u; |
3479 | return producer_version_.ReleaseNonDefault(&GetEmptyStringAlreadyInited(), GetArena()); |
3480 | } |
3481 | inline void ModelDef::set_allocated_producer_version(std::string* producer_version) { |
3482 | if (producer_version != nullptr) { |
3483 | _has_bits_[0] |= 0x00000002u; |
3484 | } else { |
3485 | _has_bits_[0] &= ~0x00000002u; |
3486 | } |
3487 | producer_version_.SetAllocated(&GetEmptyStringAlreadyInited(), producer_version, |
3488 | GetArena()); |
3489 | // @@protoc_insertion_point(field_set_allocated:torch.ModelDef.producer_version) |
3490 | } |
3491 | |
3492 | // repeated .torch.TensorDef tensors = 5; |
3493 | inline int ModelDef::_internal_tensors_size() const { |
3494 | return tensors_.size(); |
3495 | } |
3496 | inline int ModelDef::tensors_size() const { |
3497 | return _internal_tensors_size(); |
3498 | } |
3499 | inline void ModelDef::clear_tensors() { |
3500 | tensors_.Clear(); |
3501 | } |
3502 | inline ::torch::TensorDef* ModelDef::mutable_tensors(int index) { |
3503 | // @@protoc_insertion_point(field_mutable:torch.ModelDef.tensors) |
3504 | return tensors_.Mutable(index); |
3505 | } |
3506 | inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::torch::TensorDef >* |
3507 | ModelDef::mutable_tensors() { |
3508 | // @@protoc_insertion_point(field_mutable_list:torch.ModelDef.tensors) |
3509 | return &tensors_; |
3510 | } |
3511 | inline const ::torch::TensorDef& ModelDef::_internal_tensors(int index) const { |
3512 | return tensors_.Get(index); |
3513 | } |
3514 | inline const ::torch::TensorDef& ModelDef::tensors(int index) const { |
3515 | // @@protoc_insertion_point(field_get:torch.ModelDef.tensors) |
3516 | return _internal_tensors(index); |
3517 | } |
3518 | inline ::torch::TensorDef* ModelDef::_internal_add_tensors() { |
3519 | return tensors_.Add(); |
3520 | } |
3521 | inline ::torch::TensorDef* ModelDef::add_tensors() { |
3522 | // @@protoc_insertion_point(field_add:torch.ModelDef.tensors) |
3523 | return _internal_add_tensors(); |
3524 | } |
3525 | inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::torch::TensorDef >& |
3526 | ModelDef::tensors() const { |
3527 | // @@protoc_insertion_point(field_list:torch.ModelDef.tensors) |
3528 | return tensors_; |
3529 | } |
3530 | |
3531 | #ifdef __GNUC__ |
3532 | #pragma GCC diagnostic pop |
3533 | #endif // __GNUC__ |
3534 | // ------------------------------------------------------------------- |
3535 | |
3536 | // ------------------------------------------------------------------- |
3537 | |
3538 | // ------------------------------------------------------------------- |
3539 | |
3540 | // ------------------------------------------------------------------- |
3541 | |
3542 | // ------------------------------------------------------------------- |
3543 | |
3544 | // ------------------------------------------------------------------- |
3545 | |
3546 | |
3547 | // @@protoc_insertion_point(namespace_scope) |
3548 | |
3549 | } // namespace torch |
3550 | |
3551 | PROTOBUF_NAMESPACE_OPEN |
3552 | |
3553 | template <> struct is_proto_enum< ::torch::ProtoVersion> : ::std::true_type {}; |
3554 | template <> |
3555 | inline const EnumDescriptor* GetEnumDescriptor< ::torch::ProtoVersion>() { |
3556 | return ::torch::ProtoVersion_descriptor(); |
3557 | } |
3558 | |
3559 | PROTOBUF_NAMESPACE_CLOSE |
3560 | |
3561 | // @@protoc_insertion_point(global_scope) |
3562 | |
3563 | #include <google/protobuf/port_undef.inc> |
3564 | #endif // GOOGLE_PROTOBUF_INCLUDED_GOOGLE_PROTOBUF_INCLUDED_caffe2_2fproto_2ftorch_2eproto |
3565 | |