1// Generated by the protocol buffer compiler. DO NOT EDIT!
2// source: caffe2.proto
3
4#define INTERNAL_SUPPRESS_PROTOBUF_FIELD_DEPRECATION
5#include "caffe2.pb.h"
6
7#include <algorithm>
8
9#include <google/protobuf/stubs/common.h>
10#include <google/protobuf/stubs/once.h>
11#include <google/protobuf/io/coded_stream.h>
12#include <google/protobuf/wire_format_lite_inl.h>
13#include <google/protobuf/descriptor.h>
14#include <google/protobuf/generated_message_reflection.h>
15#include <google/protobuf/reflection_ops.h>
16#include <google/protobuf/wire_format.h>
17// @@protoc_insertion_point(includes)
18
19namespace caffe2 {
20
21namespace {
22
23const ::google::protobuf::Descriptor* ExternalDataProto_descriptor_ = NULL;
24const ::google::protobuf::internal::GeneratedMessageReflection*
25 ExternalDataProto_reflection_ = NULL;
26const ::google::protobuf::EnumDescriptor* ExternalDataProto_SourceType_descriptor_ = NULL;
27const ::google::protobuf::Descriptor* TensorProto_descriptor_ = NULL;
28const ::google::protobuf::internal::GeneratedMessageReflection*
29 TensorProto_reflection_ = NULL;
30const ::google::protobuf::Descriptor* TensorProto_Segment_descriptor_ = NULL;
31const ::google::protobuf::internal::GeneratedMessageReflection*
32 TensorProto_Segment_reflection_ = NULL;
33const ::google::protobuf::EnumDescriptor* TensorProto_DataType_descriptor_ = NULL;
34const ::google::protobuf::EnumDescriptor* TensorProto_StorageType_descriptor_ = NULL;
35const ::google::protobuf::Descriptor* QTensorProto_descriptor_ = NULL;
36const ::google::protobuf::internal::GeneratedMessageReflection*
37 QTensorProto_reflection_ = NULL;
38const ::google::protobuf::Descriptor* TensorProtos_descriptor_ = NULL;
39const ::google::protobuf::internal::GeneratedMessageReflection*
40 TensorProtos_reflection_ = NULL;
41const ::google::protobuf::Descriptor* TensorShape_descriptor_ = NULL;
42const ::google::protobuf::internal::GeneratedMessageReflection*
43 TensorShape_reflection_ = NULL;
44const ::google::protobuf::Descriptor* TensorShapes_descriptor_ = NULL;
45const ::google::protobuf::internal::GeneratedMessageReflection*
46 TensorShapes_reflection_ = NULL;
47const ::google::protobuf::Descriptor* TensorBoundShape_descriptor_ = NULL;
48const ::google::protobuf::internal::GeneratedMessageReflection*
49 TensorBoundShape_reflection_ = NULL;
50const ::google::protobuf::EnumDescriptor* TensorBoundShape_DimType_descriptor_ = NULL;
51const ::google::protobuf::Descriptor* TensorBoundShapes_descriptor_ = NULL;
52const ::google::protobuf::internal::GeneratedMessageReflection*
53 TensorBoundShapes_reflection_ = NULL;
54const ::google::protobuf::Descriptor* AOTConfig_descriptor_ = NULL;
55const ::google::protobuf::internal::GeneratedMessageReflection*
56 AOTConfig_reflection_ = NULL;
57const ::google::protobuf::Descriptor* Argument_descriptor_ = NULL;
58const ::google::protobuf::internal::GeneratedMessageReflection*
59 Argument_reflection_ = NULL;
60const ::google::protobuf::Descriptor* DeviceOption_descriptor_ = NULL;
61const ::google::protobuf::internal::GeneratedMessageReflection*
62 DeviceOption_reflection_ = NULL;
63const ::google::protobuf::Descriptor* OperatorDef_descriptor_ = NULL;
64const ::google::protobuf::internal::GeneratedMessageReflection*
65 OperatorDef_reflection_ = NULL;
66const ::google::protobuf::Descriptor* MapFieldEntry_descriptor_ = NULL;
67const ::google::protobuf::internal::GeneratedMessageReflection*
68 MapFieldEntry_reflection_ = NULL;
69const ::google::protobuf::Descriptor* BackendOptions_descriptor_ = NULL;
70const ::google::protobuf::internal::GeneratedMessageReflection*
71 BackendOptions_reflection_ = NULL;
72const ::google::protobuf::Descriptor* PartitionInfo_descriptor_ = NULL;
73const ::google::protobuf::internal::GeneratedMessageReflection*
74 PartitionInfo_reflection_ = NULL;
75const ::google::protobuf::Descriptor* NetDef_descriptor_ = NULL;
76const ::google::protobuf::internal::GeneratedMessageReflection*
77 NetDef_reflection_ = NULL;
78const ::google::protobuf::Descriptor* ExecutionStep_descriptor_ = NULL;
79const ::google::protobuf::internal::GeneratedMessageReflection*
80 ExecutionStep_reflection_ = NULL;
81const ::google::protobuf::Descriptor* PlanDef_descriptor_ = NULL;
82const ::google::protobuf::internal::GeneratedMessageReflection*
83 PlanDef_reflection_ = NULL;
84const ::google::protobuf::Descriptor* BlobProto_descriptor_ = NULL;
85const ::google::protobuf::internal::GeneratedMessageReflection*
86 BlobProto_reflection_ = NULL;
87const ::google::protobuf::Descriptor* DBReaderProto_descriptor_ = NULL;
88const ::google::protobuf::internal::GeneratedMessageReflection*
89 DBReaderProto_reflection_ = NULL;
90const ::google::protobuf::EnumDescriptor* DeviceTypeProto_descriptor_ = NULL;
91
92} // namespace
93
94
95void protobuf_AssignDesc_caffe2_2eproto() {
96 protobuf_AddDesc_caffe2_2eproto();
97 const ::google::protobuf::FileDescriptor* file =
98 ::google::protobuf::DescriptorPool::generated_pool()->FindFileByName(
99 "caffe2.proto");
100 GOOGLE_CHECK(file != NULL);
101 ExternalDataProto_descriptor_ = file->message_type(0);
102 static const int ExternalDataProto_offsets_[5] = {
103 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ExternalDataProto, source_type_),
104 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ExternalDataProto, record_id_),
105 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ExternalDataProto, record_size_),
106 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ExternalDataProto, offset_),
107 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ExternalDataProto, strides_),
108 };
109 ExternalDataProto_reflection_ =
110 new ::google::protobuf::internal::GeneratedMessageReflection(
111 ExternalDataProto_descriptor_,
112 ExternalDataProto::default_instance_,
113 ExternalDataProto_offsets_,
114 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ExternalDataProto, _has_bits_[0]),
115 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ExternalDataProto, _unknown_fields_),
116 -1,
117 ::google::protobuf::DescriptorPool::generated_pool(),
118 ::google::protobuf::MessageFactory::generated_factory(),
119 sizeof(ExternalDataProto));
120 ExternalDataProto_SourceType_descriptor_ = ExternalDataProto_descriptor_->enum_type(0);
121 TensorProto_descriptor_ = file->message_type(1);
122 static const int TensorProto_offsets_[14] = {
123 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TensorProto, dims_),
124 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TensorProto, data_type_),
125 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TensorProto, storage_type_),
126 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TensorProto, float_data_),
127 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TensorProto, int32_data_),
128 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TensorProto, byte_data_),
129 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TensorProto, string_data_),
130 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TensorProto, double_data_),
131 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TensorProto, int64_data_),
132 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TensorProto, raw_data_),
133 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TensorProto, external_data_),
134 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TensorProto, name_),
135 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TensorProto, device_detail_),
136 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TensorProto, segment_),
137 };
138 TensorProto_reflection_ =
139 new ::google::protobuf::internal::GeneratedMessageReflection(
140 TensorProto_descriptor_,
141 TensorProto::default_instance_,
142 TensorProto_offsets_,
143 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TensorProto, _has_bits_[0]),
144 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TensorProto, _unknown_fields_),
145 -1,
146 ::google::protobuf::DescriptorPool::generated_pool(),
147 ::google::protobuf::MessageFactory::generated_factory(),
148 sizeof(TensorProto));
149 TensorProto_Segment_descriptor_ = TensorProto_descriptor_->nested_type(0);
150 static const int TensorProto_Segment_offsets_[2] = {
151 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TensorProto_Segment, begin_),
152 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TensorProto_Segment, end_),
153 };
154 TensorProto_Segment_reflection_ =
155 new ::google::protobuf::internal::GeneratedMessageReflection(
156 TensorProto_Segment_descriptor_,
157 TensorProto_Segment::default_instance_,
158 TensorProto_Segment_offsets_,
159 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TensorProto_Segment, _has_bits_[0]),
160 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TensorProto_Segment, _unknown_fields_),
161 -1,
162 ::google::protobuf::DescriptorPool::generated_pool(),
163 ::google::protobuf::MessageFactory::generated_factory(),
164 sizeof(TensorProto_Segment));
165 TensorProto_DataType_descriptor_ = TensorProto_descriptor_->enum_type(0);
166 TensorProto_StorageType_descriptor_ = TensorProto_descriptor_->enum_type(1);
167 QTensorProto_descriptor_ = file->message_type(2);
168 static const int QTensorProto_offsets_[12] = {
169 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(QTensorProto, dims_),
170 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(QTensorProto, precision_),
171 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(QTensorProto, scale_),
172 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(QTensorProto, bias_),
173 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(QTensorProto, is_signed_),
174 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(QTensorProto, data_),
175 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(QTensorProto, name_),
176 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(QTensorProto, data_type_),
177 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(QTensorProto, scales_),
178 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(QTensorProto, biases_),
179 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(QTensorProto, axis_),
180 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(QTensorProto, is_multiparam_),
181 };
182 QTensorProto_reflection_ =
183 new ::google::protobuf::internal::GeneratedMessageReflection(
184 QTensorProto_descriptor_,
185 QTensorProto::default_instance_,
186 QTensorProto_offsets_,
187 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(QTensorProto, _has_bits_[0]),
188 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(QTensorProto, _unknown_fields_),
189 -1,
190 ::google::protobuf::DescriptorPool::generated_pool(),
191 ::google::protobuf::MessageFactory::generated_factory(),
192 sizeof(QTensorProto));
193 TensorProtos_descriptor_ = file->message_type(3);
194 static const int TensorProtos_offsets_[1] = {
195 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TensorProtos, protos_),
196 };
197 TensorProtos_reflection_ =
198 new ::google::protobuf::internal::GeneratedMessageReflection(
199 TensorProtos_descriptor_,
200 TensorProtos::default_instance_,
201 TensorProtos_offsets_,
202 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TensorProtos, _has_bits_[0]),
203 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TensorProtos, _unknown_fields_),
204 -1,
205 ::google::protobuf::DescriptorPool::generated_pool(),
206 ::google::protobuf::MessageFactory::generated_factory(),
207 sizeof(TensorProtos));
208 TensorShape_descriptor_ = file->message_type(4);
209 static const int TensorShape_offsets_[5] = {
210 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TensorShape, dims_),
211 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TensorShape, data_type_),
212 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TensorShape, unknown_dims_),
213 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TensorShape, unknown_shape_),
214 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TensorShape, name_),
215 };
216 TensorShape_reflection_ =
217 new ::google::protobuf::internal::GeneratedMessageReflection(
218 TensorShape_descriptor_,
219 TensorShape::default_instance_,
220 TensorShape_offsets_,
221 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TensorShape, _has_bits_[0]),
222 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TensorShape, _unknown_fields_),
223 -1,
224 ::google::protobuf::DescriptorPool::generated_pool(),
225 ::google::protobuf::MessageFactory::generated_factory(),
226 sizeof(TensorShape));
227 TensorShapes_descriptor_ = file->message_type(5);
228 static const int TensorShapes_offsets_[1] = {
229 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TensorShapes, shapes_),
230 };
231 TensorShapes_reflection_ =
232 new ::google::protobuf::internal::GeneratedMessageReflection(
233 TensorShapes_descriptor_,
234 TensorShapes::default_instance_,
235 TensorShapes_offsets_,
236 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TensorShapes, _has_bits_[0]),
237 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TensorShapes, _unknown_fields_),
238 -1,
239 ::google::protobuf::DescriptorPool::generated_pool(),
240 ::google::protobuf::MessageFactory::generated_factory(),
241 sizeof(TensorShapes));
242 TensorBoundShape_descriptor_ = file->message_type(6);
243 static const int TensorBoundShape_offsets_[3] = {
244 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TensorBoundShape, shape_),
245 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TensorBoundShape, dim_type_),
246 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TensorBoundShape, name_),
247 };
248 TensorBoundShape_reflection_ =
249 new ::google::protobuf::internal::GeneratedMessageReflection(
250 TensorBoundShape_descriptor_,
251 TensorBoundShape::default_instance_,
252 TensorBoundShape_offsets_,
253 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TensorBoundShape, _has_bits_[0]),
254 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TensorBoundShape, _unknown_fields_),
255 -1,
256 ::google::protobuf::DescriptorPool::generated_pool(),
257 ::google::protobuf::MessageFactory::generated_factory(),
258 sizeof(TensorBoundShape));
259 TensorBoundShape_DimType_descriptor_ = TensorBoundShape_descriptor_->enum_type(0);
260 TensorBoundShapes_descriptor_ = file->message_type(7);
261 static const int TensorBoundShapes_offsets_[3] = {
262 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TensorBoundShapes, shapes_),
263 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TensorBoundShapes, max_batch_size_),
264 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TensorBoundShapes, max_feature_len_),
265 };
266 TensorBoundShapes_reflection_ =
267 new ::google::protobuf::internal::GeneratedMessageReflection(
268 TensorBoundShapes_descriptor_,
269 TensorBoundShapes::default_instance_,
270 TensorBoundShapes_offsets_,
271 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TensorBoundShapes, _has_bits_[0]),
272 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TensorBoundShapes, _unknown_fields_),
273 -1,
274 ::google::protobuf::DescriptorPool::generated_pool(),
275 ::google::protobuf::MessageFactory::generated_factory(),
276 sizeof(TensorBoundShapes));
277 AOTConfig_descriptor_ = file->message_type(8);
278 static const int AOTConfig_offsets_[5] = {
279 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AOTConfig, max_batch_size_),
280 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AOTConfig, max_seq_size_),
281 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AOTConfig, in_batch_broadcast_),
282 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AOTConfig, onnxifi_blacklist_ops_),
283 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AOTConfig, onnxifi_min_ops_),
284 };
285 AOTConfig_reflection_ =
286 new ::google::protobuf::internal::GeneratedMessageReflection(
287 AOTConfig_descriptor_,
288 AOTConfig::default_instance_,
289 AOTConfig_offsets_,
290 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AOTConfig, _has_bits_[0]),
291 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AOTConfig, _unknown_fields_),
292 -1,
293 ::google::protobuf::DescriptorPool::generated_pool(),
294 ::google::protobuf::MessageFactory::generated_factory(),
295 sizeof(AOTConfig));
296 Argument_descriptor_ = file->message_type(9);
297 static const int Argument_offsets_[12] = {
298 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Argument, name_),
299 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Argument, f_),
300 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Argument, i_),
301 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Argument, s_),
302 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Argument, t_),
303 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Argument, n_),
304 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Argument, floats_),
305 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Argument, ints_),
306 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Argument, strings_),
307 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Argument, tensors_),
308 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Argument, nets_),
309 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Argument, qtensors_),
310 };
311 Argument_reflection_ =
312 new ::google::protobuf::internal::GeneratedMessageReflection(
313 Argument_descriptor_,
314 Argument::default_instance_,
315 Argument_offsets_,
316 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Argument, _has_bits_[0]),
317 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Argument, _unknown_fields_),
318 -1,
319 ::google::protobuf::DescriptorPool::generated_pool(),
320 ::google::protobuf::MessageFactory::generated_factory(),
321 sizeof(Argument));
322 DeviceOption_descriptor_ = file->message_type(10);
323 static const int DeviceOption_offsets_[6] = {
324 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DeviceOption, device_type_),
325 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DeviceOption, device_id_),
326 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DeviceOption, random_seed_),
327 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DeviceOption, node_name_),
328 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DeviceOption, numa_node_id_),
329 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DeviceOption, extra_info_),
330 };
331 DeviceOption_reflection_ =
332 new ::google::protobuf::internal::GeneratedMessageReflection(
333 DeviceOption_descriptor_,
334 DeviceOption::default_instance_,
335 DeviceOption_offsets_,
336 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DeviceOption, _has_bits_[0]),
337 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DeviceOption, _unknown_fields_),
338 -1,
339 ::google::protobuf::DescriptorPool::generated_pool(),
340 ::google::protobuf::MessageFactory::generated_factory(),
341 sizeof(DeviceOption));
342 OperatorDef_descriptor_ = file->message_type(11);
343 static const int OperatorDef_offsets_[12] = {
344 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(OperatorDef, input_),
345 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(OperatorDef, output_),
346 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(OperatorDef, name_),
347 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(OperatorDef, type_),
348 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(OperatorDef, arg_),
349 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(OperatorDef, device_option_),
350 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(OperatorDef, engine_),
351 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(OperatorDef, control_input_),
352 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(OperatorDef, is_gradient_op_),
353 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(OperatorDef, debug_info_),
354 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(OperatorDef, domain_),
355 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(OperatorDef, op_version_),
356 };
357 OperatorDef_reflection_ =
358 new ::google::protobuf::internal::GeneratedMessageReflection(
359 OperatorDef_descriptor_,
360 OperatorDef::default_instance_,
361 OperatorDef_offsets_,
362 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(OperatorDef, _has_bits_[0]),
363 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(OperatorDef, _unknown_fields_),
364 -1,
365 ::google::protobuf::DescriptorPool::generated_pool(),
366 ::google::protobuf::MessageFactory::generated_factory(),
367 sizeof(OperatorDef));
368 MapFieldEntry_descriptor_ = file->message_type(12);
369 static const int MapFieldEntry_offsets_[2] = {
370 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MapFieldEntry, key_),
371 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MapFieldEntry, val_),
372 };
373 MapFieldEntry_reflection_ =
374 new ::google::protobuf::internal::GeneratedMessageReflection(
375 MapFieldEntry_descriptor_,
376 MapFieldEntry::default_instance_,
377 MapFieldEntry_offsets_,
378 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MapFieldEntry, _has_bits_[0]),
379 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MapFieldEntry, _unknown_fields_),
380 -1,
381 ::google::protobuf::DescriptorPool::generated_pool(),
382 ::google::protobuf::MessageFactory::generated_factory(),
383 sizeof(MapFieldEntry));
384 BackendOptions_descriptor_ = file->message_type(13);
385 static const int BackendOptions_offsets_[2] = {
386 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(BackendOptions, backend_name_),
387 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(BackendOptions, option_),
388 };
389 BackendOptions_reflection_ =
390 new ::google::protobuf::internal::GeneratedMessageReflection(
391 BackendOptions_descriptor_,
392 BackendOptions::default_instance_,
393 BackendOptions_offsets_,
394 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(BackendOptions, _has_bits_[0]),
395 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(BackendOptions, _unknown_fields_),
396 -1,
397 ::google::protobuf::DescriptorPool::generated_pool(),
398 ::google::protobuf::MessageFactory::generated_factory(),
399 sizeof(BackendOptions));
400 PartitionInfo_descriptor_ = file->message_type(14);
401 static const int PartitionInfo_offsets_[4] = {
402 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PartitionInfo, name_),
403 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PartitionInfo, device_id_),
404 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PartitionInfo, extra_info_),
405 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PartitionInfo, backend_options_),
406 };
407 PartitionInfo_reflection_ =
408 new ::google::protobuf::internal::GeneratedMessageReflection(
409 PartitionInfo_descriptor_,
410 PartitionInfo::default_instance_,
411 PartitionInfo_offsets_,
412 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PartitionInfo, _has_bits_[0]),
413 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PartitionInfo, _unknown_fields_),
414 -1,
415 ::google::protobuf::DescriptorPool::generated_pool(),
416 ::google::protobuf::MessageFactory::generated_factory(),
417 sizeof(PartitionInfo));
418 NetDef_descriptor_ = file->message_type(15);
419 static const int NetDef_offsets_[9] = {
420 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(NetDef, name_),
421 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(NetDef, op_),
422 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(NetDef, type_),
423 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(NetDef, num_workers_),
424 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(NetDef, device_option_),
425 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(NetDef, arg_),
426 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(NetDef, external_input_),
427 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(NetDef, external_output_),
428 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(NetDef, partition_info_),
429 };
430 NetDef_reflection_ =
431 new ::google::protobuf::internal::GeneratedMessageReflection(
432 NetDef_descriptor_,
433 NetDef::default_instance_,
434 NetDef_offsets_,
435 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(NetDef, _has_bits_[0]),
436 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(NetDef, _unknown_fields_),
437 -1,
438 ::google::protobuf::DescriptorPool::generated_pool(),
439 ::google::protobuf::MessageFactory::generated_factory(),
440 sizeof(NetDef));
441 ExecutionStep_descriptor_ = file->message_type(16);
442 static const int ExecutionStep_offsets_[13] = {
443 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ExecutionStep, name_),
444 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ExecutionStep, substep_),
445 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ExecutionStep, network_),
446 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ExecutionStep, num_iter_),
447 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ExecutionStep, criteria_network_),
448 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ExecutionStep, report_net_),
449 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ExecutionStep, report_interval_),
450 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ExecutionStep, run_every_ms_),
451 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ExecutionStep, concurrent_substeps_),
452 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ExecutionStep, should_stop_blob_),
453 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ExecutionStep, only_once_),
454 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ExecutionStep, create_workspace_),
455 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ExecutionStep, num_concurrent_instances_),
456 };
457 ExecutionStep_reflection_ =
458 new ::google::protobuf::internal::GeneratedMessageReflection(
459 ExecutionStep_descriptor_,
460 ExecutionStep::default_instance_,
461 ExecutionStep_offsets_,
462 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ExecutionStep, _has_bits_[0]),
463 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ExecutionStep, _unknown_fields_),
464 -1,
465 ::google::protobuf::DescriptorPool::generated_pool(),
466 ::google::protobuf::MessageFactory::generated_factory(),
467 sizeof(ExecutionStep));
468 PlanDef_descriptor_ = file->message_type(17);
469 static const int PlanDef_offsets_[3] = {
470 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PlanDef, name_),
471 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PlanDef, network_),
472 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PlanDef, execution_step_),
473 };
474 PlanDef_reflection_ =
475 new ::google::protobuf::internal::GeneratedMessageReflection(
476 PlanDef_descriptor_,
477 PlanDef::default_instance_,
478 PlanDef_offsets_,
479 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PlanDef, _has_bits_[0]),
480 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PlanDef, _unknown_fields_),
481 -1,
482 ::google::protobuf::DescriptorPool::generated_pool(),
483 ::google::protobuf::MessageFactory::generated_factory(),
484 sizeof(PlanDef));
485 BlobProto_descriptor_ = file->message_type(18);
486 static const int BlobProto_offsets_[7] = {
487 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(BlobProto, name_),
488 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(BlobProto, type_),
489 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(BlobProto, tensor_),
490 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(BlobProto, content_),
491 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(BlobProto, qtensor_),
492 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(BlobProto, content_num_chunks_),
493 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(BlobProto, content_chunk_id_),
494 };
495 BlobProto_reflection_ =
496 new ::google::protobuf::internal::GeneratedMessageReflection(
497 BlobProto_descriptor_,
498 BlobProto::default_instance_,
499 BlobProto_offsets_,
500 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(BlobProto, _has_bits_[0]),
501 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(BlobProto, _unknown_fields_),
502 -1,
503 ::google::protobuf::DescriptorPool::generated_pool(),
504 ::google::protobuf::MessageFactory::generated_factory(),
505 sizeof(BlobProto));
506 DBReaderProto_descriptor_ = file->message_type(19);
507 static const int DBReaderProto_offsets_[4] = {
508 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DBReaderProto, name_),
509 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DBReaderProto, source_),
510 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DBReaderProto, db_type_),
511 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DBReaderProto, key_),
512 };
513 DBReaderProto_reflection_ =
514 new ::google::protobuf::internal::GeneratedMessageReflection(
515 DBReaderProto_descriptor_,
516 DBReaderProto::default_instance_,
517 DBReaderProto_offsets_,
518 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DBReaderProto, _has_bits_[0]),
519 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DBReaderProto, _unknown_fields_),
520 -1,
521 ::google::protobuf::DescriptorPool::generated_pool(),
522 ::google::protobuf::MessageFactory::generated_factory(),
523 sizeof(DBReaderProto));
524 DeviceTypeProto_descriptor_ = file->enum_type(0);
525}
526
527namespace {
528
529GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_AssignDescriptors_once_);
530inline void protobuf_AssignDescriptorsOnce() {
531 ::google::protobuf::GoogleOnceInit(&protobuf_AssignDescriptors_once_,
532 &protobuf_AssignDesc_caffe2_2eproto);
533}
534
535void protobuf_RegisterTypes(const ::std::string&) {
536 protobuf_AssignDescriptorsOnce();
537 ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
538 ExternalDataProto_descriptor_, &ExternalDataProto::default_instance());
539 ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
540 TensorProto_descriptor_, &TensorProto::default_instance());
541 ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
542 TensorProto_Segment_descriptor_, &TensorProto_Segment::default_instance());
543 ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
544 QTensorProto_descriptor_, &QTensorProto::default_instance());
545 ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
546 TensorProtos_descriptor_, &TensorProtos::default_instance());
547 ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
548 TensorShape_descriptor_, &TensorShape::default_instance());
549 ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
550 TensorShapes_descriptor_, &TensorShapes::default_instance());
551 ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
552 TensorBoundShape_descriptor_, &TensorBoundShape::default_instance());
553 ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
554 TensorBoundShapes_descriptor_, &TensorBoundShapes::default_instance());
555 ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
556 AOTConfig_descriptor_, &AOTConfig::default_instance());
557 ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
558 Argument_descriptor_, &Argument::default_instance());
559 ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
560 DeviceOption_descriptor_, &DeviceOption::default_instance());
561 ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
562 OperatorDef_descriptor_, &OperatorDef::default_instance());
563 ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
564 MapFieldEntry_descriptor_, &MapFieldEntry::default_instance());
565 ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
566 BackendOptions_descriptor_, &BackendOptions::default_instance());
567 ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
568 PartitionInfo_descriptor_, &PartitionInfo::default_instance());
569 ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
570 NetDef_descriptor_, &NetDef::default_instance());
571 ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
572 ExecutionStep_descriptor_, &ExecutionStep::default_instance());
573 ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
574 PlanDef_descriptor_, &PlanDef::default_instance());
575 ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
576 BlobProto_descriptor_, &BlobProto::default_instance());
577 ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
578 DBReaderProto_descriptor_, &DBReaderProto::default_instance());
579}
580
581} // namespace
582
583void protobuf_ShutdownFile_caffe2_2eproto() {
584 delete ExternalDataProto::default_instance_;
585 delete ExternalDataProto_reflection_;
586 delete TensorProto::default_instance_;
587 delete TensorProto_reflection_;
588 delete TensorProto_Segment::default_instance_;
589 delete TensorProto_Segment_reflection_;
590 delete QTensorProto::default_instance_;
591 delete QTensorProto_reflection_;
592 delete TensorProtos::default_instance_;
593 delete TensorProtos_reflection_;
594 delete TensorShape::default_instance_;
595 delete TensorShape_reflection_;
596 delete TensorShapes::default_instance_;
597 delete TensorShapes_reflection_;
598 delete TensorBoundShape::default_instance_;
599 delete TensorBoundShape_reflection_;
600 delete TensorBoundShapes::default_instance_;
601 delete TensorBoundShapes_reflection_;
602 delete AOTConfig::default_instance_;
603 delete AOTConfig_reflection_;
604 delete Argument::default_instance_;
605 delete Argument_reflection_;
606 delete DeviceOption::default_instance_;
607 delete DeviceOption_reflection_;
608 delete OperatorDef::default_instance_;
609 delete OperatorDef_reflection_;
610 delete MapFieldEntry::default_instance_;
611 delete MapFieldEntry_reflection_;
612 delete BackendOptions::default_instance_;
613 delete BackendOptions_reflection_;
614 delete PartitionInfo::default_instance_;
615 delete PartitionInfo_reflection_;
616 delete NetDef::default_instance_;
617 delete NetDef_reflection_;
618 delete ExecutionStep::default_instance_;
619 delete ExecutionStep_reflection_;
620 delete PlanDef::default_instance_;
621 delete PlanDef_reflection_;
622 delete BlobProto::default_instance_;
623 delete BlobProto_reflection_;
624 delete DBReaderProto::default_instance_;
625 delete DBReaderProto_reflection_;
626}
627
628void protobuf_AddDesc_caffe2_2eproto() {
629 static bool already_here = false;
630 if (already_here) return;
631 already_here = true;
632 GOOGLE_PROTOBUF_VERIFY_VERSION;
633
634 ::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
635 "\n\014caffe2.proto\022\006caffe2\"\341\001\n\021ExternalDataP"
636 "roto\022K\n\013source_type\030\001 \001(\0162$.caffe2.Exter"
637 "nalDataProto.SourceType:\020INLINE_CONTAINE"
638 "R\022\021\n\trecord_id\030\002 \001(\t\022\023\n\013record_size\030\005 \001("
639 "\004\022\021\n\006offset\030\003 \001(\003:\0010\022\017\n\007strides\030\004 \003(\003\"3\n"
640 "\nSourceType\022\024\n\020INLINE_CONTAINER\020\000\022\017\n\013SIM"
641 "PLE_FILE\020\001\"\352\005\n\013TensorProto\022\014\n\004dims\030\001 \003(\003"
642 "\0226\n\tdata_type\030\002 \001(\0162\034.caffe2.TensorProto"
643 ".DataType:\005FLOAT\022<\n\014storage_type\030\014 \001(\0162\037"
644 ".caffe2.TensorProto.StorageType:\005TYPED\022\026"
645 "\n\nfloat_data\030\003 \003(\002B\002\020\001\022\026\n\nint32_data\030\004 \003"
646 "(\005B\002\020\001\022\021\n\tbyte_data\030\005 \001(\014\022\023\n\013string_data"
647 "\030\006 \003(\014\022\027\n\013double_data\030\t \003(\001B\002\020\001\022\026\n\nint64"
648 "_data\030\n \003(\003B\002\020\001\022\020\n\010raw_data\030\r \001(\014\0220\n\rext"
649 "ernal_data\030\016 \001(\0132\031.caffe2.ExternalDataPr"
650 "oto\022\014\n\004name\030\007 \001(\t\022+\n\rdevice_detail\030\010 \001(\013"
651 "2\024.caffe2.DeviceOption\022,\n\007segment\030\013 \001(\0132"
652 "\033.caffe2.TensorProto.Segment\032%\n\007Segment\022"
653 "\r\n\005begin\030\001 \002(\003\022\013\n\003end\030\002 \002(\003\"\270\001\n\010DataType"
654 "\022\r\n\tUNDEFINED\020\000\022\t\n\005FLOAT\020\001\022\t\n\005INT32\020\002\022\010\n"
655 "\004BYTE\020\003\022\n\n\006STRING\020\004\022\010\n\004BOOL\020\005\022\t\n\005UINT8\020\006"
656 "\022\010\n\004INT8\020\007\022\n\n\006UINT16\020\010\022\t\n\005INT16\020\t\022\t\n\005INT"
657 "64\020\n\022\013\n\007FLOAT16\020\014\022\n\n\006DOUBLE\020\r\022\027\n\023ZERO_CO"
658 "LLISION_HASH\020\016\"\?\n\013StorageType\022\t\n\005TYPED\020\001"
659 "\022\007\n\003RAW\020\002\022\014\n\010EXTERNAL\020\003\022\016\n\nNO_CONTENT\020\004\""
660 "\203\002\n\014QTensorProto\022\014\n\004dims\030\001 \003(\003\022\021\n\tprecis"
661 "ion\030\002 \002(\005\022\r\n\005scale\030\003 \002(\001\022\014\n\004bias\030\004 \002(\001\022\021"
662 "\n\tis_signed\030\005 \002(\010\022\020\n\004data\030\006 \003(\005B\002\020\001\022\014\n\004n"
663 "ame\030\007 \001(\t\0226\n\tdata_type\030\010 \001(\0162\034.caffe2.Te"
664 "nsorProto.DataType:\005INT32\022\016\n\006scales\030\t \003("
665 "\001\022\016\n\006biases\030\n \003(\001\022\014\n\004axis\030\013 \001(\005\022\034\n\ris_mu"
666 "ltiparam\030\014 \001(\010:\005false\"3\n\014TensorProtos\022#\n"
667 "\006protos\030\001 \003(\0132\023.caffe2.TensorProto\"\225\001\n\013T"
668 "ensorShape\022\014\n\004dims\030\001 \003(\003\0226\n\tdata_type\030\002 "
669 "\001(\0162\034.caffe2.TensorProto.DataType:\005FLOAT"
670 "\022\024\n\014unknown_dims\030\003 \003(\005\022\034\n\runknown_shape\030"
671 "\004 \001(\010:\005false\022\014\n\004name\030\005 \001(\t\"3\n\014TensorShap"
672 "es\022#\n\006shapes\030\001 \003(\0132\023.caffe2.TensorShape\""
673 "\220\002\n\020TensorBoundShape\022\"\n\005shape\030\001 \001(\0132\023.ca"
674 "ffe2.TensorShape\0222\n\010dim_type\030\002 \003(\0162 .caf"
675 "fe2.TensorBoundShape.DimType\022\014\n\004name\030\003 \001"
676 "(\t\"\225\001\n\007DimType\022\013\n\007UNKNOWN\020\000\022\014\n\010CONSTANT\020"
677 "\001\022\t\n\005BATCH\020\002\022\030\n\024BATCH_OF_FEATURE_MAX\020\003\022 "
678 "\n\034BATCH_OF_FEATURE_MAX_DEFAULT\020\004\022\017\n\013FEAT"
679 "URE_MAX\020\005\022\027\n\023FEATURE_MAX_DEFAULT\020\006\"n\n\021Te"
680 "nsorBoundShapes\022(\n\006shapes\030\001 \003(\0132\030.caffe2"
681 ".TensorBoundShape\022\026\n\016max_batch_size\030\002 \001("
682 "\003\022\027\n\017max_feature_len\030\003 \001(\003\"\215\001\n\tAOTConfig"
683 "\022\026\n\016max_batch_size\030\001 \002(\003\022\024\n\014max_seq_size"
684 "\030\002 \002(\003\022\032\n\022in_batch_broadcast\030\003 \002(\010\022\035\n\025on"
685 "nxifi_blacklist_ops\030\004 \001(\t\022\027\n\017onnxifi_min"
686 "_ops\030\005 \001(\005\"\217\002\n\010Argument\022\014\n\004name\030\001 \001(\t\022\t\n"
687 "\001f\030\002 \001(\002\022\t\n\001i\030\003 \001(\003\022\t\n\001s\030\004 \001(\014\022\036\n\001t\030\n \001("
688 "\0132\023.caffe2.TensorProto\022\031\n\001n\030\010 \001(\0132\016.caff"
689 "e2.NetDef\022\016\n\006floats\030\005 \003(\002\022\014\n\004ints\030\006 \003(\003\022"
690 "\017\n\007strings\030\007 \003(\014\022$\n\007tensors\030\013 \003(\0132\023.caff"
691 "e2.TensorProto\022\034\n\004nets\030\t \003(\0132\016.caffe2.Ne"
692 "tDef\022&\n\010qtensors\030\014 \003(\0132\024.caffe2.QTensorP"
693 "roto\"\213\001\n\014DeviceOption\022\026\n\013device_type\030\001 \001"
694 "(\005:\0010\022\021\n\tdevice_id\030\002 \001(\005\022\023\n\013random_seed\030"
695 "\003 \001(\r\022\021\n\tnode_name\030\004 \001(\t\022\024\n\014numa_node_id"
696 "\030\005 \001(\005\022\022\n\nextra_info\030\006 \003(\t\"\222\002\n\013OperatorD"
697 "ef\022\r\n\005input\030\001 \003(\t\022\016\n\006output\030\002 \003(\t\022\014\n\004nam"
698 "e\030\003 \001(\t\022\014\n\004type\030\004 \001(\t\022\035\n\003arg\030\005 \003(\0132\020.caf"
699 "fe2.Argument\022+\n\rdevice_option\030\006 \001(\0132\024.ca"
700 "ffe2.DeviceOption\022\016\n\006engine\030\007 \001(\t\022\025\n\rcon"
701 "trol_input\030\010 \003(\t\022\035\n\016is_gradient_op\030\t \001(\010"
702 ":\005false\022\022\n\ndebug_info\030\n \001(\t\022\016\n\006domain\030\013 "
703 "\001(\t\022\022\n\nop_version\030\014 \001(\003\")\n\rMapFieldEntry"
704 "\022\013\n\003key\030\001 \002(\t\022\013\n\003val\030\002 \002(\t\"M\n\016BackendOpt"
705 "ions\022\024\n\014backend_name\030\001 \002(\t\022%\n\006option\030\002 \003"
706 "(\0132\025.caffe2.MapFieldEntry\"u\n\rPartitionIn"
707 "fo\022\014\n\004name\030\001 \002(\t\022\021\n\tdevice_id\030\002 \003(\005\022\022\n\ne"
708 "xtra_info\030\003 \001(\t\022/\n\017backend_options\030\004 \003(\013"
709 "2\026.caffe2.BackendOptions\"\206\002\n\006NetDef\022\014\n\004n"
710 "ame\030\001 \001(\t\022\037\n\002op\030\002 \003(\0132\023.caffe2.OperatorD"
711 "ef\022\014\n\004type\030\003 \001(\t\022\023\n\013num_workers\030\004 \001(\005\022+\n"
712 "\rdevice_option\030\005 \001(\0132\024.caffe2.DeviceOpti"
713 "on\022\035\n\003arg\030\006 \003(\0132\020.caffe2.Argument\022\026\n\016ext"
714 "ernal_input\030\007 \003(\t\022\027\n\017external_output\030\010 \003"
715 "(\t\022-\n\016partition_info\030\t \003(\0132\025.caffe2.Part"
716 "itionInfo\"\317\002\n\rExecutionStep\022\014\n\004name\030\001 \001("
717 "\t\022&\n\007substep\030\002 \003(\0132\025.caffe2.ExecutionSte"
718 "p\022\017\n\007network\030\003 \003(\t\022\020\n\010num_iter\030\004 \001(\003\022\034\n\020"
719 "criteria_network\030\005 \001(\tB\002\030\001\022\022\n\nreport_net"
720 "\030\007 \001(\t\022\027\n\017report_interval\030\010 \001(\005\022\024\n\014run_e"
721 "very_ms\030\013 \001(\003\022\033\n\023concurrent_substeps\030\006 \001"
722 "(\010\022\030\n\020should_stop_blob\030\t \001(\t\022\021\n\tonly_onc"
723 "e\030\n \001(\010\022\030\n\020create_workspace\030\014 \001(\010\022 \n\030num"
724 "_concurrent_instances\030\r \001(\005\"g\n\007PlanDef\022\014"
725 "\n\004name\030\001 \001(\t\022\037\n\007network\030\002 \003(\0132\016.caffe2.N"
726 "etDef\022-\n\016execution_step\030\003 \003(\0132\025.caffe2.E"
727 "xecutionStep\"\272\001\n\tBlobProto\022\014\n\004name\030\001 \001(\t"
728 "\022\014\n\004type\030\002 \001(\t\022#\n\006tensor\030\003 \001(\0132\023.caffe2."
729 "TensorProto\022\017\n\007content\030\004 \001(\014\022%\n\007qtensor\030"
730 "\005 \001(\0132\024.caffe2.QTensorProto\022\032\n\022content_n"
731 "um_chunks\030\006 \001(\005\022\030\n\020content_chunk_id\030\007 \001("
732 "\005\"K\n\rDBReaderProto\022\014\n\004name\030\001 \001(\t\022\016\n\006sour"
733 "ce\030\002 \001(\t\022\017\n\007db_type\030\003 \001(\t\022\013\n\003key\030\004 \001(\t*\372"
734 "\001\n\017DeviceTypeProto\022\r\n\tPROTO_CPU\020\000\022\016\n\nPRO"
735 "TO_CUDA\020\001\022\020\n\014PROTO_MKLDNN\020\002\022\020\n\014PROTO_OPE"
736 "NGL\020\003\022\020\n\014PROTO_OPENCL\020\004\022\017\n\013PROTO_IDEEP\020\005"
737 "\022\r\n\tPROTO_HIP\020\006\022\016\n\nPROTO_FPGA\020\007\022\017\n\013PROTO"
738 "_MSNPU\020\010\022\r\n\tPROTO_XLA\020\t\022\'\n#PROTO_COMPILE"
739 "_TIME_MAX_DEVICE_TYPES\020\n\022\031\n\023PROTO_ONLY_F"
740 "OR_TEST\020\245\243\001", 4211);
741 ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
742 "caffe2.proto", &protobuf_RegisterTypes);
743 ExternalDataProto::default_instance_ = new ExternalDataProto();
744 TensorProto::default_instance_ = new TensorProto();
745 TensorProto_Segment::default_instance_ = new TensorProto_Segment();
746 QTensorProto::default_instance_ = new QTensorProto();
747 TensorProtos::default_instance_ = new TensorProtos();
748 TensorShape::default_instance_ = new TensorShape();
749 TensorShapes::default_instance_ = new TensorShapes();
750 TensorBoundShape::default_instance_ = new TensorBoundShape();
751 TensorBoundShapes::default_instance_ = new TensorBoundShapes();
752 AOTConfig::default_instance_ = new AOTConfig();
753 Argument::default_instance_ = new Argument();
754 DeviceOption::default_instance_ = new DeviceOption();
755 OperatorDef::default_instance_ = new OperatorDef();
756 MapFieldEntry::default_instance_ = new MapFieldEntry();
757 BackendOptions::default_instance_ = new BackendOptions();
758 PartitionInfo::default_instance_ = new PartitionInfo();
759 NetDef::default_instance_ = new NetDef();
760 ExecutionStep::default_instance_ = new ExecutionStep();
761 PlanDef::default_instance_ = new PlanDef();
762 BlobProto::default_instance_ = new BlobProto();
763 DBReaderProto::default_instance_ = new DBReaderProto();
764 ExternalDataProto::default_instance_->InitAsDefaultInstance();
765 TensorProto::default_instance_->InitAsDefaultInstance();
766 TensorProto_Segment::default_instance_->InitAsDefaultInstance();
767 QTensorProto::default_instance_->InitAsDefaultInstance();
768 TensorProtos::default_instance_->InitAsDefaultInstance();
769 TensorShape::default_instance_->InitAsDefaultInstance();
770 TensorShapes::default_instance_->InitAsDefaultInstance();
771 TensorBoundShape::default_instance_->InitAsDefaultInstance();
772 TensorBoundShapes::default_instance_->InitAsDefaultInstance();
773 AOTConfig::default_instance_->InitAsDefaultInstance();
774 Argument::default_instance_->InitAsDefaultInstance();
775 DeviceOption::default_instance_->InitAsDefaultInstance();
776 OperatorDef::default_instance_->InitAsDefaultInstance();
777 MapFieldEntry::default_instance_->InitAsDefaultInstance();
778 BackendOptions::default_instance_->InitAsDefaultInstance();
779 PartitionInfo::default_instance_->InitAsDefaultInstance();
780 NetDef::default_instance_->InitAsDefaultInstance();
781 ExecutionStep::default_instance_->InitAsDefaultInstance();
782 PlanDef::default_instance_->InitAsDefaultInstance();
783 BlobProto::default_instance_->InitAsDefaultInstance();
784 DBReaderProto::default_instance_->InitAsDefaultInstance();
785 ::google::protobuf::internal::OnShutdown(&protobuf_ShutdownFile_caffe2_2eproto);
786}
787
788// Force AddDescriptors() to be called at static initialization time.
789struct StaticDescriptorInitializer_caffe2_2eproto {
790 StaticDescriptorInitializer_caffe2_2eproto() {
791 protobuf_AddDesc_caffe2_2eproto();
792 }
793} static_descriptor_initializer_caffe2_2eproto_;
794const ::google::protobuf::EnumDescriptor* DeviceTypeProto_descriptor() {
795 protobuf_AssignDescriptorsOnce();
796 return DeviceTypeProto_descriptor_;
797}
798bool DeviceTypeProto_IsValid(int value) {
799 switch(value) {
800 case 0:
801 case 1:
802 case 2:
803 case 3:
804 case 4:
805 case 5:
806 case 6:
807 case 7:
808 case 8:
809 case 9:
810 case 10:
811 case 20901:
812 return true;
813 default:
814 return false;
815 }
816}
817
818
819// ===================================================================
820
821const ::google::protobuf::EnumDescriptor* ExternalDataProto_SourceType_descriptor() {
822 protobuf_AssignDescriptorsOnce();
823 return ExternalDataProto_SourceType_descriptor_;
824}
825bool ExternalDataProto_SourceType_IsValid(int value) {
826 switch(value) {
827 case 0:
828 case 1:
829 return true;
830 default:
831 return false;
832 }
833}
834
835#ifndef _MSC_VER
836const ExternalDataProto_SourceType ExternalDataProto::INLINE_CONTAINER;
837const ExternalDataProto_SourceType ExternalDataProto::SIMPLE_FILE;
838const ExternalDataProto_SourceType ExternalDataProto::SourceType_MIN;
839const ExternalDataProto_SourceType ExternalDataProto::SourceType_MAX;
840const int ExternalDataProto::SourceType_ARRAYSIZE;
841#endif // _MSC_VER
842#ifndef _MSC_VER
843const int ExternalDataProto::kSourceTypeFieldNumber;
844const int ExternalDataProto::kRecordIdFieldNumber;
845const int ExternalDataProto::kRecordSizeFieldNumber;
846const int ExternalDataProto::kOffsetFieldNumber;
847const int ExternalDataProto::kStridesFieldNumber;
848#endif // !_MSC_VER
849
850ExternalDataProto::ExternalDataProto()
851 : ::google::protobuf::Message() {
852 SharedCtor();
853 // @@protoc_insertion_point(constructor:caffe2.ExternalDataProto)
854}
855
856void ExternalDataProto::InitAsDefaultInstance() {
857}
858
859ExternalDataProto::ExternalDataProto(const ExternalDataProto& from)
860 : ::google::protobuf::Message() {
861 SharedCtor();
862 MergeFrom(from);
863 // @@protoc_insertion_point(copy_constructor:caffe2.ExternalDataProto)
864}
865
866void ExternalDataProto::SharedCtor() {
867 ::google::protobuf::internal::GetEmptyString();
868 _cached_size_ = 0;
869 source_type_ = 0;
870 record_id_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
871 record_size_ = GOOGLE_ULONGLONG(0);
872 offset_ = GOOGLE_LONGLONG(0);
873 ::memset(_has_bits_, 0, sizeof(_has_bits_));
874}
875
876ExternalDataProto::~ExternalDataProto() {
877 // @@protoc_insertion_point(destructor:caffe2.ExternalDataProto)
878 SharedDtor();
879}
880
881void ExternalDataProto::SharedDtor() {
882 if (record_id_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
883 delete record_id_;
884 }
885 if (this != default_instance_) {
886 }
887}
888
889void ExternalDataProto::SetCachedSize(int size) const {
890 GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
891 _cached_size_ = size;
892 GOOGLE_SAFE_CONCURRENT_WRITES_END();
893}
894const ::google::protobuf::Descriptor* ExternalDataProto::descriptor() {
895 protobuf_AssignDescriptorsOnce();
896 return ExternalDataProto_descriptor_;
897}
898
899const ExternalDataProto& ExternalDataProto::default_instance() {
900 if (default_instance_ == NULL) protobuf_AddDesc_caffe2_2eproto();
901 return *default_instance_;
902}
903
904ExternalDataProto* ExternalDataProto::default_instance_ = NULL;
905
906ExternalDataProto* ExternalDataProto::New() const {
907 return new ExternalDataProto;
908}
909
910void ExternalDataProto::Clear() {
911#define OFFSET_OF_FIELD_(f) (reinterpret_cast<char*>( \
912 &reinterpret_cast<ExternalDataProto*>(16)->f) - \
913 reinterpret_cast<char*>(16))
914
915#define ZR_(first, last) do { \
916 size_t f = OFFSET_OF_FIELD_(first); \
917 size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \
918 ::memset(&first, 0, n); \
919 } while (0)
920
921 if (_has_bits_[0 / 32] & 15) {
922 ZR_(record_size_, offset_);
923 source_type_ = 0;
924 if (has_record_id()) {
925 if (record_id_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
926 record_id_->clear();
927 }
928 }
929 }
930
931#undef OFFSET_OF_FIELD_
932#undef ZR_
933
934 strides_.Clear();
935 ::memset(_has_bits_, 0, sizeof(_has_bits_));
936 mutable_unknown_fields()->Clear();
937}
938
939bool ExternalDataProto::MergePartialFromCodedStream(
940 ::google::protobuf::io::CodedInputStream* input) {
941#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure
942 ::google::protobuf::uint32 tag;
943 // @@protoc_insertion_point(parse_start:caffe2.ExternalDataProto)
944 for (;;) {
945 ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);
946 tag = p.first;
947 if (!p.second) goto handle_unusual;
948 switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
949 // optional .caffe2.ExternalDataProto.SourceType source_type = 1 [default = INLINE_CONTAINER];
950 case 1: {
951 if (tag == 8) {
952 int value;
953 DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
954 int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
955 input, &value)));
956 if (::caffe2::ExternalDataProto_SourceType_IsValid(value)) {
957 set_source_type(static_cast< ::caffe2::ExternalDataProto_SourceType >(value));
958 } else {
959 mutable_unknown_fields()->AddVarint(1, value);
960 }
961 } else {
962 goto handle_unusual;
963 }
964 if (input->ExpectTag(18)) goto parse_record_id;
965 break;
966 }
967
968 // optional string record_id = 2;
969 case 2: {
970 if (tag == 18) {
971 parse_record_id:
972 DO_(::google::protobuf::internal::WireFormatLite::ReadString(
973 input, this->mutable_record_id()));
974 ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
975 this->record_id().data(), this->record_id().length(),
976 ::google::protobuf::internal::WireFormat::PARSE,
977 "record_id");
978 } else {
979 goto handle_unusual;
980 }
981 if (input->ExpectTag(24)) goto parse_offset;
982 break;
983 }
984
985 // optional int64 offset = 3 [default = 0];
986 case 3: {
987 if (tag == 24) {
988 parse_offset:
989 DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
990 ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>(
991 input, &offset_)));
992 set_has_offset();
993 } else {
994 goto handle_unusual;
995 }
996 if (input->ExpectTag(32)) goto parse_strides;
997 break;
998 }
999
1000 // repeated int64 strides = 4;
1001 case 4: {
1002 if (tag == 32) {
1003 parse_strides:
1004 DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive<
1005 ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>(
1006 1, 32, input, this->mutable_strides())));
1007 } else if (tag == 34) {
1008 DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline<
1009 ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>(
1010 input, this->mutable_strides())));
1011 } else {
1012 goto handle_unusual;
1013 }
1014 if (input->ExpectTag(32)) goto parse_strides;
1015 if (input->ExpectTag(40)) goto parse_record_size;
1016 break;
1017 }
1018
1019 // optional uint64 record_size = 5;
1020 case 5: {
1021 if (tag == 40) {
1022 parse_record_size:
1023 DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
1024 ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_UINT64>(
1025 input, &record_size_)));
1026 set_has_record_size();
1027 } else {
1028 goto handle_unusual;
1029 }
1030 if (input->ExpectAtEnd()) goto success;
1031 break;
1032 }
1033
1034 default: {
1035 handle_unusual:
1036 if (tag == 0 ||
1037 ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
1038 ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
1039 goto success;
1040 }
1041 DO_(::google::protobuf::internal::WireFormat::SkipField(
1042 input, tag, mutable_unknown_fields()));
1043 break;
1044 }
1045 }
1046 }
1047success:
1048 // @@protoc_insertion_point(parse_success:caffe2.ExternalDataProto)
1049 return true;
1050failure:
1051 // @@protoc_insertion_point(parse_failure:caffe2.ExternalDataProto)
1052 return false;
1053#undef DO_
1054}
1055
1056void ExternalDataProto::SerializeWithCachedSizes(
1057 ::google::protobuf::io::CodedOutputStream* output) const {
1058 // @@protoc_insertion_point(serialize_start:caffe2.ExternalDataProto)
1059 // optional .caffe2.ExternalDataProto.SourceType source_type = 1 [default = INLINE_CONTAINER];
1060 if (has_source_type()) {
1061 ::google::protobuf::internal::WireFormatLite::WriteEnum(
1062 1, this->source_type(), output);
1063 }
1064
1065 // optional string record_id = 2;
1066 if (has_record_id()) {
1067 ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
1068 this->record_id().data(), this->record_id().length(),
1069 ::google::protobuf::internal::WireFormat::SERIALIZE,
1070 "record_id");
1071 ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
1072 2, this->record_id(), output);
1073 }
1074
1075 // optional int64 offset = 3 [default = 0];
1076 if (has_offset()) {
1077 ::google::protobuf::internal::WireFormatLite::WriteInt64(3, this->offset(), output);
1078 }
1079
1080 // repeated int64 strides = 4;
1081 for (int i = 0; i < this->strides_size(); i++) {
1082 ::google::protobuf::internal::WireFormatLite::WriteInt64(
1083 4, this->strides(i), output);
1084 }
1085
1086 // optional uint64 record_size = 5;
1087 if (has_record_size()) {
1088 ::google::protobuf::internal::WireFormatLite::WriteUInt64(5, this->record_size(), output);
1089 }
1090
1091 if (!unknown_fields().empty()) {
1092 ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
1093 unknown_fields(), output);
1094 }
1095 // @@protoc_insertion_point(serialize_end:caffe2.ExternalDataProto)
1096}
1097
1098::google::protobuf::uint8* ExternalDataProto::SerializeWithCachedSizesToArray(
1099 ::google::protobuf::uint8* target) const {
1100 // @@protoc_insertion_point(serialize_to_array_start:caffe2.ExternalDataProto)
1101 // optional .caffe2.ExternalDataProto.SourceType source_type = 1 [default = INLINE_CONTAINER];
1102 if (has_source_type()) {
1103 target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
1104 1, this->source_type(), target);
1105 }
1106
1107 // optional string record_id = 2;
1108 if (has_record_id()) {
1109 ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
1110 this->record_id().data(), this->record_id().length(),
1111 ::google::protobuf::internal::WireFormat::SERIALIZE,
1112 "record_id");
1113 target =
1114 ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
1115 2, this->record_id(), target);
1116 }
1117
1118 // optional int64 offset = 3 [default = 0];
1119 if (has_offset()) {
1120 target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(3, this->offset(), target);
1121 }
1122
1123 // repeated int64 strides = 4;
1124 for (int i = 0; i < this->strides_size(); i++) {
1125 target = ::google::protobuf::internal::WireFormatLite::
1126 WriteInt64ToArray(4, this->strides(i), target);
1127 }
1128
1129 // optional uint64 record_size = 5;
1130 if (has_record_size()) {
1131 target = ::google::protobuf::internal::WireFormatLite::WriteUInt64ToArray(5, this->record_size(), target);
1132 }
1133
1134 if (!unknown_fields().empty()) {
1135 target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
1136 unknown_fields(), target);
1137 }
1138 // @@protoc_insertion_point(serialize_to_array_end:caffe2.ExternalDataProto)
1139 return target;
1140}
1141
1142int ExternalDataProto::ByteSize() const {
1143 int total_size = 0;
1144
1145 if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
1146 // optional .caffe2.ExternalDataProto.SourceType source_type = 1 [default = INLINE_CONTAINER];
1147 if (has_source_type()) {
1148 total_size += 1 +
1149 ::google::protobuf::internal::WireFormatLite::EnumSize(this->source_type());
1150 }
1151
1152 // optional string record_id = 2;
1153 if (has_record_id()) {
1154 total_size += 1 +
1155 ::google::protobuf::internal::WireFormatLite::StringSize(
1156 this->record_id());
1157 }
1158
1159 // optional uint64 record_size = 5;
1160 if (has_record_size()) {
1161 total_size += 1 +
1162 ::google::protobuf::internal::WireFormatLite::UInt64Size(
1163 this->record_size());
1164 }
1165
1166 // optional int64 offset = 3 [default = 0];
1167 if (has_offset()) {
1168 total_size += 1 +
1169 ::google::protobuf::internal::WireFormatLite::Int64Size(
1170 this->offset());
1171 }
1172
1173 }
1174 // repeated int64 strides = 4;
1175 {
1176 int data_size = 0;
1177 for (int i = 0; i < this->strides_size(); i++) {
1178 data_size += ::google::protobuf::internal::WireFormatLite::
1179 Int64Size(this->strides(i));
1180 }
1181 total_size += 1 * this->strides_size() + data_size;
1182 }
1183
1184 if (!unknown_fields().empty()) {
1185 total_size +=
1186 ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
1187 unknown_fields());
1188 }
1189 GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
1190 _cached_size_ = total_size;
1191 GOOGLE_SAFE_CONCURRENT_WRITES_END();
1192 return total_size;
1193}
1194
1195void ExternalDataProto::MergeFrom(const ::google::protobuf::Message& from) {
1196 GOOGLE_CHECK_NE(&from, this);
1197 const ExternalDataProto* source =
1198 ::google::protobuf::internal::dynamic_cast_if_available<const ExternalDataProto*>(
1199 &from);
1200 if (source == NULL) {
1201 ::google::protobuf::internal::ReflectionOps::Merge(from, this);
1202 } else {
1203 MergeFrom(*source);
1204 }
1205}
1206
1207void ExternalDataProto::MergeFrom(const ExternalDataProto& from) {
1208 GOOGLE_CHECK_NE(&from, this);
1209 strides_.MergeFrom(from.strides_);
1210 if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
1211 if (from.has_source_type()) {
1212 set_source_type(from.source_type());
1213 }
1214 if (from.has_record_id()) {
1215 set_record_id(from.record_id());
1216 }
1217 if (from.has_record_size()) {
1218 set_record_size(from.record_size());
1219 }
1220 if (from.has_offset()) {
1221 set_offset(from.offset());
1222 }
1223 }
1224 mutable_unknown_fields()->MergeFrom(from.unknown_fields());
1225}
1226
1227void ExternalDataProto::CopyFrom(const ::google::protobuf::Message& from) {
1228 if (&from == this) return;
1229 Clear();
1230 MergeFrom(from);
1231}
1232
1233void ExternalDataProto::CopyFrom(const ExternalDataProto& from) {
1234 if (&from == this) return;
1235 Clear();
1236 MergeFrom(from);
1237}
1238
1239bool ExternalDataProto::IsInitialized() const {
1240
1241 return true;
1242}
1243
1244void ExternalDataProto::Swap(ExternalDataProto* other) {
1245 if (other != this) {
1246 std::swap(source_type_, other->source_type_);
1247 std::swap(record_id_, other->record_id_);
1248 std::swap(record_size_, other->record_size_);
1249 std::swap(offset_, other->offset_);
1250 strides_.Swap(&other->strides_);
1251 std::swap(_has_bits_[0], other->_has_bits_[0]);
1252 _unknown_fields_.Swap(&other->_unknown_fields_);
1253 std::swap(_cached_size_, other->_cached_size_);
1254 }
1255}
1256
1257::google::protobuf::Metadata ExternalDataProto::GetMetadata() const {
1258 protobuf_AssignDescriptorsOnce();
1259 ::google::protobuf::Metadata metadata;
1260 metadata.descriptor = ExternalDataProto_descriptor_;
1261 metadata.reflection = ExternalDataProto_reflection_;
1262 return metadata;
1263}
1264
1265
1266// ===================================================================
1267
1268const ::google::protobuf::EnumDescriptor* TensorProto_DataType_descriptor() {
1269 protobuf_AssignDescriptorsOnce();
1270 return TensorProto_DataType_descriptor_;
1271}
1272bool TensorProto_DataType_IsValid(int value) {
1273 switch(value) {
1274 case 0:
1275 case 1:
1276 case 2:
1277 case 3:
1278 case 4:
1279 case 5:
1280 case 6:
1281 case 7:
1282 case 8:
1283 case 9:
1284 case 10:
1285 case 12:
1286 case 13:
1287 case 14:
1288 return true;
1289 default:
1290 return false;
1291 }
1292}
1293
1294#ifndef _MSC_VER
1295const TensorProto_DataType TensorProto::UNDEFINED;
1296const TensorProto_DataType TensorProto::FLOAT;
1297const TensorProto_DataType TensorProto::INT32;
1298const TensorProto_DataType TensorProto::BYTE;
1299const TensorProto_DataType TensorProto::STRING;
1300const TensorProto_DataType TensorProto::BOOL;
1301const TensorProto_DataType TensorProto::UINT8;
1302const TensorProto_DataType TensorProto::INT8;
1303const TensorProto_DataType TensorProto::UINT16;
1304const TensorProto_DataType TensorProto::INT16;
1305const TensorProto_DataType TensorProto::INT64;
1306const TensorProto_DataType TensorProto::FLOAT16;
1307const TensorProto_DataType TensorProto::DOUBLE;
1308const TensorProto_DataType TensorProto::ZERO_COLLISION_HASH;
1309const TensorProto_DataType TensorProto::DataType_MIN;
1310const TensorProto_DataType TensorProto::DataType_MAX;
1311const int TensorProto::DataType_ARRAYSIZE;
1312#endif // _MSC_VER
1313const ::google::protobuf::EnumDescriptor* TensorProto_StorageType_descriptor() {
1314 protobuf_AssignDescriptorsOnce();
1315 return TensorProto_StorageType_descriptor_;
1316}
1317bool TensorProto_StorageType_IsValid(int value) {
1318 switch(value) {
1319 case 1:
1320 case 2:
1321 case 3:
1322 case 4:
1323 return true;
1324 default:
1325 return false;
1326 }
1327}
1328
1329#ifndef _MSC_VER
1330const TensorProto_StorageType TensorProto::TYPED;
1331const TensorProto_StorageType TensorProto::RAW;
1332const TensorProto_StorageType TensorProto::EXTERNAL;
1333const TensorProto_StorageType TensorProto::NO_CONTENT;
1334const TensorProto_StorageType TensorProto::StorageType_MIN;
1335const TensorProto_StorageType TensorProto::StorageType_MAX;
1336const int TensorProto::StorageType_ARRAYSIZE;
1337#endif // _MSC_VER
1338#ifndef _MSC_VER
1339const int TensorProto_Segment::kBeginFieldNumber;
1340const int TensorProto_Segment::kEndFieldNumber;
1341#endif // !_MSC_VER
1342
1343TensorProto_Segment::TensorProto_Segment()
1344 : ::google::protobuf::Message() {
1345 SharedCtor();
1346 // @@protoc_insertion_point(constructor:caffe2.TensorProto.Segment)
1347}
1348
1349void TensorProto_Segment::InitAsDefaultInstance() {
1350}
1351
1352TensorProto_Segment::TensorProto_Segment(const TensorProto_Segment& from)
1353 : ::google::protobuf::Message() {
1354 SharedCtor();
1355 MergeFrom(from);
1356 // @@protoc_insertion_point(copy_constructor:caffe2.TensorProto.Segment)
1357}
1358
1359void TensorProto_Segment::SharedCtor() {
1360 _cached_size_ = 0;
1361 begin_ = GOOGLE_LONGLONG(0);
1362 end_ = GOOGLE_LONGLONG(0);
1363 ::memset(_has_bits_, 0, sizeof(_has_bits_));
1364}
1365
1366TensorProto_Segment::~TensorProto_Segment() {
1367 // @@protoc_insertion_point(destructor:caffe2.TensorProto.Segment)
1368 SharedDtor();
1369}
1370
1371void TensorProto_Segment::SharedDtor() {
1372 if (this != default_instance_) {
1373 }
1374}
1375
1376void TensorProto_Segment::SetCachedSize(int size) const {
1377 GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
1378 _cached_size_ = size;
1379 GOOGLE_SAFE_CONCURRENT_WRITES_END();
1380}
1381const ::google::protobuf::Descriptor* TensorProto_Segment::descriptor() {
1382 protobuf_AssignDescriptorsOnce();
1383 return TensorProto_Segment_descriptor_;
1384}
1385
1386const TensorProto_Segment& TensorProto_Segment::default_instance() {
1387 if (default_instance_ == NULL) protobuf_AddDesc_caffe2_2eproto();
1388 return *default_instance_;
1389}
1390
1391TensorProto_Segment* TensorProto_Segment::default_instance_ = NULL;
1392
1393TensorProto_Segment* TensorProto_Segment::New() const {
1394 return new TensorProto_Segment;
1395}
1396
1397void TensorProto_Segment::Clear() {
1398#define OFFSET_OF_FIELD_(f) (reinterpret_cast<char*>( \
1399 &reinterpret_cast<TensorProto_Segment*>(16)->f) - \
1400 reinterpret_cast<char*>(16))
1401
1402#define ZR_(first, last) do { \
1403 size_t f = OFFSET_OF_FIELD_(first); \
1404 size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \
1405 ::memset(&first, 0, n); \
1406 } while (0)
1407
1408 ZR_(begin_, end_);
1409
1410#undef OFFSET_OF_FIELD_
1411#undef ZR_
1412
1413 ::memset(_has_bits_, 0, sizeof(_has_bits_));
1414 mutable_unknown_fields()->Clear();
1415}
1416
1417bool TensorProto_Segment::MergePartialFromCodedStream(
1418 ::google::protobuf::io::CodedInputStream* input) {
1419#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure
1420 ::google::protobuf::uint32 tag;
1421 // @@protoc_insertion_point(parse_start:caffe2.TensorProto.Segment)
1422 for (;;) {
1423 ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);
1424 tag = p.first;
1425 if (!p.second) goto handle_unusual;
1426 switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
1427 // required int64 begin = 1;
1428 case 1: {
1429 if (tag == 8) {
1430 DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
1431 ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>(
1432 input, &begin_)));
1433 set_has_begin();
1434 } else {
1435 goto handle_unusual;
1436 }
1437 if (input->ExpectTag(16)) goto parse_end;
1438 break;
1439 }
1440
1441 // required int64 end = 2;
1442 case 2: {
1443 if (tag == 16) {
1444 parse_end:
1445 DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
1446 ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>(
1447 input, &end_)));
1448 set_has_end();
1449 } else {
1450 goto handle_unusual;
1451 }
1452 if (input->ExpectAtEnd()) goto success;
1453 break;
1454 }
1455
1456 default: {
1457 handle_unusual:
1458 if (tag == 0 ||
1459 ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
1460 ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
1461 goto success;
1462 }
1463 DO_(::google::protobuf::internal::WireFormat::SkipField(
1464 input, tag, mutable_unknown_fields()));
1465 break;
1466 }
1467 }
1468 }
1469success:
1470 // @@protoc_insertion_point(parse_success:caffe2.TensorProto.Segment)
1471 return true;
1472failure:
1473 // @@protoc_insertion_point(parse_failure:caffe2.TensorProto.Segment)
1474 return false;
1475#undef DO_
1476}
1477
1478void TensorProto_Segment::SerializeWithCachedSizes(
1479 ::google::protobuf::io::CodedOutputStream* output) const {
1480 // @@protoc_insertion_point(serialize_start:caffe2.TensorProto.Segment)
1481 // required int64 begin = 1;
1482 if (has_begin()) {
1483 ::google::protobuf::internal::WireFormatLite::WriteInt64(1, this->begin(), output);
1484 }
1485
1486 // required int64 end = 2;
1487 if (has_end()) {
1488 ::google::protobuf::internal::WireFormatLite::WriteInt64(2, this->end(), output);
1489 }
1490
1491 if (!unknown_fields().empty()) {
1492 ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
1493 unknown_fields(), output);
1494 }
1495 // @@protoc_insertion_point(serialize_end:caffe2.TensorProto.Segment)
1496}
1497
1498::google::protobuf::uint8* TensorProto_Segment::SerializeWithCachedSizesToArray(
1499 ::google::protobuf::uint8* target) const {
1500 // @@protoc_insertion_point(serialize_to_array_start:caffe2.TensorProto.Segment)
1501 // required int64 begin = 1;
1502 if (has_begin()) {
1503 target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(1, this->begin(), target);
1504 }
1505
1506 // required int64 end = 2;
1507 if (has_end()) {
1508 target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(2, this->end(), target);
1509 }
1510
1511 if (!unknown_fields().empty()) {
1512 target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
1513 unknown_fields(), target);
1514 }
1515 // @@protoc_insertion_point(serialize_to_array_end:caffe2.TensorProto.Segment)
1516 return target;
1517}
1518
1519int TensorProto_Segment::ByteSize() const {
1520 int total_size = 0;
1521
1522 if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
1523 // required int64 begin = 1;
1524 if (has_begin()) {
1525 total_size += 1 +
1526 ::google::protobuf::internal::WireFormatLite::Int64Size(
1527 this->begin());
1528 }
1529
1530 // required int64 end = 2;
1531 if (has_end()) {
1532 total_size += 1 +
1533 ::google::protobuf::internal::WireFormatLite::Int64Size(
1534 this->end());
1535 }
1536
1537 }
1538 if (!unknown_fields().empty()) {
1539 total_size +=
1540 ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
1541 unknown_fields());
1542 }
1543 GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
1544 _cached_size_ = total_size;
1545 GOOGLE_SAFE_CONCURRENT_WRITES_END();
1546 return total_size;
1547}
1548
1549void TensorProto_Segment::MergeFrom(const ::google::protobuf::Message& from) {
1550 GOOGLE_CHECK_NE(&from, this);
1551 const TensorProto_Segment* source =
1552 ::google::protobuf::internal::dynamic_cast_if_available<const TensorProto_Segment*>(
1553 &from);
1554 if (source == NULL) {
1555 ::google::protobuf::internal::ReflectionOps::Merge(from, this);
1556 } else {
1557 MergeFrom(*source);
1558 }
1559}
1560
1561void TensorProto_Segment::MergeFrom(const TensorProto_Segment& from) {
1562 GOOGLE_CHECK_NE(&from, this);
1563 if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
1564 if (from.has_begin()) {
1565 set_begin(from.begin());
1566 }
1567 if (from.has_end()) {
1568 set_end(from.end());
1569 }
1570 }
1571 mutable_unknown_fields()->MergeFrom(from.unknown_fields());
1572}
1573
1574void TensorProto_Segment::CopyFrom(const ::google::protobuf::Message& from) {
1575 if (&from == this) return;
1576 Clear();
1577 MergeFrom(from);
1578}
1579
1580void TensorProto_Segment::CopyFrom(const TensorProto_Segment& from) {
1581 if (&from == this) return;
1582 Clear();
1583 MergeFrom(from);
1584}
1585
1586bool TensorProto_Segment::IsInitialized() const {
1587 if ((_has_bits_[0] & 0x00000003) != 0x00000003) return false;
1588
1589 return true;
1590}
1591
1592void TensorProto_Segment::Swap(TensorProto_Segment* other) {
1593 if (other != this) {
1594 std::swap(begin_, other->begin_);
1595 std::swap(end_, other->end_);
1596 std::swap(_has_bits_[0], other->_has_bits_[0]);
1597 _unknown_fields_.Swap(&other->_unknown_fields_);
1598 std::swap(_cached_size_, other->_cached_size_);
1599 }
1600}
1601
1602::google::protobuf::Metadata TensorProto_Segment::GetMetadata() const {
1603 protobuf_AssignDescriptorsOnce();
1604 ::google::protobuf::Metadata metadata;
1605 metadata.descriptor = TensorProto_Segment_descriptor_;
1606 metadata.reflection = TensorProto_Segment_reflection_;
1607 return metadata;
1608}
1609
1610
1611// -------------------------------------------------------------------
1612
1613#ifndef _MSC_VER
1614const int TensorProto::kDimsFieldNumber;
1615const int TensorProto::kDataTypeFieldNumber;
1616const int TensorProto::kStorageTypeFieldNumber;
1617const int TensorProto::kFloatDataFieldNumber;
1618const int TensorProto::kInt32DataFieldNumber;
1619const int TensorProto::kByteDataFieldNumber;
1620const int TensorProto::kStringDataFieldNumber;
1621const int TensorProto::kDoubleDataFieldNumber;
1622const int TensorProto::kInt64DataFieldNumber;
1623const int TensorProto::kRawDataFieldNumber;
1624const int TensorProto::kExternalDataFieldNumber;
1625const int TensorProto::kNameFieldNumber;
1626const int TensorProto::kDeviceDetailFieldNumber;
1627const int TensorProto::kSegmentFieldNumber;
1628#endif // !_MSC_VER
1629
1630TensorProto::TensorProto()
1631 : ::google::protobuf::Message() {
1632 SharedCtor();
1633 // @@protoc_insertion_point(constructor:caffe2.TensorProto)
1634}
1635
1636void TensorProto::InitAsDefaultInstance() {
1637 external_data_ = const_cast< ::caffe2::ExternalDataProto*>(&::caffe2::ExternalDataProto::default_instance());
1638 device_detail_ = const_cast< ::caffe2::DeviceOption*>(&::caffe2::DeviceOption::default_instance());
1639 segment_ = const_cast< ::caffe2::TensorProto_Segment*>(&::caffe2::TensorProto_Segment::default_instance());
1640}
1641
1642TensorProto::TensorProto(const TensorProto& from)
1643 : ::google::protobuf::Message() {
1644 SharedCtor();
1645 MergeFrom(from);
1646 // @@protoc_insertion_point(copy_constructor:caffe2.TensorProto)
1647}
1648
1649void TensorProto::SharedCtor() {
1650 ::google::protobuf::internal::GetEmptyString();
1651 _cached_size_ = 0;
1652 data_type_ = 1;
1653 storage_type_ = 1;
1654 byte_data_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
1655 raw_data_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
1656 external_data_ = NULL;
1657 name_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
1658 device_detail_ = NULL;
1659 segment_ = NULL;
1660 ::memset(_has_bits_, 0, sizeof(_has_bits_));
1661}
1662
1663TensorProto::~TensorProto() {
1664 // @@protoc_insertion_point(destructor:caffe2.TensorProto)
1665 SharedDtor();
1666}
1667
1668void TensorProto::SharedDtor() {
1669 if (byte_data_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
1670 delete byte_data_;
1671 }
1672 if (raw_data_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
1673 delete raw_data_;
1674 }
1675 if (name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
1676 delete name_;
1677 }
1678 if (this != default_instance_) {
1679 delete external_data_;
1680 delete device_detail_;
1681 delete segment_;
1682 }
1683}
1684
1685void TensorProto::SetCachedSize(int size) const {
1686 GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
1687 _cached_size_ = size;
1688 GOOGLE_SAFE_CONCURRENT_WRITES_END();
1689}
1690const ::google::protobuf::Descriptor* TensorProto::descriptor() {
1691 protobuf_AssignDescriptorsOnce();
1692 return TensorProto_descriptor_;
1693}
1694
1695const TensorProto& TensorProto::default_instance() {
1696 if (default_instance_ == NULL) protobuf_AddDesc_caffe2_2eproto();
1697 return *default_instance_;
1698}
1699
1700TensorProto* TensorProto::default_instance_ = NULL;
1701
1702TensorProto* TensorProto::New() const {
1703 return new TensorProto;
1704}
1705
1706void TensorProto::Clear() {
1707 if (_has_bits_[0 / 32] & 38) {
1708 data_type_ = 1;
1709 storage_type_ = 1;
1710 if (has_byte_data()) {
1711 if (byte_data_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
1712 byte_data_->clear();
1713 }
1714 }
1715 }
1716 if (_has_bits_[8 / 32] & 15872) {
1717 if (has_raw_data()) {
1718 if (raw_data_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
1719 raw_data_->clear();
1720 }
1721 }
1722 if (has_external_data()) {
1723 if (external_data_ != NULL) external_data_->::caffe2::ExternalDataProto::Clear();
1724 }
1725 if (has_name()) {
1726 if (name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
1727 name_->clear();
1728 }
1729 }
1730 if (has_device_detail()) {
1731 if (device_detail_ != NULL) device_detail_->::caffe2::DeviceOption::Clear();
1732 }
1733 if (has_segment()) {
1734 if (segment_ != NULL) segment_->::caffe2::TensorProto_Segment::Clear();
1735 }
1736 }
1737 dims_.Clear();
1738 float_data_.Clear();
1739 int32_data_.Clear();
1740 string_data_.Clear();
1741 double_data_.Clear();
1742 int64_data_.Clear();
1743 ::memset(_has_bits_, 0, sizeof(_has_bits_));
1744 mutable_unknown_fields()->Clear();
1745}
1746
1747bool TensorProto::MergePartialFromCodedStream(
1748 ::google::protobuf::io::CodedInputStream* input) {
1749#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure
1750 ::google::protobuf::uint32 tag;
1751 // @@protoc_insertion_point(parse_start:caffe2.TensorProto)
1752 for (;;) {
1753 ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);
1754 tag = p.first;
1755 if (!p.second) goto handle_unusual;
1756 switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
1757 // repeated int64 dims = 1;
1758 case 1: {
1759 if (tag == 8) {
1760 parse_dims:
1761 DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive<
1762 ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>(
1763 1, 8, input, this->mutable_dims())));
1764 } else if (tag == 10) {
1765 DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline<
1766 ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>(
1767 input, this->mutable_dims())));
1768 } else {
1769 goto handle_unusual;
1770 }
1771 if (input->ExpectTag(8)) goto parse_dims;
1772 if (input->ExpectTag(16)) goto parse_data_type;
1773 break;
1774 }
1775
1776 // optional .caffe2.TensorProto.DataType data_type = 2 [default = FLOAT];
1777 case 2: {
1778 if (tag == 16) {
1779 parse_data_type:
1780 int value;
1781 DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
1782 int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
1783 input, &value)));
1784 if (::caffe2::TensorProto_DataType_IsValid(value)) {
1785 set_data_type(static_cast< ::caffe2::TensorProto_DataType >(value));
1786 } else {
1787 mutable_unknown_fields()->AddVarint(2, value);
1788 }
1789 } else {
1790 goto handle_unusual;
1791 }
1792 if (input->ExpectTag(26)) goto parse_float_data;
1793 break;
1794 }
1795
1796 // repeated float float_data = 3 [packed = true];
1797 case 3: {
1798 if (tag == 26) {
1799 parse_float_data:
1800 DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive<
1801 float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
1802 input, this->mutable_float_data())));
1803 } else if (tag == 29) {
1804 DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline<
1805 float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
1806 1, 26, input, this->mutable_float_data())));
1807 } else {
1808 goto handle_unusual;
1809 }
1810 if (input->ExpectTag(34)) goto parse_int32_data;
1811 break;
1812 }
1813
1814 // repeated int32 int32_data = 4 [packed = true];
1815 case 4: {
1816 if (tag == 34) {
1817 parse_int32_data:
1818 DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive<
1819 ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
1820 input, this->mutable_int32_data())));
1821 } else if (tag == 32) {
1822 DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline<
1823 ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
1824 1, 34, input, this->mutable_int32_data())));
1825 } else {
1826 goto handle_unusual;
1827 }
1828 if (input->ExpectTag(42)) goto parse_byte_data;
1829 break;
1830 }
1831
1832 // optional bytes byte_data = 5;
1833 case 5: {
1834 if (tag == 42) {
1835 parse_byte_data:
1836 DO_(::google::protobuf::internal::WireFormatLite::ReadBytes(
1837 input, this->mutable_byte_data()));
1838 } else {
1839 goto handle_unusual;
1840 }
1841 if (input->ExpectTag(50)) goto parse_string_data;
1842 break;
1843 }
1844
1845 // repeated bytes string_data = 6;
1846 case 6: {
1847 if (tag == 50) {
1848 parse_string_data:
1849 DO_(::google::protobuf::internal::WireFormatLite::ReadBytes(
1850 input, this->add_string_data()));
1851 } else {
1852 goto handle_unusual;
1853 }
1854 if (input->ExpectTag(50)) goto parse_string_data;
1855 if (input->ExpectTag(58)) goto parse_name;
1856 break;
1857 }
1858
1859 // optional string name = 7;
1860 case 7: {
1861 if (tag == 58) {
1862 parse_name:
1863 DO_(::google::protobuf::internal::WireFormatLite::ReadString(
1864 input, this->mutable_name()));
1865 ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
1866 this->name().data(), this->name().length(),
1867 ::google::protobuf::internal::WireFormat::PARSE,
1868 "name");
1869 } else {
1870 goto handle_unusual;
1871 }
1872 if (input->ExpectTag(66)) goto parse_device_detail;
1873 break;
1874 }
1875
1876 // optional .caffe2.DeviceOption device_detail = 8;
1877 case 8: {
1878 if (tag == 66) {
1879 parse_device_detail:
1880 DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
1881 input, mutable_device_detail()));
1882 } else {
1883 goto handle_unusual;
1884 }
1885 if (input->ExpectTag(74)) goto parse_double_data;
1886 break;
1887 }
1888
1889 // repeated double double_data = 9 [packed = true];
1890 case 9: {
1891 if (tag == 74) {
1892 parse_double_data:
1893 DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive<
1894 double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>(
1895 input, this->mutable_double_data())));
1896 } else if (tag == 73) {
1897 DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline<
1898 double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>(
1899 1, 74, input, this->mutable_double_data())));
1900 } else {
1901 goto handle_unusual;
1902 }
1903 if (input->ExpectTag(82)) goto parse_int64_data;
1904 break;
1905 }
1906
1907 // repeated int64 int64_data = 10 [packed = true];
1908 case 10: {
1909 if (tag == 82) {
1910 parse_int64_data:
1911 DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive<
1912 ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>(
1913 input, this->mutable_int64_data())));
1914 } else if (tag == 80) {
1915 DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline<
1916 ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>(
1917 1, 82, input, this->mutable_int64_data())));
1918 } else {
1919 goto handle_unusual;
1920 }
1921 if (input->ExpectTag(90)) goto parse_segment;
1922 break;
1923 }
1924
1925 // optional .caffe2.TensorProto.Segment segment = 11;
1926 case 11: {
1927 if (tag == 90) {
1928 parse_segment:
1929 DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
1930 input, mutable_segment()));
1931 } else {
1932 goto handle_unusual;
1933 }
1934 if (input->ExpectTag(96)) goto parse_storage_type;
1935 break;
1936 }
1937
1938 // optional .caffe2.TensorProto.StorageType storage_type = 12 [default = TYPED];
1939 case 12: {
1940 if (tag == 96) {
1941 parse_storage_type:
1942 int value;
1943 DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
1944 int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
1945 input, &value)));
1946 if (::caffe2::TensorProto_StorageType_IsValid(value)) {
1947 set_storage_type(static_cast< ::caffe2::TensorProto_StorageType >(value));
1948 } else {
1949 mutable_unknown_fields()->AddVarint(12, value);
1950 }
1951 } else {
1952 goto handle_unusual;
1953 }
1954 if (input->ExpectTag(106)) goto parse_raw_data;
1955 break;
1956 }
1957
1958 // optional bytes raw_data = 13;
1959 case 13: {
1960 if (tag == 106) {
1961 parse_raw_data:
1962 DO_(::google::protobuf::internal::WireFormatLite::ReadBytes(
1963 input, this->mutable_raw_data()));
1964 } else {
1965 goto handle_unusual;
1966 }
1967 if (input->ExpectTag(114)) goto parse_external_data;
1968 break;
1969 }
1970
1971 // optional .caffe2.ExternalDataProto external_data = 14;
1972 case 14: {
1973 if (tag == 114) {
1974 parse_external_data:
1975 DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
1976 input, mutable_external_data()));
1977 } else {
1978 goto handle_unusual;
1979 }
1980 if (input->ExpectAtEnd()) goto success;
1981 break;
1982 }
1983
1984 default: {
1985 handle_unusual:
1986 if (tag == 0 ||
1987 ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
1988 ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
1989 goto success;
1990 }
1991 DO_(::google::protobuf::internal::WireFormat::SkipField(
1992 input, tag, mutable_unknown_fields()));
1993 break;
1994 }
1995 }
1996 }
1997success:
1998 // @@protoc_insertion_point(parse_success:caffe2.TensorProto)
1999 return true;
2000failure:
2001 // @@protoc_insertion_point(parse_failure:caffe2.TensorProto)
2002 return false;
2003#undef DO_
2004}
2005
2006void TensorProto::SerializeWithCachedSizes(
2007 ::google::protobuf::io::CodedOutputStream* output) const {
2008 // @@protoc_insertion_point(serialize_start:caffe2.TensorProto)
2009 // repeated int64 dims = 1;
2010 for (int i = 0; i < this->dims_size(); i++) {
2011 ::google::protobuf::internal::WireFormatLite::WriteInt64(
2012 1, this->dims(i), output);
2013 }
2014
2015 // optional .caffe2.TensorProto.DataType data_type = 2 [default = FLOAT];
2016 if (has_data_type()) {
2017 ::google::protobuf::internal::WireFormatLite::WriteEnum(
2018 2, this->data_type(), output);
2019 }
2020
2021 // repeated float float_data = 3 [packed = true];
2022 if (this->float_data_size() > 0) {
2023 ::google::protobuf::internal::WireFormatLite::WriteTag(3, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output);
2024 output->WriteVarint32(_float_data_cached_byte_size_);
2025 }
2026 for (int i = 0; i < this->float_data_size(); i++) {
2027 ::google::protobuf::internal::WireFormatLite::WriteFloatNoTag(
2028 this->float_data(i), output);
2029 }
2030
2031 // repeated int32 int32_data = 4 [packed = true];
2032 if (this->int32_data_size() > 0) {
2033 ::google::protobuf::internal::WireFormatLite::WriteTag(4, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output);
2034 output->WriteVarint32(_int32_data_cached_byte_size_);
2035 }
2036 for (int i = 0; i < this->int32_data_size(); i++) {
2037 ::google::protobuf::internal::WireFormatLite::WriteInt32NoTag(
2038 this->int32_data(i), output);
2039 }
2040
2041 // optional bytes byte_data = 5;
2042 if (has_byte_data()) {
2043 ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased(
2044 5, this->byte_data(), output);
2045 }
2046
2047 // repeated bytes string_data = 6;
2048 for (int i = 0; i < this->string_data_size(); i++) {
2049 ::google::protobuf::internal::WireFormatLite::WriteBytes(
2050 6, this->string_data(i), output);
2051 }
2052
2053 // optional string name = 7;
2054 if (has_name()) {
2055 ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
2056 this->name().data(), this->name().length(),
2057 ::google::protobuf::internal::WireFormat::SERIALIZE,
2058 "name");
2059 ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
2060 7, this->name(), output);
2061 }
2062
2063 // optional .caffe2.DeviceOption device_detail = 8;
2064 if (has_device_detail()) {
2065 ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
2066 8, this->device_detail(), output);
2067 }
2068
2069 // repeated double double_data = 9 [packed = true];
2070 if (this->double_data_size() > 0) {
2071 ::google::protobuf::internal::WireFormatLite::WriteTag(9, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output);
2072 output->WriteVarint32(_double_data_cached_byte_size_);
2073 }
2074 for (int i = 0; i < this->double_data_size(); i++) {
2075 ::google::protobuf::internal::WireFormatLite::WriteDoubleNoTag(
2076 this->double_data(i), output);
2077 }
2078
2079 // repeated int64 int64_data = 10 [packed = true];
2080 if (this->int64_data_size() > 0) {
2081 ::google::protobuf::internal::WireFormatLite::WriteTag(10, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output);
2082 output->WriteVarint32(_int64_data_cached_byte_size_);
2083 }
2084 for (int i = 0; i < this->int64_data_size(); i++) {
2085 ::google::protobuf::internal::WireFormatLite::WriteInt64NoTag(
2086 this->int64_data(i), output);
2087 }
2088
2089 // optional .caffe2.TensorProto.Segment segment = 11;
2090 if (has_segment()) {
2091 ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
2092 11, this->segment(), output);
2093 }
2094
2095 // optional .caffe2.TensorProto.StorageType storage_type = 12 [default = TYPED];
2096 if (has_storage_type()) {
2097 ::google::protobuf::internal::WireFormatLite::WriteEnum(
2098 12, this->storage_type(), output);
2099 }
2100
2101 // optional bytes raw_data = 13;
2102 if (has_raw_data()) {
2103 ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased(
2104 13, this->raw_data(), output);
2105 }
2106
2107 // optional .caffe2.ExternalDataProto external_data = 14;
2108 if (has_external_data()) {
2109 ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
2110 14, this->external_data(), output);
2111 }
2112
2113 if (!unknown_fields().empty()) {
2114 ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
2115 unknown_fields(), output);
2116 }
2117 // @@protoc_insertion_point(serialize_end:caffe2.TensorProto)
2118}
2119
2120::google::protobuf::uint8* TensorProto::SerializeWithCachedSizesToArray(
2121 ::google::protobuf::uint8* target) const {
2122 // @@protoc_insertion_point(serialize_to_array_start:caffe2.TensorProto)
2123 // repeated int64 dims = 1;
2124 for (int i = 0; i < this->dims_size(); i++) {
2125 target = ::google::protobuf::internal::WireFormatLite::
2126 WriteInt64ToArray(1, this->dims(i), target);
2127 }
2128
2129 // optional .caffe2.TensorProto.DataType data_type = 2 [default = FLOAT];
2130 if (has_data_type()) {
2131 target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
2132 2, this->data_type(), target);
2133 }
2134
2135 // repeated float float_data = 3 [packed = true];
2136 if (this->float_data_size() > 0) {
2137 target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray(
2138 3,
2139 ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED,
2140 target);
2141 target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray(
2142 _float_data_cached_byte_size_, target);
2143 }
2144 for (int i = 0; i < this->float_data_size(); i++) {
2145 target = ::google::protobuf::internal::WireFormatLite::
2146 WriteFloatNoTagToArray(this->float_data(i), target);
2147 }
2148
2149 // repeated int32 int32_data = 4 [packed = true];
2150 if (this->int32_data_size() > 0) {
2151 target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray(
2152 4,
2153 ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED,
2154 target);
2155 target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray(
2156 _int32_data_cached_byte_size_, target);
2157 }
2158 for (int i = 0; i < this->int32_data_size(); i++) {
2159 target = ::google::protobuf::internal::WireFormatLite::
2160 WriteInt32NoTagToArray(this->int32_data(i), target);
2161 }
2162
2163 // optional bytes byte_data = 5;
2164 if (has_byte_data()) {
2165 target =
2166 ::google::protobuf::internal::WireFormatLite::WriteBytesToArray(
2167 5, this->byte_data(), target);
2168 }
2169
2170 // repeated bytes string_data = 6;
2171 for (int i = 0; i < this->string_data_size(); i++) {
2172 target = ::google::protobuf::internal::WireFormatLite::
2173 WriteBytesToArray(6, this->string_data(i), target);
2174 }
2175
2176 // optional string name = 7;
2177 if (has_name()) {
2178 ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
2179 this->name().data(), this->name().length(),
2180 ::google::protobuf::internal::WireFormat::SERIALIZE,
2181 "name");
2182 target =
2183 ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
2184 7, this->name(), target);
2185 }
2186
2187 // optional .caffe2.DeviceOption device_detail = 8;
2188 if (has_device_detail()) {
2189 target = ::google::protobuf::internal::WireFormatLite::
2190 WriteMessageNoVirtualToArray(
2191 8, this->device_detail(), target);
2192 }
2193
2194 // repeated double double_data = 9 [packed = true];
2195 if (this->double_data_size() > 0) {
2196 target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray(
2197 9,
2198 ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED,
2199 target);
2200 target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray(
2201 _double_data_cached_byte_size_, target);
2202 }
2203 for (int i = 0; i < this->double_data_size(); i++) {
2204 target = ::google::protobuf::internal::WireFormatLite::
2205 WriteDoubleNoTagToArray(this->double_data(i), target);
2206 }
2207
2208 // repeated int64 int64_data = 10 [packed = true];
2209 if (this->int64_data_size() > 0) {
2210 target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray(
2211 10,
2212 ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED,
2213 target);
2214 target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray(
2215 _int64_data_cached_byte_size_, target);
2216 }
2217 for (int i = 0; i < this->int64_data_size(); i++) {
2218 target = ::google::protobuf::internal::WireFormatLite::
2219 WriteInt64NoTagToArray(this->int64_data(i), target);
2220 }
2221
2222 // optional .caffe2.TensorProto.Segment segment = 11;
2223 if (has_segment()) {
2224 target = ::google::protobuf::internal::WireFormatLite::
2225 WriteMessageNoVirtualToArray(
2226 11, this->segment(), target);
2227 }
2228
2229 // optional .caffe2.TensorProto.StorageType storage_type = 12 [default = TYPED];
2230 if (has_storage_type()) {
2231 target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
2232 12, this->storage_type(), target);
2233 }
2234
2235 // optional bytes raw_data = 13;
2236 if (has_raw_data()) {
2237 target =
2238 ::google::protobuf::internal::WireFormatLite::WriteBytesToArray(
2239 13, this->raw_data(), target);
2240 }
2241
2242 // optional .caffe2.ExternalDataProto external_data = 14;
2243 if (has_external_data()) {
2244 target = ::google::protobuf::internal::WireFormatLite::
2245 WriteMessageNoVirtualToArray(
2246 14, this->external_data(), target);
2247 }
2248
2249 if (!unknown_fields().empty()) {
2250 target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
2251 unknown_fields(), target);
2252 }
2253 // @@protoc_insertion_point(serialize_to_array_end:caffe2.TensorProto)
2254 return target;
2255}
2256
2257int TensorProto::ByteSize() const {
2258 int total_size = 0;
2259
2260 if (_has_bits_[1 / 32] & (0xffu << (1 % 32))) {
2261 // optional .caffe2.TensorProto.DataType data_type = 2 [default = FLOAT];
2262 if (has_data_type()) {
2263 total_size += 1 +
2264 ::google::protobuf::internal::WireFormatLite::EnumSize(this->data_type());
2265 }
2266
2267 // optional .caffe2.TensorProto.StorageType storage_type = 12 [default = TYPED];
2268 if (has_storage_type()) {
2269 total_size += 1 +
2270 ::google::protobuf::internal::WireFormatLite::EnumSize(this->storage_type());
2271 }
2272
2273 // optional bytes byte_data = 5;
2274 if (has_byte_data()) {
2275 total_size += 1 +
2276 ::google::protobuf::internal::WireFormatLite::BytesSize(
2277 this->byte_data());
2278 }
2279
2280 }
2281 if (_has_bits_[9 / 32] & (0xffu << (9 % 32))) {
2282 // optional bytes raw_data = 13;
2283 if (has_raw_data()) {
2284 total_size += 1 +
2285 ::google::protobuf::internal::WireFormatLite::BytesSize(
2286 this->raw_data());
2287 }
2288
2289 // optional .caffe2.ExternalDataProto external_data = 14;
2290 if (has_external_data()) {
2291 total_size += 1 +
2292 ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
2293 this->external_data());
2294 }
2295
2296 // optional string name = 7;
2297 if (has_name()) {
2298 total_size += 1 +
2299 ::google::protobuf::internal::WireFormatLite::StringSize(
2300 this->name());
2301 }
2302
2303 // optional .caffe2.DeviceOption device_detail = 8;
2304 if (has_device_detail()) {
2305 total_size += 1 +
2306 ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
2307 this->device_detail());
2308 }
2309
2310 // optional .caffe2.TensorProto.Segment segment = 11;
2311 if (has_segment()) {
2312 total_size += 1 +
2313 ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
2314 this->segment());
2315 }
2316
2317 }
2318 // repeated int64 dims = 1;
2319 {
2320 int data_size = 0;
2321 for (int i = 0; i < this->dims_size(); i++) {
2322 data_size += ::google::protobuf::internal::WireFormatLite::
2323 Int64Size(this->dims(i));
2324 }
2325 total_size += 1 * this->dims_size() + data_size;
2326 }
2327
2328 // repeated float float_data = 3 [packed = true];
2329 {
2330 int data_size = 0;
2331 data_size = 4 * this->float_data_size();
2332 if (data_size > 0) {
2333 total_size += 1 +
2334 ::google::protobuf::internal::WireFormatLite::Int32Size(data_size);
2335 }
2336 GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
2337 _float_data_cached_byte_size_ = data_size;
2338 GOOGLE_SAFE_CONCURRENT_WRITES_END();
2339 total_size += data_size;
2340 }
2341
2342 // repeated int32 int32_data = 4 [packed = true];
2343 {
2344 int data_size = 0;
2345 for (int i = 0; i < this->int32_data_size(); i++) {
2346 data_size += ::google::protobuf::internal::WireFormatLite::
2347 Int32Size(this->int32_data(i));
2348 }
2349 if (data_size > 0) {
2350 total_size += 1 +
2351 ::google::protobuf::internal::WireFormatLite::Int32Size(data_size);
2352 }
2353 GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
2354 _int32_data_cached_byte_size_ = data_size;
2355 GOOGLE_SAFE_CONCURRENT_WRITES_END();
2356 total_size += data_size;
2357 }
2358
2359 // repeated bytes string_data = 6;
2360 total_size += 1 * this->string_data_size();
2361 for (int i = 0; i < this->string_data_size(); i++) {
2362 total_size += ::google::protobuf::internal::WireFormatLite::BytesSize(
2363 this->string_data(i));
2364 }
2365
2366 // repeated double double_data = 9 [packed = true];
2367 {
2368 int data_size = 0;
2369 data_size = 8 * this->double_data_size();
2370 if (data_size > 0) {
2371 total_size += 1 +
2372 ::google::protobuf::internal::WireFormatLite::Int32Size(data_size);
2373 }
2374 GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
2375 _double_data_cached_byte_size_ = data_size;
2376 GOOGLE_SAFE_CONCURRENT_WRITES_END();
2377 total_size += data_size;
2378 }
2379
2380 // repeated int64 int64_data = 10 [packed = true];
2381 {
2382 int data_size = 0;
2383 for (int i = 0; i < this->int64_data_size(); i++) {
2384 data_size += ::google::protobuf::internal::WireFormatLite::
2385 Int64Size(this->int64_data(i));
2386 }
2387 if (data_size > 0) {
2388 total_size += 1 +
2389 ::google::protobuf::internal::WireFormatLite::Int32Size(data_size);
2390 }
2391 GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
2392 _int64_data_cached_byte_size_ = data_size;
2393 GOOGLE_SAFE_CONCURRENT_WRITES_END();
2394 total_size += data_size;
2395 }
2396
2397 if (!unknown_fields().empty()) {
2398 total_size +=
2399 ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
2400 unknown_fields());
2401 }
2402 GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
2403 _cached_size_ = total_size;
2404 GOOGLE_SAFE_CONCURRENT_WRITES_END();
2405 return total_size;
2406}
2407
2408void TensorProto::MergeFrom(const ::google::protobuf::Message& from) {
2409 GOOGLE_CHECK_NE(&from, this);
2410 const TensorProto* source =
2411 ::google::protobuf::internal::dynamic_cast_if_available<const TensorProto*>(
2412 &from);
2413 if (source == NULL) {
2414 ::google::protobuf::internal::ReflectionOps::Merge(from, this);
2415 } else {
2416 MergeFrom(*source);
2417 }
2418}
2419
2420void TensorProto::MergeFrom(const TensorProto& from) {
2421 GOOGLE_CHECK_NE(&from, this);
2422 dims_.MergeFrom(from.dims_);
2423 float_data_.MergeFrom(from.float_data_);
2424 int32_data_.MergeFrom(from.int32_data_);
2425 string_data_.MergeFrom(from.string_data_);
2426 double_data_.MergeFrom(from.double_data_);
2427 int64_data_.MergeFrom(from.int64_data_);
2428 if (from._has_bits_[1 / 32] & (0xffu << (1 % 32))) {
2429 if (from.has_data_type()) {
2430 set_data_type(from.data_type());
2431 }
2432 if (from.has_storage_type()) {
2433 set_storage_type(from.storage_type());
2434 }
2435 if (from.has_byte_data()) {
2436 set_byte_data(from.byte_data());
2437 }
2438 }
2439 if (from._has_bits_[9 / 32] & (0xffu << (9 % 32))) {
2440 if (from.has_raw_data()) {
2441 set_raw_data(from.raw_data());
2442 }
2443 if (from.has_external_data()) {
2444 mutable_external_data()->::caffe2::ExternalDataProto::MergeFrom(from.external_data());
2445 }
2446 if (from.has_name()) {
2447 set_name(from.name());
2448 }
2449 if (from.has_device_detail()) {
2450 mutable_device_detail()->::caffe2::DeviceOption::MergeFrom(from.device_detail());
2451 }
2452 if (from.has_segment()) {
2453 mutable_segment()->::caffe2::TensorProto_Segment::MergeFrom(from.segment());
2454 }
2455 }
2456 mutable_unknown_fields()->MergeFrom(from.unknown_fields());
2457}
2458
2459void TensorProto::CopyFrom(const ::google::protobuf::Message& from) {
2460 if (&from == this) return;
2461 Clear();
2462 MergeFrom(from);
2463}
2464
2465void TensorProto::CopyFrom(const TensorProto& from) {
2466 if (&from == this) return;
2467 Clear();
2468 MergeFrom(from);
2469}
2470
2471bool TensorProto::IsInitialized() const {
2472
2473 if (has_segment()) {
2474 if (!this->segment().IsInitialized()) return false;
2475 }
2476 return true;
2477}
2478
2479void TensorProto::Swap(TensorProto* other) {
2480 if (other != this) {
2481 dims_.Swap(&other->dims_);
2482 std::swap(data_type_, other->data_type_);
2483 std::swap(storage_type_, other->storage_type_);
2484 float_data_.Swap(&other->float_data_);
2485 int32_data_.Swap(&other->int32_data_);
2486 std::swap(byte_data_, other->byte_data_);
2487 string_data_.Swap(&other->string_data_);
2488 double_data_.Swap(&other->double_data_);
2489 int64_data_.Swap(&other->int64_data_);
2490 std::swap(raw_data_, other->raw_data_);
2491 std::swap(external_data_, other->external_data_);
2492 std::swap(name_, other->name_);
2493 std::swap(device_detail_, other->device_detail_);
2494 std::swap(segment_, other->segment_);
2495 std::swap(_has_bits_[0], other->_has_bits_[0]);
2496 _unknown_fields_.Swap(&other->_unknown_fields_);
2497 std::swap(_cached_size_, other->_cached_size_);
2498 }
2499}
2500
2501::google::protobuf::Metadata TensorProto::GetMetadata() const {
2502 protobuf_AssignDescriptorsOnce();
2503 ::google::protobuf::Metadata metadata;
2504 metadata.descriptor = TensorProto_descriptor_;
2505 metadata.reflection = TensorProto_reflection_;
2506 return metadata;
2507}
2508
2509
2510// ===================================================================
2511
2512#ifndef _MSC_VER
2513const int QTensorProto::kDimsFieldNumber;
2514const int QTensorProto::kPrecisionFieldNumber;
2515const int QTensorProto::kScaleFieldNumber;
2516const int QTensorProto::kBiasFieldNumber;
2517const int QTensorProto::kIsSignedFieldNumber;
2518const int QTensorProto::kDataFieldNumber;
2519const int QTensorProto::kNameFieldNumber;
2520const int QTensorProto::kDataTypeFieldNumber;
2521const int QTensorProto::kScalesFieldNumber;
2522const int QTensorProto::kBiasesFieldNumber;
2523const int QTensorProto::kAxisFieldNumber;
2524const int QTensorProto::kIsMultiparamFieldNumber;
2525#endif // !_MSC_VER
2526
2527QTensorProto::QTensorProto()
2528 : ::google::protobuf::Message() {
2529 SharedCtor();
2530 // @@protoc_insertion_point(constructor:caffe2.QTensorProto)
2531}
2532
2533void QTensorProto::InitAsDefaultInstance() {
2534}
2535
2536QTensorProto::QTensorProto(const QTensorProto& from)
2537 : ::google::protobuf::Message() {
2538 SharedCtor();
2539 MergeFrom(from);
2540 // @@protoc_insertion_point(copy_constructor:caffe2.QTensorProto)
2541}
2542
2543void QTensorProto::SharedCtor() {
2544 ::google::protobuf::internal::GetEmptyString();
2545 _cached_size_ = 0;
2546 precision_ = 0;
2547 scale_ = 0;
2548 bias_ = 0;
2549 is_signed_ = false;
2550 name_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
2551 data_type_ = 2;
2552 axis_ = 0;
2553 is_multiparam_ = false;
2554 ::memset(_has_bits_, 0, sizeof(_has_bits_));
2555}
2556
2557QTensorProto::~QTensorProto() {
2558 // @@protoc_insertion_point(destructor:caffe2.QTensorProto)
2559 SharedDtor();
2560}
2561
2562void QTensorProto::SharedDtor() {
2563 if (name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
2564 delete name_;
2565 }
2566 if (this != default_instance_) {
2567 }
2568}
2569
2570void QTensorProto::SetCachedSize(int size) const {
2571 GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
2572 _cached_size_ = size;
2573 GOOGLE_SAFE_CONCURRENT_WRITES_END();
2574}
2575const ::google::protobuf::Descriptor* QTensorProto::descriptor() {
2576 protobuf_AssignDescriptorsOnce();
2577 return QTensorProto_descriptor_;
2578}
2579
2580const QTensorProto& QTensorProto::default_instance() {
2581 if (default_instance_ == NULL) protobuf_AddDesc_caffe2_2eproto();
2582 return *default_instance_;
2583}
2584
2585QTensorProto* QTensorProto::default_instance_ = NULL;
2586
2587QTensorProto* QTensorProto::New() const {
2588 return new QTensorProto;
2589}
2590
2591void QTensorProto::Clear() {
2592#define OFFSET_OF_FIELD_(f) (reinterpret_cast<char*>( \
2593 &reinterpret_cast<QTensorProto*>(16)->f) - \
2594 reinterpret_cast<char*>(16))
2595
2596#define ZR_(first, last) do { \
2597 size_t f = OFFSET_OF_FIELD_(first); \
2598 size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \
2599 ::memset(&first, 0, n); \
2600 } while (0)
2601
2602 if (_has_bits_[0 / 32] & 222) {
2603 ZR_(scale_, precision_);
2604 is_signed_ = false;
2605 if (has_name()) {
2606 if (name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
2607 name_->clear();
2608 }
2609 }
2610 data_type_ = 2;
2611 }
2612 ZR_(is_multiparam_, axis_);
2613
2614#undef OFFSET_OF_FIELD_
2615#undef ZR_
2616
2617 dims_.Clear();
2618 data_.Clear();
2619 scales_.Clear();
2620 biases_.Clear();
2621 ::memset(_has_bits_, 0, sizeof(_has_bits_));
2622 mutable_unknown_fields()->Clear();
2623}
2624
2625bool QTensorProto::MergePartialFromCodedStream(
2626 ::google::protobuf::io::CodedInputStream* input) {
2627#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure
2628 ::google::protobuf::uint32 tag;
2629 // @@protoc_insertion_point(parse_start:caffe2.QTensorProto)
2630 for (;;) {
2631 ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);
2632 tag = p.first;
2633 if (!p.second) goto handle_unusual;
2634 switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
2635 // repeated int64 dims = 1;
2636 case 1: {
2637 if (tag == 8) {
2638 parse_dims:
2639 DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive<
2640 ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>(
2641 1, 8, input, this->mutable_dims())));
2642 } else if (tag == 10) {
2643 DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline<
2644 ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>(
2645 input, this->mutable_dims())));
2646 } else {
2647 goto handle_unusual;
2648 }
2649 if (input->ExpectTag(8)) goto parse_dims;
2650 if (input->ExpectTag(16)) goto parse_precision;
2651 break;
2652 }
2653
2654 // required int32 precision = 2;
2655 case 2: {
2656 if (tag == 16) {
2657 parse_precision:
2658 DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
2659 ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
2660 input, &precision_)));
2661 set_has_precision();
2662 } else {
2663 goto handle_unusual;
2664 }
2665 if (input->ExpectTag(25)) goto parse_scale;
2666 break;
2667 }
2668
2669 // required double scale = 3;
2670 case 3: {
2671 if (tag == 25) {
2672 parse_scale:
2673 DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
2674 double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>(
2675 input, &scale_)));
2676 set_has_scale();
2677 } else {
2678 goto handle_unusual;
2679 }
2680 if (input->ExpectTag(33)) goto parse_bias;
2681 break;
2682 }
2683
2684 // required double bias = 4;
2685 case 4: {
2686 if (tag == 33) {
2687 parse_bias:
2688 DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
2689 double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>(
2690 input, &bias_)));
2691 set_has_bias();
2692 } else {
2693 goto handle_unusual;
2694 }
2695 if (input->ExpectTag(40)) goto parse_is_signed;
2696 break;
2697 }
2698
2699 // required bool is_signed = 5;
2700 case 5: {
2701 if (tag == 40) {
2702 parse_is_signed:
2703 DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
2704 bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
2705 input, &is_signed_)));
2706 set_has_is_signed();
2707 } else {
2708 goto handle_unusual;
2709 }
2710 if (input->ExpectTag(50)) goto parse_data;
2711 break;
2712 }
2713
2714 // repeated int32 data = 6 [packed = true];
2715 case 6: {
2716 if (tag == 50) {
2717 parse_data:
2718 DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive<
2719 ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
2720 input, this->mutable_data())));
2721 } else if (tag == 48) {
2722 DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline<
2723 ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
2724 1, 50, input, this->mutable_data())));
2725 } else {
2726 goto handle_unusual;
2727 }
2728 if (input->ExpectTag(58)) goto parse_name;
2729 break;
2730 }
2731
2732 // optional string name = 7;
2733 case 7: {
2734 if (tag == 58) {
2735 parse_name:
2736 DO_(::google::protobuf::internal::WireFormatLite::ReadString(
2737 input, this->mutable_name()));
2738 ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
2739 this->name().data(), this->name().length(),
2740 ::google::protobuf::internal::WireFormat::PARSE,
2741 "name");
2742 } else {
2743 goto handle_unusual;
2744 }
2745 if (input->ExpectTag(64)) goto parse_data_type;
2746 break;
2747 }
2748
2749 // optional .caffe2.TensorProto.DataType data_type = 8 [default = INT32];
2750 case 8: {
2751 if (tag == 64) {
2752 parse_data_type:
2753 int value;
2754 DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
2755 int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
2756 input, &value)));
2757 if (::caffe2::TensorProto_DataType_IsValid(value)) {
2758 set_data_type(static_cast< ::caffe2::TensorProto_DataType >(value));
2759 } else {
2760 mutable_unknown_fields()->AddVarint(8, value);
2761 }
2762 } else {
2763 goto handle_unusual;
2764 }
2765 if (input->ExpectTag(73)) goto parse_scales;
2766 break;
2767 }
2768
2769 // repeated double scales = 9;
2770 case 9: {
2771 if (tag == 73) {
2772 parse_scales:
2773 DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive<
2774 double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>(
2775 1, 73, input, this->mutable_scales())));
2776 } else if (tag == 74) {
2777 DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline<
2778 double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>(
2779 input, this->mutable_scales())));
2780 } else {
2781 goto handle_unusual;
2782 }
2783 if (input->ExpectTag(73)) goto parse_scales;
2784 if (input->ExpectTag(81)) goto parse_biases;
2785 break;
2786 }
2787
2788 // repeated double biases = 10;
2789 case 10: {
2790 if (tag == 81) {
2791 parse_biases:
2792 DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive<
2793 double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>(
2794 1, 81, input, this->mutable_biases())));
2795 } else if (tag == 82) {
2796 DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline<
2797 double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>(
2798 input, this->mutable_biases())));
2799 } else {
2800 goto handle_unusual;
2801 }
2802 if (input->ExpectTag(81)) goto parse_biases;
2803 if (input->ExpectTag(88)) goto parse_axis;
2804 break;
2805 }
2806
2807 // optional int32 axis = 11;
2808 case 11: {
2809 if (tag == 88) {
2810 parse_axis:
2811 DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
2812 ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
2813 input, &axis_)));
2814 set_has_axis();
2815 } else {
2816 goto handle_unusual;
2817 }
2818 if (input->ExpectTag(96)) goto parse_is_multiparam;
2819 break;
2820 }
2821
2822 // optional bool is_multiparam = 12 [default = false];
2823 case 12: {
2824 if (tag == 96) {
2825 parse_is_multiparam:
2826 DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
2827 bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
2828 input, &is_multiparam_)));
2829 set_has_is_multiparam();
2830 } else {
2831 goto handle_unusual;
2832 }
2833 if (input->ExpectAtEnd()) goto success;
2834 break;
2835 }
2836
2837 default: {
2838 handle_unusual:
2839 if (tag == 0 ||
2840 ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
2841 ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
2842 goto success;
2843 }
2844 DO_(::google::protobuf::internal::WireFormat::SkipField(
2845 input, tag, mutable_unknown_fields()));
2846 break;
2847 }
2848 }
2849 }
2850success:
2851 // @@protoc_insertion_point(parse_success:caffe2.QTensorProto)
2852 return true;
2853failure:
2854 // @@protoc_insertion_point(parse_failure:caffe2.QTensorProto)
2855 return false;
2856#undef DO_
2857}
2858
2859void QTensorProto::SerializeWithCachedSizes(
2860 ::google::protobuf::io::CodedOutputStream* output) const {
2861 // @@protoc_insertion_point(serialize_start:caffe2.QTensorProto)
2862 // repeated int64 dims = 1;
2863 for (int i = 0; i < this->dims_size(); i++) {
2864 ::google::protobuf::internal::WireFormatLite::WriteInt64(
2865 1, this->dims(i), output);
2866 }
2867
2868 // required int32 precision = 2;
2869 if (has_precision()) {
2870 ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->precision(), output);
2871 }
2872
2873 // required double scale = 3;
2874 if (has_scale()) {
2875 ::google::protobuf::internal::WireFormatLite::WriteDouble(3, this->scale(), output);
2876 }
2877
2878 // required double bias = 4;
2879 if (has_bias()) {
2880 ::google::protobuf::internal::WireFormatLite::WriteDouble(4, this->bias(), output);
2881 }
2882
2883 // required bool is_signed = 5;
2884 if (has_is_signed()) {
2885 ::google::protobuf::internal::WireFormatLite::WriteBool(5, this->is_signed(), output);
2886 }
2887
2888 // repeated int32 data = 6 [packed = true];
2889 if (this->data_size() > 0) {
2890 ::google::protobuf::internal::WireFormatLite::WriteTag(6, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output);
2891 output->WriteVarint32(_data_cached_byte_size_);
2892 }
2893 for (int i = 0; i < this->data_size(); i++) {
2894 ::google::protobuf::internal::WireFormatLite::WriteInt32NoTag(
2895 this->data(i), output);
2896 }
2897
2898 // optional string name = 7;
2899 if (has_name()) {
2900 ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
2901 this->name().data(), this->name().length(),
2902 ::google::protobuf::internal::WireFormat::SERIALIZE,
2903 "name");
2904 ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
2905 7, this->name(), output);
2906 }
2907
2908 // optional .caffe2.TensorProto.DataType data_type = 8 [default = INT32];
2909 if (has_data_type()) {
2910 ::google::protobuf::internal::WireFormatLite::WriteEnum(
2911 8, this->data_type(), output);
2912 }
2913
2914 // repeated double scales = 9;
2915 for (int i = 0; i < this->scales_size(); i++) {
2916 ::google::protobuf::internal::WireFormatLite::WriteDouble(
2917 9, this->scales(i), output);
2918 }
2919
2920 // repeated double biases = 10;
2921 for (int i = 0; i < this->biases_size(); i++) {
2922 ::google::protobuf::internal::WireFormatLite::WriteDouble(
2923 10, this->biases(i), output);
2924 }
2925
2926 // optional int32 axis = 11;
2927 if (has_axis()) {
2928 ::google::protobuf::internal::WireFormatLite::WriteInt32(11, this->axis(), output);
2929 }
2930
2931 // optional bool is_multiparam = 12 [default = false];
2932 if (has_is_multiparam()) {
2933 ::google::protobuf::internal::WireFormatLite::WriteBool(12, this->is_multiparam(), output);
2934 }
2935
2936 if (!unknown_fields().empty()) {
2937 ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
2938 unknown_fields(), output);
2939 }
2940 // @@protoc_insertion_point(serialize_end:caffe2.QTensorProto)
2941}
2942
2943::google::protobuf::uint8* QTensorProto::SerializeWithCachedSizesToArray(
2944 ::google::protobuf::uint8* target) const {
2945 // @@protoc_insertion_point(serialize_to_array_start:caffe2.QTensorProto)
2946 // repeated int64 dims = 1;
2947 for (int i = 0; i < this->dims_size(); i++) {
2948 target = ::google::protobuf::internal::WireFormatLite::
2949 WriteInt64ToArray(1, this->dims(i), target);
2950 }
2951
2952 // required int32 precision = 2;
2953 if (has_precision()) {
2954 target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->precision(), target);
2955 }
2956
2957 // required double scale = 3;
2958 if (has_scale()) {
2959 target = ::google::protobuf::internal::WireFormatLite::WriteDoubleToArray(3, this->scale(), target);
2960 }
2961
2962 // required double bias = 4;
2963 if (has_bias()) {
2964 target = ::google::protobuf::internal::WireFormatLite::WriteDoubleToArray(4, this->bias(), target);
2965 }
2966
2967 // required bool is_signed = 5;
2968 if (has_is_signed()) {
2969 target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(5, this->is_signed(), target);
2970 }
2971
2972 // repeated int32 data = 6 [packed = true];
2973 if (this->data_size() > 0) {
2974 target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray(
2975 6,
2976 ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED,
2977 target);
2978 target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray(
2979 _data_cached_byte_size_, target);
2980 }
2981 for (int i = 0; i < this->data_size(); i++) {
2982 target = ::google::protobuf::internal::WireFormatLite::
2983 WriteInt32NoTagToArray(this->data(i), target);
2984 }
2985
2986 // optional string name = 7;
2987 if (has_name()) {
2988 ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
2989 this->name().data(), this->name().length(),
2990 ::google::protobuf::internal::WireFormat::SERIALIZE,
2991 "name");
2992 target =
2993 ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
2994 7, this->name(), target);
2995 }
2996
2997 // optional .caffe2.TensorProto.DataType data_type = 8 [default = INT32];
2998 if (has_data_type()) {
2999 target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
3000 8, this->data_type(), target);
3001 }
3002
3003 // repeated double scales = 9;
3004 for (int i = 0; i < this->scales_size(); i++) {
3005 target = ::google::protobuf::internal::WireFormatLite::
3006 WriteDoubleToArray(9, this->scales(i), target);
3007 }
3008
3009 // repeated double biases = 10;
3010 for (int i = 0; i < this->biases_size(); i++) {
3011 target = ::google::protobuf::internal::WireFormatLite::
3012 WriteDoubleToArray(10, this->biases(i), target);
3013 }
3014
3015 // optional int32 axis = 11;
3016 if (has_axis()) {
3017 target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(11, this->axis(), target);
3018 }
3019
3020 // optional bool is_multiparam = 12 [default = false];
3021 if (has_is_multiparam()) {
3022 target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(12, this->is_multiparam(), target);
3023 }
3024
3025 if (!unknown_fields().empty()) {
3026 target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
3027 unknown_fields(), target);
3028 }
3029 // @@protoc_insertion_point(serialize_to_array_end:caffe2.QTensorProto)
3030 return target;
3031}
3032
3033int QTensorProto::ByteSize() const {
3034 int total_size = 0;
3035
3036 if (_has_bits_[1 / 32] & (0xffu << (1 % 32))) {
3037 // required int32 precision = 2;
3038 if (has_precision()) {
3039 total_size += 1 +
3040 ::google::protobuf::internal::WireFormatLite::Int32Size(
3041 this->precision());
3042 }
3043
3044 // required double scale = 3;
3045 if (has_scale()) {
3046 total_size += 1 + 8;
3047 }
3048
3049 // required double bias = 4;
3050 if (has_bias()) {
3051 total_size += 1 + 8;
3052 }
3053
3054 // required bool is_signed = 5;
3055 if (has_is_signed()) {
3056 total_size += 1 + 1;
3057 }
3058
3059 // optional string name = 7;
3060 if (has_name()) {
3061 total_size += 1 +
3062 ::google::protobuf::internal::WireFormatLite::StringSize(
3063 this->name());
3064 }
3065
3066 // optional .caffe2.TensorProto.DataType data_type = 8 [default = INT32];
3067 if (has_data_type()) {
3068 total_size += 1 +
3069 ::google::protobuf::internal::WireFormatLite::EnumSize(this->data_type());
3070 }
3071
3072 }
3073 if (_has_bits_[10 / 32] & (0xffu << (10 % 32))) {
3074 // optional int32 axis = 11;
3075 if (has_axis()) {
3076 total_size += 1 +
3077 ::google::protobuf::internal::WireFormatLite::Int32Size(
3078 this->axis());
3079 }
3080
3081 // optional bool is_multiparam = 12 [default = false];
3082 if (has_is_multiparam()) {
3083 total_size += 1 + 1;
3084 }
3085
3086 }
3087 // repeated int64 dims = 1;
3088 {
3089 int data_size = 0;
3090 for (int i = 0; i < this->dims_size(); i++) {
3091 data_size += ::google::protobuf::internal::WireFormatLite::
3092 Int64Size(this->dims(i));
3093 }
3094 total_size += 1 * this->dims_size() + data_size;
3095 }
3096
3097 // repeated int32 data = 6 [packed = true];
3098 {
3099 int data_size = 0;
3100 for (int i = 0; i < this->data_size(); i++) {
3101 data_size += ::google::protobuf::internal::WireFormatLite::
3102 Int32Size(this->data(i));
3103 }
3104 if (data_size > 0) {
3105 total_size += 1 +
3106 ::google::protobuf::internal::WireFormatLite::Int32Size(data_size);
3107 }
3108 GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
3109 _data_cached_byte_size_ = data_size;
3110 GOOGLE_SAFE_CONCURRENT_WRITES_END();
3111 total_size += data_size;
3112 }
3113
3114 // repeated double scales = 9;
3115 {
3116 int data_size = 0;
3117 data_size = 8 * this->scales_size();
3118 total_size += 1 * this->scales_size() + data_size;
3119 }
3120
3121 // repeated double biases = 10;
3122 {
3123 int data_size = 0;
3124 data_size = 8 * this->biases_size();
3125 total_size += 1 * this->biases_size() + data_size;
3126 }
3127
3128 if (!unknown_fields().empty()) {
3129 total_size +=
3130 ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
3131 unknown_fields());
3132 }
3133 GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
3134 _cached_size_ = total_size;
3135 GOOGLE_SAFE_CONCURRENT_WRITES_END();
3136 return total_size;
3137}
3138
3139void QTensorProto::MergeFrom(const ::google::protobuf::Message& from) {
3140 GOOGLE_CHECK_NE(&from, this);
3141 const QTensorProto* source =
3142 ::google::protobuf::internal::dynamic_cast_if_available<const QTensorProto*>(
3143 &from);
3144 if (source == NULL) {
3145 ::google::protobuf::internal::ReflectionOps::Merge(from, this);
3146 } else {
3147 MergeFrom(*source);
3148 }
3149}
3150
3151void QTensorProto::MergeFrom(const QTensorProto& from) {
3152 GOOGLE_CHECK_NE(&from, this);
3153 dims_.MergeFrom(from.dims_);
3154 data_.MergeFrom(from.data_);
3155 scales_.MergeFrom(from.scales_);
3156 biases_.MergeFrom(from.biases_);
3157 if (from._has_bits_[1 / 32] & (0xffu << (1 % 32))) {
3158 if (from.has_precision()) {
3159 set_precision(from.precision());
3160 }
3161 if (from.has_scale()) {
3162 set_scale(from.scale());
3163 }
3164 if (from.has_bias()) {
3165 set_bias(from.bias());
3166 }
3167 if (from.has_is_signed()) {
3168 set_is_signed(from.is_signed());
3169 }
3170 if (from.has_name()) {
3171 set_name(from.name());
3172 }
3173 if (from.has_data_type()) {
3174 set_data_type(from.data_type());
3175 }
3176 }
3177 if (from._has_bits_[10 / 32] & (0xffu << (10 % 32))) {
3178 if (from.has_axis()) {
3179 set_axis(from.axis());
3180 }
3181 if (from.has_is_multiparam()) {
3182 set_is_multiparam(from.is_multiparam());
3183 }
3184 }
3185 mutable_unknown_fields()->MergeFrom(from.unknown_fields());
3186}
3187
3188void QTensorProto::CopyFrom(const ::google::protobuf::Message& from) {
3189 if (&from == this) return;
3190 Clear();
3191 MergeFrom(from);
3192}
3193
3194void QTensorProto::CopyFrom(const QTensorProto& from) {
3195 if (&from == this) return;
3196 Clear();
3197 MergeFrom(from);
3198}
3199
3200bool QTensorProto::IsInitialized() const {
3201 if ((_has_bits_[0] & 0x0000001e) != 0x0000001e) return false;
3202
3203 return true;
3204}
3205
3206void QTensorProto::Swap(QTensorProto* other) {
3207 if (other != this) {
3208 dims_.Swap(&other->dims_);
3209 std::swap(precision_, other->precision_);
3210 std::swap(scale_, other->scale_);
3211 std::swap(bias_, other->bias_);
3212 std::swap(is_signed_, other->is_signed_);
3213 data_.Swap(&other->data_);
3214 std::swap(name_, other->name_);
3215 std::swap(data_type_, other->data_type_);
3216 scales_.Swap(&other->scales_);
3217 biases_.Swap(&other->biases_);
3218 std::swap(axis_, other->axis_);
3219 std::swap(is_multiparam_, other->is_multiparam_);
3220 std::swap(_has_bits_[0], other->_has_bits_[0]);
3221 _unknown_fields_.Swap(&other->_unknown_fields_);
3222 std::swap(_cached_size_, other->_cached_size_);
3223 }
3224}
3225
3226::google::protobuf::Metadata QTensorProto::GetMetadata() const {
3227 protobuf_AssignDescriptorsOnce();
3228 ::google::protobuf::Metadata metadata;
3229 metadata.descriptor = QTensorProto_descriptor_;
3230 metadata.reflection = QTensorProto_reflection_;
3231 return metadata;
3232}
3233
3234
3235// ===================================================================
3236
3237#ifndef _MSC_VER
3238const int TensorProtos::kProtosFieldNumber;
3239#endif // !_MSC_VER
3240
3241TensorProtos::TensorProtos()
3242 : ::google::protobuf::Message() {
3243 SharedCtor();
3244 // @@protoc_insertion_point(constructor:caffe2.TensorProtos)
3245}
3246
3247void TensorProtos::InitAsDefaultInstance() {
3248}
3249
3250TensorProtos::TensorProtos(const TensorProtos& from)
3251 : ::google::protobuf::Message() {
3252 SharedCtor();
3253 MergeFrom(from);
3254 // @@protoc_insertion_point(copy_constructor:caffe2.TensorProtos)
3255}
3256
3257void TensorProtos::SharedCtor() {
3258 _cached_size_ = 0;
3259 ::memset(_has_bits_, 0, sizeof(_has_bits_));
3260}
3261
3262TensorProtos::~TensorProtos() {
3263 // @@protoc_insertion_point(destructor:caffe2.TensorProtos)
3264 SharedDtor();
3265}
3266
3267void TensorProtos::SharedDtor() {
3268 if (this != default_instance_) {
3269 }
3270}
3271
3272void TensorProtos::SetCachedSize(int size) const {
3273 GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
3274 _cached_size_ = size;
3275 GOOGLE_SAFE_CONCURRENT_WRITES_END();
3276}
3277const ::google::protobuf::Descriptor* TensorProtos::descriptor() {
3278 protobuf_AssignDescriptorsOnce();
3279 return TensorProtos_descriptor_;
3280}
3281
3282const TensorProtos& TensorProtos::default_instance() {
3283 if (default_instance_ == NULL) protobuf_AddDesc_caffe2_2eproto();
3284 return *default_instance_;
3285}
3286
3287TensorProtos* TensorProtos::default_instance_ = NULL;
3288
3289TensorProtos* TensorProtos::New() const {
3290 return new TensorProtos;
3291}
3292
3293void TensorProtos::Clear() {
3294 protos_.Clear();
3295 ::memset(_has_bits_, 0, sizeof(_has_bits_));
3296 mutable_unknown_fields()->Clear();
3297}
3298
3299bool TensorProtos::MergePartialFromCodedStream(
3300 ::google::protobuf::io::CodedInputStream* input) {
3301#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure
3302 ::google::protobuf::uint32 tag;
3303 // @@protoc_insertion_point(parse_start:caffe2.TensorProtos)
3304 for (;;) {
3305 ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);
3306 tag = p.first;
3307 if (!p.second) goto handle_unusual;
3308 switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
3309 // repeated .caffe2.TensorProto protos = 1;
3310 case 1: {
3311 if (tag == 10) {
3312 parse_protos:
3313 DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
3314 input, add_protos()));
3315 } else {
3316 goto handle_unusual;
3317 }
3318 if (input->ExpectTag(10)) goto parse_protos;
3319 if (input->ExpectAtEnd()) goto success;
3320 break;
3321 }
3322
3323 default: {
3324 handle_unusual:
3325 if (tag == 0 ||
3326 ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
3327 ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
3328 goto success;
3329 }
3330 DO_(::google::protobuf::internal::WireFormat::SkipField(
3331 input, tag, mutable_unknown_fields()));
3332 break;
3333 }
3334 }
3335 }
3336success:
3337 // @@protoc_insertion_point(parse_success:caffe2.TensorProtos)
3338 return true;
3339failure:
3340 // @@protoc_insertion_point(parse_failure:caffe2.TensorProtos)
3341 return false;
3342#undef DO_
3343}
3344
3345void TensorProtos::SerializeWithCachedSizes(
3346 ::google::protobuf::io::CodedOutputStream* output) const {
3347 // @@protoc_insertion_point(serialize_start:caffe2.TensorProtos)
3348 // repeated .caffe2.TensorProto protos = 1;
3349 for (int i = 0; i < this->protos_size(); i++) {
3350 ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
3351 1, this->protos(i), output);
3352 }
3353
3354 if (!unknown_fields().empty()) {
3355 ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
3356 unknown_fields(), output);
3357 }
3358 // @@protoc_insertion_point(serialize_end:caffe2.TensorProtos)
3359}
3360
3361::google::protobuf::uint8* TensorProtos::SerializeWithCachedSizesToArray(
3362 ::google::protobuf::uint8* target) const {
3363 // @@protoc_insertion_point(serialize_to_array_start:caffe2.TensorProtos)
3364 // repeated .caffe2.TensorProto protos = 1;
3365 for (int i = 0; i < this->protos_size(); i++) {
3366 target = ::google::protobuf::internal::WireFormatLite::
3367 WriteMessageNoVirtualToArray(
3368 1, this->protos(i), target);
3369 }
3370
3371 if (!unknown_fields().empty()) {
3372 target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
3373 unknown_fields(), target);
3374 }
3375 // @@protoc_insertion_point(serialize_to_array_end:caffe2.TensorProtos)
3376 return target;
3377}
3378
3379int TensorProtos::ByteSize() const {
3380 int total_size = 0;
3381
3382 // repeated .caffe2.TensorProto protos = 1;
3383 total_size += 1 * this->protos_size();
3384 for (int i = 0; i < this->protos_size(); i++) {
3385 total_size +=
3386 ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
3387 this->protos(i));
3388 }
3389
3390 if (!unknown_fields().empty()) {
3391 total_size +=
3392 ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
3393 unknown_fields());
3394 }
3395 GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
3396 _cached_size_ = total_size;
3397 GOOGLE_SAFE_CONCURRENT_WRITES_END();
3398 return total_size;
3399}
3400
3401void TensorProtos::MergeFrom(const ::google::protobuf::Message& from) {
3402 GOOGLE_CHECK_NE(&from, this);
3403 const TensorProtos* source =
3404 ::google::protobuf::internal::dynamic_cast_if_available<const TensorProtos*>(
3405 &from);
3406 if (source == NULL) {
3407 ::google::protobuf::internal::ReflectionOps::Merge(from, this);
3408 } else {
3409 MergeFrom(*source);
3410 }
3411}
3412
3413void TensorProtos::MergeFrom(const TensorProtos& from) {
3414 GOOGLE_CHECK_NE(&from, this);
3415 protos_.MergeFrom(from.protos_);
3416 mutable_unknown_fields()->MergeFrom(from.unknown_fields());
3417}
3418
3419void TensorProtos::CopyFrom(const ::google::protobuf::Message& from) {
3420 if (&from == this) return;
3421 Clear();
3422 MergeFrom(from);
3423}
3424
3425void TensorProtos::CopyFrom(const TensorProtos& from) {
3426 if (&from == this) return;
3427 Clear();
3428 MergeFrom(from);
3429}
3430
3431bool TensorProtos::IsInitialized() const {
3432
3433 if (!::google::protobuf::internal::AllAreInitialized(this->protos())) return false;
3434 return true;
3435}
3436
3437void TensorProtos::Swap(TensorProtos* other) {
3438 if (other != this) {
3439 protos_.Swap(&other->protos_);
3440 std::swap(_has_bits_[0], other->_has_bits_[0]);
3441 _unknown_fields_.Swap(&other->_unknown_fields_);
3442 std::swap(_cached_size_, other->_cached_size_);
3443 }
3444}
3445
3446::google::protobuf::Metadata TensorProtos::GetMetadata() const {
3447 protobuf_AssignDescriptorsOnce();
3448 ::google::protobuf::Metadata metadata;
3449 metadata.descriptor = TensorProtos_descriptor_;
3450 metadata.reflection = TensorProtos_reflection_;
3451 return metadata;
3452}
3453
3454
3455// ===================================================================
3456
3457#ifndef _MSC_VER
3458const int TensorShape::kDimsFieldNumber;
3459const int TensorShape::kDataTypeFieldNumber;
3460const int TensorShape::kUnknownDimsFieldNumber;
3461const int TensorShape::kUnknownShapeFieldNumber;
3462const int TensorShape::kNameFieldNumber;
3463#endif // !_MSC_VER
3464
3465TensorShape::TensorShape()
3466 : ::google::protobuf::Message() {
3467 SharedCtor();
3468 // @@protoc_insertion_point(constructor:caffe2.TensorShape)
3469}
3470
3471void TensorShape::InitAsDefaultInstance() {
3472}
3473
3474TensorShape::TensorShape(const TensorShape& from)
3475 : ::google::protobuf::Message() {
3476 SharedCtor();
3477 MergeFrom(from);
3478 // @@protoc_insertion_point(copy_constructor:caffe2.TensorShape)
3479}
3480
3481void TensorShape::SharedCtor() {
3482 ::google::protobuf::internal::GetEmptyString();
3483 _cached_size_ = 0;
3484 data_type_ = 1;
3485 unknown_shape_ = false;
3486 name_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
3487 ::memset(_has_bits_, 0, sizeof(_has_bits_));
3488}
3489
3490TensorShape::~TensorShape() {
3491 // @@protoc_insertion_point(destructor:caffe2.TensorShape)
3492 SharedDtor();
3493}
3494
3495void TensorShape::SharedDtor() {
3496 if (name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
3497 delete name_;
3498 }
3499 if (this != default_instance_) {
3500 }
3501}
3502
3503void TensorShape::SetCachedSize(int size) const {
3504 GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
3505 _cached_size_ = size;
3506 GOOGLE_SAFE_CONCURRENT_WRITES_END();
3507}
3508const ::google::protobuf::Descriptor* TensorShape::descriptor() {
3509 protobuf_AssignDescriptorsOnce();
3510 return TensorShape_descriptor_;
3511}
3512
3513const TensorShape& TensorShape::default_instance() {
3514 if (default_instance_ == NULL) protobuf_AddDesc_caffe2_2eproto();
3515 return *default_instance_;
3516}
3517
3518TensorShape* TensorShape::default_instance_ = NULL;
3519
3520TensorShape* TensorShape::New() const {
3521 return new TensorShape;
3522}
3523
3524void TensorShape::Clear() {
3525 if (_has_bits_[0 / 32] & 26) {
3526 data_type_ = 1;
3527 unknown_shape_ = false;
3528 if (has_name()) {
3529 if (name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
3530 name_->clear();
3531 }
3532 }
3533 }
3534 dims_.Clear();
3535 unknown_dims_.Clear();
3536 ::memset(_has_bits_, 0, sizeof(_has_bits_));
3537 mutable_unknown_fields()->Clear();
3538}
3539
3540bool TensorShape::MergePartialFromCodedStream(
3541 ::google::protobuf::io::CodedInputStream* input) {
3542#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure
3543 ::google::protobuf::uint32 tag;
3544 // @@protoc_insertion_point(parse_start:caffe2.TensorShape)
3545 for (;;) {
3546 ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);
3547 tag = p.first;
3548 if (!p.second) goto handle_unusual;
3549 switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
3550 // repeated int64 dims = 1;
3551 case 1: {
3552 if (tag == 8) {
3553 parse_dims:
3554 DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive<
3555 ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>(
3556 1, 8, input, this->mutable_dims())));
3557 } else if (tag == 10) {
3558 DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline<
3559 ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>(
3560 input, this->mutable_dims())));
3561 } else {
3562 goto handle_unusual;
3563 }
3564 if (input->ExpectTag(8)) goto parse_dims;
3565 if (input->ExpectTag(16)) goto parse_data_type;
3566 break;
3567 }
3568
3569 // optional .caffe2.TensorProto.DataType data_type = 2 [default = FLOAT];
3570 case 2: {
3571 if (tag == 16) {
3572 parse_data_type:
3573 int value;
3574 DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
3575 int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
3576 input, &value)));
3577 if (::caffe2::TensorProto_DataType_IsValid(value)) {
3578 set_data_type(static_cast< ::caffe2::TensorProto_DataType >(value));
3579 } else {
3580 mutable_unknown_fields()->AddVarint(2, value);
3581 }
3582 } else {
3583 goto handle_unusual;
3584 }
3585 if (input->ExpectTag(24)) goto parse_unknown_dims;
3586 break;
3587 }
3588
3589 // repeated int32 unknown_dims = 3;
3590 case 3: {
3591 if (tag == 24) {
3592 parse_unknown_dims:
3593 DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive<
3594 ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
3595 1, 24, input, this->mutable_unknown_dims())));
3596 } else if (tag == 26) {
3597 DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline<
3598 ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
3599 input, this->mutable_unknown_dims())));
3600 } else {
3601 goto handle_unusual;
3602 }
3603 if (input->ExpectTag(24)) goto parse_unknown_dims;
3604 if (input->ExpectTag(32)) goto parse_unknown_shape;
3605 break;
3606 }
3607
3608 // optional bool unknown_shape = 4 [default = false];
3609 case 4: {
3610 if (tag == 32) {
3611 parse_unknown_shape:
3612 DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
3613 bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
3614 input, &unknown_shape_)));
3615 set_has_unknown_shape();
3616 } else {
3617 goto handle_unusual;
3618 }
3619 if (input->ExpectTag(42)) goto parse_name;
3620 break;
3621 }
3622
3623 // optional string name = 5;
3624 case 5: {
3625 if (tag == 42) {
3626 parse_name:
3627 DO_(::google::protobuf::internal::WireFormatLite::ReadString(
3628 input, this->mutable_name()));
3629 ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
3630 this->name().data(), this->name().length(),
3631 ::google::protobuf::internal::WireFormat::PARSE,
3632 "name");
3633 } else {
3634 goto handle_unusual;
3635 }
3636 if (input->ExpectAtEnd()) goto success;
3637 break;
3638 }
3639
3640 default: {
3641 handle_unusual:
3642 if (tag == 0 ||
3643 ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
3644 ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
3645 goto success;
3646 }
3647 DO_(::google::protobuf::internal::WireFormat::SkipField(
3648 input, tag, mutable_unknown_fields()));
3649 break;
3650 }
3651 }
3652 }
3653success:
3654 // @@protoc_insertion_point(parse_success:caffe2.TensorShape)
3655 return true;
3656failure:
3657 // @@protoc_insertion_point(parse_failure:caffe2.TensorShape)
3658 return false;
3659#undef DO_
3660}
3661
3662void TensorShape::SerializeWithCachedSizes(
3663 ::google::protobuf::io::CodedOutputStream* output) const {
3664 // @@protoc_insertion_point(serialize_start:caffe2.TensorShape)
3665 // repeated int64 dims = 1;
3666 for (int i = 0; i < this->dims_size(); i++) {
3667 ::google::protobuf::internal::WireFormatLite::WriteInt64(
3668 1, this->dims(i), output);
3669 }
3670
3671 // optional .caffe2.TensorProto.DataType data_type = 2 [default = FLOAT];
3672 if (has_data_type()) {
3673 ::google::protobuf::internal::WireFormatLite::WriteEnum(
3674 2, this->data_type(), output);
3675 }
3676
3677 // repeated int32 unknown_dims = 3;
3678 for (int i = 0; i < this->unknown_dims_size(); i++) {
3679 ::google::protobuf::internal::WireFormatLite::WriteInt32(
3680 3, this->unknown_dims(i), output);
3681 }
3682
3683 // optional bool unknown_shape = 4 [default = false];
3684 if (has_unknown_shape()) {
3685 ::google::protobuf::internal::WireFormatLite::WriteBool(4, this->unknown_shape(), output);
3686 }
3687
3688 // optional string name = 5;
3689 if (has_name()) {
3690 ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
3691 this->name().data(), this->name().length(),
3692 ::google::protobuf::internal::WireFormat::SERIALIZE,
3693 "name");
3694 ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
3695 5, this->name(), output);
3696 }
3697
3698 if (!unknown_fields().empty()) {
3699 ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
3700 unknown_fields(), output);
3701 }
3702 // @@protoc_insertion_point(serialize_end:caffe2.TensorShape)
3703}
3704
3705::google::protobuf::uint8* TensorShape::SerializeWithCachedSizesToArray(
3706 ::google::protobuf::uint8* target) const {
3707 // @@protoc_insertion_point(serialize_to_array_start:caffe2.TensorShape)
3708 // repeated int64 dims = 1;
3709 for (int i = 0; i < this->dims_size(); i++) {
3710 target = ::google::protobuf::internal::WireFormatLite::
3711 WriteInt64ToArray(1, this->dims(i), target);
3712 }
3713
3714 // optional .caffe2.TensorProto.DataType data_type = 2 [default = FLOAT];
3715 if (has_data_type()) {
3716 target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
3717 2, this->data_type(), target);
3718 }
3719
3720 // repeated int32 unknown_dims = 3;
3721 for (int i = 0; i < this->unknown_dims_size(); i++) {
3722 target = ::google::protobuf::internal::WireFormatLite::
3723 WriteInt32ToArray(3, this->unknown_dims(i), target);
3724 }
3725
3726 // optional bool unknown_shape = 4 [default = false];
3727 if (has_unknown_shape()) {
3728 target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(4, this->unknown_shape(), target);
3729 }
3730
3731 // optional string name = 5;
3732 if (has_name()) {
3733 ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
3734 this->name().data(), this->name().length(),
3735 ::google::protobuf::internal::WireFormat::SERIALIZE,
3736 "name");
3737 target =
3738 ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
3739 5, this->name(), target);
3740 }
3741
3742 if (!unknown_fields().empty()) {
3743 target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
3744 unknown_fields(), target);
3745 }
3746 // @@protoc_insertion_point(serialize_to_array_end:caffe2.TensorShape)
3747 return target;
3748}
3749
3750int TensorShape::ByteSize() const {
3751 int total_size = 0;
3752
3753 if (_has_bits_[1 / 32] & (0xffu << (1 % 32))) {
3754 // optional .caffe2.TensorProto.DataType data_type = 2 [default = FLOAT];
3755 if (has_data_type()) {
3756 total_size += 1 +
3757 ::google::protobuf::internal::WireFormatLite::EnumSize(this->data_type());
3758 }
3759
3760 // optional bool unknown_shape = 4 [default = false];
3761 if (has_unknown_shape()) {
3762 total_size += 1 + 1;
3763 }
3764
3765 // optional string name = 5;
3766 if (has_name()) {
3767 total_size += 1 +
3768 ::google::protobuf::internal::WireFormatLite::StringSize(
3769 this->name());
3770 }
3771
3772 }
3773 // repeated int64 dims = 1;
3774 {
3775 int data_size = 0;
3776 for (int i = 0; i < this->dims_size(); i++) {
3777 data_size += ::google::protobuf::internal::WireFormatLite::
3778 Int64Size(this->dims(i));
3779 }
3780 total_size += 1 * this->dims_size() + data_size;
3781 }
3782
3783 // repeated int32 unknown_dims = 3;
3784 {
3785 int data_size = 0;
3786 for (int i = 0; i < this->unknown_dims_size(); i++) {
3787 data_size += ::google::protobuf::internal::WireFormatLite::
3788 Int32Size(this->unknown_dims(i));
3789 }
3790 total_size += 1 * this->unknown_dims_size() + data_size;
3791 }
3792
3793 if (!unknown_fields().empty()) {
3794 total_size +=
3795 ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
3796 unknown_fields());
3797 }
3798 GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
3799 _cached_size_ = total_size;
3800 GOOGLE_SAFE_CONCURRENT_WRITES_END();
3801 return total_size;
3802}
3803
3804void TensorShape::MergeFrom(const ::google::protobuf::Message& from) {
3805 GOOGLE_CHECK_NE(&from, this);
3806 const TensorShape* source =
3807 ::google::protobuf::internal::dynamic_cast_if_available<const TensorShape*>(
3808 &from);
3809 if (source == NULL) {
3810 ::google::protobuf::internal::ReflectionOps::Merge(from, this);
3811 } else {
3812 MergeFrom(*source);
3813 }
3814}
3815
3816void TensorShape::MergeFrom(const TensorShape& from) {
3817 GOOGLE_CHECK_NE(&from, this);
3818 dims_.MergeFrom(from.dims_);
3819 unknown_dims_.MergeFrom(from.unknown_dims_);
3820 if (from._has_bits_[1 / 32] & (0xffu << (1 % 32))) {
3821 if (from.has_data_type()) {
3822 set_data_type(from.data_type());
3823 }
3824 if (from.has_unknown_shape()) {
3825 set_unknown_shape(from.unknown_shape());
3826 }
3827 if (from.has_name()) {
3828 set_name(from.name());
3829 }
3830 }
3831 mutable_unknown_fields()->MergeFrom(from.unknown_fields());
3832}
3833
3834void TensorShape::CopyFrom(const ::google::protobuf::Message& from) {
3835 if (&from == this) return;
3836 Clear();
3837 MergeFrom(from);
3838}
3839
3840void TensorShape::CopyFrom(const TensorShape& from) {
3841 if (&from == this) return;
3842 Clear();
3843 MergeFrom(from);
3844}
3845
3846bool TensorShape::IsInitialized() const {
3847
3848 return true;
3849}
3850
3851void TensorShape::Swap(TensorShape* other) {
3852 if (other != this) {
3853 dims_.Swap(&other->dims_);
3854 std::swap(data_type_, other->data_type_);
3855 unknown_dims_.Swap(&other->unknown_dims_);
3856 std::swap(unknown_shape_, other->unknown_shape_);
3857 std::swap(name_, other->name_);
3858 std::swap(_has_bits_[0], other->_has_bits_[0]);
3859 _unknown_fields_.Swap(&other->_unknown_fields_);
3860 std::swap(_cached_size_, other->_cached_size_);
3861 }
3862}
3863
3864::google::protobuf::Metadata TensorShape::GetMetadata() const {
3865 protobuf_AssignDescriptorsOnce();
3866 ::google::protobuf::Metadata metadata;
3867 metadata.descriptor = TensorShape_descriptor_;
3868 metadata.reflection = TensorShape_reflection_;
3869 return metadata;
3870}
3871
3872
3873// ===================================================================
3874
3875#ifndef _MSC_VER
3876const int TensorShapes::kShapesFieldNumber;
3877#endif // !_MSC_VER
3878
3879TensorShapes::TensorShapes()
3880 : ::google::protobuf::Message() {
3881 SharedCtor();
3882 // @@protoc_insertion_point(constructor:caffe2.TensorShapes)
3883}
3884
3885void TensorShapes::InitAsDefaultInstance() {
3886}
3887
3888TensorShapes::TensorShapes(const TensorShapes& from)
3889 : ::google::protobuf::Message() {
3890 SharedCtor();
3891 MergeFrom(from);
3892 // @@protoc_insertion_point(copy_constructor:caffe2.TensorShapes)
3893}
3894
3895void TensorShapes::SharedCtor() {
3896 _cached_size_ = 0;
3897 ::memset(_has_bits_, 0, sizeof(_has_bits_));
3898}
3899
3900TensorShapes::~TensorShapes() {
3901 // @@protoc_insertion_point(destructor:caffe2.TensorShapes)
3902 SharedDtor();
3903}
3904
3905void TensorShapes::SharedDtor() {
3906 if (this != default_instance_) {
3907 }
3908}
3909
3910void TensorShapes::SetCachedSize(int size) const {
3911 GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
3912 _cached_size_ = size;
3913 GOOGLE_SAFE_CONCURRENT_WRITES_END();
3914}
3915const ::google::protobuf::Descriptor* TensorShapes::descriptor() {
3916 protobuf_AssignDescriptorsOnce();
3917 return TensorShapes_descriptor_;
3918}
3919
3920const TensorShapes& TensorShapes::default_instance() {
3921 if (default_instance_ == NULL) protobuf_AddDesc_caffe2_2eproto();
3922 return *default_instance_;
3923}
3924
3925TensorShapes* TensorShapes::default_instance_ = NULL;
3926
3927TensorShapes* TensorShapes::New() const {
3928 return new TensorShapes;
3929}
3930
3931void TensorShapes::Clear() {
3932 shapes_.Clear();
3933 ::memset(_has_bits_, 0, sizeof(_has_bits_));
3934 mutable_unknown_fields()->Clear();
3935}
3936
3937bool TensorShapes::MergePartialFromCodedStream(
3938 ::google::protobuf::io::CodedInputStream* input) {
3939#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure
3940 ::google::protobuf::uint32 tag;
3941 // @@protoc_insertion_point(parse_start:caffe2.TensorShapes)
3942 for (;;) {
3943 ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);
3944 tag = p.first;
3945 if (!p.second) goto handle_unusual;
3946 switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
3947 // repeated .caffe2.TensorShape shapes = 1;
3948 case 1: {
3949 if (tag == 10) {
3950 parse_shapes:
3951 DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
3952 input, add_shapes()));
3953 } else {
3954 goto handle_unusual;
3955 }
3956 if (input->ExpectTag(10)) goto parse_shapes;
3957 if (input->ExpectAtEnd()) goto success;
3958 break;
3959 }
3960
3961 default: {
3962 handle_unusual:
3963 if (tag == 0 ||
3964 ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
3965 ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
3966 goto success;
3967 }
3968 DO_(::google::protobuf::internal::WireFormat::SkipField(
3969 input, tag, mutable_unknown_fields()));
3970 break;
3971 }
3972 }
3973 }
3974success:
3975 // @@protoc_insertion_point(parse_success:caffe2.TensorShapes)
3976 return true;
3977failure:
3978 // @@protoc_insertion_point(parse_failure:caffe2.TensorShapes)
3979 return false;
3980#undef DO_
3981}
3982
3983void TensorShapes::SerializeWithCachedSizes(
3984 ::google::protobuf::io::CodedOutputStream* output) const {
3985 // @@protoc_insertion_point(serialize_start:caffe2.TensorShapes)
3986 // repeated .caffe2.TensorShape shapes = 1;
3987 for (int i = 0; i < this->shapes_size(); i++) {
3988 ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
3989 1, this->shapes(i), output);
3990 }
3991
3992 if (!unknown_fields().empty()) {
3993 ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
3994 unknown_fields(), output);
3995 }
3996 // @@protoc_insertion_point(serialize_end:caffe2.TensorShapes)
3997}
3998
3999::google::protobuf::uint8* TensorShapes::SerializeWithCachedSizesToArray(
4000 ::google::protobuf::uint8* target) const {
4001 // @@protoc_insertion_point(serialize_to_array_start:caffe2.TensorShapes)
4002 // repeated .caffe2.TensorShape shapes = 1;
4003 for (int i = 0; i < this->shapes_size(); i++) {
4004 target = ::google::protobuf::internal::WireFormatLite::
4005 WriteMessageNoVirtualToArray(
4006 1, this->shapes(i), target);
4007 }
4008
4009 if (!unknown_fields().empty()) {
4010 target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
4011 unknown_fields(), target);
4012 }
4013 // @@protoc_insertion_point(serialize_to_array_end:caffe2.TensorShapes)
4014 return target;
4015}
4016
4017int TensorShapes::ByteSize() const {
4018 int total_size = 0;
4019
4020 // repeated .caffe2.TensorShape shapes = 1;
4021 total_size += 1 * this->shapes_size();
4022 for (int i = 0; i < this->shapes_size(); i++) {
4023 total_size +=
4024 ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
4025 this->shapes(i));
4026 }
4027
4028 if (!unknown_fields().empty()) {
4029 total_size +=
4030 ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
4031 unknown_fields());
4032 }
4033 GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
4034 _cached_size_ = total_size;
4035 GOOGLE_SAFE_CONCURRENT_WRITES_END();
4036 return total_size;
4037}
4038
4039void TensorShapes::MergeFrom(const ::google::protobuf::Message& from) {
4040 GOOGLE_CHECK_NE(&from, this);
4041 const TensorShapes* source =
4042 ::google::protobuf::internal::dynamic_cast_if_available<const TensorShapes*>(
4043 &from);
4044 if (source == NULL) {
4045 ::google::protobuf::internal::ReflectionOps::Merge(from, this);
4046 } else {
4047 MergeFrom(*source);
4048 }
4049}
4050
4051void TensorShapes::MergeFrom(const TensorShapes& from) {
4052 GOOGLE_CHECK_NE(&from, this);
4053 shapes_.MergeFrom(from.shapes_);
4054 mutable_unknown_fields()->MergeFrom(from.unknown_fields());
4055}
4056
4057void TensorShapes::CopyFrom(const ::google::protobuf::Message& from) {
4058 if (&from == this) return;
4059 Clear();
4060 MergeFrom(from);
4061}
4062
4063void TensorShapes::CopyFrom(const TensorShapes& from) {
4064 if (&from == this) return;
4065 Clear();
4066 MergeFrom(from);
4067}
4068
4069bool TensorShapes::IsInitialized() const {
4070
4071 return true;
4072}
4073
4074void TensorShapes::Swap(TensorShapes* other) {
4075 if (other != this) {
4076 shapes_.Swap(&other->shapes_);
4077 std::swap(_has_bits_[0], other->_has_bits_[0]);
4078 _unknown_fields_.Swap(&other->_unknown_fields_);
4079 std::swap(_cached_size_, other->_cached_size_);
4080 }
4081}
4082
4083::google::protobuf::Metadata TensorShapes::GetMetadata() const {
4084 protobuf_AssignDescriptorsOnce();
4085 ::google::protobuf::Metadata metadata;
4086 metadata.descriptor = TensorShapes_descriptor_;
4087 metadata.reflection = TensorShapes_reflection_;
4088 return metadata;
4089}
4090
4091
4092// ===================================================================
4093
4094const ::google::protobuf::EnumDescriptor* TensorBoundShape_DimType_descriptor() {
4095 protobuf_AssignDescriptorsOnce();
4096 return TensorBoundShape_DimType_descriptor_;
4097}
4098bool TensorBoundShape_DimType_IsValid(int value) {
4099 switch(value) {
4100 case 0:
4101 case 1:
4102 case 2:
4103 case 3:
4104 case 4:
4105 case 5:
4106 case 6:
4107 return true;
4108 default:
4109 return false;
4110 }
4111}
4112
4113#ifndef _MSC_VER
4114const TensorBoundShape_DimType TensorBoundShape::UNKNOWN;
4115const TensorBoundShape_DimType TensorBoundShape::CONSTANT;
4116const TensorBoundShape_DimType TensorBoundShape::BATCH;
4117const TensorBoundShape_DimType TensorBoundShape::BATCH_OF_FEATURE_MAX;
4118const TensorBoundShape_DimType TensorBoundShape::BATCH_OF_FEATURE_MAX_DEFAULT;
4119const TensorBoundShape_DimType TensorBoundShape::FEATURE_MAX;
4120const TensorBoundShape_DimType TensorBoundShape::FEATURE_MAX_DEFAULT;
4121const TensorBoundShape_DimType TensorBoundShape::DimType_MIN;
4122const TensorBoundShape_DimType TensorBoundShape::DimType_MAX;
4123const int TensorBoundShape::DimType_ARRAYSIZE;
4124#endif // _MSC_VER
4125#ifndef _MSC_VER
4126const int TensorBoundShape::kShapeFieldNumber;
4127const int TensorBoundShape::kDimTypeFieldNumber;
4128const int TensorBoundShape::kNameFieldNumber;
4129#endif // !_MSC_VER
4130
4131TensorBoundShape::TensorBoundShape()
4132 : ::google::protobuf::Message() {
4133 SharedCtor();
4134 // @@protoc_insertion_point(constructor:caffe2.TensorBoundShape)
4135}
4136
4137void TensorBoundShape::InitAsDefaultInstance() {
4138 shape_ = const_cast< ::caffe2::TensorShape*>(&::caffe2::TensorShape::default_instance());
4139}
4140
4141TensorBoundShape::TensorBoundShape(const TensorBoundShape& from)
4142 : ::google::protobuf::Message() {
4143 SharedCtor();
4144 MergeFrom(from);
4145 // @@protoc_insertion_point(copy_constructor:caffe2.TensorBoundShape)
4146}
4147
4148void TensorBoundShape::SharedCtor() {
4149 ::google::protobuf::internal::GetEmptyString();
4150 _cached_size_ = 0;
4151 shape_ = NULL;
4152 name_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
4153 ::memset(_has_bits_, 0, sizeof(_has_bits_));
4154}
4155
4156TensorBoundShape::~TensorBoundShape() {
4157 // @@protoc_insertion_point(destructor:caffe2.TensorBoundShape)
4158 SharedDtor();
4159}
4160
4161void TensorBoundShape::SharedDtor() {
4162 if (name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
4163 delete name_;
4164 }
4165 if (this != default_instance_) {
4166 delete shape_;
4167 }
4168}
4169
4170void TensorBoundShape::SetCachedSize(int size) const {
4171 GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
4172 _cached_size_ = size;
4173 GOOGLE_SAFE_CONCURRENT_WRITES_END();
4174}
4175const ::google::protobuf::Descriptor* TensorBoundShape::descriptor() {
4176 protobuf_AssignDescriptorsOnce();
4177 return TensorBoundShape_descriptor_;
4178}
4179
4180const TensorBoundShape& TensorBoundShape::default_instance() {
4181 if (default_instance_ == NULL) protobuf_AddDesc_caffe2_2eproto();
4182 return *default_instance_;
4183}
4184
4185TensorBoundShape* TensorBoundShape::default_instance_ = NULL;
4186
4187TensorBoundShape* TensorBoundShape::New() const {
4188 return new TensorBoundShape;
4189}
4190
4191void TensorBoundShape::Clear() {
4192 if (_has_bits_[0 / 32] & 5) {
4193 if (has_shape()) {
4194 if (shape_ != NULL) shape_->::caffe2::TensorShape::Clear();
4195 }
4196 if (has_name()) {
4197 if (name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
4198 name_->clear();
4199 }
4200 }
4201 }
4202 dim_type_.Clear();
4203 ::memset(_has_bits_, 0, sizeof(_has_bits_));
4204 mutable_unknown_fields()->Clear();
4205}
4206
4207bool TensorBoundShape::MergePartialFromCodedStream(
4208 ::google::protobuf::io::CodedInputStream* input) {
4209#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure
4210 ::google::protobuf::uint32 tag;
4211 // @@protoc_insertion_point(parse_start:caffe2.TensorBoundShape)
4212 for (;;) {
4213 ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);
4214 tag = p.first;
4215 if (!p.second) goto handle_unusual;
4216 switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
4217 // optional .caffe2.TensorShape shape = 1;
4218 case 1: {
4219 if (tag == 10) {
4220 DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
4221 input, mutable_shape()));
4222 } else {
4223 goto handle_unusual;
4224 }
4225 if (input->ExpectTag(16)) goto parse_dim_type;
4226 break;
4227 }
4228
4229 // repeated .caffe2.TensorBoundShape.DimType dim_type = 2;
4230 case 2: {
4231 if (tag == 16) {
4232 parse_dim_type:
4233 int value;
4234 DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
4235 int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
4236 input, &value)));
4237 if (::caffe2::TensorBoundShape_DimType_IsValid(value)) {
4238 add_dim_type(static_cast< ::caffe2::TensorBoundShape_DimType >(value));
4239 } else {
4240 mutable_unknown_fields()->AddVarint(2, value);
4241 }
4242 } else if (tag == 18) {
4243 DO_((::google::protobuf::internal::WireFormatLite::ReadPackedEnumNoInline(
4244 input,
4245 &::caffe2::TensorBoundShape_DimType_IsValid,
4246 this->mutable_dim_type())));
4247 } else {
4248 goto handle_unusual;
4249 }
4250 if (input->ExpectTag(16)) goto parse_dim_type;
4251 if (input->ExpectTag(26)) goto parse_name;
4252 break;
4253 }
4254
4255 // optional string name = 3;
4256 case 3: {
4257 if (tag == 26) {
4258 parse_name:
4259 DO_(::google::protobuf::internal::WireFormatLite::ReadString(
4260 input, this->mutable_name()));
4261 ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
4262 this->name().data(), this->name().length(),
4263 ::google::protobuf::internal::WireFormat::PARSE,
4264 "name");
4265 } else {
4266 goto handle_unusual;
4267 }
4268 if (input->ExpectAtEnd()) goto success;
4269 break;
4270 }
4271
4272 default: {
4273 handle_unusual:
4274 if (tag == 0 ||
4275 ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
4276 ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
4277 goto success;
4278 }
4279 DO_(::google::protobuf::internal::WireFormat::SkipField(
4280 input, tag, mutable_unknown_fields()));
4281 break;
4282 }
4283 }
4284 }
4285success:
4286 // @@protoc_insertion_point(parse_success:caffe2.TensorBoundShape)
4287 return true;
4288failure:
4289 // @@protoc_insertion_point(parse_failure:caffe2.TensorBoundShape)
4290 return false;
4291#undef DO_
4292}
4293
4294void TensorBoundShape::SerializeWithCachedSizes(
4295 ::google::protobuf::io::CodedOutputStream* output) const {
4296 // @@protoc_insertion_point(serialize_start:caffe2.TensorBoundShape)
4297 // optional .caffe2.TensorShape shape = 1;
4298 if (has_shape()) {
4299 ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
4300 1, this->shape(), output);
4301 }
4302
4303 // repeated .caffe2.TensorBoundShape.DimType dim_type = 2;
4304 for (int i = 0; i < this->dim_type_size(); i++) {
4305 ::google::protobuf::internal::WireFormatLite::WriteEnum(
4306 2, this->dim_type(i), output);
4307 }
4308
4309 // optional string name = 3;
4310 if (has_name()) {
4311 ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
4312 this->name().data(), this->name().length(),
4313 ::google::protobuf::internal::WireFormat::SERIALIZE,
4314 "name");
4315 ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
4316 3, this->name(), output);
4317 }
4318
4319 if (!unknown_fields().empty()) {
4320 ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
4321 unknown_fields(), output);
4322 }
4323 // @@protoc_insertion_point(serialize_end:caffe2.TensorBoundShape)
4324}
4325
4326::google::protobuf::uint8* TensorBoundShape::SerializeWithCachedSizesToArray(
4327 ::google::protobuf::uint8* target) const {
4328 // @@protoc_insertion_point(serialize_to_array_start:caffe2.TensorBoundShape)
4329 // optional .caffe2.TensorShape shape = 1;
4330 if (has_shape()) {
4331 target = ::google::protobuf::internal::WireFormatLite::
4332 WriteMessageNoVirtualToArray(
4333 1, this->shape(), target);
4334 }
4335
4336 // repeated .caffe2.TensorBoundShape.DimType dim_type = 2;
4337 for (int i = 0; i < this->dim_type_size(); i++) {
4338 target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
4339 2, this->dim_type(i), target);
4340 }
4341
4342 // optional string name = 3;
4343 if (has_name()) {
4344 ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
4345 this->name().data(), this->name().length(),
4346 ::google::protobuf::internal::WireFormat::SERIALIZE,
4347 "name");
4348 target =
4349 ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
4350 3, this->name(), target);
4351 }
4352
4353 if (!unknown_fields().empty()) {
4354 target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
4355 unknown_fields(), target);
4356 }
4357 // @@protoc_insertion_point(serialize_to_array_end:caffe2.TensorBoundShape)
4358 return target;
4359}
4360
4361int TensorBoundShape::ByteSize() const {
4362 int total_size = 0;
4363
4364 if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
4365 // optional .caffe2.TensorShape shape = 1;
4366 if (has_shape()) {
4367 total_size += 1 +
4368 ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
4369 this->shape());
4370 }
4371
4372 // optional string name = 3;
4373 if (has_name()) {
4374 total_size += 1 +
4375 ::google::protobuf::internal::WireFormatLite::StringSize(
4376 this->name());
4377 }
4378
4379 }
4380 // repeated .caffe2.TensorBoundShape.DimType dim_type = 2;
4381 {
4382 int data_size = 0;
4383 for (int i = 0; i < this->dim_type_size(); i++) {
4384 data_size += ::google::protobuf::internal::WireFormatLite::EnumSize(
4385 this->dim_type(i));
4386 }
4387 total_size += 1 * this->dim_type_size() + data_size;
4388 }
4389
4390 if (!unknown_fields().empty()) {
4391 total_size +=
4392 ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
4393 unknown_fields());
4394 }
4395 GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
4396 _cached_size_ = total_size;
4397 GOOGLE_SAFE_CONCURRENT_WRITES_END();
4398 return total_size;
4399}
4400
4401void TensorBoundShape::MergeFrom(const ::google::protobuf::Message& from) {
4402 GOOGLE_CHECK_NE(&from, this);
4403 const TensorBoundShape* source =
4404 ::google::protobuf::internal::dynamic_cast_if_available<const TensorBoundShape*>(
4405 &from);
4406 if (source == NULL) {
4407 ::google::protobuf::internal::ReflectionOps::Merge(from, this);
4408 } else {
4409 MergeFrom(*source);
4410 }
4411}
4412
4413void TensorBoundShape::MergeFrom(const TensorBoundShape& from) {
4414 GOOGLE_CHECK_NE(&from, this);
4415 dim_type_.MergeFrom(from.dim_type_);
4416 if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
4417 if (from.has_shape()) {
4418 mutable_shape()->::caffe2::TensorShape::MergeFrom(from.shape());
4419 }
4420 if (from.has_name()) {
4421 set_name(from.name());
4422 }
4423 }
4424 mutable_unknown_fields()->MergeFrom(from.unknown_fields());
4425}
4426
4427void TensorBoundShape::CopyFrom(const ::google::protobuf::Message& from) {
4428 if (&from == this) return;
4429 Clear();
4430 MergeFrom(from);
4431}
4432
4433void TensorBoundShape::CopyFrom(const TensorBoundShape& from) {
4434 if (&from == this) return;
4435 Clear();
4436 MergeFrom(from);
4437}
4438
4439bool TensorBoundShape::IsInitialized() const {
4440
4441 return true;
4442}
4443
4444void TensorBoundShape::Swap(TensorBoundShape* other) {
4445 if (other != this) {
4446 std::swap(shape_, other->shape_);
4447 dim_type_.Swap(&other->dim_type_);
4448 std::swap(name_, other->name_);
4449 std::swap(_has_bits_[0], other->_has_bits_[0]);
4450 _unknown_fields_.Swap(&other->_unknown_fields_);
4451 std::swap(_cached_size_, other->_cached_size_);
4452 }
4453}
4454
4455::google::protobuf::Metadata TensorBoundShape::GetMetadata() const {
4456 protobuf_AssignDescriptorsOnce();
4457 ::google::protobuf::Metadata metadata;
4458 metadata.descriptor = TensorBoundShape_descriptor_;
4459 metadata.reflection = TensorBoundShape_reflection_;
4460 return metadata;
4461}
4462
4463
4464// ===================================================================
4465
4466#ifndef _MSC_VER
4467const int TensorBoundShapes::kShapesFieldNumber;
4468const int TensorBoundShapes::kMaxBatchSizeFieldNumber;
4469const int TensorBoundShapes::kMaxFeatureLenFieldNumber;
4470#endif // !_MSC_VER
4471
4472TensorBoundShapes::TensorBoundShapes()
4473 : ::google::protobuf::Message() {
4474 SharedCtor();
4475 // @@protoc_insertion_point(constructor:caffe2.TensorBoundShapes)
4476}
4477
4478void TensorBoundShapes::InitAsDefaultInstance() {
4479}
4480
4481TensorBoundShapes::TensorBoundShapes(const TensorBoundShapes& from)
4482 : ::google::protobuf::Message() {
4483 SharedCtor();
4484 MergeFrom(from);
4485 // @@protoc_insertion_point(copy_constructor:caffe2.TensorBoundShapes)
4486}
4487
4488void TensorBoundShapes::SharedCtor() {
4489 _cached_size_ = 0;
4490 max_batch_size_ = GOOGLE_LONGLONG(0);
4491 max_feature_len_ = GOOGLE_LONGLONG(0);
4492 ::memset(_has_bits_, 0, sizeof(_has_bits_));
4493}
4494
4495TensorBoundShapes::~TensorBoundShapes() {
4496 // @@protoc_insertion_point(destructor:caffe2.TensorBoundShapes)
4497 SharedDtor();
4498}
4499
4500void TensorBoundShapes::SharedDtor() {
4501 if (this != default_instance_) {
4502 }
4503}
4504
4505void TensorBoundShapes::SetCachedSize(int size) const {
4506 GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
4507 _cached_size_ = size;
4508 GOOGLE_SAFE_CONCURRENT_WRITES_END();
4509}
4510const ::google::protobuf::Descriptor* TensorBoundShapes::descriptor() {
4511 protobuf_AssignDescriptorsOnce();
4512 return TensorBoundShapes_descriptor_;
4513}
4514
4515const TensorBoundShapes& TensorBoundShapes::default_instance() {
4516 if (default_instance_ == NULL) protobuf_AddDesc_caffe2_2eproto();
4517 return *default_instance_;
4518}
4519
4520TensorBoundShapes* TensorBoundShapes::default_instance_ = NULL;
4521
4522TensorBoundShapes* TensorBoundShapes::New() const {
4523 return new TensorBoundShapes;
4524}
4525
4526void TensorBoundShapes::Clear() {
4527#define OFFSET_OF_FIELD_(f) (reinterpret_cast<char*>( \
4528 &reinterpret_cast<TensorBoundShapes*>(16)->f) - \
4529 reinterpret_cast<char*>(16))
4530
4531#define ZR_(first, last) do { \
4532 size_t f = OFFSET_OF_FIELD_(first); \
4533 size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \
4534 ::memset(&first, 0, n); \
4535 } while (0)
4536
4537 ZR_(max_batch_size_, max_feature_len_);
4538
4539#undef OFFSET_OF_FIELD_
4540#undef ZR_
4541
4542 shapes_.Clear();
4543 ::memset(_has_bits_, 0, sizeof(_has_bits_));
4544 mutable_unknown_fields()->Clear();
4545}
4546
4547bool TensorBoundShapes::MergePartialFromCodedStream(
4548 ::google::protobuf::io::CodedInputStream* input) {
4549#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure
4550 ::google::protobuf::uint32 tag;
4551 // @@protoc_insertion_point(parse_start:caffe2.TensorBoundShapes)
4552 for (;;) {
4553 ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);
4554 tag = p.first;
4555 if (!p.second) goto handle_unusual;
4556 switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
4557 // repeated .caffe2.TensorBoundShape shapes = 1;
4558 case 1: {
4559 if (tag == 10) {
4560 parse_shapes:
4561 DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
4562 input, add_shapes()));
4563 } else {
4564 goto handle_unusual;
4565 }
4566 if (input->ExpectTag(10)) goto parse_shapes;
4567 if (input->ExpectTag(16)) goto parse_max_batch_size;
4568 break;
4569 }
4570
4571 // optional int64 max_batch_size = 2;
4572 case 2: {
4573 if (tag == 16) {
4574 parse_max_batch_size:
4575 DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
4576 ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>(
4577 input, &max_batch_size_)));
4578 set_has_max_batch_size();
4579 } else {
4580 goto handle_unusual;
4581 }
4582 if (input->ExpectTag(24)) goto parse_max_feature_len;
4583 break;
4584 }
4585
4586 // optional int64 max_feature_len = 3;
4587 case 3: {
4588 if (tag == 24) {
4589 parse_max_feature_len:
4590 DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
4591 ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>(
4592 input, &max_feature_len_)));
4593 set_has_max_feature_len();
4594 } else {
4595 goto handle_unusual;
4596 }
4597 if (input->ExpectAtEnd()) goto success;
4598 break;
4599 }
4600
4601 default: {
4602 handle_unusual:
4603 if (tag == 0 ||
4604 ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
4605 ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
4606 goto success;
4607 }
4608 DO_(::google::protobuf::internal::WireFormat::SkipField(
4609 input, tag, mutable_unknown_fields()));
4610 break;
4611 }
4612 }
4613 }
4614success:
4615 // @@protoc_insertion_point(parse_success:caffe2.TensorBoundShapes)
4616 return true;
4617failure:
4618 // @@protoc_insertion_point(parse_failure:caffe2.TensorBoundShapes)
4619 return false;
4620#undef DO_
4621}
4622
4623void TensorBoundShapes::SerializeWithCachedSizes(
4624 ::google::protobuf::io::CodedOutputStream* output) const {
4625 // @@protoc_insertion_point(serialize_start:caffe2.TensorBoundShapes)
4626 // repeated .caffe2.TensorBoundShape shapes = 1;
4627 for (int i = 0; i < this->shapes_size(); i++) {
4628 ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
4629 1, this->shapes(i), output);
4630 }
4631
4632 // optional int64 max_batch_size = 2;
4633 if (has_max_batch_size()) {
4634 ::google::protobuf::internal::WireFormatLite::WriteInt64(2, this->max_batch_size(), output);
4635 }
4636
4637 // optional int64 max_feature_len = 3;
4638 if (has_max_feature_len()) {
4639 ::google::protobuf::internal::WireFormatLite::WriteInt64(3, this->max_feature_len(), output);
4640 }
4641
4642 if (!unknown_fields().empty()) {
4643 ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
4644 unknown_fields(), output);
4645 }
4646 // @@protoc_insertion_point(serialize_end:caffe2.TensorBoundShapes)
4647}
4648
4649::google::protobuf::uint8* TensorBoundShapes::SerializeWithCachedSizesToArray(
4650 ::google::protobuf::uint8* target) const {
4651 // @@protoc_insertion_point(serialize_to_array_start:caffe2.TensorBoundShapes)
4652 // repeated .caffe2.TensorBoundShape shapes = 1;
4653 for (int i = 0; i < this->shapes_size(); i++) {
4654 target = ::google::protobuf::internal::WireFormatLite::
4655 WriteMessageNoVirtualToArray(
4656 1, this->shapes(i), target);
4657 }
4658
4659 // optional int64 max_batch_size = 2;
4660 if (has_max_batch_size()) {
4661 target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(2, this->max_batch_size(), target);
4662 }
4663
4664 // optional int64 max_feature_len = 3;
4665 if (has_max_feature_len()) {
4666 target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(3, this->max_feature_len(), target);
4667 }
4668
4669 if (!unknown_fields().empty()) {
4670 target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
4671 unknown_fields(), target);
4672 }
4673 // @@protoc_insertion_point(serialize_to_array_end:caffe2.TensorBoundShapes)
4674 return target;
4675}
4676
4677int TensorBoundShapes::ByteSize() const {
4678 int total_size = 0;
4679
4680 if (_has_bits_[1 / 32] & (0xffu << (1 % 32))) {
4681 // optional int64 max_batch_size = 2;
4682 if (has_max_batch_size()) {
4683 total_size += 1 +
4684 ::google::protobuf::internal::WireFormatLite::Int64Size(
4685 this->max_batch_size());
4686 }
4687
4688 // optional int64 max_feature_len = 3;
4689 if (has_max_feature_len()) {
4690 total_size += 1 +
4691 ::google::protobuf::internal::WireFormatLite::Int64Size(
4692 this->max_feature_len());
4693 }
4694
4695 }
4696 // repeated .caffe2.TensorBoundShape shapes = 1;
4697 total_size += 1 * this->shapes_size();
4698 for (int i = 0; i < this->shapes_size(); i++) {
4699 total_size +=
4700 ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
4701 this->shapes(i));
4702 }
4703
4704 if (!unknown_fields().empty()) {
4705 total_size +=
4706 ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
4707 unknown_fields());
4708 }
4709 GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
4710 _cached_size_ = total_size;
4711 GOOGLE_SAFE_CONCURRENT_WRITES_END();
4712 return total_size;
4713}
4714
4715void TensorBoundShapes::MergeFrom(const ::google::protobuf::Message& from) {
4716 GOOGLE_CHECK_NE(&from, this);
4717 const TensorBoundShapes* source =
4718 ::google::protobuf::internal::dynamic_cast_if_available<const TensorBoundShapes*>(
4719 &from);
4720 if (source == NULL) {
4721 ::google::protobuf::internal::ReflectionOps::Merge(from, this);
4722 } else {
4723 MergeFrom(*source);
4724 }
4725}
4726
4727void TensorBoundShapes::MergeFrom(const TensorBoundShapes& from) {
4728 GOOGLE_CHECK_NE(&from, this);
4729 shapes_.MergeFrom(from.shapes_);
4730 if (from._has_bits_[1 / 32] & (0xffu << (1 % 32))) {
4731 if (from.has_max_batch_size()) {
4732 set_max_batch_size(from.max_batch_size());
4733 }
4734 if (from.has_max_feature_len()) {
4735 set_max_feature_len(from.max_feature_len());
4736 }
4737 }
4738 mutable_unknown_fields()->MergeFrom(from.unknown_fields());
4739}
4740
4741void TensorBoundShapes::CopyFrom(const ::google::protobuf::Message& from) {
4742 if (&from == this) return;
4743 Clear();
4744 MergeFrom(from);
4745}
4746
4747void TensorBoundShapes::CopyFrom(const TensorBoundShapes& from) {
4748 if (&from == this) return;
4749 Clear();
4750 MergeFrom(from);
4751}
4752
4753bool TensorBoundShapes::IsInitialized() const {
4754
4755 return true;
4756}
4757
4758void TensorBoundShapes::Swap(TensorBoundShapes* other) {
4759 if (other != this) {
4760 shapes_.Swap(&other->shapes_);
4761 std::swap(max_batch_size_, other->max_batch_size_);
4762 std::swap(max_feature_len_, other->max_feature_len_);
4763 std::swap(_has_bits_[0], other->_has_bits_[0]);
4764 _unknown_fields_.Swap(&other->_unknown_fields_);
4765 std::swap(_cached_size_, other->_cached_size_);
4766 }
4767}
4768
4769::google::protobuf::Metadata TensorBoundShapes::GetMetadata() const {
4770 protobuf_AssignDescriptorsOnce();
4771 ::google::protobuf::Metadata metadata;
4772 metadata.descriptor = TensorBoundShapes_descriptor_;
4773 metadata.reflection = TensorBoundShapes_reflection_;
4774 return metadata;
4775}
4776
4777
4778// ===================================================================
4779
4780#ifndef _MSC_VER
4781const int AOTConfig::kMaxBatchSizeFieldNumber;
4782const int AOTConfig::kMaxSeqSizeFieldNumber;
4783const int AOTConfig::kInBatchBroadcastFieldNumber;
4784const int AOTConfig::kOnnxifiBlacklistOpsFieldNumber;
4785const int AOTConfig::kOnnxifiMinOpsFieldNumber;
4786#endif // !_MSC_VER
4787
4788AOTConfig::AOTConfig()
4789 : ::google::protobuf::Message() {
4790 SharedCtor();
4791 // @@protoc_insertion_point(constructor:caffe2.AOTConfig)
4792}
4793
4794void AOTConfig::InitAsDefaultInstance() {
4795}
4796
4797AOTConfig::AOTConfig(const AOTConfig& from)
4798 : ::google::protobuf::Message() {
4799 SharedCtor();
4800 MergeFrom(from);
4801 // @@protoc_insertion_point(copy_constructor:caffe2.AOTConfig)
4802}
4803
4804void AOTConfig::SharedCtor() {
4805 ::google::protobuf::internal::GetEmptyString();
4806 _cached_size_ = 0;
4807 max_batch_size_ = GOOGLE_LONGLONG(0);
4808 max_seq_size_ = GOOGLE_LONGLONG(0);
4809 in_batch_broadcast_ = false;
4810 onnxifi_blacklist_ops_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
4811 onnxifi_min_ops_ = 0;
4812 ::memset(_has_bits_, 0, sizeof(_has_bits_));
4813}
4814
4815AOTConfig::~AOTConfig() {
4816 // @@protoc_insertion_point(destructor:caffe2.AOTConfig)
4817 SharedDtor();
4818}
4819
4820void AOTConfig::SharedDtor() {
4821 if (onnxifi_blacklist_ops_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
4822 delete onnxifi_blacklist_ops_;
4823 }
4824 if (this != default_instance_) {
4825 }
4826}
4827
4828void AOTConfig::SetCachedSize(int size) const {
4829 GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
4830 _cached_size_ = size;
4831 GOOGLE_SAFE_CONCURRENT_WRITES_END();
4832}
4833const ::google::protobuf::Descriptor* AOTConfig::descriptor() {
4834 protobuf_AssignDescriptorsOnce();
4835 return AOTConfig_descriptor_;
4836}
4837
4838const AOTConfig& AOTConfig::default_instance() {
4839 if (default_instance_ == NULL) protobuf_AddDesc_caffe2_2eproto();
4840 return *default_instance_;
4841}
4842
4843AOTConfig* AOTConfig::default_instance_ = NULL;
4844
4845AOTConfig* AOTConfig::New() const {
4846 return new AOTConfig;
4847}
4848
4849void AOTConfig::Clear() {
4850#define OFFSET_OF_FIELD_(f) (reinterpret_cast<char*>( \
4851 &reinterpret_cast<AOTConfig*>(16)->f) - \
4852 reinterpret_cast<char*>(16))
4853
4854#define ZR_(first, last) do { \
4855 size_t f = OFFSET_OF_FIELD_(first); \
4856 size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \
4857 ::memset(&first, 0, n); \
4858 } while (0)
4859
4860 if (_has_bits_[0 / 32] & 31) {
4861 ZR_(max_batch_size_, max_seq_size_);
4862 ZR_(in_batch_broadcast_, onnxifi_min_ops_);
4863 if (has_onnxifi_blacklist_ops()) {
4864 if (onnxifi_blacklist_ops_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
4865 onnxifi_blacklist_ops_->clear();
4866 }
4867 }
4868 }
4869
4870#undef OFFSET_OF_FIELD_
4871#undef ZR_
4872
4873 ::memset(_has_bits_, 0, sizeof(_has_bits_));
4874 mutable_unknown_fields()->Clear();
4875}
4876
4877bool AOTConfig::MergePartialFromCodedStream(
4878 ::google::protobuf::io::CodedInputStream* input) {
4879#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure
4880 ::google::protobuf::uint32 tag;
4881 // @@protoc_insertion_point(parse_start:caffe2.AOTConfig)
4882 for (;;) {
4883 ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);
4884 tag = p.first;
4885 if (!p.second) goto handle_unusual;
4886 switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
4887 // required int64 max_batch_size = 1;
4888 case 1: {
4889 if (tag == 8) {
4890 DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
4891 ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>(
4892 input, &max_batch_size_)));
4893 set_has_max_batch_size();
4894 } else {
4895 goto handle_unusual;
4896 }
4897 if (input->ExpectTag(16)) goto parse_max_seq_size;
4898 break;
4899 }
4900
4901 // required int64 max_seq_size = 2;
4902 case 2: {
4903 if (tag == 16) {
4904 parse_max_seq_size:
4905 DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
4906 ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>(
4907 input, &max_seq_size_)));
4908 set_has_max_seq_size();
4909 } else {
4910 goto handle_unusual;
4911 }
4912 if (input->ExpectTag(24)) goto parse_in_batch_broadcast;
4913 break;
4914 }
4915
4916 // required bool in_batch_broadcast = 3;
4917 case 3: {
4918 if (tag == 24) {
4919 parse_in_batch_broadcast:
4920 DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
4921 bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
4922 input, &in_batch_broadcast_)));
4923 set_has_in_batch_broadcast();
4924 } else {
4925 goto handle_unusual;
4926 }
4927 if (input->ExpectTag(34)) goto parse_onnxifi_blacklist_ops;
4928 break;
4929 }
4930
4931 // optional string onnxifi_blacklist_ops = 4;
4932 case 4: {
4933 if (tag == 34) {
4934 parse_onnxifi_blacklist_ops:
4935 DO_(::google::protobuf::internal::WireFormatLite::ReadString(
4936 input, this->mutable_onnxifi_blacklist_ops()));
4937 ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
4938 this->onnxifi_blacklist_ops().data(), this->onnxifi_blacklist_ops().length(),
4939 ::google::protobuf::internal::WireFormat::PARSE,
4940 "onnxifi_blacklist_ops");
4941 } else {
4942 goto handle_unusual;
4943 }
4944 if (input->ExpectTag(40)) goto parse_onnxifi_min_ops;
4945 break;
4946 }
4947
4948 // optional int32 onnxifi_min_ops = 5;
4949 case 5: {
4950 if (tag == 40) {
4951 parse_onnxifi_min_ops:
4952 DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
4953 ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
4954 input, &onnxifi_min_ops_)));
4955 set_has_onnxifi_min_ops();
4956 } else {
4957 goto handle_unusual;
4958 }
4959 if (input->ExpectAtEnd()) goto success;
4960 break;
4961 }
4962
4963 default: {
4964 handle_unusual:
4965 if (tag == 0 ||
4966 ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
4967 ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
4968 goto success;
4969 }
4970 DO_(::google::protobuf::internal::WireFormat::SkipField(
4971 input, tag, mutable_unknown_fields()));
4972 break;
4973 }
4974 }
4975 }
4976success:
4977 // @@protoc_insertion_point(parse_success:caffe2.AOTConfig)
4978 return true;
4979failure:
4980 // @@protoc_insertion_point(parse_failure:caffe2.AOTConfig)
4981 return false;
4982#undef DO_
4983}
4984
4985void AOTConfig::SerializeWithCachedSizes(
4986 ::google::protobuf::io::CodedOutputStream* output) const {
4987 // @@protoc_insertion_point(serialize_start:caffe2.AOTConfig)
4988 // required int64 max_batch_size = 1;
4989 if (has_max_batch_size()) {
4990 ::google::protobuf::internal::WireFormatLite::WriteInt64(1, this->max_batch_size(), output);
4991 }
4992
4993 // required int64 max_seq_size = 2;
4994 if (has_max_seq_size()) {
4995 ::google::protobuf::internal::WireFormatLite::WriteInt64(2, this->max_seq_size(), output);
4996 }
4997
4998 // required bool in_batch_broadcast = 3;
4999 if (has_in_batch_broadcast()) {
5000 ::google::protobuf::internal::WireFormatLite::WriteBool(3, this->in_batch_broadcast(), output);
5001 }
5002
5003 // optional string onnxifi_blacklist_ops = 4;
5004 if (has_onnxifi_blacklist_ops()) {
5005 ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
5006 this->onnxifi_blacklist_ops().data(), this->onnxifi_blacklist_ops().length(),
5007 ::google::protobuf::internal::WireFormat::SERIALIZE,
5008 "onnxifi_blacklist_ops");
5009 ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
5010 4, this->onnxifi_blacklist_ops(), output);
5011 }
5012
5013 // optional int32 onnxifi_min_ops = 5;
5014 if (has_onnxifi_min_ops()) {
5015 ::google::protobuf::internal::WireFormatLite::WriteInt32(5, this->onnxifi_min_ops(), output);
5016 }
5017
5018 if (!unknown_fields().empty()) {
5019 ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
5020 unknown_fields(), output);
5021 }
5022 // @@protoc_insertion_point(serialize_end:caffe2.AOTConfig)
5023}
5024
5025::google::protobuf::uint8* AOTConfig::SerializeWithCachedSizesToArray(
5026 ::google::protobuf::uint8* target) const {
5027 // @@protoc_insertion_point(serialize_to_array_start:caffe2.AOTConfig)
5028 // required int64 max_batch_size = 1;
5029 if (has_max_batch_size()) {
5030 target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(1, this->max_batch_size(), target);
5031 }
5032
5033 // required int64 max_seq_size = 2;
5034 if (has_max_seq_size()) {
5035 target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(2, this->max_seq_size(), target);
5036 }
5037
5038 // required bool in_batch_broadcast = 3;
5039 if (has_in_batch_broadcast()) {
5040 target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(3, this->in_batch_broadcast(), target);
5041 }
5042
5043 // optional string onnxifi_blacklist_ops = 4;
5044 if (has_onnxifi_blacklist_ops()) {
5045 ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
5046 this->onnxifi_blacklist_ops().data(), this->onnxifi_blacklist_ops().length(),
5047 ::google::protobuf::internal::WireFormat::SERIALIZE,
5048 "onnxifi_blacklist_ops");
5049 target =
5050 ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
5051 4, this->onnxifi_blacklist_ops(), target);
5052 }
5053
5054 // optional int32 onnxifi_min_ops = 5;
5055 if (has_onnxifi_min_ops()) {
5056 target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(5, this->onnxifi_min_ops(), target);
5057 }
5058
5059 if (!unknown_fields().empty()) {
5060 target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
5061 unknown_fields(), target);
5062 }
5063 // @@protoc_insertion_point(serialize_to_array_end:caffe2.AOTConfig)
5064 return target;
5065}
5066
5067int AOTConfig::ByteSize() const {
5068 int total_size = 0;
5069
5070 if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
5071 // required int64 max_batch_size = 1;
5072 if (has_max_batch_size()) {
5073 total_size += 1 +
5074 ::google::protobuf::internal::WireFormatLite::Int64Size(
5075 this->max_batch_size());
5076 }
5077
5078 // required int64 max_seq_size = 2;
5079 if (has_max_seq_size()) {
5080 total_size += 1 +
5081 ::google::protobuf::internal::WireFormatLite::Int64Size(
5082 this->max_seq_size());
5083 }
5084
5085 // required bool in_batch_broadcast = 3;
5086 if (has_in_batch_broadcast()) {
5087 total_size += 1 + 1;
5088 }
5089
5090 // optional string onnxifi_blacklist_ops = 4;
5091 if (has_onnxifi_blacklist_ops()) {
5092 total_size += 1 +
5093 ::google::protobuf::internal::WireFormatLite::StringSize(
5094 this->onnxifi_blacklist_ops());
5095 }
5096
5097 // optional int32 onnxifi_min_ops = 5;
5098 if (has_onnxifi_min_ops()) {
5099 total_size += 1 +
5100 ::google::protobuf::internal::WireFormatLite::Int32Size(
5101 this->onnxifi_min_ops());
5102 }
5103
5104 }
5105 if (!unknown_fields().empty()) {
5106 total_size +=
5107 ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
5108 unknown_fields());
5109 }
5110 GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
5111 _cached_size_ = total_size;
5112 GOOGLE_SAFE_CONCURRENT_WRITES_END();
5113 return total_size;
5114}
5115
5116void AOTConfig::MergeFrom(const ::google::protobuf::Message& from) {
5117 GOOGLE_CHECK_NE(&from, this);
5118 const AOTConfig* source =
5119 ::google::protobuf::internal::dynamic_cast_if_available<const AOTConfig*>(
5120 &from);
5121 if (source == NULL) {
5122 ::google::protobuf::internal::ReflectionOps::Merge(from, this);
5123 } else {
5124 MergeFrom(*source);
5125 }
5126}
5127
5128void AOTConfig::MergeFrom(const AOTConfig& from) {
5129 GOOGLE_CHECK_NE(&from, this);
5130 if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
5131 if (from.has_max_batch_size()) {
5132 set_max_batch_size(from.max_batch_size());
5133 }
5134 if (from.has_max_seq_size()) {
5135 set_max_seq_size(from.max_seq_size());
5136 }
5137 if (from.has_in_batch_broadcast()) {
5138 set_in_batch_broadcast(from.in_batch_broadcast());
5139 }
5140 if (from.has_onnxifi_blacklist_ops()) {
5141 set_onnxifi_blacklist_ops(from.onnxifi_blacklist_ops());
5142 }
5143 if (from.has_onnxifi_min_ops()) {
5144 set_onnxifi_min_ops(from.onnxifi_min_ops());
5145 }
5146 }
5147 mutable_unknown_fields()->MergeFrom(from.unknown_fields());
5148}
5149
5150void AOTConfig::CopyFrom(const ::google::protobuf::Message& from) {
5151 if (&from == this) return;
5152 Clear();
5153 MergeFrom(from);
5154}
5155
5156void AOTConfig::CopyFrom(const AOTConfig& from) {
5157 if (&from == this) return;
5158 Clear();
5159 MergeFrom(from);
5160}
5161
5162bool AOTConfig::IsInitialized() const {
5163 if ((_has_bits_[0] & 0x00000007) != 0x00000007) return false;
5164
5165 return true;
5166}
5167
5168void AOTConfig::Swap(AOTConfig* other) {
5169 if (other != this) {
5170 std::swap(max_batch_size_, other->max_batch_size_);
5171 std::swap(max_seq_size_, other->max_seq_size_);
5172 std::swap(in_batch_broadcast_, other->in_batch_broadcast_);
5173 std::swap(onnxifi_blacklist_ops_, other->onnxifi_blacklist_ops_);
5174 std::swap(onnxifi_min_ops_, other->onnxifi_min_ops_);
5175 std::swap(_has_bits_[0], other->_has_bits_[0]);
5176 _unknown_fields_.Swap(&other->_unknown_fields_);
5177 std::swap(_cached_size_, other->_cached_size_);
5178 }
5179}
5180
5181::google::protobuf::Metadata AOTConfig::GetMetadata() const {
5182 protobuf_AssignDescriptorsOnce();
5183 ::google::protobuf::Metadata metadata;
5184 metadata.descriptor = AOTConfig_descriptor_;
5185 metadata.reflection = AOTConfig_reflection_;
5186 return metadata;
5187}
5188
5189
5190// ===================================================================
5191
5192#ifndef _MSC_VER
5193const int Argument::kNameFieldNumber;
5194const int Argument::kFFieldNumber;
5195const int Argument::kIFieldNumber;
5196const int Argument::kSFieldNumber;
5197const int Argument::kTFieldNumber;
5198const int Argument::kNFieldNumber;
5199const int Argument::kFloatsFieldNumber;
5200const int Argument::kIntsFieldNumber;
5201const int Argument::kStringsFieldNumber;
5202const int Argument::kTensorsFieldNumber;
5203const int Argument::kNetsFieldNumber;
5204const int Argument::kQtensorsFieldNumber;
5205#endif // !_MSC_VER
5206
5207Argument::Argument()
5208 : ::google::protobuf::Message() {
5209 SharedCtor();
5210 // @@protoc_insertion_point(constructor:caffe2.Argument)
5211}
5212
5213void Argument::InitAsDefaultInstance() {
5214 t_ = const_cast< ::caffe2::TensorProto*>(&::caffe2::TensorProto::default_instance());
5215 n_ = const_cast< ::caffe2::NetDef*>(&::caffe2::NetDef::default_instance());
5216}
5217
5218Argument::Argument(const Argument& from)
5219 : ::google::protobuf::Message() {
5220 SharedCtor();
5221 MergeFrom(from);
5222 // @@protoc_insertion_point(copy_constructor:caffe2.Argument)
5223}
5224
5225void Argument::SharedCtor() {
5226 ::google::protobuf::internal::GetEmptyString();
5227 _cached_size_ = 0;
5228 name_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
5229 f_ = 0;
5230 i_ = GOOGLE_LONGLONG(0);
5231 s_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
5232 t_ = NULL;
5233 n_ = NULL;
5234 ::memset(_has_bits_, 0, sizeof(_has_bits_));
5235}
5236
5237Argument::~Argument() {
5238 // @@protoc_insertion_point(destructor:caffe2.Argument)
5239 SharedDtor();
5240}
5241
5242void Argument::SharedDtor() {
5243 if (name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
5244 delete name_;
5245 }
5246 if (s_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
5247 delete s_;
5248 }
5249 if (this != default_instance_) {
5250 delete t_;
5251 delete n_;
5252 }
5253}
5254
5255void Argument::SetCachedSize(int size) const {
5256 GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
5257 _cached_size_ = size;
5258 GOOGLE_SAFE_CONCURRENT_WRITES_END();
5259}
5260const ::google::protobuf::Descriptor* Argument::descriptor() {
5261 protobuf_AssignDescriptorsOnce();
5262 return Argument_descriptor_;
5263}
5264
5265const Argument& Argument::default_instance() {
5266 if (default_instance_ == NULL) protobuf_AddDesc_caffe2_2eproto();
5267 return *default_instance_;
5268}
5269
5270Argument* Argument::default_instance_ = NULL;
5271
5272Argument* Argument::New() const {
5273 return new Argument;
5274}
5275
5276void Argument::Clear() {
5277 if (_has_bits_[0 / 32] & 63) {
5278 if (has_name()) {
5279 if (name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
5280 name_->clear();
5281 }
5282 }
5283 f_ = 0;
5284 i_ = GOOGLE_LONGLONG(0);
5285 if (has_s()) {
5286 if (s_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
5287 s_->clear();
5288 }
5289 }
5290 if (has_t()) {
5291 if (t_ != NULL) t_->::caffe2::TensorProto::Clear();
5292 }
5293 if (has_n()) {
5294 if (n_ != NULL) n_->::caffe2::NetDef::Clear();
5295 }
5296 }
5297 floats_.Clear();
5298 ints_.Clear();
5299 strings_.Clear();
5300 tensors_.Clear();
5301 nets_.Clear();
5302 qtensors_.Clear();
5303 ::memset(_has_bits_, 0, sizeof(_has_bits_));
5304 mutable_unknown_fields()->Clear();
5305}
5306
5307bool Argument::MergePartialFromCodedStream(
5308 ::google::protobuf::io::CodedInputStream* input) {
5309#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure
5310 ::google::protobuf::uint32 tag;
5311 // @@protoc_insertion_point(parse_start:caffe2.Argument)
5312 for (;;) {
5313 ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);
5314 tag = p.first;
5315 if (!p.second) goto handle_unusual;
5316 switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
5317 // optional string name = 1;
5318 case 1: {
5319 if (tag == 10) {
5320 DO_(::google::protobuf::internal::WireFormatLite::ReadString(
5321 input, this->mutable_name()));
5322 ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
5323 this->name().data(), this->name().length(),
5324 ::google::protobuf::internal::WireFormat::PARSE,
5325 "name");
5326 } else {
5327 goto handle_unusual;
5328 }
5329 if (input->ExpectTag(21)) goto parse_f;
5330 break;
5331 }
5332
5333 // optional float f = 2;
5334 case 2: {
5335 if (tag == 21) {
5336 parse_f:
5337 DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
5338 float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
5339 input, &f_)));
5340 set_has_f();
5341 } else {
5342 goto handle_unusual;
5343 }
5344 if (input->ExpectTag(24)) goto parse_i;
5345 break;
5346 }
5347
5348 // optional int64 i = 3;
5349 case 3: {
5350 if (tag == 24) {
5351 parse_i:
5352 DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
5353 ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>(
5354 input, &i_)));
5355 set_has_i();
5356 } else {
5357 goto handle_unusual;
5358 }
5359 if (input->ExpectTag(34)) goto parse_s;
5360 break;
5361 }
5362
5363 // optional bytes s = 4;
5364 case 4: {
5365 if (tag == 34) {
5366 parse_s:
5367 DO_(::google::protobuf::internal::WireFormatLite::ReadBytes(
5368 input, this->mutable_s()));
5369 } else {
5370 goto handle_unusual;
5371 }
5372 if (input->ExpectTag(45)) goto parse_floats;
5373 break;
5374 }
5375
5376 // repeated float floats = 5;
5377 case 5: {
5378 if (tag == 45) {
5379 parse_floats:
5380 DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive<
5381 float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
5382 1, 45, input, this->mutable_floats())));
5383 } else if (tag == 42) {
5384 DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline<
5385 float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
5386 input, this->mutable_floats())));
5387 } else {
5388 goto handle_unusual;
5389 }
5390 if (input->ExpectTag(45)) goto parse_floats;
5391 if (input->ExpectTag(48)) goto parse_ints;
5392 break;
5393 }
5394
5395 // repeated int64 ints = 6;
5396 case 6: {
5397 if (tag == 48) {
5398 parse_ints:
5399 DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive<
5400 ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>(
5401 1, 48, input, this->mutable_ints())));
5402 } else if (tag == 50) {
5403 DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline<
5404 ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>(
5405 input, this->mutable_ints())));
5406 } else {
5407 goto handle_unusual;
5408 }
5409 if (input->ExpectTag(48)) goto parse_ints;
5410 if (input->ExpectTag(58)) goto parse_strings;
5411 break;
5412 }
5413
5414 // repeated bytes strings = 7;
5415 case 7: {
5416 if (tag == 58) {
5417 parse_strings:
5418 DO_(::google::protobuf::internal::WireFormatLite::ReadBytes(
5419 input, this->add_strings()));
5420 } else {
5421 goto handle_unusual;
5422 }
5423 if (input->ExpectTag(58)) goto parse_strings;
5424 if (input->ExpectTag(66)) goto parse_n;
5425 break;
5426 }
5427
5428 // optional .caffe2.NetDef n = 8;
5429 case 8: {
5430 if (tag == 66) {
5431 parse_n:
5432 DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
5433 input, mutable_n()));
5434 } else {
5435 goto handle_unusual;
5436 }
5437 if (input->ExpectTag(74)) goto parse_nets;
5438 break;
5439 }
5440
5441 // repeated .caffe2.NetDef nets = 9;
5442 case 9: {
5443 if (tag == 74) {
5444 parse_nets:
5445 DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
5446 input, add_nets()));
5447 } else {
5448 goto handle_unusual;
5449 }
5450 if (input->ExpectTag(74)) goto parse_nets;
5451 if (input->ExpectTag(82)) goto parse_t;
5452 break;
5453 }
5454
5455 // optional .caffe2.TensorProto t = 10;
5456 case 10: {
5457 if (tag == 82) {
5458 parse_t:
5459 DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
5460 input, mutable_t()));
5461 } else {
5462 goto handle_unusual;
5463 }
5464 if (input->ExpectTag(90)) goto parse_tensors;
5465 break;
5466 }
5467
5468 // repeated .caffe2.TensorProto tensors = 11;
5469 case 11: {
5470 if (tag == 90) {
5471 parse_tensors:
5472 DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
5473 input, add_tensors()));
5474 } else {
5475 goto handle_unusual;
5476 }
5477 if (input->ExpectTag(90)) goto parse_tensors;
5478 if (input->ExpectTag(98)) goto parse_qtensors;
5479 break;
5480 }
5481
5482 // repeated .caffe2.QTensorProto qtensors = 12;
5483 case 12: {
5484 if (tag == 98) {
5485 parse_qtensors:
5486 DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
5487 input, add_qtensors()));
5488 } else {
5489 goto handle_unusual;
5490 }
5491 if (input->ExpectTag(98)) goto parse_qtensors;
5492 if (input->ExpectAtEnd()) goto success;
5493 break;
5494 }
5495
5496 default: {
5497 handle_unusual:
5498 if (tag == 0 ||
5499 ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
5500 ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
5501 goto success;
5502 }
5503 DO_(::google::protobuf::internal::WireFormat::SkipField(
5504 input, tag, mutable_unknown_fields()));
5505 break;
5506 }
5507 }
5508 }
5509success:
5510 // @@protoc_insertion_point(parse_success:caffe2.Argument)
5511 return true;
5512failure:
5513 // @@protoc_insertion_point(parse_failure:caffe2.Argument)
5514 return false;
5515#undef DO_
5516}
5517
5518void Argument::SerializeWithCachedSizes(
5519 ::google::protobuf::io::CodedOutputStream* output) const {
5520 // @@protoc_insertion_point(serialize_start:caffe2.Argument)
5521 // optional string name = 1;
5522 if (has_name()) {
5523 ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
5524 this->name().data(), this->name().length(),
5525 ::google::protobuf::internal::WireFormat::SERIALIZE,
5526 "name");
5527 ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
5528 1, this->name(), output);
5529 }
5530
5531 // optional float f = 2;
5532 if (has_f()) {
5533 ::google::protobuf::internal::WireFormatLite::WriteFloat(2, this->f(), output);
5534 }
5535
5536 // optional int64 i = 3;
5537 if (has_i()) {
5538 ::google::protobuf::internal::WireFormatLite::WriteInt64(3, this->i(), output);
5539 }
5540
5541 // optional bytes s = 4;
5542 if (has_s()) {
5543 ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased(
5544 4, this->s(), output);
5545 }
5546
5547 // repeated float floats = 5;
5548 for (int i = 0; i < this->floats_size(); i++) {
5549 ::google::protobuf::internal::WireFormatLite::WriteFloat(
5550 5, this->floats(i), output);
5551 }
5552
5553 // repeated int64 ints = 6;
5554 for (int i = 0; i < this->ints_size(); i++) {
5555 ::google::protobuf::internal::WireFormatLite::WriteInt64(
5556 6, this->ints(i), output);
5557 }
5558
5559 // repeated bytes strings = 7;
5560 for (int i = 0; i < this->strings_size(); i++) {
5561 ::google::protobuf::internal::WireFormatLite::WriteBytes(
5562 7, this->strings(i), output);
5563 }
5564
5565 // optional .caffe2.NetDef n = 8;
5566 if (has_n()) {
5567 ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
5568 8, this->n(), output);
5569 }
5570
5571 // repeated .caffe2.NetDef nets = 9;
5572 for (int i = 0; i < this->nets_size(); i++) {
5573 ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
5574 9, this->nets(i), output);
5575 }
5576
5577 // optional .caffe2.TensorProto t = 10;
5578 if (has_t()) {
5579 ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
5580 10, this->t(), output);
5581 }
5582
5583 // repeated .caffe2.TensorProto tensors = 11;
5584 for (int i = 0; i < this->tensors_size(); i++) {
5585 ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
5586 11, this->tensors(i), output);
5587 }
5588
5589 // repeated .caffe2.QTensorProto qtensors = 12;
5590 for (int i = 0; i < this->qtensors_size(); i++) {
5591 ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
5592 12, this->qtensors(i), output);
5593 }
5594
5595 if (!unknown_fields().empty()) {
5596 ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
5597 unknown_fields(), output);
5598 }
5599 // @@protoc_insertion_point(serialize_end:caffe2.Argument)
5600}
5601
5602::google::protobuf::uint8* Argument::SerializeWithCachedSizesToArray(
5603 ::google::protobuf::uint8* target) const {
5604 // @@protoc_insertion_point(serialize_to_array_start:caffe2.Argument)
5605 // optional string name = 1;
5606 if (has_name()) {
5607 ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
5608 this->name().data(), this->name().length(),
5609 ::google::protobuf::internal::WireFormat::SERIALIZE,
5610 "name");
5611 target =
5612 ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
5613 1, this->name(), target);
5614 }
5615
5616 // optional float f = 2;
5617 if (has_f()) {
5618 target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(2, this->f(), target);
5619 }
5620
5621 // optional int64 i = 3;
5622 if (has_i()) {
5623 target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(3, this->i(), target);
5624 }
5625
5626 // optional bytes s = 4;
5627 if (has_s()) {
5628 target =
5629 ::google::protobuf::internal::WireFormatLite::WriteBytesToArray(
5630 4, this->s(), target);
5631 }
5632
5633 // repeated float floats = 5;
5634 for (int i = 0; i < this->floats_size(); i++) {
5635 target = ::google::protobuf::internal::WireFormatLite::
5636 WriteFloatToArray(5, this->floats(i), target);
5637 }
5638
5639 // repeated int64 ints = 6;
5640 for (int i = 0; i < this->ints_size(); i++) {
5641 target = ::google::protobuf::internal::WireFormatLite::
5642 WriteInt64ToArray(6, this->ints(i), target);
5643 }
5644
5645 // repeated bytes strings = 7;
5646 for (int i = 0; i < this->strings_size(); i++) {
5647 target = ::google::protobuf::internal::WireFormatLite::
5648 WriteBytesToArray(7, this->strings(i), target);
5649 }
5650
5651 // optional .caffe2.NetDef n = 8;
5652 if (has_n()) {
5653 target = ::google::protobuf::internal::WireFormatLite::
5654 WriteMessageNoVirtualToArray(
5655 8, this->n(), target);
5656 }
5657
5658 // repeated .caffe2.NetDef nets = 9;
5659 for (int i = 0; i < this->nets_size(); i++) {
5660 target = ::google::protobuf::internal::WireFormatLite::
5661 WriteMessageNoVirtualToArray(
5662 9, this->nets(i), target);
5663 }
5664
5665 // optional .caffe2.TensorProto t = 10;
5666 if (has_t()) {
5667 target = ::google::protobuf::internal::WireFormatLite::
5668 WriteMessageNoVirtualToArray(
5669 10, this->t(), target);
5670 }
5671
5672 // repeated .caffe2.TensorProto tensors = 11;
5673 for (int i = 0; i < this->tensors_size(); i++) {
5674 target = ::google::protobuf::internal::WireFormatLite::
5675 WriteMessageNoVirtualToArray(
5676 11, this->tensors(i), target);
5677 }
5678
5679 // repeated .caffe2.QTensorProto qtensors = 12;
5680 for (int i = 0; i < this->qtensors_size(); i++) {
5681 target = ::google::protobuf::internal::WireFormatLite::
5682 WriteMessageNoVirtualToArray(
5683 12, this->qtensors(i), target);
5684 }
5685
5686 if (!unknown_fields().empty()) {
5687 target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
5688 unknown_fields(), target);
5689 }
5690 // @@protoc_insertion_point(serialize_to_array_end:caffe2.Argument)
5691 return target;
5692}
5693
5694int Argument::ByteSize() const {
5695 int total_size = 0;
5696
5697 if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
5698 // optional string name = 1;
5699 if (has_name()) {
5700 total_size += 1 +
5701 ::google::protobuf::internal::WireFormatLite::StringSize(
5702 this->name());
5703 }
5704
5705 // optional float f = 2;
5706 if (has_f()) {
5707 total_size += 1 + 4;
5708 }
5709
5710 // optional int64 i = 3;
5711 if (has_i()) {
5712 total_size += 1 +
5713 ::google::protobuf::internal::WireFormatLite::Int64Size(
5714 this->i());
5715 }
5716
5717 // optional bytes s = 4;
5718 if (has_s()) {
5719 total_size += 1 +
5720 ::google::protobuf::internal::WireFormatLite::BytesSize(
5721 this->s());
5722 }
5723
5724 // optional .caffe2.TensorProto t = 10;
5725 if (has_t()) {
5726 total_size += 1 +
5727 ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
5728 this->t());
5729 }
5730
5731 // optional .caffe2.NetDef n = 8;
5732 if (has_n()) {
5733 total_size += 1 +
5734 ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
5735 this->n());
5736 }
5737
5738 }
5739 // repeated float floats = 5;
5740 {
5741 int data_size = 0;
5742 data_size = 4 * this->floats_size();
5743 total_size += 1 * this->floats_size() + data_size;
5744 }
5745
5746 // repeated int64 ints = 6;
5747 {
5748 int data_size = 0;
5749 for (int i = 0; i < this->ints_size(); i++) {
5750 data_size += ::google::protobuf::internal::WireFormatLite::
5751 Int64Size(this->ints(i));
5752 }
5753 total_size += 1 * this->ints_size() + data_size;
5754 }
5755
5756 // repeated bytes strings = 7;
5757 total_size += 1 * this->strings_size();
5758 for (int i = 0; i < this->strings_size(); i++) {
5759 total_size += ::google::protobuf::internal::WireFormatLite::BytesSize(
5760 this->strings(i));
5761 }
5762
5763 // repeated .caffe2.TensorProto tensors = 11;
5764 total_size += 1 * this->tensors_size();
5765 for (int i = 0; i < this->tensors_size(); i++) {
5766 total_size +=
5767 ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
5768 this->tensors(i));
5769 }
5770
5771 // repeated .caffe2.NetDef nets = 9;
5772 total_size += 1 * this->nets_size();
5773 for (int i = 0; i < this->nets_size(); i++) {
5774 total_size +=
5775 ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
5776 this->nets(i));
5777 }
5778
5779 // repeated .caffe2.QTensorProto qtensors = 12;
5780 total_size += 1 * this->qtensors_size();
5781 for (int i = 0; i < this->qtensors_size(); i++) {
5782 total_size +=
5783 ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
5784 this->qtensors(i));
5785 }
5786
5787 if (!unknown_fields().empty()) {
5788 total_size +=
5789 ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
5790 unknown_fields());
5791 }
5792 GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
5793 _cached_size_ = total_size;
5794 GOOGLE_SAFE_CONCURRENT_WRITES_END();
5795 return total_size;
5796}
5797
5798void Argument::MergeFrom(const ::google::protobuf::Message& from) {
5799 GOOGLE_CHECK_NE(&from, this);
5800 const Argument* source =
5801 ::google::protobuf::internal::dynamic_cast_if_available<const Argument*>(
5802 &from);
5803 if (source == NULL) {
5804 ::google::protobuf::internal::ReflectionOps::Merge(from, this);
5805 } else {
5806 MergeFrom(*source);
5807 }
5808}
5809
5810void Argument::MergeFrom(const Argument& from) {
5811 GOOGLE_CHECK_NE(&from, this);
5812 floats_.MergeFrom(from.floats_);
5813 ints_.MergeFrom(from.ints_);
5814 strings_.MergeFrom(from.strings_);
5815 tensors_.MergeFrom(from.tensors_);
5816 nets_.MergeFrom(from.nets_);
5817 qtensors_.MergeFrom(from.qtensors_);
5818 if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
5819 if (from.has_name()) {
5820 set_name(from.name());
5821 }
5822 if (from.has_f()) {
5823 set_f(from.f());
5824 }
5825 if (from.has_i()) {
5826 set_i(from.i());
5827 }
5828 if (from.has_s()) {
5829 set_s(from.s());
5830 }
5831 if (from.has_t()) {
5832 mutable_t()->::caffe2::TensorProto::MergeFrom(from.t());
5833 }
5834 if (from.has_n()) {
5835 mutable_n()->::caffe2::NetDef::MergeFrom(from.n());
5836 }
5837 }
5838 mutable_unknown_fields()->MergeFrom(from.unknown_fields());
5839}
5840
5841void Argument::CopyFrom(const ::google::protobuf::Message& from) {
5842 if (&from == this) return;
5843 Clear();
5844 MergeFrom(from);
5845}
5846
5847void Argument::CopyFrom(const Argument& from) {
5848 if (&from == this) return;
5849 Clear();
5850 MergeFrom(from);
5851}
5852
5853bool Argument::IsInitialized() const {
5854
5855 if (has_t()) {
5856 if (!this->t().IsInitialized()) return false;
5857 }
5858 if (has_n()) {
5859 if (!this->n().IsInitialized()) return false;
5860 }
5861 if (!::google::protobuf::internal::AllAreInitialized(this->tensors())) return false;
5862 if (!::google::protobuf::internal::AllAreInitialized(this->nets())) return false;
5863 if (!::google::protobuf::internal::AllAreInitialized(this->qtensors())) return false;
5864 return true;
5865}
5866
5867void Argument::Swap(Argument* other) {
5868 if (other != this) {
5869 std::swap(name_, other->name_);
5870 std::swap(f_, other->f_);
5871 std::swap(i_, other->i_);
5872 std::swap(s_, other->s_);
5873 std::swap(t_, other->t_);
5874 std::swap(n_, other->n_);
5875 floats_.Swap(&other->floats_);
5876 ints_.Swap(&other->ints_);
5877 strings_.Swap(&other->strings_);
5878 tensors_.Swap(&other->tensors_);
5879 nets_.Swap(&other->nets_);
5880 qtensors_.Swap(&other->qtensors_);
5881 std::swap(_has_bits_[0], other->_has_bits_[0]);
5882 _unknown_fields_.Swap(&other->_unknown_fields_);
5883 std::swap(_cached_size_, other->_cached_size_);
5884 }
5885}
5886
5887::google::protobuf::Metadata Argument::GetMetadata() const {
5888 protobuf_AssignDescriptorsOnce();
5889 ::google::protobuf::Metadata metadata;
5890 metadata.descriptor = Argument_descriptor_;
5891 metadata.reflection = Argument_reflection_;
5892 return metadata;
5893}
5894
5895
5896// ===================================================================
5897
5898#ifndef _MSC_VER
5899const int DeviceOption::kDeviceTypeFieldNumber;
5900const int DeviceOption::kDeviceIdFieldNumber;
5901const int DeviceOption::kRandomSeedFieldNumber;
5902const int DeviceOption::kNodeNameFieldNumber;
5903const int DeviceOption::kNumaNodeIdFieldNumber;
5904const int DeviceOption::kExtraInfoFieldNumber;
5905#endif // !_MSC_VER
5906
5907DeviceOption::DeviceOption()
5908 : ::google::protobuf::Message() {
5909 SharedCtor();
5910 // @@protoc_insertion_point(constructor:caffe2.DeviceOption)
5911}
5912
5913void DeviceOption::InitAsDefaultInstance() {
5914}
5915
5916DeviceOption::DeviceOption(const DeviceOption& from)
5917 : ::google::protobuf::Message() {
5918 SharedCtor();
5919 MergeFrom(from);
5920 // @@protoc_insertion_point(copy_constructor:caffe2.DeviceOption)
5921}
5922
5923void DeviceOption::SharedCtor() {
5924 ::google::protobuf::internal::GetEmptyString();
5925 _cached_size_ = 0;
5926 device_type_ = 0;
5927 device_id_ = 0;
5928 random_seed_ = 0u;
5929 node_name_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
5930 numa_node_id_ = 0;
5931 ::memset(_has_bits_, 0, sizeof(_has_bits_));
5932}
5933
5934DeviceOption::~DeviceOption() {
5935 // @@protoc_insertion_point(destructor:caffe2.DeviceOption)
5936 SharedDtor();
5937}
5938
5939void DeviceOption::SharedDtor() {
5940 if (node_name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
5941 delete node_name_;
5942 }
5943 if (this != default_instance_) {
5944 }
5945}
5946
5947void DeviceOption::SetCachedSize(int size) const {
5948 GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
5949 _cached_size_ = size;
5950 GOOGLE_SAFE_CONCURRENT_WRITES_END();
5951}
5952const ::google::protobuf::Descriptor* DeviceOption::descriptor() {
5953 protobuf_AssignDescriptorsOnce();
5954 return DeviceOption_descriptor_;
5955}
5956
5957const DeviceOption& DeviceOption::default_instance() {
5958 if (default_instance_ == NULL) protobuf_AddDesc_caffe2_2eproto();
5959 return *default_instance_;
5960}
5961
5962DeviceOption* DeviceOption::default_instance_ = NULL;
5963
5964DeviceOption* DeviceOption::New() const {
5965 return new DeviceOption;
5966}
5967
5968void DeviceOption::Clear() {
5969#define OFFSET_OF_FIELD_(f) (reinterpret_cast<char*>( \
5970 &reinterpret_cast<DeviceOption*>(16)->f) - \
5971 reinterpret_cast<char*>(16))
5972
5973#define ZR_(first, last) do { \
5974 size_t f = OFFSET_OF_FIELD_(first); \
5975 size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \
5976 ::memset(&first, 0, n); \
5977 } while (0)
5978
5979 if (_has_bits_[0 / 32] & 31) {
5980 ZR_(device_type_, device_id_);
5981 ZR_(random_seed_, numa_node_id_);
5982 if (has_node_name()) {
5983 if (node_name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
5984 node_name_->clear();
5985 }
5986 }
5987 }
5988
5989#undef OFFSET_OF_FIELD_
5990#undef ZR_
5991
5992 extra_info_.Clear();
5993 ::memset(_has_bits_, 0, sizeof(_has_bits_));
5994 mutable_unknown_fields()->Clear();
5995}
5996
5997bool DeviceOption::MergePartialFromCodedStream(
5998 ::google::protobuf::io::CodedInputStream* input) {
5999#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure
6000 ::google::protobuf::uint32 tag;
6001 // @@protoc_insertion_point(parse_start:caffe2.DeviceOption)
6002 for (;;) {
6003 ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);
6004 tag = p.first;
6005 if (!p.second) goto handle_unusual;
6006 switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
6007 // optional int32 device_type = 1 [default = 0];
6008 case 1: {
6009 if (tag == 8) {
6010 DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
6011 ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
6012 input, &device_type_)));
6013 set_has_device_type();
6014 } else {
6015 goto handle_unusual;
6016 }
6017 if (input->ExpectTag(16)) goto parse_device_id;
6018 break;
6019 }
6020
6021 // optional int32 device_id = 2;
6022 case 2: {
6023 if (tag == 16) {
6024 parse_device_id:
6025 DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
6026 ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
6027 input, &device_id_)));
6028 set_has_device_id();
6029 } else {
6030 goto handle_unusual;
6031 }
6032 if (input->ExpectTag(24)) goto parse_random_seed;
6033 break;
6034 }
6035
6036 // optional uint32 random_seed = 3;
6037 case 3: {
6038 if (tag == 24) {
6039 parse_random_seed:
6040 DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
6041 ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
6042 input, &random_seed_)));
6043 set_has_random_seed();
6044 } else {
6045 goto handle_unusual;
6046 }
6047 if (input->ExpectTag(34)) goto parse_node_name;
6048 break;
6049 }
6050
6051 // optional string node_name = 4;
6052 case 4: {
6053 if (tag == 34) {
6054 parse_node_name:
6055 DO_(::google::protobuf::internal::WireFormatLite::ReadString(
6056 input, this->mutable_node_name()));
6057 ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
6058 this->node_name().data(), this->node_name().length(),
6059 ::google::protobuf::internal::WireFormat::PARSE,
6060 "node_name");
6061 } else {
6062 goto handle_unusual;
6063 }
6064 if (input->ExpectTag(40)) goto parse_numa_node_id;
6065 break;
6066 }
6067
6068 // optional int32 numa_node_id = 5;
6069 case 5: {
6070 if (tag == 40) {
6071 parse_numa_node_id:
6072 DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
6073 ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
6074 input, &numa_node_id_)));
6075 set_has_numa_node_id();
6076 } else {
6077 goto handle_unusual;
6078 }
6079 if (input->ExpectTag(50)) goto parse_extra_info;
6080 break;
6081 }
6082
6083 // repeated string extra_info = 6;
6084 case 6: {
6085 if (tag == 50) {
6086 parse_extra_info:
6087 DO_(::google::protobuf::internal::WireFormatLite::ReadString(
6088 input, this->add_extra_info()));
6089 ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
6090 this->extra_info(this->extra_info_size() - 1).data(),
6091 this->extra_info(this->extra_info_size() - 1).length(),
6092 ::google::protobuf::internal::WireFormat::PARSE,
6093 "extra_info");
6094 } else {
6095 goto handle_unusual;
6096 }
6097 if (input->ExpectTag(50)) goto parse_extra_info;
6098 if (input->ExpectAtEnd()) goto success;
6099 break;
6100 }
6101
6102 default: {
6103 handle_unusual:
6104 if (tag == 0 ||
6105 ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
6106 ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
6107 goto success;
6108 }
6109 DO_(::google::protobuf::internal::WireFormat::SkipField(
6110 input, tag, mutable_unknown_fields()));
6111 break;
6112 }
6113 }
6114 }
6115success:
6116 // @@protoc_insertion_point(parse_success:caffe2.DeviceOption)
6117 return true;
6118failure:
6119 // @@protoc_insertion_point(parse_failure:caffe2.DeviceOption)
6120 return false;
6121#undef DO_
6122}
6123
6124void DeviceOption::SerializeWithCachedSizes(
6125 ::google::protobuf::io::CodedOutputStream* output) const {
6126 // @@protoc_insertion_point(serialize_start:caffe2.DeviceOption)
6127 // optional int32 device_type = 1 [default = 0];
6128 if (has_device_type()) {
6129 ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->device_type(), output);
6130 }
6131
6132 // optional int32 device_id = 2;
6133 if (has_device_id()) {
6134 ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->device_id(), output);
6135 }
6136
6137 // optional uint32 random_seed = 3;
6138 if (has_random_seed()) {
6139 ::google::protobuf::internal::WireFormatLite::WriteUInt32(3, this->random_seed(), output);
6140 }
6141
6142 // optional string node_name = 4;
6143 if (has_node_name()) {
6144 ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
6145 this->node_name().data(), this->node_name().length(),
6146 ::google::protobuf::internal::WireFormat::SERIALIZE,
6147 "node_name");
6148 ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
6149 4, this->node_name(), output);
6150 }
6151
6152 // optional int32 numa_node_id = 5;
6153 if (has_numa_node_id()) {
6154 ::google::protobuf::internal::WireFormatLite::WriteInt32(5, this->numa_node_id(), output);
6155 }
6156
6157 // repeated string extra_info = 6;
6158 for (int i = 0; i < this->extra_info_size(); i++) {
6159 ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
6160 this->extra_info(i).data(), this->extra_info(i).length(),
6161 ::google::protobuf::internal::WireFormat::SERIALIZE,
6162 "extra_info");
6163 ::google::protobuf::internal::WireFormatLite::WriteString(
6164 6, this->extra_info(i), output);
6165 }
6166
6167 if (!unknown_fields().empty()) {
6168 ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
6169 unknown_fields(), output);
6170 }
6171 // @@protoc_insertion_point(serialize_end:caffe2.DeviceOption)
6172}
6173
6174::google::protobuf::uint8* DeviceOption::SerializeWithCachedSizesToArray(
6175 ::google::protobuf::uint8* target) const {
6176 // @@protoc_insertion_point(serialize_to_array_start:caffe2.DeviceOption)
6177 // optional int32 device_type = 1 [default = 0];
6178 if (has_device_type()) {
6179 target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->device_type(), target);
6180 }
6181
6182 // optional int32 device_id = 2;
6183 if (has_device_id()) {
6184 target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->device_id(), target);
6185 }
6186
6187 // optional uint32 random_seed = 3;
6188 if (has_random_seed()) {
6189 target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(3, this->random_seed(), target);
6190 }
6191
6192 // optional string node_name = 4;
6193 if (has_node_name()) {
6194 ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
6195 this->node_name().data(), this->node_name().length(),
6196 ::google::protobuf::internal::WireFormat::SERIALIZE,
6197 "node_name");
6198 target =
6199 ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
6200 4, this->node_name(), target);
6201 }
6202
6203 // optional int32 numa_node_id = 5;
6204 if (has_numa_node_id()) {
6205 target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(5, this->numa_node_id(), target);
6206 }
6207
6208 // repeated string extra_info = 6;
6209 for (int i = 0; i < this->extra_info_size(); i++) {
6210 ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
6211 this->extra_info(i).data(), this->extra_info(i).length(),
6212 ::google::protobuf::internal::WireFormat::SERIALIZE,
6213 "extra_info");
6214 target = ::google::protobuf::internal::WireFormatLite::
6215 WriteStringToArray(6, this->extra_info(i), target);
6216 }
6217
6218 if (!unknown_fields().empty()) {
6219 target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
6220 unknown_fields(), target);
6221 }
6222 // @@protoc_insertion_point(serialize_to_array_end:caffe2.DeviceOption)
6223 return target;
6224}
6225
6226int DeviceOption::ByteSize() const {
6227 int total_size = 0;
6228
6229 if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
6230 // optional int32 device_type = 1 [default = 0];
6231 if (has_device_type()) {
6232 total_size += 1 +
6233 ::google::protobuf::internal::WireFormatLite::Int32Size(
6234 this->device_type());
6235 }
6236
6237 // optional int32 device_id = 2;
6238 if (has_device_id()) {
6239 total_size += 1 +
6240 ::google::protobuf::internal::WireFormatLite::Int32Size(
6241 this->device_id());
6242 }
6243
6244 // optional uint32 random_seed = 3;
6245 if (has_random_seed()) {
6246 total_size += 1 +
6247 ::google::protobuf::internal::WireFormatLite::UInt32Size(
6248 this->random_seed());
6249 }
6250
6251 // optional string node_name = 4;
6252 if (has_node_name()) {
6253 total_size += 1 +
6254 ::google::protobuf::internal::WireFormatLite::StringSize(
6255 this->node_name());
6256 }
6257
6258 // optional int32 numa_node_id = 5;
6259 if (has_numa_node_id()) {
6260 total_size += 1 +
6261 ::google::protobuf::internal::WireFormatLite::Int32Size(
6262 this->numa_node_id());
6263 }
6264
6265 }
6266 // repeated string extra_info = 6;
6267 total_size += 1 * this->extra_info_size();
6268 for (int i = 0; i < this->extra_info_size(); i++) {
6269 total_size += ::google::protobuf::internal::WireFormatLite::StringSize(
6270 this->extra_info(i));
6271 }
6272
6273 if (!unknown_fields().empty()) {
6274 total_size +=
6275 ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
6276 unknown_fields());
6277 }
6278 GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
6279 _cached_size_ = total_size;
6280 GOOGLE_SAFE_CONCURRENT_WRITES_END();
6281 return total_size;
6282}
6283
6284void DeviceOption::MergeFrom(const ::google::protobuf::Message& from) {
6285 GOOGLE_CHECK_NE(&from, this);
6286 const DeviceOption* source =
6287 ::google::protobuf::internal::dynamic_cast_if_available<const DeviceOption*>(
6288 &from);
6289 if (source == NULL) {
6290 ::google::protobuf::internal::ReflectionOps::Merge(from, this);
6291 } else {
6292 MergeFrom(*source);
6293 }
6294}
6295
6296void DeviceOption::MergeFrom(const DeviceOption& from) {
6297 GOOGLE_CHECK_NE(&from, this);
6298 extra_info_.MergeFrom(from.extra_info_);
6299 if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
6300 if (from.has_device_type()) {
6301 set_device_type(from.device_type());
6302 }
6303 if (from.has_device_id()) {
6304 set_device_id(from.device_id());
6305 }
6306 if (from.has_random_seed()) {
6307 set_random_seed(from.random_seed());
6308 }
6309 if (from.has_node_name()) {
6310 set_node_name(from.node_name());
6311 }
6312 if (from.has_numa_node_id()) {
6313 set_numa_node_id(from.numa_node_id());
6314 }
6315 }
6316 mutable_unknown_fields()->MergeFrom(from.unknown_fields());
6317}
6318
6319void DeviceOption::CopyFrom(const ::google::protobuf::Message& from) {
6320 if (&from == this) return;
6321 Clear();
6322 MergeFrom(from);
6323}
6324
6325void DeviceOption::CopyFrom(const DeviceOption& from) {
6326 if (&from == this) return;
6327 Clear();
6328 MergeFrom(from);
6329}
6330
6331bool DeviceOption::IsInitialized() const {
6332
6333 return true;
6334}
6335
6336void DeviceOption::Swap(DeviceOption* other) {
6337 if (other != this) {
6338 std::swap(device_type_, other->device_type_);
6339 std::swap(device_id_, other->device_id_);
6340 std::swap(random_seed_, other->random_seed_);
6341 std::swap(node_name_, other->node_name_);
6342 std::swap(numa_node_id_, other->numa_node_id_);
6343 extra_info_.Swap(&other->extra_info_);
6344 std::swap(_has_bits_[0], other->_has_bits_[0]);
6345 _unknown_fields_.Swap(&other->_unknown_fields_);
6346 std::swap(_cached_size_, other->_cached_size_);
6347 }
6348}
6349
6350::google::protobuf::Metadata DeviceOption::GetMetadata() const {
6351 protobuf_AssignDescriptorsOnce();
6352 ::google::protobuf::Metadata metadata;
6353 metadata.descriptor = DeviceOption_descriptor_;
6354 metadata.reflection = DeviceOption_reflection_;
6355 return metadata;
6356}
6357
6358
6359// ===================================================================
6360
6361#ifndef _MSC_VER
6362const int OperatorDef::kInputFieldNumber;
6363const int OperatorDef::kOutputFieldNumber;
6364const int OperatorDef::kNameFieldNumber;
6365const int OperatorDef::kTypeFieldNumber;
6366const int OperatorDef::kArgFieldNumber;
6367const int OperatorDef::kDeviceOptionFieldNumber;
6368const int OperatorDef::kEngineFieldNumber;
6369const int OperatorDef::kControlInputFieldNumber;
6370const int OperatorDef::kIsGradientOpFieldNumber;
6371const int OperatorDef::kDebugInfoFieldNumber;
6372const int OperatorDef::kDomainFieldNumber;
6373const int OperatorDef::kOpVersionFieldNumber;
6374#endif // !_MSC_VER
6375
6376OperatorDef::OperatorDef()
6377 : ::google::protobuf::Message() {
6378 SharedCtor();
6379 // @@protoc_insertion_point(constructor:caffe2.OperatorDef)
6380}
6381
6382void OperatorDef::InitAsDefaultInstance() {
6383 device_option_ = const_cast< ::caffe2::DeviceOption*>(&::caffe2::DeviceOption::default_instance());
6384}
6385
6386OperatorDef::OperatorDef(const OperatorDef& from)
6387 : ::google::protobuf::Message() {
6388 SharedCtor();
6389 MergeFrom(from);
6390 // @@protoc_insertion_point(copy_constructor:caffe2.OperatorDef)
6391}
6392
6393void OperatorDef::SharedCtor() {
6394 ::google::protobuf::internal::GetEmptyString();
6395 _cached_size_ = 0;
6396 name_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
6397 type_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
6398 device_option_ = NULL;
6399 engine_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
6400 is_gradient_op_ = false;
6401 debug_info_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
6402 domain_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
6403 op_version_ = GOOGLE_LONGLONG(0);
6404 ::memset(_has_bits_, 0, sizeof(_has_bits_));
6405}
6406
6407OperatorDef::~OperatorDef() {
6408 // @@protoc_insertion_point(destructor:caffe2.OperatorDef)
6409 SharedDtor();
6410}
6411
6412void OperatorDef::SharedDtor() {
6413 if (name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
6414 delete name_;
6415 }
6416 if (type_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
6417 delete type_;
6418 }
6419 if (engine_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
6420 delete engine_;
6421 }
6422 if (debug_info_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
6423 delete debug_info_;
6424 }
6425 if (domain_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
6426 delete domain_;
6427 }
6428 if (this != default_instance_) {
6429 delete device_option_;
6430 }
6431}
6432
6433void OperatorDef::SetCachedSize(int size) const {
6434 GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
6435 _cached_size_ = size;
6436 GOOGLE_SAFE_CONCURRENT_WRITES_END();
6437}
6438const ::google::protobuf::Descriptor* OperatorDef::descriptor() {
6439 protobuf_AssignDescriptorsOnce();
6440 return OperatorDef_descriptor_;
6441}
6442
6443const OperatorDef& OperatorDef::default_instance() {
6444 if (default_instance_ == NULL) protobuf_AddDesc_caffe2_2eproto();
6445 return *default_instance_;
6446}
6447
6448OperatorDef* OperatorDef::default_instance_ = NULL;
6449
6450OperatorDef* OperatorDef::New() const {
6451 return new OperatorDef;
6452}
6453
6454void OperatorDef::Clear() {
6455#define OFFSET_OF_FIELD_(f) (reinterpret_cast<char*>( \
6456 &reinterpret_cast<OperatorDef*>(16)->f) - \
6457 reinterpret_cast<char*>(16))
6458
6459#define ZR_(first, last) do { \
6460 size_t f = OFFSET_OF_FIELD_(first); \
6461 size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \
6462 ::memset(&first, 0, n); \
6463 } while (0)
6464
6465 if (_has_bits_[0 / 32] & 108) {
6466 if (has_name()) {
6467 if (name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
6468 name_->clear();
6469 }
6470 }
6471 if (has_type()) {
6472 if (type_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
6473 type_->clear();
6474 }
6475 }
6476 if (has_device_option()) {
6477 if (device_option_ != NULL) device_option_->::caffe2::DeviceOption::Clear();
6478 }
6479 if (has_engine()) {
6480 if (engine_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
6481 engine_->clear();
6482 }
6483 }
6484 }
6485 if (_has_bits_[8 / 32] & 3840) {
6486 ZR_(op_version_, is_gradient_op_);
6487 if (has_debug_info()) {
6488 if (debug_info_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
6489 debug_info_->clear();
6490 }
6491 }
6492 if (has_domain()) {
6493 if (domain_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
6494 domain_->clear();
6495 }
6496 }
6497 }
6498
6499#undef OFFSET_OF_FIELD_
6500#undef ZR_
6501
6502 input_.Clear();
6503 output_.Clear();
6504 arg_.Clear();
6505 control_input_.Clear();
6506 ::memset(_has_bits_, 0, sizeof(_has_bits_));
6507 mutable_unknown_fields()->Clear();
6508}
6509
6510bool OperatorDef::MergePartialFromCodedStream(
6511 ::google::protobuf::io::CodedInputStream* input) {
6512#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure
6513 ::google::protobuf::uint32 tag;
6514 // @@protoc_insertion_point(parse_start:caffe2.OperatorDef)
6515 for (;;) {
6516 ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);
6517 tag = p.first;
6518 if (!p.second) goto handle_unusual;
6519 switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
6520 // repeated string input = 1;
6521 case 1: {
6522 if (tag == 10) {
6523 parse_input:
6524 DO_(::google::protobuf::internal::WireFormatLite::ReadString(
6525 input, this->add_input()));
6526 ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
6527 this->input(this->input_size() - 1).data(),
6528 this->input(this->input_size() - 1).length(),
6529 ::google::protobuf::internal::WireFormat::PARSE,
6530 "input");
6531 } else {
6532 goto handle_unusual;
6533 }
6534 if (input->ExpectTag(10)) goto parse_input;
6535 if (input->ExpectTag(18)) goto parse_output;
6536 break;
6537 }
6538
6539 // repeated string output = 2;
6540 case 2: {
6541 if (tag == 18) {
6542 parse_output:
6543 DO_(::google::protobuf::internal::WireFormatLite::ReadString(
6544 input, this->add_output()));
6545 ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
6546 this->output(this->output_size() - 1).data(),
6547 this->output(this->output_size() - 1).length(),
6548 ::google::protobuf::internal::WireFormat::PARSE,
6549 "output");
6550 } else {
6551 goto handle_unusual;
6552 }
6553 if (input->ExpectTag(18)) goto parse_output;
6554 if (input->ExpectTag(26)) goto parse_name;
6555 break;
6556 }
6557
6558 // optional string name = 3;
6559 case 3: {
6560 if (tag == 26) {
6561 parse_name:
6562 DO_(::google::protobuf::internal::WireFormatLite::ReadString(
6563 input, this->mutable_name()));
6564 ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
6565 this->name().data(), this->name().length(),
6566 ::google::protobuf::internal::WireFormat::PARSE,
6567 "name");
6568 } else {
6569 goto handle_unusual;
6570 }
6571 if (input->ExpectTag(34)) goto parse_type;
6572 break;
6573 }
6574
6575 // optional string type = 4;
6576 case 4: {
6577 if (tag == 34) {
6578 parse_type:
6579 DO_(::google::protobuf::internal::WireFormatLite::ReadString(
6580 input, this->mutable_type()));
6581 ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
6582 this->type().data(), this->type().length(),
6583 ::google::protobuf::internal::WireFormat::PARSE,
6584 "type");
6585 } else {
6586 goto handle_unusual;
6587 }
6588 if (input->ExpectTag(42)) goto parse_arg;
6589 break;
6590 }
6591
6592 // repeated .caffe2.Argument arg = 5;
6593 case 5: {
6594 if (tag == 42) {
6595 parse_arg:
6596 DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
6597 input, add_arg()));
6598 } else {
6599 goto handle_unusual;
6600 }
6601 if (input->ExpectTag(42)) goto parse_arg;
6602 if (input->ExpectTag(50)) goto parse_device_option;
6603 break;
6604 }
6605
6606 // optional .caffe2.DeviceOption device_option = 6;
6607 case 6: {
6608 if (tag == 50) {
6609 parse_device_option:
6610 DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
6611 input, mutable_device_option()));
6612 } else {
6613 goto handle_unusual;
6614 }
6615 if (input->ExpectTag(58)) goto parse_engine;
6616 break;
6617 }
6618
6619 // optional string engine = 7;
6620 case 7: {
6621 if (tag == 58) {
6622 parse_engine:
6623 DO_(::google::protobuf::internal::WireFormatLite::ReadString(
6624 input, this->mutable_engine()));
6625 ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
6626 this->engine().data(), this->engine().length(),
6627 ::google::protobuf::internal::WireFormat::PARSE,
6628 "engine");
6629 } else {
6630 goto handle_unusual;
6631 }
6632 if (input->ExpectTag(66)) goto parse_control_input;
6633 break;
6634 }
6635
6636 // repeated string control_input = 8;
6637 case 8: {
6638 if (tag == 66) {
6639 parse_control_input:
6640 DO_(::google::protobuf::internal::WireFormatLite::ReadString(
6641 input, this->add_control_input()));
6642 ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
6643 this->control_input(this->control_input_size() - 1).data(),
6644 this->control_input(this->control_input_size() - 1).length(),
6645 ::google::protobuf::internal::WireFormat::PARSE,
6646 "control_input");
6647 } else {
6648 goto handle_unusual;
6649 }
6650 if (input->ExpectTag(66)) goto parse_control_input;
6651 if (input->ExpectTag(72)) goto parse_is_gradient_op;
6652 break;
6653 }
6654
6655 // optional bool is_gradient_op = 9 [default = false];
6656 case 9: {
6657 if (tag == 72) {
6658 parse_is_gradient_op:
6659 DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
6660 bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
6661 input, &is_gradient_op_)));
6662 set_has_is_gradient_op();
6663 } else {
6664 goto handle_unusual;
6665 }
6666 if (input->ExpectTag(82)) goto parse_debug_info;
6667 break;
6668 }
6669
6670 // optional string debug_info = 10;
6671 case 10: {
6672 if (tag == 82) {
6673 parse_debug_info:
6674 DO_(::google::protobuf::internal::WireFormatLite::ReadString(
6675 input, this->mutable_debug_info()));
6676 ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
6677 this->debug_info().data(), this->debug_info().length(),
6678 ::google::protobuf::internal::WireFormat::PARSE,
6679 "debug_info");
6680 } else {
6681 goto handle_unusual;
6682 }
6683 if (input->ExpectTag(90)) goto parse_domain;
6684 break;
6685 }
6686
6687 // optional string domain = 11;
6688 case 11: {
6689 if (tag == 90) {
6690 parse_domain:
6691 DO_(::google::protobuf::internal::WireFormatLite::ReadString(
6692 input, this->mutable_domain()));
6693 ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
6694 this->domain().data(), this->domain().length(),
6695 ::google::protobuf::internal::WireFormat::PARSE,
6696 "domain");
6697 } else {
6698 goto handle_unusual;
6699 }
6700 if (input->ExpectTag(96)) goto parse_op_version;
6701 break;
6702 }
6703
6704 // optional int64 op_version = 12;
6705 case 12: {
6706 if (tag == 96) {
6707 parse_op_version:
6708 DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
6709 ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>(
6710 input, &op_version_)));
6711 set_has_op_version();
6712 } else {
6713 goto handle_unusual;
6714 }
6715 if (input->ExpectAtEnd()) goto success;
6716 break;
6717 }
6718
6719 default: {
6720 handle_unusual:
6721 if (tag == 0 ||
6722 ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
6723 ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
6724 goto success;
6725 }
6726 DO_(::google::protobuf::internal::WireFormat::SkipField(
6727 input, tag, mutable_unknown_fields()));
6728 break;
6729 }
6730 }
6731 }
6732success:
6733 // @@protoc_insertion_point(parse_success:caffe2.OperatorDef)
6734 return true;
6735failure:
6736 // @@protoc_insertion_point(parse_failure:caffe2.OperatorDef)
6737 return false;
6738#undef DO_
6739}
6740
6741void OperatorDef::SerializeWithCachedSizes(
6742 ::google::protobuf::io::CodedOutputStream* output) const {
6743 // @@protoc_insertion_point(serialize_start:caffe2.OperatorDef)
6744 // repeated string input = 1;
6745 for (int i = 0; i < this->input_size(); i++) {
6746 ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
6747 this->input(i).data(), this->input(i).length(),
6748 ::google::protobuf::internal::WireFormat::SERIALIZE,
6749 "input");
6750 ::google::protobuf::internal::WireFormatLite::WriteString(
6751 1, this->input(i), output);
6752 }
6753
6754 // repeated string output = 2;
6755 for (int i = 0; i < this->output_size(); i++) {
6756 ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
6757 this->output(i).data(), this->output(i).length(),
6758 ::google::protobuf::internal::WireFormat::SERIALIZE,
6759 "output");
6760 ::google::protobuf::internal::WireFormatLite::WriteString(
6761 2, this->output(i), output);
6762 }
6763
6764 // optional string name = 3;
6765 if (has_name()) {
6766 ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
6767 this->name().data(), this->name().length(),
6768 ::google::protobuf::internal::WireFormat::SERIALIZE,
6769 "name");
6770 ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
6771 3, this->name(), output);
6772 }
6773
6774 // optional string type = 4;
6775 if (has_type()) {
6776 ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
6777 this->type().data(), this->type().length(),
6778 ::google::protobuf::internal::WireFormat::SERIALIZE,
6779 "type");
6780 ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
6781 4, this->type(), output);
6782 }
6783
6784 // repeated .caffe2.Argument arg = 5;
6785 for (int i = 0; i < this->arg_size(); i++) {
6786 ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
6787 5, this->arg(i), output);
6788 }
6789
6790 // optional .caffe2.DeviceOption device_option = 6;
6791 if (has_device_option()) {
6792 ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
6793 6, this->device_option(), output);
6794 }
6795
6796 // optional string engine = 7;
6797 if (has_engine()) {
6798 ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
6799 this->engine().data(), this->engine().length(),
6800 ::google::protobuf::internal::WireFormat::SERIALIZE,
6801 "engine");
6802 ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
6803 7, this->engine(), output);
6804 }
6805
6806 // repeated string control_input = 8;
6807 for (int i = 0; i < this->control_input_size(); i++) {
6808 ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
6809 this->control_input(i).data(), this->control_input(i).length(),
6810 ::google::protobuf::internal::WireFormat::SERIALIZE,
6811 "control_input");
6812 ::google::protobuf::internal::WireFormatLite::WriteString(
6813 8, this->control_input(i), output);
6814 }
6815
6816 // optional bool is_gradient_op = 9 [default = false];
6817 if (has_is_gradient_op()) {
6818 ::google::protobuf::internal::WireFormatLite::WriteBool(9, this->is_gradient_op(), output);
6819 }
6820
6821 // optional string debug_info = 10;
6822 if (has_debug_info()) {
6823 ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
6824 this->debug_info().data(), this->debug_info().length(),
6825 ::google::protobuf::internal::WireFormat::SERIALIZE,
6826 "debug_info");
6827 ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
6828 10, this->debug_info(), output);
6829 }
6830
6831 // optional string domain = 11;
6832 if (has_domain()) {
6833 ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
6834 this->domain().data(), this->domain().length(),
6835 ::google::protobuf::internal::WireFormat::SERIALIZE,
6836 "domain");
6837 ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
6838 11, this->domain(), output);
6839 }
6840
6841 // optional int64 op_version = 12;
6842 if (has_op_version()) {
6843 ::google::protobuf::internal::WireFormatLite::WriteInt64(12, this->op_version(), output);
6844 }
6845
6846 if (!unknown_fields().empty()) {
6847 ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
6848 unknown_fields(), output);
6849 }
6850 // @@protoc_insertion_point(serialize_end:caffe2.OperatorDef)
6851}
6852
6853::google::protobuf::uint8* OperatorDef::SerializeWithCachedSizesToArray(
6854 ::google::protobuf::uint8* target) const {
6855 // @@protoc_insertion_point(serialize_to_array_start:caffe2.OperatorDef)
6856 // repeated string input = 1;
6857 for (int i = 0; i < this->input_size(); i++) {
6858 ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
6859 this->input(i).data(), this->input(i).length(),
6860 ::google::protobuf::internal::WireFormat::SERIALIZE,
6861 "input");
6862 target = ::google::protobuf::internal::WireFormatLite::
6863 WriteStringToArray(1, this->input(i), target);
6864 }
6865
6866 // repeated string output = 2;
6867 for (int i = 0; i < this->output_size(); i++) {
6868 ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
6869 this->output(i).data(), this->output(i).length(),
6870 ::google::protobuf::internal::WireFormat::SERIALIZE,
6871 "output");
6872 target = ::google::protobuf::internal::WireFormatLite::
6873 WriteStringToArray(2, this->output(i), target);
6874 }
6875
6876 // optional string name = 3;
6877 if (has_name()) {
6878 ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
6879 this->name().data(), this->name().length(),
6880 ::google::protobuf::internal::WireFormat::SERIALIZE,
6881 "name");
6882 target =
6883 ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
6884 3, this->name(), target);
6885 }
6886
6887 // optional string type = 4;
6888 if (has_type()) {
6889 ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
6890 this->type().data(), this->type().length(),
6891 ::google::protobuf::internal::WireFormat::SERIALIZE,
6892 "type");
6893 target =
6894 ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
6895 4, this->type(), target);
6896 }
6897
6898 // repeated .caffe2.Argument arg = 5;
6899 for (int i = 0; i < this->arg_size(); i++) {
6900 target = ::google::protobuf::internal::WireFormatLite::
6901 WriteMessageNoVirtualToArray(
6902 5, this->arg(i), target);
6903 }
6904
6905 // optional .caffe2.DeviceOption device_option = 6;
6906 if (has_device_option()) {
6907 target = ::google::protobuf::internal::WireFormatLite::
6908 WriteMessageNoVirtualToArray(
6909 6, this->device_option(), target);
6910 }
6911
6912 // optional string engine = 7;
6913 if (has_engine()) {
6914 ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
6915 this->engine().data(), this->engine().length(),
6916 ::google::protobuf::internal::WireFormat::SERIALIZE,
6917 "engine");
6918 target =
6919 ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
6920 7, this->engine(), target);
6921 }
6922
6923 // repeated string control_input = 8;
6924 for (int i = 0; i < this->control_input_size(); i++) {
6925 ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
6926 this->control_input(i).data(), this->control_input(i).length(),
6927 ::google::protobuf::internal::WireFormat::SERIALIZE,
6928 "control_input");
6929 target = ::google::protobuf::internal::WireFormatLite::
6930 WriteStringToArray(8, this->control_input(i), target);
6931 }
6932
6933 // optional bool is_gradient_op = 9 [default = false];
6934 if (has_is_gradient_op()) {
6935 target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(9, this->is_gradient_op(), target);
6936 }
6937
6938 // optional string debug_info = 10;
6939 if (has_debug_info()) {
6940 ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
6941 this->debug_info().data(), this->debug_info().length(),
6942 ::google::protobuf::internal::WireFormat::SERIALIZE,
6943 "debug_info");
6944 target =
6945 ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
6946 10, this->debug_info(), target);
6947 }
6948
6949 // optional string domain = 11;
6950 if (has_domain()) {
6951 ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
6952 this->domain().data(), this->domain().length(),
6953 ::google::protobuf::internal::WireFormat::SERIALIZE,
6954 "domain");
6955 target =
6956 ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
6957 11, this->domain(), target);
6958 }
6959
6960 // optional int64 op_version = 12;
6961 if (has_op_version()) {
6962 target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(12, this->op_version(), target);
6963 }
6964
6965 if (!unknown_fields().empty()) {
6966 target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
6967 unknown_fields(), target);
6968 }
6969 // @@protoc_insertion_point(serialize_to_array_end:caffe2.OperatorDef)
6970 return target;
6971}
6972
6973int OperatorDef::ByteSize() const {
6974 int total_size = 0;
6975
6976 if (_has_bits_[2 / 32] & (0xffu << (2 % 32))) {
6977 // optional string name = 3;
6978 if (has_name()) {
6979 total_size += 1 +
6980 ::google::protobuf::internal::WireFormatLite::StringSize(
6981 this->name());
6982 }
6983
6984 // optional string type = 4;
6985 if (has_type()) {
6986 total_size += 1 +
6987 ::google::protobuf::internal::WireFormatLite::StringSize(
6988 this->type());
6989 }
6990
6991 // optional .caffe2.DeviceOption device_option = 6;
6992 if (has_device_option()) {
6993 total_size += 1 +
6994 ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
6995 this->device_option());
6996 }
6997
6998 // optional string engine = 7;
6999 if (has_engine()) {
7000 total_size += 1 +
7001 ::google::protobuf::internal::WireFormatLite::StringSize(
7002 this->engine());
7003 }
7004
7005 }
7006 if (_has_bits_[8 / 32] & (0xffu << (8 % 32))) {
7007 // optional bool is_gradient_op = 9 [default = false];
7008 if (has_is_gradient_op()) {
7009 total_size += 1 + 1;
7010 }
7011
7012 // optional string debug_info = 10;
7013 if (has_debug_info()) {
7014 total_size += 1 +
7015 ::google::protobuf::internal::WireFormatLite::StringSize(
7016 this->debug_info());
7017 }
7018
7019 // optional string domain = 11;
7020 if (has_domain()) {
7021 total_size += 1 +
7022 ::google::protobuf::internal::WireFormatLite::StringSize(
7023 this->domain());
7024 }
7025
7026 // optional int64 op_version = 12;
7027 if (has_op_version()) {
7028 total_size += 1 +
7029 ::google::protobuf::internal::WireFormatLite::Int64Size(
7030 this->op_version());
7031 }
7032
7033 }
7034 // repeated string input = 1;
7035 total_size += 1 * this->input_size();
7036 for (int i = 0; i < this->input_size(); i++) {
7037 total_size += ::google::protobuf::internal::WireFormatLite::StringSize(
7038 this->input(i));
7039 }
7040
7041 // repeated string output = 2;
7042 total_size += 1 * this->output_size();
7043 for (int i = 0; i < this->output_size(); i++) {
7044 total_size += ::google::protobuf::internal::WireFormatLite::StringSize(
7045 this->output(i));
7046 }
7047
7048 // repeated .caffe2.Argument arg = 5;
7049 total_size += 1 * this->arg_size();
7050 for (int i = 0; i < this->arg_size(); i++) {
7051 total_size +=
7052 ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
7053 this->arg(i));
7054 }
7055
7056 // repeated string control_input = 8;
7057 total_size += 1 * this->control_input_size();
7058 for (int i = 0; i < this->control_input_size(); i++) {
7059 total_size += ::google::protobuf::internal::WireFormatLite::StringSize(
7060 this->control_input(i));
7061 }
7062
7063 if (!unknown_fields().empty()) {
7064 total_size +=
7065 ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
7066 unknown_fields());
7067 }
7068 GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
7069 _cached_size_ = total_size;
7070 GOOGLE_SAFE_CONCURRENT_WRITES_END();
7071 return total_size;
7072}
7073
7074void OperatorDef::MergeFrom(const ::google::protobuf::Message& from) {
7075 GOOGLE_CHECK_NE(&from, this);
7076 const OperatorDef* source =
7077 ::google::protobuf::internal::dynamic_cast_if_available<const OperatorDef*>(
7078 &from);
7079 if (source == NULL) {
7080 ::google::protobuf::internal::ReflectionOps::Merge(from, this);
7081 } else {
7082 MergeFrom(*source);
7083 }
7084}
7085
7086void OperatorDef::MergeFrom(const OperatorDef& from) {
7087 GOOGLE_CHECK_NE(&from, this);
7088 input_.MergeFrom(from.input_);
7089 output_.MergeFrom(from.output_);
7090 arg_.MergeFrom(from.arg_);
7091 control_input_.MergeFrom(from.control_input_);
7092 if (from._has_bits_[2 / 32] & (0xffu << (2 % 32))) {
7093 if (from.has_name()) {
7094 set_name(from.name());
7095 }
7096 if (from.has_type()) {
7097 set_type(from.type());
7098 }
7099 if (from.has_device_option()) {
7100 mutable_device_option()->::caffe2::DeviceOption::MergeFrom(from.device_option());
7101 }
7102 if (from.has_engine()) {
7103 set_engine(from.engine());
7104 }
7105 }
7106 if (from._has_bits_[8 / 32] & (0xffu << (8 % 32))) {
7107 if (from.has_is_gradient_op()) {
7108 set_is_gradient_op(from.is_gradient_op());
7109 }
7110 if (from.has_debug_info()) {
7111 set_debug_info(from.debug_info());
7112 }
7113 if (from.has_domain()) {
7114 set_domain(from.domain());
7115 }
7116 if (from.has_op_version()) {
7117 set_op_version(from.op_version());
7118 }
7119 }
7120 mutable_unknown_fields()->MergeFrom(from.unknown_fields());
7121}
7122
7123void OperatorDef::CopyFrom(const ::google::protobuf::Message& from) {
7124 if (&from == this) return;
7125 Clear();
7126 MergeFrom(from);
7127}
7128
7129void OperatorDef::CopyFrom(const OperatorDef& from) {
7130 if (&from == this) return;
7131 Clear();
7132 MergeFrom(from);
7133}
7134
7135bool OperatorDef::IsInitialized() const {
7136
7137 if (!::google::protobuf::internal::AllAreInitialized(this->arg())) return false;
7138 return true;
7139}
7140
7141void OperatorDef::Swap(OperatorDef* other) {
7142 if (other != this) {
7143 input_.Swap(&other->input_);
7144 output_.Swap(&other->output_);
7145 std::swap(name_, other->name_);
7146 std::swap(type_, other->type_);
7147 arg_.Swap(&other->arg_);
7148 std::swap(device_option_, other->device_option_);
7149 std::swap(engine_, other->engine_);
7150 control_input_.Swap(&other->control_input_);
7151 std::swap(is_gradient_op_, other->is_gradient_op_);
7152 std::swap(debug_info_, other->debug_info_);
7153 std::swap(domain_, other->domain_);
7154 std::swap(op_version_, other->op_version_);
7155 std::swap(_has_bits_[0], other->_has_bits_[0]);
7156 _unknown_fields_.Swap(&other->_unknown_fields_);
7157 std::swap(_cached_size_, other->_cached_size_);
7158 }
7159}
7160
7161::google::protobuf::Metadata OperatorDef::GetMetadata() const {
7162 protobuf_AssignDescriptorsOnce();
7163 ::google::protobuf::Metadata metadata;
7164 metadata.descriptor = OperatorDef_descriptor_;
7165 metadata.reflection = OperatorDef_reflection_;
7166 return metadata;
7167}
7168
7169
7170// ===================================================================
7171
7172#ifndef _MSC_VER
7173const int MapFieldEntry::kKeyFieldNumber;
7174const int MapFieldEntry::kValFieldNumber;
7175#endif // !_MSC_VER
7176
7177MapFieldEntry::MapFieldEntry()
7178 : ::google::protobuf::Message() {
7179 SharedCtor();
7180 // @@protoc_insertion_point(constructor:caffe2.MapFieldEntry)
7181}
7182
7183void MapFieldEntry::InitAsDefaultInstance() {
7184}
7185
7186MapFieldEntry::MapFieldEntry(const MapFieldEntry& from)
7187 : ::google::protobuf::Message() {
7188 SharedCtor();
7189 MergeFrom(from);
7190 // @@protoc_insertion_point(copy_constructor:caffe2.MapFieldEntry)
7191}
7192
7193void MapFieldEntry::SharedCtor() {
7194 ::google::protobuf::internal::GetEmptyString();
7195 _cached_size_ = 0;
7196 key_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
7197 val_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
7198 ::memset(_has_bits_, 0, sizeof(_has_bits_));
7199}
7200
7201MapFieldEntry::~MapFieldEntry() {
7202 // @@protoc_insertion_point(destructor:caffe2.MapFieldEntry)
7203 SharedDtor();
7204}
7205
7206void MapFieldEntry::SharedDtor() {
7207 if (key_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
7208 delete key_;
7209 }
7210 if (val_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
7211 delete val_;
7212 }
7213 if (this != default_instance_) {
7214 }
7215}
7216
7217void MapFieldEntry::SetCachedSize(int size) const {
7218 GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
7219 _cached_size_ = size;
7220 GOOGLE_SAFE_CONCURRENT_WRITES_END();
7221}
7222const ::google::protobuf::Descriptor* MapFieldEntry::descriptor() {
7223 protobuf_AssignDescriptorsOnce();
7224 return MapFieldEntry_descriptor_;
7225}
7226
7227const MapFieldEntry& MapFieldEntry::default_instance() {
7228 if (default_instance_ == NULL) protobuf_AddDesc_caffe2_2eproto();
7229 return *default_instance_;
7230}
7231
7232MapFieldEntry* MapFieldEntry::default_instance_ = NULL;
7233
7234MapFieldEntry* MapFieldEntry::New() const {
7235 return new MapFieldEntry;
7236}
7237
7238void MapFieldEntry::Clear() {
7239 if (_has_bits_[0 / 32] & 3) {
7240 if (has_key()) {
7241 if (key_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
7242 key_->clear();
7243 }
7244 }
7245 if (has_val()) {
7246 if (val_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
7247 val_->clear();
7248 }
7249 }
7250 }
7251 ::memset(_has_bits_, 0, sizeof(_has_bits_));
7252 mutable_unknown_fields()->Clear();
7253}
7254
7255bool MapFieldEntry::MergePartialFromCodedStream(
7256 ::google::protobuf::io::CodedInputStream* input) {
7257#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure
7258 ::google::protobuf::uint32 tag;
7259 // @@protoc_insertion_point(parse_start:caffe2.MapFieldEntry)
7260 for (;;) {
7261 ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);
7262 tag = p.first;
7263 if (!p.second) goto handle_unusual;
7264 switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
7265 // required string key = 1;
7266 case 1: {
7267 if (tag == 10) {
7268 DO_(::google::protobuf::internal::WireFormatLite::ReadString(
7269 input, this->mutable_key()));
7270 ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
7271 this->key().data(), this->key().length(),
7272 ::google::protobuf::internal::WireFormat::PARSE,
7273 "key");
7274 } else {
7275 goto handle_unusual;
7276 }
7277 if (input->ExpectTag(18)) goto parse_val;
7278 break;
7279 }
7280
7281 // required string val = 2;
7282 case 2: {
7283 if (tag == 18) {
7284 parse_val:
7285 DO_(::google::protobuf::internal::WireFormatLite::ReadString(
7286 input, this->mutable_val()));
7287 ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
7288 this->val().data(), this->val().length(),
7289 ::google::protobuf::internal::WireFormat::PARSE,
7290 "val");
7291 } else {
7292 goto handle_unusual;
7293 }
7294 if (input->ExpectAtEnd()) goto success;
7295 break;
7296 }
7297
7298 default: {
7299 handle_unusual:
7300 if (tag == 0 ||
7301 ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
7302 ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
7303 goto success;
7304 }
7305 DO_(::google::protobuf::internal::WireFormat::SkipField(
7306 input, tag, mutable_unknown_fields()));
7307 break;
7308 }
7309 }
7310 }
7311success:
7312 // @@protoc_insertion_point(parse_success:caffe2.MapFieldEntry)
7313 return true;
7314failure:
7315 // @@protoc_insertion_point(parse_failure:caffe2.MapFieldEntry)
7316 return false;
7317#undef DO_
7318}
7319
7320void MapFieldEntry::SerializeWithCachedSizes(
7321 ::google::protobuf::io::CodedOutputStream* output) const {
7322 // @@protoc_insertion_point(serialize_start:caffe2.MapFieldEntry)
7323 // required string key = 1;
7324 if (has_key()) {
7325 ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
7326 this->key().data(), this->key().length(),
7327 ::google::protobuf::internal::WireFormat::SERIALIZE,
7328 "key");
7329 ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
7330 1, this->key(), output);
7331 }
7332
7333 // required string val = 2;
7334 if (has_val()) {
7335 ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
7336 this->val().data(), this->val().length(),
7337 ::google::protobuf::internal::WireFormat::SERIALIZE,
7338 "val");
7339 ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
7340 2, this->val(), output);
7341 }
7342
7343 if (!unknown_fields().empty()) {
7344 ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
7345 unknown_fields(), output);
7346 }
7347 // @@protoc_insertion_point(serialize_end:caffe2.MapFieldEntry)
7348}
7349
7350::google::protobuf::uint8* MapFieldEntry::SerializeWithCachedSizesToArray(
7351 ::google::protobuf::uint8* target) const {
7352 // @@protoc_insertion_point(serialize_to_array_start:caffe2.MapFieldEntry)
7353 // required string key = 1;
7354 if (has_key()) {
7355 ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
7356 this->key().data(), this->key().length(),
7357 ::google::protobuf::internal::WireFormat::SERIALIZE,
7358 "key");
7359 target =
7360 ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
7361 1, this->key(), target);
7362 }
7363
7364 // required string val = 2;
7365 if (has_val()) {
7366 ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
7367 this->val().data(), this->val().length(),
7368 ::google::protobuf::internal::WireFormat::SERIALIZE,
7369 "val");
7370 target =
7371 ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
7372 2, this->val(), target);
7373 }
7374
7375 if (!unknown_fields().empty()) {
7376 target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
7377 unknown_fields(), target);
7378 }
7379 // @@protoc_insertion_point(serialize_to_array_end:caffe2.MapFieldEntry)
7380 return target;
7381}
7382
7383int MapFieldEntry::ByteSize() const {
7384 int total_size = 0;
7385
7386 if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
7387 // required string key = 1;
7388 if (has_key()) {
7389 total_size += 1 +
7390 ::google::protobuf::internal::WireFormatLite::StringSize(
7391 this->key());
7392 }
7393
7394 // required string val = 2;
7395 if (has_val()) {
7396 total_size += 1 +
7397 ::google::protobuf::internal::WireFormatLite::StringSize(
7398 this->val());
7399 }
7400
7401 }
7402 if (!unknown_fields().empty()) {
7403 total_size +=
7404 ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
7405 unknown_fields());
7406 }
7407 GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
7408 _cached_size_ = total_size;
7409 GOOGLE_SAFE_CONCURRENT_WRITES_END();
7410 return total_size;
7411}
7412
7413void MapFieldEntry::MergeFrom(const ::google::protobuf::Message& from) {
7414 GOOGLE_CHECK_NE(&from, this);
7415 const MapFieldEntry* source =
7416 ::google::protobuf::internal::dynamic_cast_if_available<const MapFieldEntry*>(
7417 &from);
7418 if (source == NULL) {
7419 ::google::protobuf::internal::ReflectionOps::Merge(from, this);
7420 } else {
7421 MergeFrom(*source);
7422 }
7423}
7424
7425void MapFieldEntry::MergeFrom(const MapFieldEntry& from) {
7426 GOOGLE_CHECK_NE(&from, this);
7427 if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
7428 if (from.has_key()) {
7429 set_key(from.key());
7430 }
7431 if (from.has_val()) {
7432 set_val(from.val());
7433 }
7434 }
7435 mutable_unknown_fields()->MergeFrom(from.unknown_fields());
7436}
7437
7438void MapFieldEntry::CopyFrom(const ::google::protobuf::Message& from) {
7439 if (&from == this) return;
7440 Clear();
7441 MergeFrom(from);
7442}
7443
7444void MapFieldEntry::CopyFrom(const MapFieldEntry& from) {
7445 if (&from == this) return;
7446 Clear();
7447 MergeFrom(from);
7448}
7449
7450bool MapFieldEntry::IsInitialized() const {
7451 if ((_has_bits_[0] & 0x00000003) != 0x00000003) return false;
7452
7453 return true;
7454}
7455
7456void MapFieldEntry::Swap(MapFieldEntry* other) {
7457 if (other != this) {
7458 std::swap(key_, other->key_);
7459 std::swap(val_, other->val_);
7460 std::swap(_has_bits_[0], other->_has_bits_[0]);
7461 _unknown_fields_.Swap(&other->_unknown_fields_);
7462 std::swap(_cached_size_, other->_cached_size_);
7463 }
7464}
7465
7466::google::protobuf::Metadata MapFieldEntry::GetMetadata() const {
7467 protobuf_AssignDescriptorsOnce();
7468 ::google::protobuf::Metadata metadata;
7469 metadata.descriptor = MapFieldEntry_descriptor_;
7470 metadata.reflection = MapFieldEntry_reflection_;
7471 return metadata;
7472}
7473
7474
7475// ===================================================================
7476
7477#ifndef _MSC_VER
7478const int BackendOptions::kBackendNameFieldNumber;
7479const int BackendOptions::kOptionFieldNumber;
7480#endif // !_MSC_VER
7481
7482BackendOptions::BackendOptions()
7483 : ::google::protobuf::Message() {
7484 SharedCtor();
7485 // @@protoc_insertion_point(constructor:caffe2.BackendOptions)
7486}
7487
7488void BackendOptions::InitAsDefaultInstance() {
7489}
7490
7491BackendOptions::BackendOptions(const BackendOptions& from)
7492 : ::google::protobuf::Message() {
7493 SharedCtor();
7494 MergeFrom(from);
7495 // @@protoc_insertion_point(copy_constructor:caffe2.BackendOptions)
7496}
7497
7498void BackendOptions::SharedCtor() {
7499 ::google::protobuf::internal::GetEmptyString();
7500 _cached_size_ = 0;
7501 backend_name_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
7502 ::memset(_has_bits_, 0, sizeof(_has_bits_));
7503}
7504
7505BackendOptions::~BackendOptions() {
7506 // @@protoc_insertion_point(destructor:caffe2.BackendOptions)
7507 SharedDtor();
7508}
7509
7510void BackendOptions::SharedDtor() {
7511 if (backend_name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
7512 delete backend_name_;
7513 }
7514 if (this != default_instance_) {
7515 }
7516}
7517
7518void BackendOptions::SetCachedSize(int size) const {
7519 GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
7520 _cached_size_ = size;
7521 GOOGLE_SAFE_CONCURRENT_WRITES_END();
7522}
7523const ::google::protobuf::Descriptor* BackendOptions::descriptor() {
7524 protobuf_AssignDescriptorsOnce();
7525 return BackendOptions_descriptor_;
7526}
7527
7528const BackendOptions& BackendOptions::default_instance() {
7529 if (default_instance_ == NULL) protobuf_AddDesc_caffe2_2eproto();
7530 return *default_instance_;
7531}
7532
7533BackendOptions* BackendOptions::default_instance_ = NULL;
7534
7535BackendOptions* BackendOptions::New() const {
7536 return new BackendOptions;
7537}
7538
7539void BackendOptions::Clear() {
7540 if (has_backend_name()) {
7541 if (backend_name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
7542 backend_name_->clear();
7543 }
7544 }
7545 option_.Clear();
7546 ::memset(_has_bits_, 0, sizeof(_has_bits_));
7547 mutable_unknown_fields()->Clear();
7548}
7549
7550bool BackendOptions::MergePartialFromCodedStream(
7551 ::google::protobuf::io::CodedInputStream* input) {
7552#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure
7553 ::google::protobuf::uint32 tag;
7554 // @@protoc_insertion_point(parse_start:caffe2.BackendOptions)
7555 for (;;) {
7556 ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);
7557 tag = p.first;
7558 if (!p.second) goto handle_unusual;
7559 switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
7560 // required string backend_name = 1;
7561 case 1: {
7562 if (tag == 10) {
7563 DO_(::google::protobuf::internal::WireFormatLite::ReadString(
7564 input, this->mutable_backend_name()));
7565 ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
7566 this->backend_name().data(), this->backend_name().length(),
7567 ::google::protobuf::internal::WireFormat::PARSE,
7568 "backend_name");
7569 } else {
7570 goto handle_unusual;
7571 }
7572 if (input->ExpectTag(18)) goto parse_option;
7573 break;
7574 }
7575
7576 // repeated .caffe2.MapFieldEntry option = 2;
7577 case 2: {
7578 if (tag == 18) {
7579 parse_option:
7580 DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
7581 input, add_option()));
7582 } else {
7583 goto handle_unusual;
7584 }
7585 if (input->ExpectTag(18)) goto parse_option;
7586 if (input->ExpectAtEnd()) goto success;
7587 break;
7588 }
7589
7590 default: {
7591 handle_unusual:
7592 if (tag == 0 ||
7593 ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
7594 ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
7595 goto success;
7596 }
7597 DO_(::google::protobuf::internal::WireFormat::SkipField(
7598 input, tag, mutable_unknown_fields()));
7599 break;
7600 }
7601 }
7602 }
7603success:
7604 // @@protoc_insertion_point(parse_success:caffe2.BackendOptions)
7605 return true;
7606failure:
7607 // @@protoc_insertion_point(parse_failure:caffe2.BackendOptions)
7608 return false;
7609#undef DO_
7610}
7611
7612void BackendOptions::SerializeWithCachedSizes(
7613 ::google::protobuf::io::CodedOutputStream* output) const {
7614 // @@protoc_insertion_point(serialize_start:caffe2.BackendOptions)
7615 // required string backend_name = 1;
7616 if (has_backend_name()) {
7617 ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
7618 this->backend_name().data(), this->backend_name().length(),
7619 ::google::protobuf::internal::WireFormat::SERIALIZE,
7620 "backend_name");
7621 ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
7622 1, this->backend_name(), output);
7623 }
7624
7625 // repeated .caffe2.MapFieldEntry option = 2;
7626 for (int i = 0; i < this->option_size(); i++) {
7627 ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
7628 2, this->option(i), output);
7629 }
7630
7631 if (!unknown_fields().empty()) {
7632 ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
7633 unknown_fields(), output);
7634 }
7635 // @@protoc_insertion_point(serialize_end:caffe2.BackendOptions)
7636}
7637
7638::google::protobuf::uint8* BackendOptions::SerializeWithCachedSizesToArray(
7639 ::google::protobuf::uint8* target) const {
7640 // @@protoc_insertion_point(serialize_to_array_start:caffe2.BackendOptions)
7641 // required string backend_name = 1;
7642 if (has_backend_name()) {
7643 ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
7644 this->backend_name().data(), this->backend_name().length(),
7645 ::google::protobuf::internal::WireFormat::SERIALIZE,
7646 "backend_name");
7647 target =
7648 ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
7649 1, this->backend_name(), target);
7650 }
7651
7652 // repeated .caffe2.MapFieldEntry option = 2;
7653 for (int i = 0; i < this->option_size(); i++) {
7654 target = ::google::protobuf::internal::WireFormatLite::
7655 WriteMessageNoVirtualToArray(
7656 2, this->option(i), target);
7657 }
7658
7659 if (!unknown_fields().empty()) {
7660 target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
7661 unknown_fields(), target);
7662 }
7663 // @@protoc_insertion_point(serialize_to_array_end:caffe2.BackendOptions)
7664 return target;
7665}
7666
7667int BackendOptions::ByteSize() const {
7668 int total_size = 0;
7669
7670 if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
7671 // required string backend_name = 1;
7672 if (has_backend_name()) {
7673 total_size += 1 +
7674 ::google::protobuf::internal::WireFormatLite::StringSize(
7675 this->backend_name());
7676 }
7677
7678 }
7679 // repeated .caffe2.MapFieldEntry option = 2;
7680 total_size += 1 * this->option_size();
7681 for (int i = 0; i < this->option_size(); i++) {
7682 total_size +=
7683 ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
7684 this->option(i));
7685 }
7686
7687 if (!unknown_fields().empty()) {
7688 total_size +=
7689 ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
7690 unknown_fields());
7691 }
7692 GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
7693 _cached_size_ = total_size;
7694 GOOGLE_SAFE_CONCURRENT_WRITES_END();
7695 return total_size;
7696}
7697
7698void BackendOptions::MergeFrom(const ::google::protobuf::Message& from) {
7699 GOOGLE_CHECK_NE(&from, this);
7700 const BackendOptions* source =
7701 ::google::protobuf::internal::dynamic_cast_if_available<const BackendOptions*>(
7702 &from);
7703 if (source == NULL) {
7704 ::google::protobuf::internal::ReflectionOps::Merge(from, this);
7705 } else {
7706 MergeFrom(*source);
7707 }
7708}
7709
7710void BackendOptions::MergeFrom(const BackendOptions& from) {
7711 GOOGLE_CHECK_NE(&from, this);
7712 option_.MergeFrom(from.option_);
7713 if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
7714 if (from.has_backend_name()) {
7715 set_backend_name(from.backend_name());
7716 }
7717 }
7718 mutable_unknown_fields()->MergeFrom(from.unknown_fields());
7719}
7720
7721void BackendOptions::CopyFrom(const ::google::protobuf::Message& from) {
7722 if (&from == this) return;
7723 Clear();
7724 MergeFrom(from);
7725}
7726
7727void BackendOptions::CopyFrom(const BackendOptions& from) {
7728 if (&from == this) return;
7729 Clear();
7730 MergeFrom(from);
7731}
7732
7733bool BackendOptions::IsInitialized() const {
7734 if ((_has_bits_[0] & 0x00000001) != 0x00000001) return false;
7735
7736 if (!::google::protobuf::internal::AllAreInitialized(this->option())) return false;
7737 return true;
7738}
7739
7740void BackendOptions::Swap(BackendOptions* other) {
7741 if (other != this) {
7742 std::swap(backend_name_, other->backend_name_);
7743 option_.Swap(&other->option_);
7744 std::swap(_has_bits_[0], other->_has_bits_[0]);
7745 _unknown_fields_.Swap(&other->_unknown_fields_);
7746 std::swap(_cached_size_, other->_cached_size_);
7747 }
7748}
7749
7750::google::protobuf::Metadata BackendOptions::GetMetadata() const {
7751 protobuf_AssignDescriptorsOnce();
7752 ::google::protobuf::Metadata metadata;
7753 metadata.descriptor = BackendOptions_descriptor_;
7754 metadata.reflection = BackendOptions_reflection_;
7755 return metadata;
7756}
7757
7758
7759// ===================================================================
7760
7761#ifndef _MSC_VER
7762const int PartitionInfo::kNameFieldNumber;
7763const int PartitionInfo::kDeviceIdFieldNumber;
7764const int PartitionInfo::kExtraInfoFieldNumber;
7765const int PartitionInfo::kBackendOptionsFieldNumber;
7766#endif // !_MSC_VER
7767
7768PartitionInfo::PartitionInfo()
7769 : ::google::protobuf::Message() {
7770 SharedCtor();
7771 // @@protoc_insertion_point(constructor:caffe2.PartitionInfo)
7772}
7773
7774void PartitionInfo::InitAsDefaultInstance() {
7775}
7776
7777PartitionInfo::PartitionInfo(const PartitionInfo& from)
7778 : ::google::protobuf::Message() {
7779 SharedCtor();
7780 MergeFrom(from);
7781 // @@protoc_insertion_point(copy_constructor:caffe2.PartitionInfo)
7782}
7783
7784void PartitionInfo::SharedCtor() {
7785 ::google::protobuf::internal::GetEmptyString();
7786 _cached_size_ = 0;
7787 name_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
7788 extra_info_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
7789 ::memset(_has_bits_, 0, sizeof(_has_bits_));
7790}
7791
7792PartitionInfo::~PartitionInfo() {
7793 // @@protoc_insertion_point(destructor:caffe2.PartitionInfo)
7794 SharedDtor();
7795}
7796
7797void PartitionInfo::SharedDtor() {
7798 if (name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
7799 delete name_;
7800 }
7801 if (extra_info_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
7802 delete extra_info_;
7803 }
7804 if (this != default_instance_) {
7805 }
7806}
7807
7808void PartitionInfo::SetCachedSize(int size) const {
7809 GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
7810 _cached_size_ = size;
7811 GOOGLE_SAFE_CONCURRENT_WRITES_END();
7812}
7813const ::google::protobuf::Descriptor* PartitionInfo::descriptor() {
7814 protobuf_AssignDescriptorsOnce();
7815 return PartitionInfo_descriptor_;
7816}
7817
7818const PartitionInfo& PartitionInfo::default_instance() {
7819 if (default_instance_ == NULL) protobuf_AddDesc_caffe2_2eproto();
7820 return *default_instance_;
7821}
7822
7823PartitionInfo* PartitionInfo::default_instance_ = NULL;
7824
7825PartitionInfo* PartitionInfo::New() const {
7826 return new PartitionInfo;
7827}
7828
7829void PartitionInfo::Clear() {
7830 if (_has_bits_[0 / 32] & 5) {
7831 if (has_name()) {
7832 if (name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
7833 name_->clear();
7834 }
7835 }
7836 if (has_extra_info()) {
7837 if (extra_info_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
7838 extra_info_->clear();
7839 }
7840 }
7841 }
7842 device_id_.Clear();
7843 backend_options_.Clear();
7844 ::memset(_has_bits_, 0, sizeof(_has_bits_));
7845 mutable_unknown_fields()->Clear();
7846}
7847
7848bool PartitionInfo::MergePartialFromCodedStream(
7849 ::google::protobuf::io::CodedInputStream* input) {
7850#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure
7851 ::google::protobuf::uint32 tag;
7852 // @@protoc_insertion_point(parse_start:caffe2.PartitionInfo)
7853 for (;;) {
7854 ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);
7855 tag = p.first;
7856 if (!p.second) goto handle_unusual;
7857 switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
7858 // required string name = 1;
7859 case 1: {
7860 if (tag == 10) {
7861 DO_(::google::protobuf::internal::WireFormatLite::ReadString(
7862 input, this->mutable_name()));
7863 ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
7864 this->name().data(), this->name().length(),
7865 ::google::protobuf::internal::WireFormat::PARSE,
7866 "name");
7867 } else {
7868 goto handle_unusual;
7869 }
7870 if (input->ExpectTag(16)) goto parse_device_id;
7871 break;
7872 }
7873
7874 // repeated int32 device_id = 2;
7875 case 2: {
7876 if (tag == 16) {
7877 parse_device_id:
7878 DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive<
7879 ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
7880 1, 16, input, this->mutable_device_id())));
7881 } else if (tag == 18) {
7882 DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline<
7883 ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
7884 input, this->mutable_device_id())));
7885 } else {
7886 goto handle_unusual;
7887 }
7888 if (input->ExpectTag(16)) goto parse_device_id;
7889 if (input->ExpectTag(26)) goto parse_extra_info;
7890 break;
7891 }
7892
7893 // optional string extra_info = 3;
7894 case 3: {
7895 if (tag == 26) {
7896 parse_extra_info:
7897 DO_(::google::protobuf::internal::WireFormatLite::ReadString(
7898 input, this->mutable_extra_info()));
7899 ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
7900 this->extra_info().data(), this->extra_info().length(),
7901 ::google::protobuf::internal::WireFormat::PARSE,
7902 "extra_info");
7903 } else {
7904 goto handle_unusual;
7905 }
7906 if (input->ExpectTag(34)) goto parse_backend_options;
7907 break;
7908 }
7909
7910 // repeated .caffe2.BackendOptions backend_options = 4;
7911 case 4: {
7912 if (tag == 34) {
7913 parse_backend_options:
7914 DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
7915 input, add_backend_options()));
7916 } else {
7917 goto handle_unusual;
7918 }
7919 if (input->ExpectTag(34)) goto parse_backend_options;
7920 if (input->ExpectAtEnd()) goto success;
7921 break;
7922 }
7923
7924 default: {
7925 handle_unusual:
7926 if (tag == 0 ||
7927 ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
7928 ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
7929 goto success;
7930 }
7931 DO_(::google::protobuf::internal::WireFormat::SkipField(
7932 input, tag, mutable_unknown_fields()));
7933 break;
7934 }
7935 }
7936 }
7937success:
7938 // @@protoc_insertion_point(parse_success:caffe2.PartitionInfo)
7939 return true;
7940failure:
7941 // @@protoc_insertion_point(parse_failure:caffe2.PartitionInfo)
7942 return false;
7943#undef DO_
7944}
7945
7946void PartitionInfo::SerializeWithCachedSizes(
7947 ::google::protobuf::io::CodedOutputStream* output) const {
7948 // @@protoc_insertion_point(serialize_start:caffe2.PartitionInfo)
7949 // required string name = 1;
7950 if (has_name()) {
7951 ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
7952 this->name().data(), this->name().length(),
7953 ::google::protobuf::internal::WireFormat::SERIALIZE,
7954 "name");
7955 ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
7956 1, this->name(), output);
7957 }
7958
7959 // repeated int32 device_id = 2;
7960 for (int i = 0; i < this->device_id_size(); i++) {
7961 ::google::protobuf::internal::WireFormatLite::WriteInt32(
7962 2, this->device_id(i), output);
7963 }
7964
7965 // optional string extra_info = 3;
7966 if (has_extra_info()) {
7967 ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
7968 this->extra_info().data(), this->extra_info().length(),
7969 ::google::protobuf::internal::WireFormat::SERIALIZE,
7970 "extra_info");
7971 ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
7972 3, this->extra_info(), output);
7973 }
7974
7975 // repeated .caffe2.BackendOptions backend_options = 4;
7976 for (int i = 0; i < this->backend_options_size(); i++) {
7977 ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
7978 4, this->backend_options(i), output);
7979 }
7980
7981 if (!unknown_fields().empty()) {
7982 ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
7983 unknown_fields(), output);
7984 }
7985 // @@protoc_insertion_point(serialize_end:caffe2.PartitionInfo)
7986}
7987
7988::google::protobuf::uint8* PartitionInfo::SerializeWithCachedSizesToArray(
7989 ::google::protobuf::uint8* target) const {
7990 // @@protoc_insertion_point(serialize_to_array_start:caffe2.PartitionInfo)
7991 // required string name = 1;
7992 if (has_name()) {
7993 ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
7994 this->name().data(), this->name().length(),
7995 ::google::protobuf::internal::WireFormat::SERIALIZE,
7996 "name");
7997 target =
7998 ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
7999 1, this->name(), target);
8000 }
8001
8002 // repeated int32 device_id = 2;
8003 for (int i = 0; i < this->device_id_size(); i++) {
8004 target = ::google::protobuf::internal::WireFormatLite::
8005 WriteInt32ToArray(2, this->device_id(i), target);
8006 }
8007
8008 // optional string extra_info = 3;
8009 if (has_extra_info()) {
8010 ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
8011 this->extra_info().data(), this->extra_info().length(),
8012 ::google::protobuf::internal::WireFormat::SERIALIZE,
8013 "extra_info");
8014 target =
8015 ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
8016 3, this->extra_info(), target);
8017 }
8018
8019 // repeated .caffe2.BackendOptions backend_options = 4;
8020 for (int i = 0; i < this->backend_options_size(); i++) {
8021 target = ::google::protobuf::internal::WireFormatLite::
8022 WriteMessageNoVirtualToArray(
8023 4, this->backend_options(i), target);
8024 }
8025
8026 if (!unknown_fields().empty()) {
8027 target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
8028 unknown_fields(), target);
8029 }
8030 // @@protoc_insertion_point(serialize_to_array_end:caffe2.PartitionInfo)
8031 return target;
8032}
8033
8034int PartitionInfo::ByteSize() const {
8035 int total_size = 0;
8036
8037 if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
8038 // required string name = 1;
8039 if (has_name()) {
8040 total_size += 1 +
8041 ::google::protobuf::internal::WireFormatLite::StringSize(
8042 this->name());
8043 }
8044
8045 // optional string extra_info = 3;
8046 if (has_extra_info()) {
8047 total_size += 1 +
8048 ::google::protobuf::internal::WireFormatLite::StringSize(
8049 this->extra_info());
8050 }
8051
8052 }
8053 // repeated int32 device_id = 2;
8054 {
8055 int data_size = 0;
8056 for (int i = 0; i < this->device_id_size(); i++) {
8057 data_size += ::google::protobuf::internal::WireFormatLite::
8058 Int32Size(this->device_id(i));
8059 }
8060 total_size += 1 * this->device_id_size() + data_size;
8061 }
8062
8063 // repeated .caffe2.BackendOptions backend_options = 4;
8064 total_size += 1 * this->backend_options_size();
8065 for (int i = 0; i < this->backend_options_size(); i++) {
8066 total_size +=
8067 ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
8068 this->backend_options(i));
8069 }
8070
8071 if (!unknown_fields().empty()) {
8072 total_size +=
8073 ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
8074 unknown_fields());
8075 }
8076 GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
8077 _cached_size_ = total_size;
8078 GOOGLE_SAFE_CONCURRENT_WRITES_END();
8079 return total_size;
8080}
8081
8082void PartitionInfo::MergeFrom(const ::google::protobuf::Message& from) {
8083 GOOGLE_CHECK_NE(&from, this);
8084 const PartitionInfo* source =
8085 ::google::protobuf::internal::dynamic_cast_if_available<const PartitionInfo*>(
8086 &from);
8087 if (source == NULL) {
8088 ::google::protobuf::internal::ReflectionOps::Merge(from, this);
8089 } else {
8090 MergeFrom(*source);
8091 }
8092}
8093
8094void PartitionInfo::MergeFrom(const PartitionInfo& from) {
8095 GOOGLE_CHECK_NE(&from, this);
8096 device_id_.MergeFrom(from.device_id_);
8097 backend_options_.MergeFrom(from.backend_options_);
8098 if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
8099 if (from.has_name()) {
8100 set_name(from.name());
8101 }
8102 if (from.has_extra_info()) {
8103 set_extra_info(from.extra_info());
8104 }
8105 }
8106 mutable_unknown_fields()->MergeFrom(from.unknown_fields());
8107}
8108
8109void PartitionInfo::CopyFrom(const ::google::protobuf::Message& from) {
8110 if (&from == this) return;
8111 Clear();
8112 MergeFrom(from);
8113}
8114
8115void PartitionInfo::CopyFrom(const PartitionInfo& from) {
8116 if (&from == this) return;
8117 Clear();
8118 MergeFrom(from);
8119}
8120
8121bool PartitionInfo::IsInitialized() const {
8122 if ((_has_bits_[0] & 0x00000001) != 0x00000001) return false;
8123
8124 if (!::google::protobuf::internal::AllAreInitialized(this->backend_options())) return false;
8125 return true;
8126}
8127
8128void PartitionInfo::Swap(PartitionInfo* other) {
8129 if (other != this) {
8130 std::swap(name_, other->name_);
8131 device_id_.Swap(&other->device_id_);
8132 std::swap(extra_info_, other->extra_info_);
8133 backend_options_.Swap(&other->backend_options_);
8134 std::swap(_has_bits_[0], other->_has_bits_[0]);
8135 _unknown_fields_.Swap(&other->_unknown_fields_);
8136 std::swap(_cached_size_, other->_cached_size_);
8137 }
8138}
8139
8140::google::protobuf::Metadata PartitionInfo::GetMetadata() const {
8141 protobuf_AssignDescriptorsOnce();
8142 ::google::protobuf::Metadata metadata;
8143 metadata.descriptor = PartitionInfo_descriptor_;
8144 metadata.reflection = PartitionInfo_reflection_;
8145 return metadata;
8146}
8147
8148
8149// ===================================================================
8150
8151#ifndef _MSC_VER
8152const int NetDef::kNameFieldNumber;
8153const int NetDef::kOpFieldNumber;
8154const int NetDef::kTypeFieldNumber;
8155const int NetDef::kNumWorkersFieldNumber;
8156const int NetDef::kDeviceOptionFieldNumber;
8157const int NetDef::kArgFieldNumber;
8158const int NetDef::kExternalInputFieldNumber;
8159const int NetDef::kExternalOutputFieldNumber;
8160const int NetDef::kPartitionInfoFieldNumber;
8161#endif // !_MSC_VER
8162
8163NetDef::NetDef()
8164 : ::google::protobuf::Message() {
8165 SharedCtor();
8166 // @@protoc_insertion_point(constructor:caffe2.NetDef)
8167}
8168
8169void NetDef::InitAsDefaultInstance() {
8170 device_option_ = const_cast< ::caffe2::DeviceOption*>(&::caffe2::DeviceOption::default_instance());
8171}
8172
8173NetDef::NetDef(const NetDef& from)
8174 : ::google::protobuf::Message() {
8175 SharedCtor();
8176 MergeFrom(from);
8177 // @@protoc_insertion_point(copy_constructor:caffe2.NetDef)
8178}
8179
8180void NetDef::SharedCtor() {
8181 ::google::protobuf::internal::GetEmptyString();
8182 _cached_size_ = 0;
8183 name_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
8184 type_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
8185 num_workers_ = 0;
8186 device_option_ = NULL;
8187 ::memset(_has_bits_, 0, sizeof(_has_bits_));
8188}
8189
8190NetDef::~NetDef() {
8191 // @@protoc_insertion_point(destructor:caffe2.NetDef)
8192 SharedDtor();
8193}
8194
8195void NetDef::SharedDtor() {
8196 if (name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
8197 delete name_;
8198 }
8199 if (type_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
8200 delete type_;
8201 }
8202 if (this != default_instance_) {
8203 delete device_option_;
8204 }
8205}
8206
8207void NetDef::SetCachedSize(int size) const {
8208 GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
8209 _cached_size_ = size;
8210 GOOGLE_SAFE_CONCURRENT_WRITES_END();
8211}
8212const ::google::protobuf::Descriptor* NetDef::descriptor() {
8213 protobuf_AssignDescriptorsOnce();
8214 return NetDef_descriptor_;
8215}
8216
8217const NetDef& NetDef::default_instance() {
8218 if (default_instance_ == NULL) protobuf_AddDesc_caffe2_2eproto();
8219 return *default_instance_;
8220}
8221
8222NetDef* NetDef::default_instance_ = NULL;
8223
8224NetDef* NetDef::New() const {
8225 return new NetDef;
8226}
8227
8228void NetDef::Clear() {
8229 if (_has_bits_[0 / 32] & 29) {
8230 if (has_name()) {
8231 if (name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
8232 name_->clear();
8233 }
8234 }
8235 if (has_type()) {
8236 if (type_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
8237 type_->clear();
8238 }
8239 }
8240 num_workers_ = 0;
8241 if (has_device_option()) {
8242 if (device_option_ != NULL) device_option_->::caffe2::DeviceOption::Clear();
8243 }
8244 }
8245 op_.Clear();
8246 arg_.Clear();
8247 external_input_.Clear();
8248 external_output_.Clear();
8249 partition_info_.Clear();
8250 ::memset(_has_bits_, 0, sizeof(_has_bits_));
8251 mutable_unknown_fields()->Clear();
8252}
8253
8254bool NetDef::MergePartialFromCodedStream(
8255 ::google::protobuf::io::CodedInputStream* input) {
8256#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure
8257 ::google::protobuf::uint32 tag;
8258 // @@protoc_insertion_point(parse_start:caffe2.NetDef)
8259 for (;;) {
8260 ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);
8261 tag = p.first;
8262 if (!p.second) goto handle_unusual;
8263 switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
8264 // optional string name = 1;
8265 case 1: {
8266 if (tag == 10) {
8267 DO_(::google::protobuf::internal::WireFormatLite::ReadString(
8268 input, this->mutable_name()));
8269 ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
8270 this->name().data(), this->name().length(),
8271 ::google::protobuf::internal::WireFormat::PARSE,
8272 "name");
8273 } else {
8274 goto handle_unusual;
8275 }
8276 if (input->ExpectTag(18)) goto parse_op;
8277 break;
8278 }
8279
8280 // repeated .caffe2.OperatorDef op = 2;
8281 case 2: {
8282 if (tag == 18) {
8283 parse_op:
8284 DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
8285 input, add_op()));
8286 } else {
8287 goto handle_unusual;
8288 }
8289 if (input->ExpectTag(18)) goto parse_op;
8290 if (input->ExpectTag(26)) goto parse_type;
8291 break;
8292 }
8293
8294 // optional string type = 3;
8295 case 3: {
8296 if (tag == 26) {
8297 parse_type:
8298 DO_(::google::protobuf::internal::WireFormatLite::ReadString(
8299 input, this->mutable_type()));
8300 ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
8301 this->type().data(), this->type().length(),
8302 ::google::protobuf::internal::WireFormat::PARSE,
8303 "type");
8304 } else {
8305 goto handle_unusual;
8306 }
8307 if (input->ExpectTag(32)) goto parse_num_workers;
8308 break;
8309 }
8310
8311 // optional int32 num_workers = 4;
8312 case 4: {
8313 if (tag == 32) {
8314 parse_num_workers:
8315 DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
8316 ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
8317 input, &num_workers_)));
8318 set_has_num_workers();
8319 } else {
8320 goto handle_unusual;
8321 }
8322 if (input->ExpectTag(42)) goto parse_device_option;
8323 break;
8324 }
8325
8326 // optional .caffe2.DeviceOption device_option = 5;
8327 case 5: {
8328 if (tag == 42) {
8329 parse_device_option:
8330 DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
8331 input, mutable_device_option()));
8332 } else {
8333 goto handle_unusual;
8334 }
8335 if (input->ExpectTag(50)) goto parse_arg;
8336 break;
8337 }
8338
8339 // repeated .caffe2.Argument arg = 6;
8340 case 6: {
8341 if (tag == 50) {
8342 parse_arg:
8343 DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
8344 input, add_arg()));
8345 } else {
8346 goto handle_unusual;
8347 }
8348 if (input->ExpectTag(50)) goto parse_arg;
8349 if (input->ExpectTag(58)) goto parse_external_input;
8350 break;
8351 }
8352
8353 // repeated string external_input = 7;
8354 case 7: {
8355 if (tag == 58) {
8356 parse_external_input:
8357 DO_(::google::protobuf::internal::WireFormatLite::ReadString(
8358 input, this->add_external_input()));
8359 ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
8360 this->external_input(this->external_input_size() - 1).data(),
8361 this->external_input(this->external_input_size() - 1).length(),
8362 ::google::protobuf::internal::WireFormat::PARSE,
8363 "external_input");
8364 } else {
8365 goto handle_unusual;
8366 }
8367 if (input->ExpectTag(58)) goto parse_external_input;
8368 if (input->ExpectTag(66)) goto parse_external_output;
8369 break;
8370 }
8371
8372 // repeated string external_output = 8;
8373 case 8: {
8374 if (tag == 66) {
8375 parse_external_output:
8376 DO_(::google::protobuf::internal::WireFormatLite::ReadString(
8377 input, this->add_external_output()));
8378 ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
8379 this->external_output(this->external_output_size() - 1).data(),
8380 this->external_output(this->external_output_size() - 1).length(),
8381 ::google::protobuf::internal::WireFormat::PARSE,
8382 "external_output");
8383 } else {
8384 goto handle_unusual;
8385 }
8386 if (input->ExpectTag(66)) goto parse_external_output;
8387 if (input->ExpectTag(74)) goto parse_partition_info;
8388 break;
8389 }
8390
8391 // repeated .caffe2.PartitionInfo partition_info = 9;
8392 case 9: {
8393 if (tag == 74) {
8394 parse_partition_info:
8395 DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
8396 input, add_partition_info()));
8397 } else {
8398 goto handle_unusual;
8399 }
8400 if (input->ExpectTag(74)) goto parse_partition_info;
8401 if (input->ExpectAtEnd()) goto success;
8402 break;
8403 }
8404
8405 default: {
8406 handle_unusual:
8407 if (tag == 0 ||
8408 ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
8409 ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
8410 goto success;
8411 }
8412 DO_(::google::protobuf::internal::WireFormat::SkipField(
8413 input, tag, mutable_unknown_fields()));
8414 break;
8415 }
8416 }
8417 }
8418success:
8419 // @@protoc_insertion_point(parse_success:caffe2.NetDef)
8420 return true;
8421failure:
8422 // @@protoc_insertion_point(parse_failure:caffe2.NetDef)
8423 return false;
8424#undef DO_
8425}
8426
8427void NetDef::SerializeWithCachedSizes(
8428 ::google::protobuf::io::CodedOutputStream* output) const {
8429 // @@protoc_insertion_point(serialize_start:caffe2.NetDef)
8430 // optional string name = 1;
8431 if (has_name()) {
8432 ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
8433 this->name().data(), this->name().length(),
8434 ::google::protobuf::internal::WireFormat::SERIALIZE,
8435 "name");
8436 ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
8437 1, this->name(), output);
8438 }
8439
8440 // repeated .caffe2.OperatorDef op = 2;
8441 for (int i = 0; i < this->op_size(); i++) {
8442 ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
8443 2, this->op(i), output);
8444 }
8445
8446 // optional string type = 3;
8447 if (has_type()) {
8448 ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
8449 this->type().data(), this->type().length(),
8450 ::google::protobuf::internal::WireFormat::SERIALIZE,
8451 "type");
8452 ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
8453 3, this->type(), output);
8454 }
8455
8456 // optional int32 num_workers = 4;
8457 if (has_num_workers()) {
8458 ::google::protobuf::internal::WireFormatLite::WriteInt32(4, this->num_workers(), output);
8459 }
8460
8461 // optional .caffe2.DeviceOption device_option = 5;
8462 if (has_device_option()) {
8463 ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
8464 5, this->device_option(), output);
8465 }
8466
8467 // repeated .caffe2.Argument arg = 6;
8468 for (int i = 0; i < this->arg_size(); i++) {
8469 ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
8470 6, this->arg(i), output);
8471 }
8472
8473 // repeated string external_input = 7;
8474 for (int i = 0; i < this->external_input_size(); i++) {
8475 ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
8476 this->external_input(i).data(), this->external_input(i).length(),
8477 ::google::protobuf::internal::WireFormat::SERIALIZE,
8478 "external_input");
8479 ::google::protobuf::internal::WireFormatLite::WriteString(
8480 7, this->external_input(i), output);
8481 }
8482
8483 // repeated string external_output = 8;
8484 for (int i = 0; i < this->external_output_size(); i++) {
8485 ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
8486 this->external_output(i).data(), this->external_output(i).length(),
8487 ::google::protobuf::internal::WireFormat::SERIALIZE,
8488 "external_output");
8489 ::google::protobuf::internal::WireFormatLite::WriteString(
8490 8, this->external_output(i), output);
8491 }
8492
8493 // repeated .caffe2.PartitionInfo partition_info = 9;
8494 for (int i = 0; i < this->partition_info_size(); i++) {
8495 ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
8496 9, this->partition_info(i), output);
8497 }
8498
8499 if (!unknown_fields().empty()) {
8500 ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
8501 unknown_fields(), output);
8502 }
8503 // @@protoc_insertion_point(serialize_end:caffe2.NetDef)
8504}
8505
8506::google::protobuf::uint8* NetDef::SerializeWithCachedSizesToArray(
8507 ::google::protobuf::uint8* target) const {
8508 // @@protoc_insertion_point(serialize_to_array_start:caffe2.NetDef)
8509 // optional string name = 1;
8510 if (has_name()) {
8511 ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
8512 this->name().data(), this->name().length(),
8513 ::google::protobuf::internal::WireFormat::SERIALIZE,
8514 "name");
8515 target =
8516 ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
8517 1, this->name(), target);
8518 }
8519
8520 // repeated .caffe2.OperatorDef op = 2;
8521 for (int i = 0; i < this->op_size(); i++) {
8522 target = ::google::protobuf::internal::WireFormatLite::
8523 WriteMessageNoVirtualToArray(
8524 2, this->op(i), target);
8525 }
8526
8527 // optional string type = 3;
8528 if (has_type()) {
8529 ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
8530 this->type().data(), this->type().length(),
8531 ::google::protobuf::internal::WireFormat::SERIALIZE,
8532 "type");
8533 target =
8534 ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
8535 3, this->type(), target);
8536 }
8537
8538 // optional int32 num_workers = 4;
8539 if (has_num_workers()) {
8540 target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(4, this->num_workers(), target);
8541 }
8542
8543 // optional .caffe2.DeviceOption device_option = 5;
8544 if (has_device_option()) {
8545 target = ::google::protobuf::internal::WireFormatLite::
8546 WriteMessageNoVirtualToArray(
8547 5, this->device_option(), target);
8548 }
8549
8550 // repeated .caffe2.Argument arg = 6;
8551 for (int i = 0; i < this->arg_size(); i++) {
8552 target = ::google::protobuf::internal::WireFormatLite::
8553 WriteMessageNoVirtualToArray(
8554 6, this->arg(i), target);
8555 }
8556
8557 // repeated string external_input = 7;
8558 for (int i = 0; i < this->external_input_size(); i++) {
8559 ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
8560 this->external_input(i).data(), this->external_input(i).length(),
8561 ::google::protobuf::internal::WireFormat::SERIALIZE,
8562 "external_input");
8563 target = ::google::protobuf::internal::WireFormatLite::
8564 WriteStringToArray(7, this->external_input(i), target);
8565 }
8566
8567 // repeated string external_output = 8;
8568 for (int i = 0; i < this->external_output_size(); i++) {
8569 ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
8570 this->external_output(i).data(), this->external_output(i).length(),
8571 ::google::protobuf::internal::WireFormat::SERIALIZE,
8572 "external_output");
8573 target = ::google::protobuf::internal::WireFormatLite::
8574 WriteStringToArray(8, this->external_output(i), target);
8575 }
8576
8577 // repeated .caffe2.PartitionInfo partition_info = 9;
8578 for (int i = 0; i < this->partition_info_size(); i++) {
8579 target = ::google::protobuf::internal::WireFormatLite::
8580 WriteMessageNoVirtualToArray(
8581 9, this->partition_info(i), target);
8582 }
8583
8584 if (!unknown_fields().empty()) {
8585 target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
8586 unknown_fields(), target);
8587 }
8588 // @@protoc_insertion_point(serialize_to_array_end:caffe2.NetDef)
8589 return target;
8590}
8591
8592int NetDef::ByteSize() const {
8593 int total_size = 0;
8594
8595 if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
8596 // optional string name = 1;
8597 if (has_name()) {
8598 total_size += 1 +
8599 ::google::protobuf::internal::WireFormatLite::StringSize(
8600 this->name());
8601 }
8602
8603 // optional string type = 3;
8604 if (has_type()) {
8605 total_size += 1 +
8606 ::google::protobuf::internal::WireFormatLite::StringSize(
8607 this->type());
8608 }
8609
8610 // optional int32 num_workers = 4;
8611 if (has_num_workers()) {
8612 total_size += 1 +
8613 ::google::protobuf::internal::WireFormatLite::Int32Size(
8614 this->num_workers());
8615 }
8616
8617 // optional .caffe2.DeviceOption device_option = 5;
8618 if (has_device_option()) {
8619 total_size += 1 +
8620 ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
8621 this->device_option());
8622 }
8623
8624 }
8625 // repeated .caffe2.OperatorDef op = 2;
8626 total_size += 1 * this->op_size();
8627 for (int i = 0; i < this->op_size(); i++) {
8628 total_size +=
8629 ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
8630 this->op(i));
8631 }
8632
8633 // repeated .caffe2.Argument arg = 6;
8634 total_size += 1 * this->arg_size();
8635 for (int i = 0; i < this->arg_size(); i++) {
8636 total_size +=
8637 ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
8638 this->arg(i));
8639 }
8640
8641 // repeated string external_input = 7;
8642 total_size += 1 * this->external_input_size();
8643 for (int i = 0; i < this->external_input_size(); i++) {
8644 total_size += ::google::protobuf::internal::WireFormatLite::StringSize(
8645 this->external_input(i));
8646 }
8647
8648 // repeated string external_output = 8;
8649 total_size += 1 * this->external_output_size();
8650 for (int i = 0; i < this->external_output_size(); i++) {
8651 total_size += ::google::protobuf::internal::WireFormatLite::StringSize(
8652 this->external_output(i));
8653 }
8654
8655 // repeated .caffe2.PartitionInfo partition_info = 9;
8656 total_size += 1 * this->partition_info_size();
8657 for (int i = 0; i < this->partition_info_size(); i++) {
8658 total_size +=
8659 ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
8660 this->partition_info(i));
8661 }
8662
8663 if (!unknown_fields().empty()) {
8664 total_size +=
8665 ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
8666 unknown_fields());
8667 }
8668 GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
8669 _cached_size_ = total_size;
8670 GOOGLE_SAFE_CONCURRENT_WRITES_END();
8671 return total_size;
8672}
8673
8674void NetDef::MergeFrom(const ::google::protobuf::Message& from) {
8675 GOOGLE_CHECK_NE(&from, this);
8676 const NetDef* source =
8677 ::google::protobuf::internal::dynamic_cast_if_available<const NetDef*>(
8678 &from);
8679 if (source == NULL) {
8680 ::google::protobuf::internal::ReflectionOps::Merge(from, this);
8681 } else {
8682 MergeFrom(*source);
8683 }
8684}
8685
8686void NetDef::MergeFrom(const NetDef& from) {
8687 GOOGLE_CHECK_NE(&from, this);
8688 op_.MergeFrom(from.op_);
8689 arg_.MergeFrom(from.arg_);
8690 external_input_.MergeFrom(from.external_input_);
8691 external_output_.MergeFrom(from.external_output_);
8692 partition_info_.MergeFrom(from.partition_info_);
8693 if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
8694 if (from.has_name()) {
8695 set_name(from.name());
8696 }
8697 if (from.has_type()) {
8698 set_type(from.type());
8699 }
8700 if (from.has_num_workers()) {
8701 set_num_workers(from.num_workers());
8702 }
8703 if (from.has_device_option()) {
8704 mutable_device_option()->::caffe2::DeviceOption::MergeFrom(from.device_option());
8705 }
8706 }
8707 mutable_unknown_fields()->MergeFrom(from.unknown_fields());
8708}
8709
8710void NetDef::CopyFrom(const ::google::protobuf::Message& from) {
8711 if (&from == this) return;
8712 Clear();
8713 MergeFrom(from);
8714}
8715
8716void NetDef::CopyFrom(const NetDef& from) {
8717 if (&from == this) return;
8718 Clear();
8719 MergeFrom(from);
8720}
8721
8722bool NetDef::IsInitialized() const {
8723
8724 if (!::google::protobuf::internal::AllAreInitialized(this->op())) return false;
8725 if (!::google::protobuf::internal::AllAreInitialized(this->arg())) return false;
8726 if (!::google::protobuf::internal::AllAreInitialized(this->partition_info())) return false;
8727 return true;
8728}
8729
8730void NetDef::Swap(NetDef* other) {
8731 if (other != this) {
8732 std::swap(name_, other->name_);
8733 op_.Swap(&other->op_);
8734 std::swap(type_, other->type_);
8735 std::swap(num_workers_, other->num_workers_);
8736 std::swap(device_option_, other->device_option_);
8737 arg_.Swap(&other->arg_);
8738 external_input_.Swap(&other->external_input_);
8739 external_output_.Swap(&other->external_output_);
8740 partition_info_.Swap(&other->partition_info_);
8741 std::swap(_has_bits_[0], other->_has_bits_[0]);
8742 _unknown_fields_.Swap(&other->_unknown_fields_);
8743 std::swap(_cached_size_, other->_cached_size_);
8744 }
8745}
8746
8747::google::protobuf::Metadata NetDef::GetMetadata() const {
8748 protobuf_AssignDescriptorsOnce();
8749 ::google::protobuf::Metadata metadata;
8750 metadata.descriptor = NetDef_descriptor_;
8751 metadata.reflection = NetDef_reflection_;
8752 return metadata;
8753}
8754
8755
8756// ===================================================================
8757
8758#ifndef _MSC_VER
8759const int ExecutionStep::kNameFieldNumber;
8760const int ExecutionStep::kSubstepFieldNumber;
8761const int ExecutionStep::kNetworkFieldNumber;
8762const int ExecutionStep::kNumIterFieldNumber;
8763const int ExecutionStep::kCriteriaNetworkFieldNumber;
8764const int ExecutionStep::kReportNetFieldNumber;
8765const int ExecutionStep::kReportIntervalFieldNumber;
8766const int ExecutionStep::kRunEveryMsFieldNumber;
8767const int ExecutionStep::kConcurrentSubstepsFieldNumber;
8768const int ExecutionStep::kShouldStopBlobFieldNumber;
8769const int ExecutionStep::kOnlyOnceFieldNumber;
8770const int ExecutionStep::kCreateWorkspaceFieldNumber;
8771const int ExecutionStep::kNumConcurrentInstancesFieldNumber;
8772#endif // !_MSC_VER
8773
8774ExecutionStep::ExecutionStep()
8775 : ::google::protobuf::Message() {
8776 SharedCtor();
8777 // @@protoc_insertion_point(constructor:caffe2.ExecutionStep)
8778}
8779
8780void ExecutionStep::InitAsDefaultInstance() {
8781}
8782
8783ExecutionStep::ExecutionStep(const ExecutionStep& from)
8784 : ::google::protobuf::Message() {
8785 SharedCtor();
8786 MergeFrom(from);
8787 // @@protoc_insertion_point(copy_constructor:caffe2.ExecutionStep)
8788}
8789
8790void ExecutionStep::SharedCtor() {
8791 ::google::protobuf::internal::GetEmptyString();
8792 _cached_size_ = 0;
8793 name_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
8794 num_iter_ = GOOGLE_LONGLONG(0);
8795 criteria_network_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
8796 report_net_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
8797 report_interval_ = 0;
8798 run_every_ms_ = GOOGLE_LONGLONG(0);
8799 concurrent_substeps_ = false;
8800 should_stop_blob_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
8801 only_once_ = false;
8802 create_workspace_ = false;
8803 num_concurrent_instances_ = 0;
8804 ::memset(_has_bits_, 0, sizeof(_has_bits_));
8805}
8806
8807ExecutionStep::~ExecutionStep() {
8808 // @@protoc_insertion_point(destructor:caffe2.ExecutionStep)
8809 SharedDtor();
8810}
8811
8812void ExecutionStep::SharedDtor() {
8813 if (name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
8814 delete name_;
8815 }
8816 if (criteria_network_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
8817 delete criteria_network_;
8818 }
8819 if (report_net_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
8820 delete report_net_;
8821 }
8822 if (should_stop_blob_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
8823 delete should_stop_blob_;
8824 }
8825 if (this != default_instance_) {
8826 }
8827}
8828
8829void ExecutionStep::SetCachedSize(int size) const {
8830 GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
8831 _cached_size_ = size;
8832 GOOGLE_SAFE_CONCURRENT_WRITES_END();
8833}
8834const ::google::protobuf::Descriptor* ExecutionStep::descriptor() {
8835 protobuf_AssignDescriptorsOnce();
8836 return ExecutionStep_descriptor_;
8837}
8838
8839const ExecutionStep& ExecutionStep::default_instance() {
8840 if (default_instance_ == NULL) protobuf_AddDesc_caffe2_2eproto();
8841 return *default_instance_;
8842}
8843
8844ExecutionStep* ExecutionStep::default_instance_ = NULL;
8845
8846ExecutionStep* ExecutionStep::New() const {
8847 return new ExecutionStep;
8848}
8849
8850void ExecutionStep::Clear() {
8851#define OFFSET_OF_FIELD_(f) (reinterpret_cast<char*>( \
8852 &reinterpret_cast<ExecutionStep*>(16)->f) - \
8853 reinterpret_cast<char*>(16))
8854
8855#define ZR_(first, last) do { \
8856 size_t f = OFFSET_OF_FIELD_(first); \
8857 size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \
8858 ::memset(&first, 0, n); \
8859 } while (0)
8860
8861 if (_has_bits_[0 / 32] & 249) {
8862 ZR_(run_every_ms_, report_interval_);
8863 if (has_name()) {
8864 if (name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
8865 name_->clear();
8866 }
8867 }
8868 num_iter_ = GOOGLE_LONGLONG(0);
8869 if (has_criteria_network()) {
8870 if (criteria_network_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
8871 criteria_network_->clear();
8872 }
8873 }
8874 if (has_report_net()) {
8875 if (report_net_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
8876 report_net_->clear();
8877 }
8878 }
8879 }
8880 if (_has_bits_[8 / 32] & 7936) {
8881 ZR_(concurrent_substeps_, create_workspace_);
8882 if (has_should_stop_blob()) {
8883 if (should_stop_blob_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
8884 should_stop_blob_->clear();
8885 }
8886 }
8887 num_concurrent_instances_ = 0;
8888 }
8889
8890#undef OFFSET_OF_FIELD_
8891#undef ZR_
8892
8893 substep_.Clear();
8894 network_.Clear();
8895 ::memset(_has_bits_, 0, sizeof(_has_bits_));
8896 mutable_unknown_fields()->Clear();
8897}
8898
8899bool ExecutionStep::MergePartialFromCodedStream(
8900 ::google::protobuf::io::CodedInputStream* input) {
8901#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure
8902 ::google::protobuf::uint32 tag;
8903 // @@protoc_insertion_point(parse_start:caffe2.ExecutionStep)
8904 for (;;) {
8905 ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);
8906 tag = p.first;
8907 if (!p.second) goto handle_unusual;
8908 switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
8909 // optional string name = 1;
8910 case 1: {
8911 if (tag == 10) {
8912 DO_(::google::protobuf::internal::WireFormatLite::ReadString(
8913 input, this->mutable_name()));
8914 ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
8915 this->name().data(), this->name().length(),
8916 ::google::protobuf::internal::WireFormat::PARSE,
8917 "name");
8918 } else {
8919 goto handle_unusual;
8920 }
8921 if (input->ExpectTag(18)) goto parse_substep;
8922 break;
8923 }
8924
8925 // repeated .caffe2.ExecutionStep substep = 2;
8926 case 2: {
8927 if (tag == 18) {
8928 parse_substep:
8929 DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
8930 input, add_substep()));
8931 } else {
8932 goto handle_unusual;
8933 }
8934 if (input->ExpectTag(18)) goto parse_substep;
8935 if (input->ExpectTag(26)) goto parse_network;
8936 break;
8937 }
8938
8939 // repeated string network = 3;
8940 case 3: {
8941 if (tag == 26) {
8942 parse_network:
8943 DO_(::google::protobuf::internal::WireFormatLite::ReadString(
8944 input, this->add_network()));
8945 ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
8946 this->network(this->network_size() - 1).data(),
8947 this->network(this->network_size() - 1).length(),
8948 ::google::protobuf::internal::WireFormat::PARSE,
8949 "network");
8950 } else {
8951 goto handle_unusual;
8952 }
8953 if (input->ExpectTag(26)) goto parse_network;
8954 if (input->ExpectTag(32)) goto parse_num_iter;
8955 break;
8956 }
8957
8958 // optional int64 num_iter = 4;
8959 case 4: {
8960 if (tag == 32) {
8961 parse_num_iter:
8962 DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
8963 ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>(
8964 input, &num_iter_)));
8965 set_has_num_iter();
8966 } else {
8967 goto handle_unusual;
8968 }
8969 if (input->ExpectTag(42)) goto parse_criteria_network;
8970 break;
8971 }
8972
8973 // optional string criteria_network = 5 [deprecated = true];
8974 case 5: {
8975 if (tag == 42) {
8976 parse_criteria_network:
8977 DO_(::google::protobuf::internal::WireFormatLite::ReadString(
8978 input, this->mutable_criteria_network()));
8979 ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
8980 this->criteria_network().data(), this->criteria_network().length(),
8981 ::google::protobuf::internal::WireFormat::PARSE,
8982 "criteria_network");
8983 } else {
8984 goto handle_unusual;
8985 }
8986 if (input->ExpectTag(48)) goto parse_concurrent_substeps;
8987 break;
8988 }
8989
8990 // optional bool concurrent_substeps = 6;
8991 case 6: {
8992 if (tag == 48) {
8993 parse_concurrent_substeps:
8994 DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
8995 bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
8996 input, &concurrent_substeps_)));
8997 set_has_concurrent_substeps();
8998 } else {
8999 goto handle_unusual;
9000 }
9001 if (input->ExpectTag(58)) goto parse_report_net;
9002 break;
9003 }
9004
9005 // optional string report_net = 7;
9006 case 7: {
9007 if (tag == 58) {
9008 parse_report_net:
9009 DO_(::google::protobuf::internal::WireFormatLite::ReadString(
9010 input, this->mutable_report_net()));
9011 ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
9012 this->report_net().data(), this->report_net().length(),
9013 ::google::protobuf::internal::WireFormat::PARSE,
9014 "report_net");
9015 } else {
9016 goto handle_unusual;
9017 }
9018 if (input->ExpectTag(64)) goto parse_report_interval;
9019 break;
9020 }
9021
9022 // optional int32 report_interval = 8;
9023 case 8: {
9024 if (tag == 64) {
9025 parse_report_interval:
9026 DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
9027 ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
9028 input, &report_interval_)));
9029 set_has_report_interval();
9030 } else {
9031 goto handle_unusual;
9032 }
9033 if (input->ExpectTag(74)) goto parse_should_stop_blob;
9034 break;
9035 }
9036
9037 // optional string should_stop_blob = 9;
9038 case 9: {
9039 if (tag == 74) {
9040 parse_should_stop_blob:
9041 DO_(::google::protobuf::internal::WireFormatLite::ReadString(
9042 input, this->mutable_should_stop_blob()));
9043 ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
9044 this->should_stop_blob().data(), this->should_stop_blob().length(),
9045 ::google::protobuf::internal::WireFormat::PARSE,
9046 "should_stop_blob");
9047 } else {
9048 goto handle_unusual;
9049 }
9050 if (input->ExpectTag(80)) goto parse_only_once;
9051 break;
9052 }
9053
9054 // optional bool only_once = 10;
9055 case 10: {
9056 if (tag == 80) {
9057 parse_only_once:
9058 DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
9059 bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
9060 input, &only_once_)));
9061 set_has_only_once();
9062 } else {
9063 goto handle_unusual;
9064 }
9065 if (input->ExpectTag(88)) goto parse_run_every_ms;
9066 break;
9067 }
9068
9069 // optional int64 run_every_ms = 11;
9070 case 11: {
9071 if (tag == 88) {
9072 parse_run_every_ms:
9073 DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
9074 ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>(
9075 input, &run_every_ms_)));
9076 set_has_run_every_ms();
9077 } else {
9078 goto handle_unusual;
9079 }
9080 if (input->ExpectTag(96)) goto parse_create_workspace;
9081 break;
9082 }
9083
9084 // optional bool create_workspace = 12;
9085 case 12: {
9086 if (tag == 96) {
9087 parse_create_workspace:
9088 DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
9089 bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
9090 input, &create_workspace_)));
9091 set_has_create_workspace();
9092 } else {
9093 goto handle_unusual;
9094 }
9095 if (input->ExpectTag(104)) goto parse_num_concurrent_instances;
9096 break;
9097 }
9098
9099 // optional int32 num_concurrent_instances = 13;
9100 case 13: {
9101 if (tag == 104) {
9102 parse_num_concurrent_instances:
9103 DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
9104 ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
9105 input, &num_concurrent_instances_)));
9106 set_has_num_concurrent_instances();
9107 } else {
9108 goto handle_unusual;
9109 }
9110 if (input->ExpectAtEnd()) goto success;
9111 break;
9112 }
9113
9114 default: {
9115 handle_unusual:
9116 if (tag == 0 ||
9117 ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
9118 ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
9119 goto success;
9120 }
9121 DO_(::google::protobuf::internal::WireFormat::SkipField(
9122 input, tag, mutable_unknown_fields()));
9123 break;
9124 }
9125 }
9126 }
9127success:
9128 // @@protoc_insertion_point(parse_success:caffe2.ExecutionStep)
9129 return true;
9130failure:
9131 // @@protoc_insertion_point(parse_failure:caffe2.ExecutionStep)
9132 return false;
9133#undef DO_
9134}
9135
9136void ExecutionStep::SerializeWithCachedSizes(
9137 ::google::protobuf::io::CodedOutputStream* output) const {
9138 // @@protoc_insertion_point(serialize_start:caffe2.ExecutionStep)
9139 // optional string name = 1;
9140 if (has_name()) {
9141 ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
9142 this->name().data(), this->name().length(),
9143 ::google::protobuf::internal::WireFormat::SERIALIZE,
9144 "name");
9145 ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
9146 1, this->name(), output);
9147 }
9148
9149 // repeated .caffe2.ExecutionStep substep = 2;
9150 for (int i = 0; i < this->substep_size(); i++) {
9151 ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
9152 2, this->substep(i), output);
9153 }
9154
9155 // repeated string network = 3;
9156 for (int i = 0; i < this->network_size(); i++) {
9157 ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
9158 this->network(i).data(), this->network(i).length(),
9159 ::google::protobuf::internal::WireFormat::SERIALIZE,
9160 "network");
9161 ::google::protobuf::internal::WireFormatLite::WriteString(
9162 3, this->network(i), output);
9163 }
9164
9165 // optional int64 num_iter = 4;
9166 if (has_num_iter()) {
9167 ::google::protobuf::internal::WireFormatLite::WriteInt64(4, this->num_iter(), output);
9168 }
9169
9170 // optional string criteria_network = 5 [deprecated = true];
9171 if (has_criteria_network()) {
9172 ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
9173 this->criteria_network().data(), this->criteria_network().length(),
9174 ::google::protobuf::internal::WireFormat::SERIALIZE,
9175 "criteria_network");
9176 ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
9177 5, this->criteria_network(), output);
9178 }
9179
9180 // optional bool concurrent_substeps = 6;
9181 if (has_concurrent_substeps()) {
9182 ::google::protobuf::internal::WireFormatLite::WriteBool(6, this->concurrent_substeps(), output);
9183 }
9184
9185 // optional string report_net = 7;
9186 if (has_report_net()) {
9187 ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
9188 this->report_net().data(), this->report_net().length(),
9189 ::google::protobuf::internal::WireFormat::SERIALIZE,
9190 "report_net");
9191 ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
9192 7, this->report_net(), output);
9193 }
9194
9195 // optional int32 report_interval = 8;
9196 if (has_report_interval()) {
9197 ::google::protobuf::internal::WireFormatLite::WriteInt32(8, this->report_interval(), output);
9198 }
9199
9200 // optional string should_stop_blob = 9;
9201 if (has_should_stop_blob()) {
9202 ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
9203 this->should_stop_blob().data(), this->should_stop_blob().length(),
9204 ::google::protobuf::internal::WireFormat::SERIALIZE,
9205 "should_stop_blob");
9206 ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
9207 9, this->should_stop_blob(), output);
9208 }
9209
9210 // optional bool only_once = 10;
9211 if (has_only_once()) {
9212 ::google::protobuf::internal::WireFormatLite::WriteBool(10, this->only_once(), output);
9213 }
9214
9215 // optional int64 run_every_ms = 11;
9216 if (has_run_every_ms()) {
9217 ::google::protobuf::internal::WireFormatLite::WriteInt64(11, this->run_every_ms(), output);
9218 }
9219
9220 // optional bool create_workspace = 12;
9221 if (has_create_workspace()) {
9222 ::google::protobuf::internal::WireFormatLite::WriteBool(12, this->create_workspace(), output);
9223 }
9224
9225 // optional int32 num_concurrent_instances = 13;
9226 if (has_num_concurrent_instances()) {
9227 ::google::protobuf::internal::WireFormatLite::WriteInt32(13, this->num_concurrent_instances(), output);
9228 }
9229
9230 if (!unknown_fields().empty()) {
9231 ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
9232 unknown_fields(), output);
9233 }
9234 // @@protoc_insertion_point(serialize_end:caffe2.ExecutionStep)
9235}
9236
9237::google::protobuf::uint8* ExecutionStep::SerializeWithCachedSizesToArray(
9238 ::google::protobuf::uint8* target) const {
9239 // @@protoc_insertion_point(serialize_to_array_start:caffe2.ExecutionStep)
9240 // optional string name = 1;
9241 if (has_name()) {
9242 ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
9243 this->name().data(), this->name().length(),
9244 ::google::protobuf::internal::WireFormat::SERIALIZE,
9245 "name");
9246 target =
9247 ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
9248 1, this->name(), target);
9249 }
9250
9251 // repeated .caffe2.ExecutionStep substep = 2;
9252 for (int i = 0; i < this->substep_size(); i++) {
9253 target = ::google::protobuf::internal::WireFormatLite::
9254 WriteMessageNoVirtualToArray(
9255 2, this->substep(i), target);
9256 }
9257
9258 // repeated string network = 3;
9259 for (int i = 0; i < this->network_size(); i++) {
9260 ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
9261 this->network(i).data(), this->network(i).length(),
9262 ::google::protobuf::internal::WireFormat::SERIALIZE,
9263 "network");
9264 target = ::google::protobuf::internal::WireFormatLite::
9265 WriteStringToArray(3, this->network(i), target);
9266 }
9267
9268 // optional int64 num_iter = 4;
9269 if (has_num_iter()) {
9270 target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(4, this->num_iter(), target);
9271 }
9272
9273 // optional string criteria_network = 5 [deprecated = true];
9274 if (has_criteria_network()) {
9275 ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
9276 this->criteria_network().data(), this->criteria_network().length(),
9277 ::google::protobuf::internal::WireFormat::SERIALIZE,
9278 "criteria_network");
9279 target =
9280 ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
9281 5, this->criteria_network(), target);
9282 }
9283
9284 // optional bool concurrent_substeps = 6;
9285 if (has_concurrent_substeps()) {
9286 target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(6, this->concurrent_substeps(), target);
9287 }
9288
9289 // optional string report_net = 7;
9290 if (has_report_net()) {
9291 ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
9292 this->report_net().data(), this->report_net().length(),
9293 ::google::protobuf::internal::WireFormat::SERIALIZE,
9294 "report_net");
9295 target =
9296 ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
9297 7, this->report_net(), target);
9298 }
9299
9300 // optional int32 report_interval = 8;
9301 if (has_report_interval()) {
9302 target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(8, this->report_interval(), target);
9303 }
9304
9305 // optional string should_stop_blob = 9;
9306 if (has_should_stop_blob()) {
9307 ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
9308 this->should_stop_blob().data(), this->should_stop_blob().length(),
9309 ::google::protobuf::internal::WireFormat::SERIALIZE,
9310 "should_stop_blob");
9311 target =
9312 ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
9313 9, this->should_stop_blob(), target);
9314 }
9315
9316 // optional bool only_once = 10;
9317 if (has_only_once()) {
9318 target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(10, this->only_once(), target);
9319 }
9320
9321 // optional int64 run_every_ms = 11;
9322 if (has_run_every_ms()) {
9323 target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(11, this->run_every_ms(), target);
9324 }
9325
9326 // optional bool create_workspace = 12;
9327 if (has_create_workspace()) {
9328 target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(12, this->create_workspace(), target);
9329 }
9330
9331 // optional int32 num_concurrent_instances = 13;
9332 if (has_num_concurrent_instances()) {
9333 target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(13, this->num_concurrent_instances(), target);
9334 }
9335
9336 if (!unknown_fields().empty()) {
9337 target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
9338 unknown_fields(), target);
9339 }
9340 // @@protoc_insertion_point(serialize_to_array_end:caffe2.ExecutionStep)
9341 return target;
9342}
9343
9344int ExecutionStep::ByteSize() const {
9345 int total_size = 0;
9346
9347 if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
9348 // optional string name = 1;
9349 if (has_name()) {
9350 total_size += 1 +
9351 ::google::protobuf::internal::WireFormatLite::StringSize(
9352 this->name());
9353 }
9354
9355 // optional int64 num_iter = 4;
9356 if (has_num_iter()) {
9357 total_size += 1 +
9358 ::google::protobuf::internal::WireFormatLite::Int64Size(
9359 this->num_iter());
9360 }
9361
9362 // optional string criteria_network = 5 [deprecated = true];
9363 if (has_criteria_network()) {
9364 total_size += 1 +
9365 ::google::protobuf::internal::WireFormatLite::StringSize(
9366 this->criteria_network());
9367 }
9368
9369 // optional string report_net = 7;
9370 if (has_report_net()) {
9371 total_size += 1 +
9372 ::google::protobuf::internal::WireFormatLite::StringSize(
9373 this->report_net());
9374 }
9375
9376 // optional int32 report_interval = 8;
9377 if (has_report_interval()) {
9378 total_size += 1 +
9379 ::google::protobuf::internal::WireFormatLite::Int32Size(
9380 this->report_interval());
9381 }
9382
9383 // optional int64 run_every_ms = 11;
9384 if (has_run_every_ms()) {
9385 total_size += 1 +
9386 ::google::protobuf::internal::WireFormatLite::Int64Size(
9387 this->run_every_ms());
9388 }
9389
9390 }
9391 if (_has_bits_[8 / 32] & (0xffu << (8 % 32))) {
9392 // optional bool concurrent_substeps = 6;
9393 if (has_concurrent_substeps()) {
9394 total_size += 1 + 1;
9395 }
9396
9397 // optional string should_stop_blob = 9;
9398 if (has_should_stop_blob()) {
9399 total_size += 1 +
9400 ::google::protobuf::internal::WireFormatLite::StringSize(
9401 this->should_stop_blob());
9402 }
9403
9404 // optional bool only_once = 10;
9405 if (has_only_once()) {
9406 total_size += 1 + 1;
9407 }
9408
9409 // optional bool create_workspace = 12;
9410 if (has_create_workspace()) {
9411 total_size += 1 + 1;
9412 }
9413
9414 // optional int32 num_concurrent_instances = 13;
9415 if (has_num_concurrent_instances()) {
9416 total_size += 1 +
9417 ::google::protobuf::internal::WireFormatLite::Int32Size(
9418 this->num_concurrent_instances());
9419 }
9420
9421 }
9422 // repeated .caffe2.ExecutionStep substep = 2;
9423 total_size += 1 * this->substep_size();
9424 for (int i = 0; i < this->substep_size(); i++) {
9425 total_size +=
9426 ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
9427 this->substep(i));
9428 }
9429
9430 // repeated string network = 3;
9431 total_size += 1 * this->network_size();
9432 for (int i = 0; i < this->network_size(); i++) {
9433 total_size += ::google::protobuf::internal::WireFormatLite::StringSize(
9434 this->network(i));
9435 }
9436
9437 if (!unknown_fields().empty()) {
9438 total_size +=
9439 ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
9440 unknown_fields());
9441 }
9442 GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
9443 _cached_size_ = total_size;
9444 GOOGLE_SAFE_CONCURRENT_WRITES_END();
9445 return total_size;
9446}
9447
9448void ExecutionStep::MergeFrom(const ::google::protobuf::Message& from) {
9449 GOOGLE_CHECK_NE(&from, this);
9450 const ExecutionStep* source =
9451 ::google::protobuf::internal::dynamic_cast_if_available<const ExecutionStep*>(
9452 &from);
9453 if (source == NULL) {
9454 ::google::protobuf::internal::ReflectionOps::Merge(from, this);
9455 } else {
9456 MergeFrom(*source);
9457 }
9458}
9459
9460void ExecutionStep::MergeFrom(const ExecutionStep& from) {
9461 GOOGLE_CHECK_NE(&from, this);
9462 substep_.MergeFrom(from.substep_);
9463 network_.MergeFrom(from.network_);
9464 if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
9465 if (from.has_name()) {
9466 set_name(from.name());
9467 }
9468 if (from.has_num_iter()) {
9469 set_num_iter(from.num_iter());
9470 }
9471 if (from.has_criteria_network()) {
9472 set_criteria_network(from.criteria_network());
9473 }
9474 if (from.has_report_net()) {
9475 set_report_net(from.report_net());
9476 }
9477 if (from.has_report_interval()) {
9478 set_report_interval(from.report_interval());
9479 }
9480 if (from.has_run_every_ms()) {
9481 set_run_every_ms(from.run_every_ms());
9482 }
9483 }
9484 if (from._has_bits_[8 / 32] & (0xffu << (8 % 32))) {
9485 if (from.has_concurrent_substeps()) {
9486 set_concurrent_substeps(from.concurrent_substeps());
9487 }
9488 if (from.has_should_stop_blob()) {
9489 set_should_stop_blob(from.should_stop_blob());
9490 }
9491 if (from.has_only_once()) {
9492 set_only_once(from.only_once());
9493 }
9494 if (from.has_create_workspace()) {
9495 set_create_workspace(from.create_workspace());
9496 }
9497 if (from.has_num_concurrent_instances()) {
9498 set_num_concurrent_instances(from.num_concurrent_instances());
9499 }
9500 }
9501 mutable_unknown_fields()->MergeFrom(from.unknown_fields());
9502}
9503
9504void ExecutionStep::CopyFrom(const ::google::protobuf::Message& from) {
9505 if (&from == this) return;
9506 Clear();
9507 MergeFrom(from);
9508}
9509
9510void ExecutionStep::CopyFrom(const ExecutionStep& from) {
9511 if (&from == this) return;
9512 Clear();
9513 MergeFrom(from);
9514}
9515
9516bool ExecutionStep::IsInitialized() const {
9517
9518 return true;
9519}
9520
9521void ExecutionStep::Swap(ExecutionStep* other) {
9522 if (other != this) {
9523 std::swap(name_, other->name_);
9524 substep_.Swap(&other->substep_);
9525 network_.Swap(&other->network_);
9526 std::swap(num_iter_, other->num_iter_);
9527 std::swap(criteria_network_, other->criteria_network_);
9528 std::swap(report_net_, other->report_net_);
9529 std::swap(report_interval_, other->report_interval_);
9530 std::swap(run_every_ms_, other->run_every_ms_);
9531 std::swap(concurrent_substeps_, other->concurrent_substeps_);
9532 std::swap(should_stop_blob_, other->should_stop_blob_);
9533 std::swap(only_once_, other->only_once_);
9534 std::swap(create_workspace_, other->create_workspace_);
9535 std::swap(num_concurrent_instances_, other->num_concurrent_instances_);
9536 std::swap(_has_bits_[0], other->_has_bits_[0]);
9537 _unknown_fields_.Swap(&other->_unknown_fields_);
9538 std::swap(_cached_size_, other->_cached_size_);
9539 }
9540}
9541
9542::google::protobuf::Metadata ExecutionStep::GetMetadata() const {
9543 protobuf_AssignDescriptorsOnce();
9544 ::google::protobuf::Metadata metadata;
9545 metadata.descriptor = ExecutionStep_descriptor_;
9546 metadata.reflection = ExecutionStep_reflection_;
9547 return metadata;
9548}
9549
9550
9551// ===================================================================
9552
9553#ifndef _MSC_VER
9554const int PlanDef::kNameFieldNumber;
9555const int PlanDef::kNetworkFieldNumber;
9556const int PlanDef::kExecutionStepFieldNumber;
9557#endif // !_MSC_VER
9558
9559PlanDef::PlanDef()
9560 : ::google::protobuf::Message() {
9561 SharedCtor();
9562 // @@protoc_insertion_point(constructor:caffe2.PlanDef)
9563}
9564
9565void PlanDef::InitAsDefaultInstance() {
9566}
9567
9568PlanDef::PlanDef(const PlanDef& from)
9569 : ::google::protobuf::Message() {
9570 SharedCtor();
9571 MergeFrom(from);
9572 // @@protoc_insertion_point(copy_constructor:caffe2.PlanDef)
9573}
9574
9575void PlanDef::SharedCtor() {
9576 ::google::protobuf::internal::GetEmptyString();
9577 _cached_size_ = 0;
9578 name_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
9579 ::memset(_has_bits_, 0, sizeof(_has_bits_));
9580}
9581
9582PlanDef::~PlanDef() {
9583 // @@protoc_insertion_point(destructor:caffe2.PlanDef)
9584 SharedDtor();
9585}
9586
9587void PlanDef::SharedDtor() {
9588 if (name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
9589 delete name_;
9590 }
9591 if (this != default_instance_) {
9592 }
9593}
9594
9595void PlanDef::SetCachedSize(int size) const {
9596 GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
9597 _cached_size_ = size;
9598 GOOGLE_SAFE_CONCURRENT_WRITES_END();
9599}
9600const ::google::protobuf::Descriptor* PlanDef::descriptor() {
9601 protobuf_AssignDescriptorsOnce();
9602 return PlanDef_descriptor_;
9603}
9604
9605const PlanDef& PlanDef::default_instance() {
9606 if (default_instance_ == NULL) protobuf_AddDesc_caffe2_2eproto();
9607 return *default_instance_;
9608}
9609
9610PlanDef* PlanDef::default_instance_ = NULL;
9611
9612PlanDef* PlanDef::New() const {
9613 return new PlanDef;
9614}
9615
9616void PlanDef::Clear() {
9617 if (has_name()) {
9618 if (name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
9619 name_->clear();
9620 }
9621 }
9622 network_.Clear();
9623 execution_step_.Clear();
9624 ::memset(_has_bits_, 0, sizeof(_has_bits_));
9625 mutable_unknown_fields()->Clear();
9626}
9627
9628bool PlanDef::MergePartialFromCodedStream(
9629 ::google::protobuf::io::CodedInputStream* input) {
9630#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure
9631 ::google::protobuf::uint32 tag;
9632 // @@protoc_insertion_point(parse_start:caffe2.PlanDef)
9633 for (;;) {
9634 ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);
9635 tag = p.first;
9636 if (!p.second) goto handle_unusual;
9637 switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
9638 // optional string name = 1;
9639 case 1: {
9640 if (tag == 10) {
9641 DO_(::google::protobuf::internal::WireFormatLite::ReadString(
9642 input, this->mutable_name()));
9643 ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
9644 this->name().data(), this->name().length(),
9645 ::google::protobuf::internal::WireFormat::PARSE,
9646 "name");
9647 } else {
9648 goto handle_unusual;
9649 }
9650 if (input->ExpectTag(18)) goto parse_network;
9651 break;
9652 }
9653
9654 // repeated .caffe2.NetDef network = 2;
9655 case 2: {
9656 if (tag == 18) {
9657 parse_network:
9658 DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
9659 input, add_network()));
9660 } else {
9661 goto handle_unusual;
9662 }
9663 if (input->ExpectTag(18)) goto parse_network;
9664 if (input->ExpectTag(26)) goto parse_execution_step;
9665 break;
9666 }
9667
9668 // repeated .caffe2.ExecutionStep execution_step = 3;
9669 case 3: {
9670 if (tag == 26) {
9671 parse_execution_step:
9672 DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
9673 input, add_execution_step()));
9674 } else {
9675 goto handle_unusual;
9676 }
9677 if (input->ExpectTag(26)) goto parse_execution_step;
9678 if (input->ExpectAtEnd()) goto success;
9679 break;
9680 }
9681
9682 default: {
9683 handle_unusual:
9684 if (tag == 0 ||
9685 ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
9686 ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
9687 goto success;
9688 }
9689 DO_(::google::protobuf::internal::WireFormat::SkipField(
9690 input, tag, mutable_unknown_fields()));
9691 break;
9692 }
9693 }
9694 }
9695success:
9696 // @@protoc_insertion_point(parse_success:caffe2.PlanDef)
9697 return true;
9698failure:
9699 // @@protoc_insertion_point(parse_failure:caffe2.PlanDef)
9700 return false;
9701#undef DO_
9702}
9703
9704void PlanDef::SerializeWithCachedSizes(
9705 ::google::protobuf::io::CodedOutputStream* output) const {
9706 // @@protoc_insertion_point(serialize_start:caffe2.PlanDef)
9707 // optional string name = 1;
9708 if (has_name()) {
9709 ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
9710 this->name().data(), this->name().length(),
9711 ::google::protobuf::internal::WireFormat::SERIALIZE,
9712 "name");
9713 ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
9714 1, this->name(), output);
9715 }
9716
9717 // repeated .caffe2.NetDef network = 2;
9718 for (int i = 0; i < this->network_size(); i++) {
9719 ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
9720 2, this->network(i), output);
9721 }
9722
9723 // repeated .caffe2.ExecutionStep execution_step = 3;
9724 for (int i = 0; i < this->execution_step_size(); i++) {
9725 ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
9726 3, this->execution_step(i), output);
9727 }
9728
9729 if (!unknown_fields().empty()) {
9730 ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
9731 unknown_fields(), output);
9732 }
9733 // @@protoc_insertion_point(serialize_end:caffe2.PlanDef)
9734}
9735
9736::google::protobuf::uint8* PlanDef::SerializeWithCachedSizesToArray(
9737 ::google::protobuf::uint8* target) const {
9738 // @@protoc_insertion_point(serialize_to_array_start:caffe2.PlanDef)
9739 // optional string name = 1;
9740 if (has_name()) {
9741 ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
9742 this->name().data(), this->name().length(),
9743 ::google::protobuf::internal::WireFormat::SERIALIZE,
9744 "name");
9745 target =
9746 ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
9747 1, this->name(), target);
9748 }
9749
9750 // repeated .caffe2.NetDef network = 2;
9751 for (int i = 0; i < this->network_size(); i++) {
9752 target = ::google::protobuf::internal::WireFormatLite::
9753 WriteMessageNoVirtualToArray(
9754 2, this->network(i), target);
9755 }
9756
9757 // repeated .caffe2.ExecutionStep execution_step = 3;
9758 for (int i = 0; i < this->execution_step_size(); i++) {
9759 target = ::google::protobuf::internal::WireFormatLite::
9760 WriteMessageNoVirtualToArray(
9761 3, this->execution_step(i), target);
9762 }
9763
9764 if (!unknown_fields().empty()) {
9765 target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
9766 unknown_fields(), target);
9767 }
9768 // @@protoc_insertion_point(serialize_to_array_end:caffe2.PlanDef)
9769 return target;
9770}
9771
9772int PlanDef::ByteSize() const {
9773 int total_size = 0;
9774
9775 if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
9776 // optional string name = 1;
9777 if (has_name()) {
9778 total_size += 1 +
9779 ::google::protobuf::internal::WireFormatLite::StringSize(
9780 this->name());
9781 }
9782
9783 }
9784 // repeated .caffe2.NetDef network = 2;
9785 total_size += 1 * this->network_size();
9786 for (int i = 0; i < this->network_size(); i++) {
9787 total_size +=
9788 ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
9789 this->network(i));
9790 }
9791
9792 // repeated .caffe2.ExecutionStep execution_step = 3;
9793 total_size += 1 * this->execution_step_size();
9794 for (int i = 0; i < this->execution_step_size(); i++) {
9795 total_size +=
9796 ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
9797 this->execution_step(i));
9798 }
9799
9800 if (!unknown_fields().empty()) {
9801 total_size +=
9802 ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
9803 unknown_fields());
9804 }
9805 GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
9806 _cached_size_ = total_size;
9807 GOOGLE_SAFE_CONCURRENT_WRITES_END();
9808 return total_size;
9809}
9810
9811void PlanDef::MergeFrom(const ::google::protobuf::Message& from) {
9812 GOOGLE_CHECK_NE(&from, this);
9813 const PlanDef* source =
9814 ::google::protobuf::internal::dynamic_cast_if_available<const PlanDef*>(
9815 &from);
9816 if (source == NULL) {
9817 ::google::protobuf::internal::ReflectionOps::Merge(from, this);
9818 } else {
9819 MergeFrom(*source);
9820 }
9821}
9822
9823void PlanDef::MergeFrom(const PlanDef& from) {
9824 GOOGLE_CHECK_NE(&from, this);
9825 network_.MergeFrom(from.network_);
9826 execution_step_.MergeFrom(from.execution_step_);
9827 if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
9828 if (from.has_name()) {
9829 set_name(from.name());
9830 }
9831 }
9832 mutable_unknown_fields()->MergeFrom(from.unknown_fields());
9833}
9834
9835void PlanDef::CopyFrom(const ::google::protobuf::Message& from) {
9836 if (&from == this) return;
9837 Clear();
9838 MergeFrom(from);
9839}
9840
9841void PlanDef::CopyFrom(const PlanDef& from) {
9842 if (&from == this) return;
9843 Clear();
9844 MergeFrom(from);
9845}
9846
9847bool PlanDef::IsInitialized() const {
9848
9849 if (!::google::protobuf::internal::AllAreInitialized(this->network())) return false;
9850 return true;
9851}
9852
9853void PlanDef::Swap(PlanDef* other) {
9854 if (other != this) {
9855 std::swap(name_, other->name_);
9856 network_.Swap(&other->network_);
9857 execution_step_.Swap(&other->execution_step_);
9858 std::swap(_has_bits_[0], other->_has_bits_[0]);
9859 _unknown_fields_.Swap(&other->_unknown_fields_);
9860 std::swap(_cached_size_, other->_cached_size_);
9861 }
9862}
9863
9864::google::protobuf::Metadata PlanDef::GetMetadata() const {
9865 protobuf_AssignDescriptorsOnce();
9866 ::google::protobuf::Metadata metadata;
9867 metadata.descriptor = PlanDef_descriptor_;
9868 metadata.reflection = PlanDef_reflection_;
9869 return metadata;
9870}
9871
9872
9873// ===================================================================
9874
9875#ifndef _MSC_VER
9876const int BlobProto::kNameFieldNumber;
9877const int BlobProto::kTypeFieldNumber;
9878const int BlobProto::kTensorFieldNumber;
9879const int BlobProto::kContentFieldNumber;
9880const int BlobProto::kQtensorFieldNumber;
9881const int BlobProto::kContentNumChunksFieldNumber;
9882const int BlobProto::kContentChunkIdFieldNumber;
9883#endif // !_MSC_VER
9884
9885BlobProto::BlobProto()
9886 : ::google::protobuf::Message() {
9887 SharedCtor();
9888 // @@protoc_insertion_point(constructor:caffe2.BlobProto)
9889}
9890
9891void BlobProto::InitAsDefaultInstance() {
9892 tensor_ = const_cast< ::caffe2::TensorProto*>(&::caffe2::TensorProto::default_instance());
9893 qtensor_ = const_cast< ::caffe2::QTensorProto*>(&::caffe2::QTensorProto::default_instance());
9894}
9895
9896BlobProto::BlobProto(const BlobProto& from)
9897 : ::google::protobuf::Message() {
9898 SharedCtor();
9899 MergeFrom(from);
9900 // @@protoc_insertion_point(copy_constructor:caffe2.BlobProto)
9901}
9902
9903void BlobProto::SharedCtor() {
9904 ::google::protobuf::internal::GetEmptyString();
9905 _cached_size_ = 0;
9906 name_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
9907 type_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
9908 tensor_ = NULL;
9909 content_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
9910 qtensor_ = NULL;
9911 content_num_chunks_ = 0;
9912 content_chunk_id_ = 0;
9913 ::memset(_has_bits_, 0, sizeof(_has_bits_));
9914}
9915
9916BlobProto::~BlobProto() {
9917 // @@protoc_insertion_point(destructor:caffe2.BlobProto)
9918 SharedDtor();
9919}
9920
9921void BlobProto::SharedDtor() {
9922 if (name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
9923 delete name_;
9924 }
9925 if (type_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
9926 delete type_;
9927 }
9928 if (content_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
9929 delete content_;
9930 }
9931 if (this != default_instance_) {
9932 delete tensor_;
9933 delete qtensor_;
9934 }
9935}
9936
9937void BlobProto::SetCachedSize(int size) const {
9938 GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
9939 _cached_size_ = size;
9940 GOOGLE_SAFE_CONCURRENT_WRITES_END();
9941}
9942const ::google::protobuf::Descriptor* BlobProto::descriptor() {
9943 protobuf_AssignDescriptorsOnce();
9944 return BlobProto_descriptor_;
9945}
9946
9947const BlobProto& BlobProto::default_instance() {
9948 if (default_instance_ == NULL) protobuf_AddDesc_caffe2_2eproto();
9949 return *default_instance_;
9950}
9951
9952BlobProto* BlobProto::default_instance_ = NULL;
9953
9954BlobProto* BlobProto::New() const {
9955 return new BlobProto;
9956}
9957
9958void BlobProto::Clear() {
9959#define OFFSET_OF_FIELD_(f) (reinterpret_cast<char*>( \
9960 &reinterpret_cast<BlobProto*>(16)->f) - \
9961 reinterpret_cast<char*>(16))
9962
9963#define ZR_(first, last) do { \
9964 size_t f = OFFSET_OF_FIELD_(first); \
9965 size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \
9966 ::memset(&first, 0, n); \
9967 } while (0)
9968
9969 if (_has_bits_[0 / 32] & 127) {
9970 ZR_(content_num_chunks_, content_chunk_id_);
9971 if (has_name()) {
9972 if (name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
9973 name_->clear();
9974 }
9975 }
9976 if (has_type()) {
9977 if (type_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
9978 type_->clear();
9979 }
9980 }
9981 if (has_tensor()) {
9982 if (tensor_ != NULL) tensor_->::caffe2::TensorProto::Clear();
9983 }
9984 if (has_content()) {
9985 if (content_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
9986 content_->clear();
9987 }
9988 }
9989 if (has_qtensor()) {
9990 if (qtensor_ != NULL) qtensor_->::caffe2::QTensorProto::Clear();
9991 }
9992 }
9993
9994#undef OFFSET_OF_FIELD_
9995#undef ZR_
9996
9997 ::memset(_has_bits_, 0, sizeof(_has_bits_));
9998 mutable_unknown_fields()->Clear();
9999}
10000
10001bool BlobProto::MergePartialFromCodedStream(
10002 ::google::protobuf::io::CodedInputStream* input) {
10003#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure
10004 ::google::protobuf::uint32 tag;
10005 // @@protoc_insertion_point(parse_start:caffe2.BlobProto)
10006 for (;;) {
10007 ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);
10008 tag = p.first;
10009 if (!p.second) goto handle_unusual;
10010 switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
10011 // optional string name = 1;
10012 case 1: {
10013 if (tag == 10) {
10014 DO_(::google::protobuf::internal::WireFormatLite::ReadString(
10015 input, this->mutable_name()));
10016 ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
10017 this->name().data(), this->name().length(),
10018 ::google::protobuf::internal::WireFormat::PARSE,
10019 "name");
10020 } else {
10021 goto handle_unusual;
10022 }
10023 if (input->ExpectTag(18)) goto parse_type;
10024 break;
10025 }
10026
10027 // optional string type = 2;
10028 case 2: {
10029 if (tag == 18) {
10030 parse_type:
10031 DO_(::google::protobuf::internal::WireFormatLite::ReadString(
10032 input, this->mutable_type()));
10033 ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
10034 this->type().data(), this->type().length(),
10035 ::google::protobuf::internal::WireFormat::PARSE,
10036 "type");
10037 } else {
10038 goto handle_unusual;
10039 }
10040 if (input->ExpectTag(26)) goto parse_tensor;
10041 break;
10042 }
10043
10044 // optional .caffe2.TensorProto tensor = 3;
10045 case 3: {
10046 if (tag == 26) {
10047 parse_tensor:
10048 DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
10049 input, mutable_tensor()));
10050 } else {
10051 goto handle_unusual;
10052 }
10053 if (input->ExpectTag(34)) goto parse_content;
10054 break;
10055 }
10056
10057 // optional bytes content = 4;
10058 case 4: {
10059 if (tag == 34) {
10060 parse_content:
10061 DO_(::google::protobuf::internal::WireFormatLite::ReadBytes(
10062 input, this->mutable_content()));
10063 } else {
10064 goto handle_unusual;
10065 }
10066 if (input->ExpectTag(42)) goto parse_qtensor;
10067 break;
10068 }
10069
10070 // optional .caffe2.QTensorProto qtensor = 5;
10071 case 5: {
10072 if (tag == 42) {
10073 parse_qtensor:
10074 DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
10075 input, mutable_qtensor()));
10076 } else {
10077 goto handle_unusual;
10078 }
10079 if (input->ExpectTag(48)) goto parse_content_num_chunks;
10080 break;
10081 }
10082
10083 // optional int32 content_num_chunks = 6;
10084 case 6: {
10085 if (tag == 48) {
10086 parse_content_num_chunks:
10087 DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
10088 ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
10089 input, &content_num_chunks_)));
10090 set_has_content_num_chunks();
10091 } else {
10092 goto handle_unusual;
10093 }
10094 if (input->ExpectTag(56)) goto parse_content_chunk_id;
10095 break;
10096 }
10097
10098 // optional int32 content_chunk_id = 7;
10099 case 7: {
10100 if (tag == 56) {
10101 parse_content_chunk_id:
10102 DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
10103 ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
10104 input, &content_chunk_id_)));
10105 set_has_content_chunk_id();
10106 } else {
10107 goto handle_unusual;
10108 }
10109 if (input->ExpectAtEnd()) goto success;
10110 break;
10111 }
10112
10113 default: {
10114 handle_unusual:
10115 if (tag == 0 ||
10116 ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
10117 ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
10118 goto success;
10119 }
10120 DO_(::google::protobuf::internal::WireFormat::SkipField(
10121 input, tag, mutable_unknown_fields()));
10122 break;
10123 }
10124 }
10125 }
10126success:
10127 // @@protoc_insertion_point(parse_success:caffe2.BlobProto)
10128 return true;
10129failure:
10130 // @@protoc_insertion_point(parse_failure:caffe2.BlobProto)
10131 return false;
10132#undef DO_
10133}
10134
10135void BlobProto::SerializeWithCachedSizes(
10136 ::google::protobuf::io::CodedOutputStream* output) const {
10137 // @@protoc_insertion_point(serialize_start:caffe2.BlobProto)
10138 // optional string name = 1;
10139 if (has_name()) {
10140 ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
10141 this->name().data(), this->name().length(),
10142 ::google::protobuf::internal::WireFormat::SERIALIZE,
10143 "name");
10144 ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
10145 1, this->name(), output);
10146 }
10147
10148 // optional string type = 2;
10149 if (has_type()) {
10150 ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
10151 this->type().data(), this->type().length(),
10152 ::google::protobuf::internal::WireFormat::SERIALIZE,
10153 "type");
10154 ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
10155 2, this->type(), output);
10156 }
10157
10158 // optional .caffe2.TensorProto tensor = 3;
10159 if (has_tensor()) {
10160 ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
10161 3, this->tensor(), output);
10162 }
10163
10164 // optional bytes content = 4;
10165 if (has_content()) {
10166 ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased(
10167 4, this->content(), output);
10168 }
10169
10170 // optional .caffe2.QTensorProto qtensor = 5;
10171 if (has_qtensor()) {
10172 ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
10173 5, this->qtensor(), output);
10174 }
10175
10176 // optional int32 content_num_chunks = 6;
10177 if (has_content_num_chunks()) {
10178 ::google::protobuf::internal::WireFormatLite::WriteInt32(6, this->content_num_chunks(), output);
10179 }
10180
10181 // optional int32 content_chunk_id = 7;
10182 if (has_content_chunk_id()) {
10183 ::google::protobuf::internal::WireFormatLite::WriteInt32(7, this->content_chunk_id(), output);
10184 }
10185
10186 if (!unknown_fields().empty()) {
10187 ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
10188 unknown_fields(), output);
10189 }
10190 // @@protoc_insertion_point(serialize_end:caffe2.BlobProto)
10191}
10192
10193::google::protobuf::uint8* BlobProto::SerializeWithCachedSizesToArray(
10194 ::google::protobuf::uint8* target) const {
10195 // @@protoc_insertion_point(serialize_to_array_start:caffe2.BlobProto)
10196 // optional string name = 1;
10197 if (has_name()) {
10198 ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
10199 this->name().data(), this->name().length(),
10200 ::google::protobuf::internal::WireFormat::SERIALIZE,
10201 "name");
10202 target =
10203 ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
10204 1, this->name(), target);
10205 }
10206
10207 // optional string type = 2;
10208 if (has_type()) {
10209 ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
10210 this->type().data(), this->type().length(),
10211 ::google::protobuf::internal::WireFormat::SERIALIZE,
10212 "type");
10213 target =
10214 ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
10215 2, this->type(), target);
10216 }
10217
10218 // optional .caffe2.TensorProto tensor = 3;
10219 if (has_tensor()) {
10220 target = ::google::protobuf::internal::WireFormatLite::
10221 WriteMessageNoVirtualToArray(
10222 3, this->tensor(), target);
10223 }
10224
10225 // optional bytes content = 4;
10226 if (has_content()) {
10227 target =
10228 ::google::protobuf::internal::WireFormatLite::WriteBytesToArray(
10229 4, this->content(), target);
10230 }
10231
10232 // optional .caffe2.QTensorProto qtensor = 5;
10233 if (has_qtensor()) {
10234 target = ::google::protobuf::internal::WireFormatLite::
10235 WriteMessageNoVirtualToArray(
10236 5, this->qtensor(), target);
10237 }
10238
10239 // optional int32 content_num_chunks = 6;
10240 if (has_content_num_chunks()) {
10241 target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(6, this->content_num_chunks(), target);
10242 }
10243
10244 // optional int32 content_chunk_id = 7;
10245 if (has_content_chunk_id()) {
10246 target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(7, this->content_chunk_id(), target);
10247 }
10248
10249 if (!unknown_fields().empty()) {
10250 target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
10251 unknown_fields(), target);
10252 }
10253 // @@protoc_insertion_point(serialize_to_array_end:caffe2.BlobProto)
10254 return target;
10255}
10256
10257int BlobProto::ByteSize() const {
10258 int total_size = 0;
10259
10260 if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
10261 // optional string name = 1;
10262 if (has_name()) {
10263 total_size += 1 +
10264 ::google::protobuf::internal::WireFormatLite::StringSize(
10265 this->name());
10266 }
10267
10268 // optional string type = 2;
10269 if (has_type()) {
10270 total_size += 1 +
10271 ::google::protobuf::internal::WireFormatLite::StringSize(
10272 this->type());
10273 }
10274
10275 // optional .caffe2.TensorProto tensor = 3;
10276 if (has_tensor()) {
10277 total_size += 1 +
10278 ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
10279 this->tensor());
10280 }
10281
10282 // optional bytes content = 4;
10283 if (has_content()) {
10284 total_size += 1 +
10285 ::google::protobuf::internal::WireFormatLite::BytesSize(
10286 this->content());
10287 }
10288
10289 // optional .caffe2.QTensorProto qtensor = 5;
10290 if (has_qtensor()) {
10291 total_size += 1 +
10292 ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
10293 this->qtensor());
10294 }
10295
10296 // optional int32 content_num_chunks = 6;
10297 if (has_content_num_chunks()) {
10298 total_size += 1 +
10299 ::google::protobuf::internal::WireFormatLite::Int32Size(
10300 this->content_num_chunks());
10301 }
10302
10303 // optional int32 content_chunk_id = 7;
10304 if (has_content_chunk_id()) {
10305 total_size += 1 +
10306 ::google::protobuf::internal::WireFormatLite::Int32Size(
10307 this->content_chunk_id());
10308 }
10309
10310 }
10311 if (!unknown_fields().empty()) {
10312 total_size +=
10313 ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
10314 unknown_fields());
10315 }
10316 GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
10317 _cached_size_ = total_size;
10318 GOOGLE_SAFE_CONCURRENT_WRITES_END();
10319 return total_size;
10320}
10321
10322void BlobProto::MergeFrom(const ::google::protobuf::Message& from) {
10323 GOOGLE_CHECK_NE(&from, this);
10324 const BlobProto* source =
10325 ::google::protobuf::internal::dynamic_cast_if_available<const BlobProto*>(
10326 &from);
10327 if (source == NULL) {
10328 ::google::protobuf::internal::ReflectionOps::Merge(from, this);
10329 } else {
10330 MergeFrom(*source);
10331 }
10332}
10333
10334void BlobProto::MergeFrom(const BlobProto& from) {
10335 GOOGLE_CHECK_NE(&from, this);
10336 if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
10337 if (from.has_name()) {
10338 set_name(from.name());
10339 }
10340 if (from.has_type()) {
10341 set_type(from.type());
10342 }
10343 if (from.has_tensor()) {
10344 mutable_tensor()->::caffe2::TensorProto::MergeFrom(from.tensor());
10345 }
10346 if (from.has_content()) {
10347 set_content(from.content());
10348 }
10349 if (from.has_qtensor()) {
10350 mutable_qtensor()->::caffe2::QTensorProto::MergeFrom(from.qtensor());
10351 }
10352 if (from.has_content_num_chunks()) {
10353 set_content_num_chunks(from.content_num_chunks());
10354 }
10355 if (from.has_content_chunk_id()) {
10356 set_content_chunk_id(from.content_chunk_id());
10357 }
10358 }
10359 mutable_unknown_fields()->MergeFrom(from.unknown_fields());
10360}
10361
10362void BlobProto::CopyFrom(const ::google::protobuf::Message& from) {
10363 if (&from == this) return;
10364 Clear();
10365 MergeFrom(from);
10366}
10367
10368void BlobProto::CopyFrom(const BlobProto& from) {
10369 if (&from == this) return;
10370 Clear();
10371 MergeFrom(from);
10372}
10373
10374bool BlobProto::IsInitialized() const {
10375
10376 if (has_tensor()) {
10377 if (!this->tensor().IsInitialized()) return false;
10378 }
10379 if (has_qtensor()) {
10380 if (!this->qtensor().IsInitialized()) return false;
10381 }
10382 return true;
10383}
10384
10385void BlobProto::Swap(BlobProto* other) {
10386 if (other != this) {
10387 std::swap(name_, other->name_);
10388 std::swap(type_, other->type_);
10389 std::swap(tensor_, other->tensor_);
10390 std::swap(content_, other->content_);
10391 std::swap(qtensor_, other->qtensor_);
10392 std::swap(content_num_chunks_, other->content_num_chunks_);
10393 std::swap(content_chunk_id_, other->content_chunk_id_);
10394 std::swap(_has_bits_[0], other->_has_bits_[0]);
10395 _unknown_fields_.Swap(&other->_unknown_fields_);
10396 std::swap(_cached_size_, other->_cached_size_);
10397 }
10398}
10399
10400::google::protobuf::Metadata BlobProto::GetMetadata() const {
10401 protobuf_AssignDescriptorsOnce();
10402 ::google::protobuf::Metadata metadata;
10403 metadata.descriptor = BlobProto_descriptor_;
10404 metadata.reflection = BlobProto_reflection_;
10405 return metadata;
10406}
10407
10408
10409// ===================================================================
10410
10411#ifndef _MSC_VER
10412const int DBReaderProto::kNameFieldNumber;
10413const int DBReaderProto::kSourceFieldNumber;
10414const int DBReaderProto::kDbTypeFieldNumber;
10415const int DBReaderProto::kKeyFieldNumber;
10416#endif // !_MSC_VER
10417
10418DBReaderProto::DBReaderProto()
10419 : ::google::protobuf::Message() {
10420 SharedCtor();
10421 // @@protoc_insertion_point(constructor:caffe2.DBReaderProto)
10422}
10423
10424void DBReaderProto::InitAsDefaultInstance() {
10425}
10426
10427DBReaderProto::DBReaderProto(const DBReaderProto& from)
10428 : ::google::protobuf::Message() {
10429 SharedCtor();
10430 MergeFrom(from);
10431 // @@protoc_insertion_point(copy_constructor:caffe2.DBReaderProto)
10432}
10433
10434void DBReaderProto::SharedCtor() {
10435 ::google::protobuf::internal::GetEmptyString();
10436 _cached_size_ = 0;
10437 name_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
10438 source_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
10439 db_type_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
10440 key_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
10441 ::memset(_has_bits_, 0, sizeof(_has_bits_));
10442}
10443
10444DBReaderProto::~DBReaderProto() {
10445 // @@protoc_insertion_point(destructor:caffe2.DBReaderProto)
10446 SharedDtor();
10447}
10448
10449void DBReaderProto::SharedDtor() {
10450 if (name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
10451 delete name_;
10452 }
10453 if (source_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
10454 delete source_;
10455 }
10456 if (db_type_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
10457 delete db_type_;
10458 }
10459 if (key_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
10460 delete key_;
10461 }
10462 if (this != default_instance_) {
10463 }
10464}
10465
10466void DBReaderProto::SetCachedSize(int size) const {
10467 GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
10468 _cached_size_ = size;
10469 GOOGLE_SAFE_CONCURRENT_WRITES_END();
10470}
10471const ::google::protobuf::Descriptor* DBReaderProto::descriptor() {
10472 protobuf_AssignDescriptorsOnce();
10473 return DBReaderProto_descriptor_;
10474}
10475
10476const DBReaderProto& DBReaderProto::default_instance() {
10477 if (default_instance_ == NULL) protobuf_AddDesc_caffe2_2eproto();
10478 return *default_instance_;
10479}
10480
10481DBReaderProto* DBReaderProto::default_instance_ = NULL;
10482
10483DBReaderProto* DBReaderProto::New() const {
10484 return new DBReaderProto;
10485}
10486
10487void DBReaderProto::Clear() {
10488 if (_has_bits_[0 / 32] & 15) {
10489 if (has_name()) {
10490 if (name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
10491 name_->clear();
10492 }
10493 }
10494 if (has_source()) {
10495 if (source_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
10496 source_->clear();
10497 }
10498 }
10499 if (has_db_type()) {
10500 if (db_type_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
10501 db_type_->clear();
10502 }
10503 }
10504 if (has_key()) {
10505 if (key_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
10506 key_->clear();
10507 }
10508 }
10509 }
10510 ::memset(_has_bits_, 0, sizeof(_has_bits_));
10511 mutable_unknown_fields()->Clear();
10512}
10513
10514bool DBReaderProto::MergePartialFromCodedStream(
10515 ::google::protobuf::io::CodedInputStream* input) {
10516#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure
10517 ::google::protobuf::uint32 tag;
10518 // @@protoc_insertion_point(parse_start:caffe2.DBReaderProto)
10519 for (;;) {
10520 ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);
10521 tag = p.first;
10522 if (!p.second) goto handle_unusual;
10523 switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
10524 // optional string name = 1;
10525 case 1: {
10526 if (tag == 10) {
10527 DO_(::google::protobuf::internal::WireFormatLite::ReadString(
10528 input, this->mutable_name()));
10529 ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
10530 this->name().data(), this->name().length(),
10531 ::google::protobuf::internal::WireFormat::PARSE,
10532 "name");
10533 } else {
10534 goto handle_unusual;
10535 }
10536 if (input->ExpectTag(18)) goto parse_source;
10537 break;
10538 }
10539
10540 // optional string source = 2;
10541 case 2: {
10542 if (tag == 18) {
10543 parse_source:
10544 DO_(::google::protobuf::internal::WireFormatLite::ReadString(
10545 input, this->mutable_source()));
10546 ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
10547 this->source().data(), this->source().length(),
10548 ::google::protobuf::internal::WireFormat::PARSE,
10549 "source");
10550 } else {
10551 goto handle_unusual;
10552 }
10553 if (input->ExpectTag(26)) goto parse_db_type;
10554 break;
10555 }
10556
10557 // optional string db_type = 3;
10558 case 3: {
10559 if (tag == 26) {
10560 parse_db_type:
10561 DO_(::google::protobuf::internal::WireFormatLite::ReadString(
10562 input, this->mutable_db_type()));
10563 ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
10564 this->db_type().data(), this->db_type().length(),
10565 ::google::protobuf::internal::WireFormat::PARSE,
10566 "db_type");
10567 } else {
10568 goto handle_unusual;
10569 }
10570 if (input->ExpectTag(34)) goto parse_key;
10571 break;
10572 }
10573
10574 // optional string key = 4;
10575 case 4: {
10576 if (tag == 34) {
10577 parse_key:
10578 DO_(::google::protobuf::internal::WireFormatLite::ReadString(
10579 input, this->mutable_key()));
10580 ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
10581 this->key().data(), this->key().length(),
10582 ::google::protobuf::internal::WireFormat::PARSE,
10583 "key");
10584 } else {
10585 goto handle_unusual;
10586 }
10587 if (input->ExpectAtEnd()) goto success;
10588 break;
10589 }
10590
10591 default: {
10592 handle_unusual:
10593 if (tag == 0 ||
10594 ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
10595 ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
10596 goto success;
10597 }
10598 DO_(::google::protobuf::internal::WireFormat::SkipField(
10599 input, tag, mutable_unknown_fields()));
10600 break;
10601 }
10602 }
10603 }
10604success:
10605 // @@protoc_insertion_point(parse_success:caffe2.DBReaderProto)
10606 return true;
10607failure:
10608 // @@protoc_insertion_point(parse_failure:caffe2.DBReaderProto)
10609 return false;
10610#undef DO_
10611}
10612
10613void DBReaderProto::SerializeWithCachedSizes(
10614 ::google::protobuf::io::CodedOutputStream* output) const {
10615 // @@protoc_insertion_point(serialize_start:caffe2.DBReaderProto)
10616 // optional string name = 1;
10617 if (has_name()) {
10618 ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
10619 this->name().data(), this->name().length(),
10620 ::google::protobuf::internal::WireFormat::SERIALIZE,
10621 "name");
10622 ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
10623 1, this->name(), output);
10624 }
10625
10626 // optional string source = 2;
10627 if (has_source()) {
10628 ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
10629 this->source().data(), this->source().length(),
10630 ::google::protobuf::internal::WireFormat::SERIALIZE,
10631 "source");
10632 ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
10633 2, this->source(), output);
10634 }
10635
10636 // optional string db_type = 3;
10637 if (has_db_type()) {
10638 ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
10639 this->db_type().data(), this->db_type().length(),
10640 ::google::protobuf::internal::WireFormat::SERIALIZE,
10641 "db_type");
10642 ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
10643 3, this->db_type(), output);
10644 }
10645
10646 // optional string key = 4;
10647 if (has_key()) {
10648 ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
10649 this->key().data(), this->key().length(),
10650 ::google::protobuf::internal::WireFormat::SERIALIZE,
10651 "key");
10652 ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
10653 4, this->key(), output);
10654 }
10655
10656 if (!unknown_fields().empty()) {
10657 ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
10658 unknown_fields(), output);
10659 }
10660 // @@protoc_insertion_point(serialize_end:caffe2.DBReaderProto)
10661}
10662
10663::google::protobuf::uint8* DBReaderProto::SerializeWithCachedSizesToArray(
10664 ::google::protobuf::uint8* target) const {
10665 // @@protoc_insertion_point(serialize_to_array_start:caffe2.DBReaderProto)
10666 // optional string name = 1;
10667 if (has_name()) {
10668 ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
10669 this->name().data(), this->name().length(),
10670 ::google::protobuf::internal::WireFormat::SERIALIZE,
10671 "name");
10672 target =
10673 ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
10674 1, this->name(), target);
10675 }
10676
10677 // optional string source = 2;
10678 if (has_source()) {
10679 ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
10680 this->source().data(), this->source().length(),
10681 ::google::protobuf::internal::WireFormat::SERIALIZE,
10682 "source");
10683 target =
10684 ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
10685 2, this->source(), target);
10686 }
10687
10688 // optional string db_type = 3;
10689 if (has_db_type()) {
10690 ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
10691 this->db_type().data(), this->db_type().length(),
10692 ::google::protobuf::internal::WireFormat::SERIALIZE,
10693 "db_type");
10694 target =
10695 ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
10696 3, this->db_type(), target);
10697 }
10698
10699 // optional string key = 4;
10700 if (has_key()) {
10701 ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
10702 this->key().data(), this->key().length(),
10703 ::google::protobuf::internal::WireFormat::SERIALIZE,
10704 "key");
10705 target =
10706 ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
10707 4, this->key(), target);
10708 }
10709
10710 if (!unknown_fields().empty()) {
10711 target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
10712 unknown_fields(), target);
10713 }
10714 // @@protoc_insertion_point(serialize_to_array_end:caffe2.DBReaderProto)
10715 return target;
10716}
10717
10718int DBReaderProto::ByteSize() const {
10719 int total_size = 0;
10720
10721 if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
10722 // optional string name = 1;
10723 if (has_name()) {
10724 total_size += 1 +
10725 ::google::protobuf::internal::WireFormatLite::StringSize(
10726 this->name());
10727 }
10728
10729 // optional string source = 2;
10730 if (has_source()) {
10731 total_size += 1 +
10732 ::google::protobuf::internal::WireFormatLite::StringSize(
10733 this->source());
10734 }
10735
10736 // optional string db_type = 3;
10737 if (has_db_type()) {
10738 total_size += 1 +
10739 ::google::protobuf::internal::WireFormatLite::StringSize(
10740 this->db_type());
10741 }
10742
10743 // optional string key = 4;
10744 if (has_key()) {
10745 total_size += 1 +
10746 ::google::protobuf::internal::WireFormatLite::StringSize(
10747 this->key());
10748 }
10749
10750 }
10751 if (!unknown_fields().empty()) {
10752 total_size +=
10753 ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
10754 unknown_fields());
10755 }
10756 GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
10757 _cached_size_ = total_size;
10758 GOOGLE_SAFE_CONCURRENT_WRITES_END();
10759 return total_size;
10760}
10761
10762void DBReaderProto::MergeFrom(const ::google::protobuf::Message& from) {
10763 GOOGLE_CHECK_NE(&from, this);
10764 const DBReaderProto* source =
10765 ::google::protobuf::internal::dynamic_cast_if_available<const DBReaderProto*>(
10766 &from);
10767 if (source == NULL) {
10768 ::google::protobuf::internal::ReflectionOps::Merge(from, this);
10769 } else {
10770 MergeFrom(*source);
10771 }
10772}
10773
10774void DBReaderProto::MergeFrom(const DBReaderProto& from) {
10775 GOOGLE_CHECK_NE(&from, this);
10776 if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
10777 if (from.has_name()) {
10778 set_name(from.name());
10779 }
10780 if (from.has_source()) {
10781 set_source(from.source());
10782 }
10783 if (from.has_db_type()) {
10784 set_db_type(from.db_type());
10785 }
10786 if (from.has_key()) {
10787 set_key(from.key());
10788 }
10789 }
10790 mutable_unknown_fields()->MergeFrom(from.unknown_fields());
10791}
10792
10793void DBReaderProto::CopyFrom(const ::google::protobuf::Message& from) {
10794 if (&from == this) return;
10795 Clear();
10796 MergeFrom(from);
10797}
10798
10799void DBReaderProto::CopyFrom(const DBReaderProto& from) {
10800 if (&from == this) return;
10801 Clear();
10802 MergeFrom(from);
10803}
10804
10805bool DBReaderProto::IsInitialized() const {
10806
10807 return true;
10808}
10809
10810void DBReaderProto::Swap(DBReaderProto* other) {
10811 if (other != this) {
10812 std::swap(name_, other->name_);
10813 std::swap(source_, other->source_);
10814 std::swap(db_type_, other->db_type_);
10815 std::swap(key_, other->key_);
10816 std::swap(_has_bits_[0], other->_has_bits_[0]);
10817 _unknown_fields_.Swap(&other->_unknown_fields_);
10818 std::swap(_cached_size_, other->_cached_size_);
10819 }
10820}
10821
10822::google::protobuf::Metadata DBReaderProto::GetMetadata() const {
10823 protobuf_AssignDescriptorsOnce();
10824 ::google::protobuf::Metadata metadata;
10825 metadata.descriptor = DBReaderProto_descriptor_;
10826 metadata.reflection = DBReaderProto_reflection_;
10827 return metadata;
10828}
10829
10830
10831// @@protoc_insertion_point(namespace_scope)
10832
10833} // namespace caffe2
10834
10835// @@protoc_insertion_point(global_scope)
10836