1// Generated by the protocol buffer compiler. DO NOT EDIT!
2// source: tensorflow/lite/toco/model_flags.proto
3
4#include "tensorflow/lite/toco/model_flags.pb.h"
5
6#include <algorithm>
7
8#include <google/protobuf/stubs/common.h>
9#include <google/protobuf/io/coded_stream.h>
10#include <google/protobuf/extension_set.h>
11#include <google/protobuf/wire_format_lite.h>
12#include <google/protobuf/descriptor.h>
13#include <google/protobuf/generated_message_reflection.h>
14#include <google/protobuf/reflection_ops.h>
15#include <google/protobuf/wire_format.h>
16// @@protoc_insertion_point(includes)
17#include <google/protobuf/port_def.inc>
18extern PROTOBUF_INTERNAL_EXPORT_tensorflow_2flite_2ftoco_2fmodel_5fflags_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_ArraysExtraInfo_tensorflow_2flite_2ftoco_2fmodel_5fflags_2eproto;
19extern PROTOBUF_INTERNAL_EXPORT_tensorflow_2flite_2ftoco_2fmodel_5fflags_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_ArraysExtraInfo_Entry_tensorflow_2flite_2ftoco_2fmodel_5fflags_2eproto;
20extern PROTOBUF_INTERNAL_EXPORT_tensorflow_2flite_2ftoco_2fmodel_5fflags_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_InputArray_tensorflow_2flite_2ftoco_2fmodel_5fflags_2eproto;
21extern PROTOBUF_INTERNAL_EXPORT_tensorflow_2flite_2ftoco_2fmodel_5fflags_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_InputArrayShape_tensorflow_2flite_2ftoco_2fmodel_5fflags_2eproto;
22extern PROTOBUF_INTERNAL_EXPORT_tensorflow_2flite_2ftoco_2fmodel_5fflags_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_ModelFlags_ModelCheck_tensorflow_2flite_2ftoco_2fmodel_5fflags_2eproto;
23extern PROTOBUF_INTERNAL_EXPORT_tensorflow_2flite_2ftoco_2fmodel_5fflags_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_RnnState_tensorflow_2flite_2ftoco_2fmodel_5fflags_2eproto;
24namespace toco {
25class InputArrayShapeDefaultTypeInternal {
26 public:
27 ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<InputArrayShape> _instance;
28} _InputArrayShape_default_instance_;
29class InputArrayDefaultTypeInternal {
30 public:
31 ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<InputArray> _instance;
32} _InputArray_default_instance_;
33class RnnStateDefaultTypeInternal {
34 public:
35 ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<RnnState> _instance;
36} _RnnState_default_instance_;
37class ArraysExtraInfo_EntryDefaultTypeInternal {
38 public:
39 ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<ArraysExtraInfo_Entry> _instance;
40} _ArraysExtraInfo_Entry_default_instance_;
41class ArraysExtraInfoDefaultTypeInternal {
42 public:
43 ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<ArraysExtraInfo> _instance;
44} _ArraysExtraInfo_default_instance_;
45class ModelFlags_ModelCheckDefaultTypeInternal {
46 public:
47 ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<ModelFlags_ModelCheck> _instance;
48} _ModelFlags_ModelCheck_default_instance_;
49class ModelFlagsDefaultTypeInternal {
50 public:
51 ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<ModelFlags> _instance;
52} _ModelFlags_default_instance_;
53} // namespace toco
54static void InitDefaultsscc_info_ArraysExtraInfo_tensorflow_2flite_2ftoco_2fmodel_5fflags_2eproto() {
55 GOOGLE_PROTOBUF_VERIFY_VERSION;
56
57 {
58 void* ptr = &::toco::_ArraysExtraInfo_default_instance_;
59 new (ptr) ::toco::ArraysExtraInfo();
60 ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
61 }
62 ::toco::ArraysExtraInfo::InitAsDefaultInstance();
63}
64
65::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_ArraysExtraInfo_tensorflow_2flite_2ftoco_2fmodel_5fflags_2eproto =
66 {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsscc_info_ArraysExtraInfo_tensorflow_2flite_2ftoco_2fmodel_5fflags_2eproto}, {
67 &scc_info_ArraysExtraInfo_Entry_tensorflow_2flite_2ftoco_2fmodel_5fflags_2eproto.base,}};
68
69static void InitDefaultsscc_info_ArraysExtraInfo_Entry_tensorflow_2flite_2ftoco_2fmodel_5fflags_2eproto() {
70 GOOGLE_PROTOBUF_VERIFY_VERSION;
71
72 {
73 void* ptr = &::toco::_ArraysExtraInfo_Entry_default_instance_;
74 new (ptr) ::toco::ArraysExtraInfo_Entry();
75 ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
76 }
77 ::toco::ArraysExtraInfo_Entry::InitAsDefaultInstance();
78}
79
80::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_ArraysExtraInfo_Entry_tensorflow_2flite_2ftoco_2fmodel_5fflags_2eproto =
81 {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsscc_info_ArraysExtraInfo_Entry_tensorflow_2flite_2ftoco_2fmodel_5fflags_2eproto}, {
82 &scc_info_InputArrayShape_tensorflow_2flite_2ftoco_2fmodel_5fflags_2eproto.base,}};
83
84static void InitDefaultsscc_info_InputArray_tensorflow_2flite_2ftoco_2fmodel_5fflags_2eproto() {
85 GOOGLE_PROTOBUF_VERIFY_VERSION;
86
87 {
88 void* ptr = &::toco::_InputArray_default_instance_;
89 new (ptr) ::toco::InputArray();
90 ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
91 }
92 ::toco::InputArray::InitAsDefaultInstance();
93}
94
95::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_InputArray_tensorflow_2flite_2ftoco_2fmodel_5fflags_2eproto =
96 {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsscc_info_InputArray_tensorflow_2flite_2ftoco_2fmodel_5fflags_2eproto}, {
97 &scc_info_InputArrayShape_tensorflow_2flite_2ftoco_2fmodel_5fflags_2eproto.base,}};
98
99static void InitDefaultsscc_info_InputArrayShape_tensorflow_2flite_2ftoco_2fmodel_5fflags_2eproto() {
100 GOOGLE_PROTOBUF_VERIFY_VERSION;
101
102 {
103 void* ptr = &::toco::_InputArrayShape_default_instance_;
104 new (ptr) ::toco::InputArrayShape();
105 ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
106 }
107 ::toco::InputArrayShape::InitAsDefaultInstance();
108}
109
110::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_InputArrayShape_tensorflow_2flite_2ftoco_2fmodel_5fflags_2eproto =
111 {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsscc_info_InputArrayShape_tensorflow_2flite_2ftoco_2fmodel_5fflags_2eproto}, {}};
112
113static void InitDefaultsscc_info_ModelFlags_tensorflow_2flite_2ftoco_2fmodel_5fflags_2eproto() {
114 GOOGLE_PROTOBUF_VERIFY_VERSION;
115
116 {
117 void* ptr = &::toco::_ModelFlags_default_instance_;
118 new (ptr) ::toco::ModelFlags();
119 ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
120 }
121 ::toco::ModelFlags::InitAsDefaultInstance();
122}
123
124::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<4> scc_info_ModelFlags_tensorflow_2flite_2ftoco_2fmodel_5fflags_2eproto =
125 {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 4, InitDefaultsscc_info_ModelFlags_tensorflow_2flite_2ftoco_2fmodel_5fflags_2eproto}, {
126 &scc_info_InputArray_tensorflow_2flite_2ftoco_2fmodel_5fflags_2eproto.base,
127 &scc_info_RnnState_tensorflow_2flite_2ftoco_2fmodel_5fflags_2eproto.base,
128 &scc_info_ModelFlags_ModelCheck_tensorflow_2flite_2ftoco_2fmodel_5fflags_2eproto.base,
129 &scc_info_ArraysExtraInfo_tensorflow_2flite_2ftoco_2fmodel_5fflags_2eproto.base,}};
130
131static void InitDefaultsscc_info_ModelFlags_ModelCheck_tensorflow_2flite_2ftoco_2fmodel_5fflags_2eproto() {
132 GOOGLE_PROTOBUF_VERIFY_VERSION;
133
134 ::toco::ModelFlags_ModelCheck::_i_give_permission_to_break_this_code_default_count_type_.DefaultConstruct();
135 *::toco::ModelFlags_ModelCheck::_i_give_permission_to_break_this_code_default_count_type_.get_mutable() = std::string("None", 4);
136 ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyString(
137 ::toco::ModelFlags_ModelCheck::_i_give_permission_to_break_this_code_default_count_type_.get_mutable());
138 {
139 void* ptr = &::toco::_ModelFlags_ModelCheck_default_instance_;
140 new (ptr) ::toco::ModelFlags_ModelCheck();
141 ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
142 }
143 ::toco::ModelFlags_ModelCheck::InitAsDefaultInstance();
144}
145
146::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_ModelFlags_ModelCheck_tensorflow_2flite_2ftoco_2fmodel_5fflags_2eproto =
147 {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsscc_info_ModelFlags_ModelCheck_tensorflow_2flite_2ftoco_2fmodel_5fflags_2eproto}, {}};
148
149static void InitDefaultsscc_info_RnnState_tensorflow_2flite_2ftoco_2fmodel_5fflags_2eproto() {
150 GOOGLE_PROTOBUF_VERIFY_VERSION;
151
152 {
153 void* ptr = &::toco::_RnnState_default_instance_;
154 new (ptr) ::toco::RnnState();
155 ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
156 }
157 ::toco::RnnState::InitAsDefaultInstance();
158}
159
160::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_RnnState_tensorflow_2flite_2ftoco_2fmodel_5fflags_2eproto =
161 {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsscc_info_RnnState_tensorflow_2flite_2ftoco_2fmodel_5fflags_2eproto}, {}};
162
163static ::PROTOBUF_NAMESPACE_ID::Metadata file_level_metadata_tensorflow_2flite_2ftoco_2fmodel_5fflags_2eproto[7];
164static const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* file_level_enum_descriptors_tensorflow_2flite_2ftoco_2fmodel_5fflags_2eproto[1];
165static constexpr ::PROTOBUF_NAMESPACE_ID::ServiceDescriptor const** file_level_service_descriptors_tensorflow_2flite_2ftoco_2fmodel_5fflags_2eproto = nullptr;
166
167const ::PROTOBUF_NAMESPACE_ID::uint32 TableStruct_tensorflow_2flite_2ftoco_2fmodel_5fflags_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
168 PROTOBUF_FIELD_OFFSET(::toco::InputArrayShape, _has_bits_),
169 PROTOBUF_FIELD_OFFSET(::toco::InputArrayShape, _internal_metadata_),
170 ~0u, // no _extensions_
171 ~0u, // no _oneof_case_
172 ~0u, // no _weak_field_map_
173 PROTOBUF_FIELD_OFFSET(::toco::InputArrayShape, dims_),
174 PROTOBUF_FIELD_OFFSET(::toco::InputArrayShape, unknown_rank_),
175 ~0u,
176 0,
177 PROTOBUF_FIELD_OFFSET(::toco::InputArray, _has_bits_),
178 PROTOBUF_FIELD_OFFSET(::toco::InputArray, _internal_metadata_),
179 ~0u, // no _extensions_
180 ~0u, // no _oneof_case_
181 ~0u, // no _weak_field_map_
182 PROTOBUF_FIELD_OFFSET(::toco::InputArray, name_),
183 PROTOBUF_FIELD_OFFSET(::toco::InputArray, shape_),
184 PROTOBUF_FIELD_OFFSET(::toco::InputArray, mean_value_),
185 PROTOBUF_FIELD_OFFSET(::toco::InputArray, std_value_),
186 PROTOBUF_FIELD_OFFSET(::toco::InputArray, data_type_),
187 0,
188 1,
189 2,
190 4,
191 3,
192 PROTOBUF_FIELD_OFFSET(::toco::RnnState, _has_bits_),
193 PROTOBUF_FIELD_OFFSET(::toco::RnnState, _internal_metadata_),
194 ~0u, // no _extensions_
195 ~0u, // no _oneof_case_
196 ~0u, // no _weak_field_map_
197 PROTOBUF_FIELD_OFFSET(::toco::RnnState, state_array_),
198 PROTOBUF_FIELD_OFFSET(::toco::RnnState, back_edge_source_array_),
199 PROTOBUF_FIELD_OFFSET(::toco::RnnState, discardable_),
200 PROTOBUF_FIELD_OFFSET(::toco::RnnState, size_),
201 PROTOBUF_FIELD_OFFSET(::toco::RnnState, num_dims_),
202 0,
203 1,
204 4,
205 2,
206 3,
207 PROTOBUF_FIELD_OFFSET(::toco::ArraysExtraInfo_Entry, _has_bits_),
208 PROTOBUF_FIELD_OFFSET(::toco::ArraysExtraInfo_Entry, _internal_metadata_),
209 ~0u, // no _extensions_
210 ~0u, // no _oneof_case_
211 ~0u, // no _weak_field_map_
212 PROTOBUF_FIELD_OFFSET(::toco::ArraysExtraInfo_Entry, name_),
213 PROTOBUF_FIELD_OFFSET(::toco::ArraysExtraInfo_Entry, name_regexp_),
214 PROTOBUF_FIELD_OFFSET(::toco::ArraysExtraInfo_Entry, min_),
215 PROTOBUF_FIELD_OFFSET(::toco::ArraysExtraInfo_Entry, max_),
216 PROTOBUF_FIELD_OFFSET(::toco::ArraysExtraInfo_Entry, data_type_),
217 PROTOBUF_FIELD_OFFSET(::toco::ArraysExtraInfo_Entry, shape_),
218 PROTOBUF_FIELD_OFFSET(::toco::ArraysExtraInfo_Entry, constant_float_value_),
219 0,
220 1,
221 3,
222 4,
223 5,
224 2,
225 6,
226 PROTOBUF_FIELD_OFFSET(::toco::ArraysExtraInfo, _has_bits_),
227 PROTOBUF_FIELD_OFFSET(::toco::ArraysExtraInfo, _internal_metadata_),
228 ~0u, // no _extensions_
229 ~0u, // no _oneof_case_
230 ~0u, // no _weak_field_map_
231 PROTOBUF_FIELD_OFFSET(::toco::ArraysExtraInfo, entries_),
232 ~0u,
233 PROTOBUF_FIELD_OFFSET(::toco::ModelFlags_ModelCheck, _has_bits_),
234 PROTOBUF_FIELD_OFFSET(::toco::ModelFlags_ModelCheck, _internal_metadata_),
235 ~0u, // no _extensions_
236 ~0u, // no _oneof_case_
237 ~0u, // no _weak_field_map_
238 PROTOBUF_FIELD_OFFSET(::toco::ModelFlags_ModelCheck, count_type_),
239 PROTOBUF_FIELD_OFFSET(::toco::ModelFlags_ModelCheck, count_min_),
240 PROTOBUF_FIELD_OFFSET(::toco::ModelFlags_ModelCheck, count_max_),
241 0,
242 1,
243 2,
244 PROTOBUF_FIELD_OFFSET(::toco::ModelFlags, _has_bits_),
245 PROTOBUF_FIELD_OFFSET(::toco::ModelFlags, _internal_metadata_),
246 ~0u, // no _extensions_
247 ~0u, // no _oneof_case_
248 ~0u, // no _weak_field_map_
249 PROTOBUF_FIELD_OFFSET(::toco::ModelFlags, input_arrays_),
250 PROTOBUF_FIELD_OFFSET(::toco::ModelFlags, output_arrays_),
251 PROTOBUF_FIELD_OFFSET(::toco::ModelFlags, control_output_arrays_),
252 PROTOBUF_FIELD_OFFSET(::toco::ModelFlags, variable_batch_),
253 PROTOBUF_FIELD_OFFSET(::toco::ModelFlags, rnn_states_),
254 PROTOBUF_FIELD_OFFSET(::toco::ModelFlags, model_checks_),
255 PROTOBUF_FIELD_OFFSET(::toco::ModelFlags, allow_nonexistent_arrays_),
256 PROTOBUF_FIELD_OFFSET(::toco::ModelFlags, allow_nonascii_arrays_),
257 PROTOBUF_FIELD_OFFSET(::toco::ModelFlags, arrays_extra_info_),
258 PROTOBUF_FIELD_OFFSET(::toco::ModelFlags, change_concat_input_ranges_),
259 PROTOBUF_FIELD_OFFSET(::toco::ModelFlags, saved_model_dir_),
260 PROTOBUF_FIELD_OFFSET(::toco::ModelFlags, saved_model_version_),
261 PROTOBUF_FIELD_OFFSET(::toco::ModelFlags, saved_model_tags_),
262 PROTOBUF_FIELD_OFFSET(::toco::ModelFlags, saved_model_exported_names_),
263 PROTOBUF_FIELD_OFFSET(::toco::ModelFlags, use_hlo_import_),
264 PROTOBUF_FIELD_OFFSET(::toco::ModelFlags, hlo_file_type_),
265 ~0u,
266 ~0u,
267 ~0u,
268 3,
269 ~0u,
270 ~0u,
271 4,
272 5,
273 1,
274 8,
275 0,
276 7,
277 ~0u,
278 ~0u,
279 6,
280 2,
281};
282static const ::PROTOBUF_NAMESPACE_ID::internal::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
283 { 0, 7, sizeof(::toco::InputArrayShape)},
284 { 9, 19, sizeof(::toco::InputArray)},
285 { 24, 34, sizeof(::toco::RnnState)},
286 { 39, 51, sizeof(::toco::ArraysExtraInfo_Entry)},
287 { 58, 64, sizeof(::toco::ArraysExtraInfo)},
288 { 65, 73, sizeof(::toco::ModelFlags_ModelCheck)},
289 { 76, 97, sizeof(::toco::ModelFlags)},
290};
291
292static ::PROTOBUF_NAMESPACE_ID::Message const * const file_default_instances[] = {
293 reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::toco::_InputArrayShape_default_instance_),
294 reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::toco::_InputArray_default_instance_),
295 reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::toco::_RnnState_default_instance_),
296 reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::toco::_ArraysExtraInfo_Entry_default_instance_),
297 reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::toco::_ArraysExtraInfo_default_instance_),
298 reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::toco::_ModelFlags_ModelCheck_default_instance_),
299 reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::toco::_ModelFlags_default_instance_),
300};
301
302const char descriptor_table_protodef_tensorflow_2flite_2ftoco_2fmodel_5fflags_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) =
303 "\n&tensorflow/lite/toco/model_flags.proto"
304 "\022\004toco\032 tensorflow/lite/toco/types.proto"
305 "\"5\n\017InputArrayShape\022\014\n\004dims\030\002 \003(\005\022\024\n\014unk"
306 "nown_rank\030\003 \001(\010\"\217\001\n\nInputArray\022\014\n\004name\030\001"
307 " \001(\t\022$\n\005shape\030\006 \001(\0132\025.toco.InputArraySha"
308 "pe\022\022\n\nmean_value\030\003 \001(\002\022\024\n\tstd_value\030\004 \001("
309 "\002:\0011\022#\n\tdata_type\030\005 \001(\0162\020.toco.IODataTyp"
310 "e\"t\n\010RnnState\022\023\n\013state_array\030\001 \001(\t\022\036\n\026ba"
311 "ck_edge_source_array\030\002 \001(\t\022\023\n\013discardabl"
312 "e\030\005 \001(\010\022\014\n\004size\030\003 \001(\005\022\020\n\010num_dims\030\004 \001(\005\""
313 "\357\001\n\017ArraysExtraInfo\022,\n\007entries\030\001 \003(\0132\033.t"
314 "oco.ArraysExtraInfo.Entry\032\255\001\n\005Entry\022\014\n\004n"
315 "ame\030\001 \001(\t\022\023\n\013name_regexp\030\007 \001(\t\022\013\n\003min\030\002 "
316 "\001(\001\022\013\n\003max\030\003 \001(\001\022#\n\tdata_type\030\004 \001(\0162\020.to"
317 "co.IODataType\022$\n\005shape\030\005 \001(\0132\025.toco.Inpu"
318 "tArrayShape\022\034\n\024constant_float_value\030\006 \001("
319 "\002\"\306\005\n\nModelFlags\022&\n\014input_arrays\030\001 \003(\0132\020"
320 ".toco.InputArray\022\025\n\routput_arrays\030\002 \003(\t\022"
321 "\035\n\025control_output_arrays\030\030 \003(\t\022\026\n\016variab"
322 "le_batch\030\n \001(\010\022\"\n\nrnn_states\030\014 \003(\0132\016.toc"
323 "o.RnnState\0221\n\014model_checks\030\016 \003(\0132\033.toco."
324 "ModelFlags.ModelCheck\022 \n\030allow_nonexiste"
325 "nt_arrays\030\020 \001(\010\022\035\n\025allow_nonascii_arrays"
326 "\030\021 \001(\010\0220\n\021arrays_extra_info\030\022 \001(\0132\025.toco"
327 ".ArraysExtraInfo\022(\n\032change_concat_input_"
328 "ranges\030\023 \001(\010:\004true\022\027\n\017saved_model_dir\030\024 "
329 "\001(\t\022\033\n\023saved_model_version\030\025 \001(\005\022\030\n\020save"
330 "d_model_tags\030\026 \003(\t\022\"\n\032saved_model_export"
331 "ed_names\030\027 \003(\t\022\026\n\016use_hlo_import\030\031 \001(\010\0223"
332 "\n\rhlo_file_type\030\032 \001(\0162\034.toco.ModelFlags."
333 "HloFileType\032T\n\nModelCheck\022\030\n\ncount_type\030"
334 "\001 \001(\t:\004None\022\025\n\tcount_min\030\002 \001(\005:\002-1\022\025\n\tco"
335 "unt_max\030\003 \001(\005:\002-1\"7\n\013HloFileType\022\013\n\007UNKN"
336 "OWN\020\000\022\014\n\010HLO_TEXT\020\001\022\r\n\tHLO_PROTO\020\002"
337 ;
338static const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable*const descriptor_table_tensorflow_2flite_2ftoco_2fmodel_5fflags_2eproto_deps[1] = {
339 &::descriptor_table_tensorflow_2flite_2ftoco_2ftypes_2eproto,
340};
341static ::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase*const descriptor_table_tensorflow_2flite_2ftoco_2fmodel_5fflags_2eproto_sccs[7] = {
342 &scc_info_ArraysExtraInfo_tensorflow_2flite_2ftoco_2fmodel_5fflags_2eproto.base,
343 &scc_info_ArraysExtraInfo_Entry_tensorflow_2flite_2ftoco_2fmodel_5fflags_2eproto.base,
344 &scc_info_InputArray_tensorflow_2flite_2ftoco_2fmodel_5fflags_2eproto.base,
345 &scc_info_InputArrayShape_tensorflow_2flite_2ftoco_2fmodel_5fflags_2eproto.base,
346 &scc_info_ModelFlags_tensorflow_2flite_2ftoco_2fmodel_5fflags_2eproto.base,
347 &scc_info_ModelFlags_ModelCheck_tensorflow_2flite_2ftoco_2fmodel_5fflags_2eproto.base,
348 &scc_info_RnnState_tensorflow_2flite_2ftoco_2fmodel_5fflags_2eproto.base,
349};
350static ::PROTOBUF_NAMESPACE_ID::internal::once_flag descriptor_table_tensorflow_2flite_2ftoco_2fmodel_5fflags_2eproto_once;
351static bool descriptor_table_tensorflow_2flite_2ftoco_2fmodel_5fflags_2eproto_initialized = false;
352const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_tensorflow_2flite_2ftoco_2fmodel_5fflags_2eproto = {
353 &descriptor_table_tensorflow_2flite_2ftoco_2fmodel_5fflags_2eproto_initialized, descriptor_table_protodef_tensorflow_2flite_2ftoco_2fmodel_5fflags_2eproto, "tensorflow/lite/toco/model_flags.proto", 1354,
354 &descriptor_table_tensorflow_2flite_2ftoco_2fmodel_5fflags_2eproto_once, descriptor_table_tensorflow_2flite_2ftoco_2fmodel_5fflags_2eproto_sccs, descriptor_table_tensorflow_2flite_2ftoco_2fmodel_5fflags_2eproto_deps, 7, 1,
355 schemas, file_default_instances, TableStruct_tensorflow_2flite_2ftoco_2fmodel_5fflags_2eproto::offsets,
356 file_level_metadata_tensorflow_2flite_2ftoco_2fmodel_5fflags_2eproto, 7, file_level_enum_descriptors_tensorflow_2flite_2ftoco_2fmodel_5fflags_2eproto, file_level_service_descriptors_tensorflow_2flite_2ftoco_2fmodel_5fflags_2eproto,
357};
358
359// Force running AddDescriptors() at dynamic initialization time.
360static bool dynamic_init_dummy_tensorflow_2flite_2ftoco_2fmodel_5fflags_2eproto = ( ::PROTOBUF_NAMESPACE_ID::internal::AddDescriptors(&descriptor_table_tensorflow_2flite_2ftoco_2fmodel_5fflags_2eproto), true);
361namespace toco {
362const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* ModelFlags_HloFileType_descriptor() {
363 ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_tensorflow_2flite_2ftoco_2fmodel_5fflags_2eproto);
364 return file_level_enum_descriptors_tensorflow_2flite_2ftoco_2fmodel_5fflags_2eproto[0];
365}
366bool ModelFlags_HloFileType_IsValid(int value) {
367 switch (value) {
368 case 0:
369 case 1:
370 case 2:
371 return true;
372 default:
373 return false;
374 }
375}
376
377#if (__cplusplus < 201703) && (!defined(_MSC_VER) || _MSC_VER >= 1900)
378constexpr ModelFlags_HloFileType ModelFlags::UNKNOWN;
379constexpr ModelFlags_HloFileType ModelFlags::HLO_TEXT;
380constexpr ModelFlags_HloFileType ModelFlags::HLO_PROTO;
381constexpr ModelFlags_HloFileType ModelFlags::HloFileType_MIN;
382constexpr ModelFlags_HloFileType ModelFlags::HloFileType_MAX;
383constexpr int ModelFlags::HloFileType_ARRAYSIZE;
384#endif // (__cplusplus < 201703) && (!defined(_MSC_VER) || _MSC_VER >= 1900)
385
386// ===================================================================
387
388void InputArrayShape::InitAsDefaultInstance() {
389}
390class InputArrayShape::_Internal {
391 public:
392 using HasBits = decltype(std::declval<InputArrayShape>()._has_bits_);
393 static void set_has_unknown_rank(HasBits* has_bits) {
394 (*has_bits)[0] |= 1u;
395 }
396};
397
398InputArrayShape::InputArrayShape()
399 : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
400 SharedCtor();
401 // @@protoc_insertion_point(constructor:toco.InputArrayShape)
402}
403InputArrayShape::InputArrayShape(const InputArrayShape& from)
404 : ::PROTOBUF_NAMESPACE_ID::Message(),
405 _internal_metadata_(nullptr),
406 _has_bits_(from._has_bits_),
407 dims_(from.dims_) {
408 _internal_metadata_.MergeFrom(from._internal_metadata_);
409 unknown_rank_ = from.unknown_rank_;
410 // @@protoc_insertion_point(copy_constructor:toco.InputArrayShape)
411}
412
413void InputArrayShape::SharedCtor() {
414 unknown_rank_ = false;
415}
416
417InputArrayShape::~InputArrayShape() {
418 // @@protoc_insertion_point(destructor:toco.InputArrayShape)
419 SharedDtor();
420}
421
422void InputArrayShape::SharedDtor() {
423}
424
425void InputArrayShape::SetCachedSize(int size) const {
426 _cached_size_.Set(size);
427}
428const InputArrayShape& InputArrayShape::default_instance() {
429 ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_InputArrayShape_tensorflow_2flite_2ftoco_2fmodel_5fflags_2eproto.base);
430 return *internal_default_instance();
431}
432
433
434void InputArrayShape::Clear() {
435// @@protoc_insertion_point(message_clear_start:toco.InputArrayShape)
436 ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
437 // Prevent compiler warnings about cached_has_bits being unused
438 (void) cached_has_bits;
439
440 dims_.Clear();
441 unknown_rank_ = false;
442 _has_bits_.Clear();
443 _internal_metadata_.Clear();
444}
445
446#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
447const char* InputArrayShape::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
448#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
449 _Internal::HasBits has_bits{};
450 while (!ctx->Done(&ptr)) {
451 ::PROTOBUF_NAMESPACE_ID::uint32 tag;
452 ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
453 CHK_(ptr);
454 switch (tag >> 3) {
455 // repeated int32 dims = 2;
456 case 2:
457 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) {
458 ptr -= 1;
459 do {
460 ptr += 1;
461 add_dims(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr));
462 CHK_(ptr);
463 if (!ctx->DataAvailable(ptr)) break;
464 } while (::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<::PROTOBUF_NAMESPACE_ID::uint8>(ptr) == 16);
465 } else if (static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18) {
466 ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedInt32Parser(mutable_dims(), ptr, ctx);
467 CHK_(ptr);
468 } else goto handle_unusual;
469 continue;
470 // optional bool unknown_rank = 3;
471 case 3:
472 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24)) {
473 _Internal::set_has_unknown_rank(&has_bits);
474 unknown_rank_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
475 CHK_(ptr);
476 } else goto handle_unusual;
477 continue;
478 default: {
479 handle_unusual:
480 if ((tag & 7) == 4 || tag == 0) {
481 ctx->SetLastTag(tag);
482 goto success;
483 }
484 ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
485 CHK_(ptr != nullptr);
486 continue;
487 }
488 } // switch
489 } // while
490success:
491 _has_bits_.Or(has_bits);
492 return ptr;
493failure:
494 ptr = nullptr;
495 goto success;
496#undef CHK_
497}
498#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
499bool InputArrayShape::MergePartialFromCodedStream(
500 ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) {
501#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure
502 ::PROTOBUF_NAMESPACE_ID::uint32 tag;
503 // @@protoc_insertion_point(parse_start:toco.InputArrayShape)
504 for (;;) {
505 ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
506 tag = p.first;
507 if (!p.second) goto handle_unusual;
508 switch (::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::GetTagFieldNumber(tag)) {
509 // repeated int32 dims = 2;
510 case 2: {
511 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (16 & 0xFF)) {
512 DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadRepeatedPrimitive<
513 ::PROTOBUF_NAMESPACE_ID::int32, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT32>(
514 1, 16u, input, this->mutable_dims())));
515 } else if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (18 & 0xFF)) {
516 DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPackedPrimitiveNoInline<
517 ::PROTOBUF_NAMESPACE_ID::int32, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT32>(
518 input, this->mutable_dims())));
519 } else {
520 goto handle_unusual;
521 }
522 break;
523 }
524
525 // optional bool unknown_rank = 3;
526 case 3: {
527 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (24 & 0xFF)) {
528 _Internal::set_has_unknown_rank(&_has_bits_);
529 DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
530 bool, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_BOOL>(
531 input, &unknown_rank_)));
532 } else {
533 goto handle_unusual;
534 }
535 break;
536 }
537
538 default: {
539 handle_unusual:
540 if (tag == 0) {
541 goto success;
542 }
543 DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SkipField(
544 input, tag, _internal_metadata_.mutable_unknown_fields()));
545 break;
546 }
547 }
548 }
549success:
550 // @@protoc_insertion_point(parse_success:toco.InputArrayShape)
551 return true;
552failure:
553 // @@protoc_insertion_point(parse_failure:toco.InputArrayShape)
554 return false;
555#undef DO_
556}
557#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
558
559void InputArrayShape::SerializeWithCachedSizes(
560 ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const {
561 // @@protoc_insertion_point(serialize_start:toco.InputArrayShape)
562 ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
563 (void) cached_has_bits;
564
565 // repeated int32 dims = 2;
566 for (int i = 0, n = this->dims_size(); i < n; i++) {
567 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32(
568 2, this->dims(i), output);
569 }
570
571 cached_has_bits = _has_bits_[0];
572 // optional bool unknown_rank = 3;
573 if (cached_has_bits & 0x00000001u) {
574 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBool(3, this->unknown_rank(), output);
575 }
576
577 if (_internal_metadata_.have_unknown_fields()) {
578 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields(
579 _internal_metadata_.unknown_fields(), output);
580 }
581 // @@protoc_insertion_point(serialize_end:toco.InputArrayShape)
582}
583
584::PROTOBUF_NAMESPACE_ID::uint8* InputArrayShape::InternalSerializeWithCachedSizesToArray(
585 ::PROTOBUF_NAMESPACE_ID::uint8* target) const {
586 // @@protoc_insertion_point(serialize_to_array_start:toco.InputArrayShape)
587 ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
588 (void) cached_has_bits;
589
590 // repeated int32 dims = 2;
591 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
592 WriteInt32ToArray(2, this->dims_, target);
593
594 cached_has_bits = _has_bits_[0];
595 // optional bool unknown_rank = 3;
596 if (cached_has_bits & 0x00000001u) {
597 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(3, this->unknown_rank(), target);
598 }
599
600 if (_internal_metadata_.have_unknown_fields()) {
601 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray(
602 _internal_metadata_.unknown_fields(), target);
603 }
604 // @@protoc_insertion_point(serialize_to_array_end:toco.InputArrayShape)
605 return target;
606}
607
608size_t InputArrayShape::ByteSizeLong() const {
609// @@protoc_insertion_point(message_byte_size_start:toco.InputArrayShape)
610 size_t total_size = 0;
611
612 if (_internal_metadata_.have_unknown_fields()) {
613 total_size +=
614 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::ComputeUnknownFieldsSize(
615 _internal_metadata_.unknown_fields());
616 }
617 ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
618 // Prevent compiler warnings about cached_has_bits being unused
619 (void) cached_has_bits;
620
621 // repeated int32 dims = 2;
622 {
623 size_t data_size = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
624 Int32Size(this->dims_);
625 total_size += 1 *
626 ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(this->dims_size());
627 total_size += data_size;
628 }
629
630 // optional bool unknown_rank = 3;
631 cached_has_bits = _has_bits_[0];
632 if (cached_has_bits & 0x00000001u) {
633 total_size += 1 + 1;
634 }
635
636 int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
637 SetCachedSize(cached_size);
638 return total_size;
639}
640
641void InputArrayShape::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
642// @@protoc_insertion_point(generalized_merge_from_start:toco.InputArrayShape)
643 GOOGLE_DCHECK_NE(&from, this);
644 const InputArrayShape* source =
645 ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<InputArrayShape>(
646 &from);
647 if (source == nullptr) {
648 // @@protoc_insertion_point(generalized_merge_from_cast_fail:toco.InputArrayShape)
649 ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
650 } else {
651 // @@protoc_insertion_point(generalized_merge_from_cast_success:toco.InputArrayShape)
652 MergeFrom(*source);
653 }
654}
655
656void InputArrayShape::MergeFrom(const InputArrayShape& from) {
657// @@protoc_insertion_point(class_specific_merge_from_start:toco.InputArrayShape)
658 GOOGLE_DCHECK_NE(&from, this);
659 _internal_metadata_.MergeFrom(from._internal_metadata_);
660 ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
661 (void) cached_has_bits;
662
663 dims_.MergeFrom(from.dims_);
664 if (from.has_unknown_rank()) {
665 set_unknown_rank(from.unknown_rank());
666 }
667}
668
669void InputArrayShape::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
670// @@protoc_insertion_point(generalized_copy_from_start:toco.InputArrayShape)
671 if (&from == this) return;
672 Clear();
673 MergeFrom(from);
674}
675
676void InputArrayShape::CopyFrom(const InputArrayShape& from) {
677// @@protoc_insertion_point(class_specific_copy_from_start:toco.InputArrayShape)
678 if (&from == this) return;
679 Clear();
680 MergeFrom(from);
681}
682
683bool InputArrayShape::IsInitialized() const {
684 return true;
685}
686
687void InputArrayShape::InternalSwap(InputArrayShape* other) {
688 using std::swap;
689 _internal_metadata_.Swap(&other->_internal_metadata_);
690 swap(_has_bits_[0], other->_has_bits_[0]);
691 dims_.InternalSwap(&other->dims_);
692 swap(unknown_rank_, other->unknown_rank_);
693}
694
695::PROTOBUF_NAMESPACE_ID::Metadata InputArrayShape::GetMetadata() const {
696 return GetMetadataStatic();
697}
698
699
700// ===================================================================
701
702void InputArray::InitAsDefaultInstance() {
703 ::toco::_InputArray_default_instance_._instance.get_mutable()->shape_ = const_cast< ::toco::InputArrayShape*>(
704 ::toco::InputArrayShape::internal_default_instance());
705}
706class InputArray::_Internal {
707 public:
708 using HasBits = decltype(std::declval<InputArray>()._has_bits_);
709 static void set_has_name(HasBits* has_bits) {
710 (*has_bits)[0] |= 1u;
711 }
712 static const ::toco::InputArrayShape& shape(const InputArray* msg);
713 static void set_has_shape(HasBits* has_bits) {
714 (*has_bits)[0] |= 2u;
715 }
716 static void set_has_mean_value(HasBits* has_bits) {
717 (*has_bits)[0] |= 4u;
718 }
719 static void set_has_std_value(HasBits* has_bits) {
720 (*has_bits)[0] |= 16u;
721 }
722 static void set_has_data_type(HasBits* has_bits) {
723 (*has_bits)[0] |= 8u;
724 }
725};
726
727const ::toco::InputArrayShape&
728InputArray::_Internal::shape(const InputArray* msg) {
729 return *msg->shape_;
730}
731InputArray::InputArray()
732 : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
733 SharedCtor();
734 // @@protoc_insertion_point(constructor:toco.InputArray)
735}
736InputArray::InputArray(const InputArray& from)
737 : ::PROTOBUF_NAMESPACE_ID::Message(),
738 _internal_metadata_(nullptr),
739 _has_bits_(from._has_bits_) {
740 _internal_metadata_.MergeFrom(from._internal_metadata_);
741 name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
742 if (from.has_name()) {
743 name_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.name_);
744 }
745 if (from.has_shape()) {
746 shape_ = new ::toco::InputArrayShape(*from.shape_);
747 } else {
748 shape_ = nullptr;
749 }
750 ::memcpy(&mean_value_, &from.mean_value_,
751 static_cast<size_t>(reinterpret_cast<char*>(&std_value_) -
752 reinterpret_cast<char*>(&mean_value_)) + sizeof(std_value_));
753 // @@protoc_insertion_point(copy_constructor:toco.InputArray)
754}
755
756void InputArray::SharedCtor() {
757 ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_InputArray_tensorflow_2flite_2ftoco_2fmodel_5fflags_2eproto.base);
758 name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
759 ::memset(&shape_, 0, static_cast<size_t>(
760 reinterpret_cast<char*>(&data_type_) -
761 reinterpret_cast<char*>(&shape_)) + sizeof(data_type_));
762 std_value_ = 1;
763}
764
765InputArray::~InputArray() {
766 // @@protoc_insertion_point(destructor:toco.InputArray)
767 SharedDtor();
768}
769
770void InputArray::SharedDtor() {
771 name_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
772 if (this != internal_default_instance()) delete shape_;
773}
774
775void InputArray::SetCachedSize(int size) const {
776 _cached_size_.Set(size);
777}
778const InputArray& InputArray::default_instance() {
779 ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_InputArray_tensorflow_2flite_2ftoco_2fmodel_5fflags_2eproto.base);
780 return *internal_default_instance();
781}
782
783
784void InputArray::Clear() {
785// @@protoc_insertion_point(message_clear_start:toco.InputArray)
786 ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
787 // Prevent compiler warnings about cached_has_bits being unused
788 (void) cached_has_bits;
789
790 cached_has_bits = _has_bits_[0];
791 if (cached_has_bits & 0x00000003u) {
792 if (cached_has_bits & 0x00000001u) {
793 name_.ClearNonDefaultToEmptyNoArena();
794 }
795 if (cached_has_bits & 0x00000002u) {
796 GOOGLE_DCHECK(shape_ != nullptr);
797 shape_->Clear();
798 }
799 }
800 if (cached_has_bits & 0x0000001cu) {
801 ::memset(&mean_value_, 0, static_cast<size_t>(
802 reinterpret_cast<char*>(&data_type_) -
803 reinterpret_cast<char*>(&mean_value_)) + sizeof(data_type_));
804 std_value_ = 1;
805 }
806 _has_bits_.Clear();
807 _internal_metadata_.Clear();
808}
809
810#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
811const char* InputArray::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
812#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
813 _Internal::HasBits has_bits{};
814 while (!ctx->Done(&ptr)) {
815 ::PROTOBUF_NAMESPACE_ID::uint32 tag;
816 ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
817 CHK_(ptr);
818 switch (tag >> 3) {
819 // optional string name = 1;
820 case 1:
821 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) {
822 ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParserUTF8Verify(mutable_name(), ptr, ctx, "toco.InputArray.name");
823 CHK_(ptr);
824 } else goto handle_unusual;
825 continue;
826 // optional float mean_value = 3;
827 case 3:
828 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 29)) {
829 _Internal::set_has_mean_value(&has_bits);
830 mean_value_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
831 ptr += sizeof(float);
832 } else goto handle_unusual;
833 continue;
834 // optional float std_value = 4 [default = 1];
835 case 4:
836 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 37)) {
837 _Internal::set_has_std_value(&has_bits);
838 std_value_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
839 ptr += sizeof(float);
840 } else goto handle_unusual;
841 continue;
842 // optional .toco.IODataType data_type = 5;
843 case 5:
844 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 40)) {
845 ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
846 CHK_(ptr);
847 if (PROTOBUF_PREDICT_TRUE(::toco::IODataType_IsValid(val))) {
848 set_data_type(static_cast<::toco::IODataType>(val));
849 } else {
850 ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(5, val, mutable_unknown_fields());
851 }
852 } else goto handle_unusual;
853 continue;
854 // optional .toco.InputArrayShape shape = 6;
855 case 6:
856 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 50)) {
857 ptr = ctx->ParseMessage(mutable_shape(), ptr);
858 CHK_(ptr);
859 } else goto handle_unusual;
860 continue;
861 default: {
862 handle_unusual:
863 if ((tag & 7) == 4 || tag == 0) {
864 ctx->SetLastTag(tag);
865 goto success;
866 }
867 ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
868 CHK_(ptr != nullptr);
869 continue;
870 }
871 } // switch
872 } // while
873success:
874 _has_bits_.Or(has_bits);
875 return ptr;
876failure:
877 ptr = nullptr;
878 goto success;
879#undef CHK_
880}
881#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
882bool InputArray::MergePartialFromCodedStream(
883 ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) {
884#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure
885 ::PROTOBUF_NAMESPACE_ID::uint32 tag;
886 // @@protoc_insertion_point(parse_start:toco.InputArray)
887 for (;;) {
888 ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
889 tag = p.first;
890 if (!p.second) goto handle_unusual;
891 switch (::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::GetTagFieldNumber(tag)) {
892 // optional string name = 1;
893 case 1: {
894 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (10 & 0xFF)) {
895 DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadString(
896 input, this->mutable_name()));
897 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
898 this->name().data(), static_cast<int>(this->name().length()),
899 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::PARSE,
900 "toco.InputArray.name");
901 } else {
902 goto handle_unusual;
903 }
904 break;
905 }
906
907 // optional float mean_value = 3;
908 case 3: {
909 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (29 & 0xFF)) {
910 _Internal::set_has_mean_value(&_has_bits_);
911 DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
912 float, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_FLOAT>(
913 input, &mean_value_)));
914 } else {
915 goto handle_unusual;
916 }
917 break;
918 }
919
920 // optional float std_value = 4 [default = 1];
921 case 4: {
922 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (37 & 0xFF)) {
923 _Internal::set_has_std_value(&_has_bits_);
924 DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
925 float, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_FLOAT>(
926 input, &std_value_)));
927 } else {
928 goto handle_unusual;
929 }
930 break;
931 }
932
933 // optional .toco.IODataType data_type = 5;
934 case 5: {
935 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (40 & 0xFF)) {
936 int value = 0;
937 DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
938 int, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_ENUM>(
939 input, &value)));
940 if (::toco::IODataType_IsValid(value)) {
941 set_data_type(static_cast< ::toco::IODataType >(value));
942 } else {
943 mutable_unknown_fields()->AddVarint(
944 5, static_cast<::PROTOBUF_NAMESPACE_ID::uint64>(value));
945 }
946 } else {
947 goto handle_unusual;
948 }
949 break;
950 }
951
952 // optional .toco.InputArrayShape shape = 6;
953 case 6: {
954 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (50 & 0xFF)) {
955 DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage(
956 input, mutable_shape()));
957 } else {
958 goto handle_unusual;
959 }
960 break;
961 }
962
963 default: {
964 handle_unusual:
965 if (tag == 0) {
966 goto success;
967 }
968 DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SkipField(
969 input, tag, _internal_metadata_.mutable_unknown_fields()));
970 break;
971 }
972 }
973 }
974success:
975 // @@protoc_insertion_point(parse_success:toco.InputArray)
976 return true;
977failure:
978 // @@protoc_insertion_point(parse_failure:toco.InputArray)
979 return false;
980#undef DO_
981}
982#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
983
984void InputArray::SerializeWithCachedSizes(
985 ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const {
986 // @@protoc_insertion_point(serialize_start:toco.InputArray)
987 ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
988 (void) cached_has_bits;
989
990 cached_has_bits = _has_bits_[0];
991 // optional string name = 1;
992 if (cached_has_bits & 0x00000001u) {
993 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
994 this->name().data(), static_cast<int>(this->name().length()),
995 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
996 "toco.InputArray.name");
997 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringMaybeAliased(
998 1, this->name(), output);
999 }
1000
1001 // optional float mean_value = 3;
1002 if (cached_has_bits & 0x00000004u) {
1003 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloat(3, this->mean_value(), output);
1004 }
1005
1006 // optional float std_value = 4 [default = 1];
1007 if (cached_has_bits & 0x00000010u) {
1008 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloat(4, this->std_value(), output);
1009 }
1010
1011 // optional .toco.IODataType data_type = 5;
1012 if (cached_has_bits & 0x00000008u) {
1013 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnum(
1014 5, this->data_type(), output);
1015 }
1016
1017 // optional .toco.InputArrayShape shape = 6;
1018 if (cached_has_bits & 0x00000002u) {
1019 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray(
1020 6, _Internal::shape(this), output);
1021 }
1022
1023 if (_internal_metadata_.have_unknown_fields()) {
1024 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields(
1025 _internal_metadata_.unknown_fields(), output);
1026 }
1027 // @@protoc_insertion_point(serialize_end:toco.InputArray)
1028}
1029
1030::PROTOBUF_NAMESPACE_ID::uint8* InputArray::InternalSerializeWithCachedSizesToArray(
1031 ::PROTOBUF_NAMESPACE_ID::uint8* target) const {
1032 // @@protoc_insertion_point(serialize_to_array_start:toco.InputArray)
1033 ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
1034 (void) cached_has_bits;
1035
1036 cached_has_bits = _has_bits_[0];
1037 // optional string name = 1;
1038 if (cached_has_bits & 0x00000001u) {
1039 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
1040 this->name().data(), static_cast<int>(this->name().length()),
1041 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
1042 "toco.InputArray.name");
1043 target =
1044 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringToArray(
1045 1, this->name(), target);
1046 }
1047
1048 // optional float mean_value = 3;
1049 if (cached_has_bits & 0x00000004u) {
1050 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(3, this->mean_value(), target);
1051 }
1052
1053 // optional float std_value = 4 [default = 1];
1054 if (cached_has_bits & 0x00000010u) {
1055 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(4, this->std_value(), target);
1056 }
1057
1058 // optional .toco.IODataType data_type = 5;
1059 if (cached_has_bits & 0x00000008u) {
1060 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
1061 5, this->data_type(), target);
1062 }
1063
1064 // optional .toco.InputArrayShape shape = 6;
1065 if (cached_has_bits & 0x00000002u) {
1066 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
1067 InternalWriteMessageToArray(
1068 6, _Internal::shape(this), target);
1069 }
1070
1071 if (_internal_metadata_.have_unknown_fields()) {
1072 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray(
1073 _internal_metadata_.unknown_fields(), target);
1074 }
1075 // @@protoc_insertion_point(serialize_to_array_end:toco.InputArray)
1076 return target;
1077}
1078
1079size_t InputArray::ByteSizeLong() const {
1080// @@protoc_insertion_point(message_byte_size_start:toco.InputArray)
1081 size_t total_size = 0;
1082
1083 if (_internal_metadata_.have_unknown_fields()) {
1084 total_size +=
1085 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::ComputeUnknownFieldsSize(
1086 _internal_metadata_.unknown_fields());
1087 }
1088 ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
1089 // Prevent compiler warnings about cached_has_bits being unused
1090 (void) cached_has_bits;
1091
1092 cached_has_bits = _has_bits_[0];
1093 if (cached_has_bits & 0x0000001fu) {
1094 // optional string name = 1;
1095 if (cached_has_bits & 0x00000001u) {
1096 total_size += 1 +
1097 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
1098 this->name());
1099 }
1100
1101 // optional .toco.InputArrayShape shape = 6;
1102 if (cached_has_bits & 0x00000002u) {
1103 total_size += 1 +
1104 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
1105 *shape_);
1106 }
1107
1108 // optional float mean_value = 3;
1109 if (cached_has_bits & 0x00000004u) {
1110 total_size += 1 + 4;
1111 }
1112
1113 // optional .toco.IODataType data_type = 5;
1114 if (cached_has_bits & 0x00000008u) {
1115 total_size += 1 +
1116 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->data_type());
1117 }
1118
1119 // optional float std_value = 4 [default = 1];
1120 if (cached_has_bits & 0x00000010u) {
1121 total_size += 1 + 4;
1122 }
1123
1124 }
1125 int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
1126 SetCachedSize(cached_size);
1127 return total_size;
1128}
1129
1130void InputArray::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
1131// @@protoc_insertion_point(generalized_merge_from_start:toco.InputArray)
1132 GOOGLE_DCHECK_NE(&from, this);
1133 const InputArray* source =
1134 ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<InputArray>(
1135 &from);
1136 if (source == nullptr) {
1137 // @@protoc_insertion_point(generalized_merge_from_cast_fail:toco.InputArray)
1138 ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
1139 } else {
1140 // @@protoc_insertion_point(generalized_merge_from_cast_success:toco.InputArray)
1141 MergeFrom(*source);
1142 }
1143}
1144
1145void InputArray::MergeFrom(const InputArray& from) {
1146// @@protoc_insertion_point(class_specific_merge_from_start:toco.InputArray)
1147 GOOGLE_DCHECK_NE(&from, this);
1148 _internal_metadata_.MergeFrom(from._internal_metadata_);
1149 ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
1150 (void) cached_has_bits;
1151
1152 cached_has_bits = from._has_bits_[0];
1153 if (cached_has_bits & 0x0000001fu) {
1154 if (cached_has_bits & 0x00000001u) {
1155 _has_bits_[0] |= 0x00000001u;
1156 name_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.name_);
1157 }
1158 if (cached_has_bits & 0x00000002u) {
1159 mutable_shape()->::toco::InputArrayShape::MergeFrom(from.shape());
1160 }
1161 if (cached_has_bits & 0x00000004u) {
1162 mean_value_ = from.mean_value_;
1163 }
1164 if (cached_has_bits & 0x00000008u) {
1165 data_type_ = from.data_type_;
1166 }
1167 if (cached_has_bits & 0x00000010u) {
1168 std_value_ = from.std_value_;
1169 }
1170 _has_bits_[0] |= cached_has_bits;
1171 }
1172}
1173
1174void InputArray::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
1175// @@protoc_insertion_point(generalized_copy_from_start:toco.InputArray)
1176 if (&from == this) return;
1177 Clear();
1178 MergeFrom(from);
1179}
1180
1181void InputArray::CopyFrom(const InputArray& from) {
1182// @@protoc_insertion_point(class_specific_copy_from_start:toco.InputArray)
1183 if (&from == this) return;
1184 Clear();
1185 MergeFrom(from);
1186}
1187
1188bool InputArray::IsInitialized() const {
1189 return true;
1190}
1191
1192void InputArray::InternalSwap(InputArray* other) {
1193 using std::swap;
1194 _internal_metadata_.Swap(&other->_internal_metadata_);
1195 swap(_has_bits_[0], other->_has_bits_[0]);
1196 name_.Swap(&other->name_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
1197 GetArenaNoVirtual());
1198 swap(shape_, other->shape_);
1199 swap(mean_value_, other->mean_value_);
1200 swap(data_type_, other->data_type_);
1201 swap(std_value_, other->std_value_);
1202}
1203
1204::PROTOBUF_NAMESPACE_ID::Metadata InputArray::GetMetadata() const {
1205 return GetMetadataStatic();
1206}
1207
1208
1209// ===================================================================
1210
1211void RnnState::InitAsDefaultInstance() {
1212}
1213class RnnState::_Internal {
1214 public:
1215 using HasBits = decltype(std::declval<RnnState>()._has_bits_);
1216 static void set_has_state_array(HasBits* has_bits) {
1217 (*has_bits)[0] |= 1u;
1218 }
1219 static void set_has_back_edge_source_array(HasBits* has_bits) {
1220 (*has_bits)[0] |= 2u;
1221 }
1222 static void set_has_discardable(HasBits* has_bits) {
1223 (*has_bits)[0] |= 16u;
1224 }
1225 static void set_has_size(HasBits* has_bits) {
1226 (*has_bits)[0] |= 4u;
1227 }
1228 static void set_has_num_dims(HasBits* has_bits) {
1229 (*has_bits)[0] |= 8u;
1230 }
1231};
1232
1233RnnState::RnnState()
1234 : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
1235 SharedCtor();
1236 // @@protoc_insertion_point(constructor:toco.RnnState)
1237}
1238RnnState::RnnState(const RnnState& from)
1239 : ::PROTOBUF_NAMESPACE_ID::Message(),
1240 _internal_metadata_(nullptr),
1241 _has_bits_(from._has_bits_) {
1242 _internal_metadata_.MergeFrom(from._internal_metadata_);
1243 state_array_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
1244 if (from.has_state_array()) {
1245 state_array_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.state_array_);
1246 }
1247 back_edge_source_array_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
1248 if (from.has_back_edge_source_array()) {
1249 back_edge_source_array_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.back_edge_source_array_);
1250 }
1251 ::memcpy(&size_, &from.size_,
1252 static_cast<size_t>(reinterpret_cast<char*>(&discardable_) -
1253 reinterpret_cast<char*>(&size_)) + sizeof(discardable_));
1254 // @@protoc_insertion_point(copy_constructor:toco.RnnState)
1255}
1256
1257void RnnState::SharedCtor() {
1258 ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_RnnState_tensorflow_2flite_2ftoco_2fmodel_5fflags_2eproto.base);
1259 state_array_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
1260 back_edge_source_array_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
1261 ::memset(&size_, 0, static_cast<size_t>(
1262 reinterpret_cast<char*>(&discardable_) -
1263 reinterpret_cast<char*>(&size_)) + sizeof(discardable_));
1264}
1265
1266RnnState::~RnnState() {
1267 // @@protoc_insertion_point(destructor:toco.RnnState)
1268 SharedDtor();
1269}
1270
1271void RnnState::SharedDtor() {
1272 state_array_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
1273 back_edge_source_array_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
1274}
1275
1276void RnnState::SetCachedSize(int size) const {
1277 _cached_size_.Set(size);
1278}
1279const RnnState& RnnState::default_instance() {
1280 ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_RnnState_tensorflow_2flite_2ftoco_2fmodel_5fflags_2eproto.base);
1281 return *internal_default_instance();
1282}
1283
1284
1285void RnnState::Clear() {
1286// @@protoc_insertion_point(message_clear_start:toco.RnnState)
1287 ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
1288 // Prevent compiler warnings about cached_has_bits being unused
1289 (void) cached_has_bits;
1290
1291 cached_has_bits = _has_bits_[0];
1292 if (cached_has_bits & 0x00000003u) {
1293 if (cached_has_bits & 0x00000001u) {
1294 state_array_.ClearNonDefaultToEmptyNoArena();
1295 }
1296 if (cached_has_bits & 0x00000002u) {
1297 back_edge_source_array_.ClearNonDefaultToEmptyNoArena();
1298 }
1299 }
1300 if (cached_has_bits & 0x0000001cu) {
1301 ::memset(&size_, 0, static_cast<size_t>(
1302 reinterpret_cast<char*>(&discardable_) -
1303 reinterpret_cast<char*>(&size_)) + sizeof(discardable_));
1304 }
1305 _has_bits_.Clear();
1306 _internal_metadata_.Clear();
1307}
1308
1309#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
1310const char* RnnState::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
1311#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
1312 _Internal::HasBits has_bits{};
1313 while (!ctx->Done(&ptr)) {
1314 ::PROTOBUF_NAMESPACE_ID::uint32 tag;
1315 ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
1316 CHK_(ptr);
1317 switch (tag >> 3) {
1318 // optional string state_array = 1;
1319 case 1:
1320 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) {
1321 ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParserUTF8Verify(mutable_state_array(), ptr, ctx, "toco.RnnState.state_array");
1322 CHK_(ptr);
1323 } else goto handle_unusual;
1324 continue;
1325 // optional string back_edge_source_array = 2;
1326 case 2:
1327 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) {
1328 ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParserUTF8Verify(mutable_back_edge_source_array(), ptr, ctx, "toco.RnnState.back_edge_source_array");
1329 CHK_(ptr);
1330 } else goto handle_unusual;
1331 continue;
1332 // optional int32 size = 3;
1333 case 3:
1334 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24)) {
1335 _Internal::set_has_size(&has_bits);
1336 size_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
1337 CHK_(ptr);
1338 } else goto handle_unusual;
1339 continue;
1340 // optional int32 num_dims = 4;
1341 case 4:
1342 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 32)) {
1343 _Internal::set_has_num_dims(&has_bits);
1344 num_dims_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
1345 CHK_(ptr);
1346 } else goto handle_unusual;
1347 continue;
1348 // optional bool discardable = 5;
1349 case 5:
1350 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 40)) {
1351 _Internal::set_has_discardable(&has_bits);
1352 discardable_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
1353 CHK_(ptr);
1354 } else goto handle_unusual;
1355 continue;
1356 default: {
1357 handle_unusual:
1358 if ((tag & 7) == 4 || tag == 0) {
1359 ctx->SetLastTag(tag);
1360 goto success;
1361 }
1362 ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
1363 CHK_(ptr != nullptr);
1364 continue;
1365 }
1366 } // switch
1367 } // while
1368success:
1369 _has_bits_.Or(has_bits);
1370 return ptr;
1371failure:
1372 ptr = nullptr;
1373 goto success;
1374#undef CHK_
1375}
1376#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
1377bool RnnState::MergePartialFromCodedStream(
1378 ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) {
1379#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure
1380 ::PROTOBUF_NAMESPACE_ID::uint32 tag;
1381 // @@protoc_insertion_point(parse_start:toco.RnnState)
1382 for (;;) {
1383 ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
1384 tag = p.first;
1385 if (!p.second) goto handle_unusual;
1386 switch (::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::GetTagFieldNumber(tag)) {
1387 // optional string state_array = 1;
1388 case 1: {
1389 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (10 & 0xFF)) {
1390 DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadString(
1391 input, this->mutable_state_array()));
1392 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
1393 this->state_array().data(), static_cast<int>(this->state_array().length()),
1394 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::PARSE,
1395 "toco.RnnState.state_array");
1396 } else {
1397 goto handle_unusual;
1398 }
1399 break;
1400 }
1401
1402 // optional string back_edge_source_array = 2;
1403 case 2: {
1404 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (18 & 0xFF)) {
1405 DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadString(
1406 input, this->mutable_back_edge_source_array()));
1407 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
1408 this->back_edge_source_array().data(), static_cast<int>(this->back_edge_source_array().length()),
1409 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::PARSE,
1410 "toco.RnnState.back_edge_source_array");
1411 } else {
1412 goto handle_unusual;
1413 }
1414 break;
1415 }
1416
1417 // optional int32 size = 3;
1418 case 3: {
1419 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (24 & 0xFF)) {
1420 _Internal::set_has_size(&_has_bits_);
1421 DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
1422 ::PROTOBUF_NAMESPACE_ID::int32, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT32>(
1423 input, &size_)));
1424 } else {
1425 goto handle_unusual;
1426 }
1427 break;
1428 }
1429
1430 // optional int32 num_dims = 4;
1431 case 4: {
1432 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (32 & 0xFF)) {
1433 _Internal::set_has_num_dims(&_has_bits_);
1434 DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
1435 ::PROTOBUF_NAMESPACE_ID::int32, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT32>(
1436 input, &num_dims_)));
1437 } else {
1438 goto handle_unusual;
1439 }
1440 break;
1441 }
1442
1443 // optional bool discardable = 5;
1444 case 5: {
1445 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (40 & 0xFF)) {
1446 _Internal::set_has_discardable(&_has_bits_);
1447 DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
1448 bool, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_BOOL>(
1449 input, &discardable_)));
1450 } else {
1451 goto handle_unusual;
1452 }
1453 break;
1454 }
1455
1456 default: {
1457 handle_unusual:
1458 if (tag == 0) {
1459 goto success;
1460 }
1461 DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SkipField(
1462 input, tag, _internal_metadata_.mutable_unknown_fields()));
1463 break;
1464 }
1465 }
1466 }
1467success:
1468 // @@protoc_insertion_point(parse_success:toco.RnnState)
1469 return true;
1470failure:
1471 // @@protoc_insertion_point(parse_failure:toco.RnnState)
1472 return false;
1473#undef DO_
1474}
1475#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
1476
1477void RnnState::SerializeWithCachedSizes(
1478 ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const {
1479 // @@protoc_insertion_point(serialize_start:toco.RnnState)
1480 ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
1481 (void) cached_has_bits;
1482
1483 cached_has_bits = _has_bits_[0];
1484 // optional string state_array = 1;
1485 if (cached_has_bits & 0x00000001u) {
1486 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
1487 this->state_array().data(), static_cast<int>(this->state_array().length()),
1488 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
1489 "toco.RnnState.state_array");
1490 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringMaybeAliased(
1491 1, this->state_array(), output);
1492 }
1493
1494 // optional string back_edge_source_array = 2;
1495 if (cached_has_bits & 0x00000002u) {
1496 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
1497 this->back_edge_source_array().data(), static_cast<int>(this->back_edge_source_array().length()),
1498 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
1499 "toco.RnnState.back_edge_source_array");
1500 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringMaybeAliased(
1501 2, this->back_edge_source_array(), output);
1502 }
1503
1504 // optional int32 size = 3;
1505 if (cached_has_bits & 0x00000004u) {
1506 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32(3, this->size(), output);
1507 }
1508
1509 // optional int32 num_dims = 4;
1510 if (cached_has_bits & 0x00000008u) {
1511 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32(4, this->num_dims(), output);
1512 }
1513
1514 // optional bool discardable = 5;
1515 if (cached_has_bits & 0x00000010u) {
1516 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBool(5, this->discardable(), output);
1517 }
1518
1519 if (_internal_metadata_.have_unknown_fields()) {
1520 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields(
1521 _internal_metadata_.unknown_fields(), output);
1522 }
1523 // @@protoc_insertion_point(serialize_end:toco.RnnState)
1524}
1525
1526::PROTOBUF_NAMESPACE_ID::uint8* RnnState::InternalSerializeWithCachedSizesToArray(
1527 ::PROTOBUF_NAMESPACE_ID::uint8* target) const {
1528 // @@protoc_insertion_point(serialize_to_array_start:toco.RnnState)
1529 ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
1530 (void) cached_has_bits;
1531
1532 cached_has_bits = _has_bits_[0];
1533 // optional string state_array = 1;
1534 if (cached_has_bits & 0x00000001u) {
1535 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
1536 this->state_array().data(), static_cast<int>(this->state_array().length()),
1537 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
1538 "toco.RnnState.state_array");
1539 target =
1540 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringToArray(
1541 1, this->state_array(), target);
1542 }
1543
1544 // optional string back_edge_source_array = 2;
1545 if (cached_has_bits & 0x00000002u) {
1546 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
1547 this->back_edge_source_array().data(), static_cast<int>(this->back_edge_source_array().length()),
1548 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
1549 "toco.RnnState.back_edge_source_array");
1550 target =
1551 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringToArray(
1552 2, this->back_edge_source_array(), target);
1553 }
1554
1555 // optional int32 size = 3;
1556 if (cached_has_bits & 0x00000004u) {
1557 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(3, this->size(), target);
1558 }
1559
1560 // optional int32 num_dims = 4;
1561 if (cached_has_bits & 0x00000008u) {
1562 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(4, this->num_dims(), target);
1563 }
1564
1565 // optional bool discardable = 5;
1566 if (cached_has_bits & 0x00000010u) {
1567 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(5, this->discardable(), target);
1568 }
1569
1570 if (_internal_metadata_.have_unknown_fields()) {
1571 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray(
1572 _internal_metadata_.unknown_fields(), target);
1573 }
1574 // @@protoc_insertion_point(serialize_to_array_end:toco.RnnState)
1575 return target;
1576}
1577
1578size_t RnnState::ByteSizeLong() const {
1579// @@protoc_insertion_point(message_byte_size_start:toco.RnnState)
1580 size_t total_size = 0;
1581
1582 if (_internal_metadata_.have_unknown_fields()) {
1583 total_size +=
1584 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::ComputeUnknownFieldsSize(
1585 _internal_metadata_.unknown_fields());
1586 }
1587 ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
1588 // Prevent compiler warnings about cached_has_bits being unused
1589 (void) cached_has_bits;
1590
1591 cached_has_bits = _has_bits_[0];
1592 if (cached_has_bits & 0x0000001fu) {
1593 // optional string state_array = 1;
1594 if (cached_has_bits & 0x00000001u) {
1595 total_size += 1 +
1596 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
1597 this->state_array());
1598 }
1599
1600 // optional string back_edge_source_array = 2;
1601 if (cached_has_bits & 0x00000002u) {
1602 total_size += 1 +
1603 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
1604 this->back_edge_source_array());
1605 }
1606
1607 // optional int32 size = 3;
1608 if (cached_has_bits & 0x00000004u) {
1609 total_size += 1 +
1610 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
1611 this->size());
1612 }
1613
1614 // optional int32 num_dims = 4;
1615 if (cached_has_bits & 0x00000008u) {
1616 total_size += 1 +
1617 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
1618 this->num_dims());
1619 }
1620
1621 // optional bool discardable = 5;
1622 if (cached_has_bits & 0x00000010u) {
1623 total_size += 1 + 1;
1624 }
1625
1626 }
1627 int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
1628 SetCachedSize(cached_size);
1629 return total_size;
1630}
1631
1632void RnnState::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
1633// @@protoc_insertion_point(generalized_merge_from_start:toco.RnnState)
1634 GOOGLE_DCHECK_NE(&from, this);
1635 const RnnState* source =
1636 ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<RnnState>(
1637 &from);
1638 if (source == nullptr) {
1639 // @@protoc_insertion_point(generalized_merge_from_cast_fail:toco.RnnState)
1640 ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
1641 } else {
1642 // @@protoc_insertion_point(generalized_merge_from_cast_success:toco.RnnState)
1643 MergeFrom(*source);
1644 }
1645}
1646
1647void RnnState::MergeFrom(const RnnState& from) {
1648// @@protoc_insertion_point(class_specific_merge_from_start:toco.RnnState)
1649 GOOGLE_DCHECK_NE(&from, this);
1650 _internal_metadata_.MergeFrom(from._internal_metadata_);
1651 ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
1652 (void) cached_has_bits;
1653
1654 cached_has_bits = from._has_bits_[0];
1655 if (cached_has_bits & 0x0000001fu) {
1656 if (cached_has_bits & 0x00000001u) {
1657 _has_bits_[0] |= 0x00000001u;
1658 state_array_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.state_array_);
1659 }
1660 if (cached_has_bits & 0x00000002u) {
1661 _has_bits_[0] |= 0x00000002u;
1662 back_edge_source_array_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.back_edge_source_array_);
1663 }
1664 if (cached_has_bits & 0x00000004u) {
1665 size_ = from.size_;
1666 }
1667 if (cached_has_bits & 0x00000008u) {
1668 num_dims_ = from.num_dims_;
1669 }
1670 if (cached_has_bits & 0x00000010u) {
1671 discardable_ = from.discardable_;
1672 }
1673 _has_bits_[0] |= cached_has_bits;
1674 }
1675}
1676
1677void RnnState::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
1678// @@protoc_insertion_point(generalized_copy_from_start:toco.RnnState)
1679 if (&from == this) return;
1680 Clear();
1681 MergeFrom(from);
1682}
1683
1684void RnnState::CopyFrom(const RnnState& from) {
1685// @@protoc_insertion_point(class_specific_copy_from_start:toco.RnnState)
1686 if (&from == this) return;
1687 Clear();
1688 MergeFrom(from);
1689}
1690
1691bool RnnState::IsInitialized() const {
1692 return true;
1693}
1694
1695void RnnState::InternalSwap(RnnState* other) {
1696 using std::swap;
1697 _internal_metadata_.Swap(&other->_internal_metadata_);
1698 swap(_has_bits_[0], other->_has_bits_[0]);
1699 state_array_.Swap(&other->state_array_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
1700 GetArenaNoVirtual());
1701 back_edge_source_array_.Swap(&other->back_edge_source_array_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
1702 GetArenaNoVirtual());
1703 swap(size_, other->size_);
1704 swap(num_dims_, other->num_dims_);
1705 swap(discardable_, other->discardable_);
1706}
1707
1708::PROTOBUF_NAMESPACE_ID::Metadata RnnState::GetMetadata() const {
1709 return GetMetadataStatic();
1710}
1711
1712
1713// ===================================================================
1714
1715void ArraysExtraInfo_Entry::InitAsDefaultInstance() {
1716 ::toco::_ArraysExtraInfo_Entry_default_instance_._instance.get_mutable()->shape_ = const_cast< ::toco::InputArrayShape*>(
1717 ::toco::InputArrayShape::internal_default_instance());
1718}
1719class ArraysExtraInfo_Entry::_Internal {
1720 public:
1721 using HasBits = decltype(std::declval<ArraysExtraInfo_Entry>()._has_bits_);
1722 static void set_has_name(HasBits* has_bits) {
1723 (*has_bits)[0] |= 1u;
1724 }
1725 static void set_has_name_regexp(HasBits* has_bits) {
1726 (*has_bits)[0] |= 2u;
1727 }
1728 static void set_has_min(HasBits* has_bits) {
1729 (*has_bits)[0] |= 8u;
1730 }
1731 static void set_has_max(HasBits* has_bits) {
1732 (*has_bits)[0] |= 16u;
1733 }
1734 static void set_has_data_type(HasBits* has_bits) {
1735 (*has_bits)[0] |= 32u;
1736 }
1737 static const ::toco::InputArrayShape& shape(const ArraysExtraInfo_Entry* msg);
1738 static void set_has_shape(HasBits* has_bits) {
1739 (*has_bits)[0] |= 4u;
1740 }
1741 static void set_has_constant_float_value(HasBits* has_bits) {
1742 (*has_bits)[0] |= 64u;
1743 }
1744};
1745
1746const ::toco::InputArrayShape&
1747ArraysExtraInfo_Entry::_Internal::shape(const ArraysExtraInfo_Entry* msg) {
1748 return *msg->shape_;
1749}
1750ArraysExtraInfo_Entry::ArraysExtraInfo_Entry()
1751 : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
1752 SharedCtor();
1753 // @@protoc_insertion_point(constructor:toco.ArraysExtraInfo.Entry)
1754}
1755ArraysExtraInfo_Entry::ArraysExtraInfo_Entry(const ArraysExtraInfo_Entry& from)
1756 : ::PROTOBUF_NAMESPACE_ID::Message(),
1757 _internal_metadata_(nullptr),
1758 _has_bits_(from._has_bits_) {
1759 _internal_metadata_.MergeFrom(from._internal_metadata_);
1760 name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
1761 if (from.has_name()) {
1762 name_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.name_);
1763 }
1764 name_regexp_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
1765 if (from.has_name_regexp()) {
1766 name_regexp_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.name_regexp_);
1767 }
1768 if (from.has_shape()) {
1769 shape_ = new ::toco::InputArrayShape(*from.shape_);
1770 } else {
1771 shape_ = nullptr;
1772 }
1773 ::memcpy(&min_, &from.min_,
1774 static_cast<size_t>(reinterpret_cast<char*>(&constant_float_value_) -
1775 reinterpret_cast<char*>(&min_)) + sizeof(constant_float_value_));
1776 // @@protoc_insertion_point(copy_constructor:toco.ArraysExtraInfo.Entry)
1777}
1778
1779void ArraysExtraInfo_Entry::SharedCtor() {
1780 ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_ArraysExtraInfo_Entry_tensorflow_2flite_2ftoco_2fmodel_5fflags_2eproto.base);
1781 name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
1782 name_regexp_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
1783 ::memset(&shape_, 0, static_cast<size_t>(
1784 reinterpret_cast<char*>(&constant_float_value_) -
1785 reinterpret_cast<char*>(&shape_)) + sizeof(constant_float_value_));
1786}
1787
1788ArraysExtraInfo_Entry::~ArraysExtraInfo_Entry() {
1789 // @@protoc_insertion_point(destructor:toco.ArraysExtraInfo.Entry)
1790 SharedDtor();
1791}
1792
1793void ArraysExtraInfo_Entry::SharedDtor() {
1794 name_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
1795 name_regexp_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
1796 if (this != internal_default_instance()) delete shape_;
1797}
1798
1799void ArraysExtraInfo_Entry::SetCachedSize(int size) const {
1800 _cached_size_.Set(size);
1801}
1802const ArraysExtraInfo_Entry& ArraysExtraInfo_Entry::default_instance() {
1803 ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_ArraysExtraInfo_Entry_tensorflow_2flite_2ftoco_2fmodel_5fflags_2eproto.base);
1804 return *internal_default_instance();
1805}
1806
1807
1808void ArraysExtraInfo_Entry::Clear() {
1809// @@protoc_insertion_point(message_clear_start:toco.ArraysExtraInfo.Entry)
1810 ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
1811 // Prevent compiler warnings about cached_has_bits being unused
1812 (void) cached_has_bits;
1813
1814 cached_has_bits = _has_bits_[0];
1815 if (cached_has_bits & 0x00000007u) {
1816 if (cached_has_bits & 0x00000001u) {
1817 name_.ClearNonDefaultToEmptyNoArena();
1818 }
1819 if (cached_has_bits & 0x00000002u) {
1820 name_regexp_.ClearNonDefaultToEmptyNoArena();
1821 }
1822 if (cached_has_bits & 0x00000004u) {
1823 GOOGLE_DCHECK(shape_ != nullptr);
1824 shape_->Clear();
1825 }
1826 }
1827 if (cached_has_bits & 0x00000078u) {
1828 ::memset(&min_, 0, static_cast<size_t>(
1829 reinterpret_cast<char*>(&constant_float_value_) -
1830 reinterpret_cast<char*>(&min_)) + sizeof(constant_float_value_));
1831 }
1832 _has_bits_.Clear();
1833 _internal_metadata_.Clear();
1834}
1835
1836#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
1837const char* ArraysExtraInfo_Entry::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
1838#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
1839 _Internal::HasBits has_bits{};
1840 while (!ctx->Done(&ptr)) {
1841 ::PROTOBUF_NAMESPACE_ID::uint32 tag;
1842 ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
1843 CHK_(ptr);
1844 switch (tag >> 3) {
1845 // optional string name = 1;
1846 case 1:
1847 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) {
1848 ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParserUTF8Verify(mutable_name(), ptr, ctx, "toco.ArraysExtraInfo.Entry.name");
1849 CHK_(ptr);
1850 } else goto handle_unusual;
1851 continue;
1852 // optional double min = 2;
1853 case 2:
1854 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 17)) {
1855 _Internal::set_has_min(&has_bits);
1856 min_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<double>(ptr);
1857 ptr += sizeof(double);
1858 } else goto handle_unusual;
1859 continue;
1860 // optional double max = 3;
1861 case 3:
1862 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 25)) {
1863 _Internal::set_has_max(&has_bits);
1864 max_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<double>(ptr);
1865 ptr += sizeof(double);
1866 } else goto handle_unusual;
1867 continue;
1868 // optional .toco.IODataType data_type = 4;
1869 case 4:
1870 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 32)) {
1871 ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
1872 CHK_(ptr);
1873 if (PROTOBUF_PREDICT_TRUE(::toco::IODataType_IsValid(val))) {
1874 set_data_type(static_cast<::toco::IODataType>(val));
1875 } else {
1876 ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(4, val, mutable_unknown_fields());
1877 }
1878 } else goto handle_unusual;
1879 continue;
1880 // optional .toco.InputArrayShape shape = 5;
1881 case 5:
1882 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 42)) {
1883 ptr = ctx->ParseMessage(mutable_shape(), ptr);
1884 CHK_(ptr);
1885 } else goto handle_unusual;
1886 continue;
1887 // optional float constant_float_value = 6;
1888 case 6:
1889 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 53)) {
1890 _Internal::set_has_constant_float_value(&has_bits);
1891 constant_float_value_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
1892 ptr += sizeof(float);
1893 } else goto handle_unusual;
1894 continue;
1895 // optional string name_regexp = 7;
1896 case 7:
1897 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 58)) {
1898 ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParserUTF8Verify(mutable_name_regexp(), ptr, ctx, "toco.ArraysExtraInfo.Entry.name_regexp");
1899 CHK_(ptr);
1900 } else goto handle_unusual;
1901 continue;
1902 default: {
1903 handle_unusual:
1904 if ((tag & 7) == 4 || tag == 0) {
1905 ctx->SetLastTag(tag);
1906 goto success;
1907 }
1908 ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
1909 CHK_(ptr != nullptr);
1910 continue;
1911 }
1912 } // switch
1913 } // while
1914success:
1915 _has_bits_.Or(has_bits);
1916 return ptr;
1917failure:
1918 ptr = nullptr;
1919 goto success;
1920#undef CHK_
1921}
1922#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
1923bool ArraysExtraInfo_Entry::MergePartialFromCodedStream(
1924 ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) {
1925#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure
1926 ::PROTOBUF_NAMESPACE_ID::uint32 tag;
1927 // @@protoc_insertion_point(parse_start:toco.ArraysExtraInfo.Entry)
1928 for (;;) {
1929 ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
1930 tag = p.first;
1931 if (!p.second) goto handle_unusual;
1932 switch (::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::GetTagFieldNumber(tag)) {
1933 // optional string name = 1;
1934 case 1: {
1935 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (10 & 0xFF)) {
1936 DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadString(
1937 input, this->mutable_name()));
1938 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
1939 this->name().data(), static_cast<int>(this->name().length()),
1940 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::PARSE,
1941 "toco.ArraysExtraInfo.Entry.name");
1942 } else {
1943 goto handle_unusual;
1944 }
1945 break;
1946 }
1947
1948 // optional double min = 2;
1949 case 2: {
1950 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (17 & 0xFF)) {
1951 _Internal::set_has_min(&_has_bits_);
1952 DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
1953 double, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_DOUBLE>(
1954 input, &min_)));
1955 } else {
1956 goto handle_unusual;
1957 }
1958 break;
1959 }
1960
1961 // optional double max = 3;
1962 case 3: {
1963 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (25 & 0xFF)) {
1964 _Internal::set_has_max(&_has_bits_);
1965 DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
1966 double, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_DOUBLE>(
1967 input, &max_)));
1968 } else {
1969 goto handle_unusual;
1970 }
1971 break;
1972 }
1973
1974 // optional .toco.IODataType data_type = 4;
1975 case 4: {
1976 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (32 & 0xFF)) {
1977 int value = 0;
1978 DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
1979 int, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_ENUM>(
1980 input, &value)));
1981 if (::toco::IODataType_IsValid(value)) {
1982 set_data_type(static_cast< ::toco::IODataType >(value));
1983 } else {
1984 mutable_unknown_fields()->AddVarint(
1985 4, static_cast<::PROTOBUF_NAMESPACE_ID::uint64>(value));
1986 }
1987 } else {
1988 goto handle_unusual;
1989 }
1990 break;
1991 }
1992
1993 // optional .toco.InputArrayShape shape = 5;
1994 case 5: {
1995 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (42 & 0xFF)) {
1996 DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage(
1997 input, mutable_shape()));
1998 } else {
1999 goto handle_unusual;
2000 }
2001 break;
2002 }
2003
2004 // optional float constant_float_value = 6;
2005 case 6: {
2006 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (53 & 0xFF)) {
2007 _Internal::set_has_constant_float_value(&_has_bits_);
2008 DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
2009 float, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_FLOAT>(
2010 input, &constant_float_value_)));
2011 } else {
2012 goto handle_unusual;
2013 }
2014 break;
2015 }
2016
2017 // optional string name_regexp = 7;
2018 case 7: {
2019 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (58 & 0xFF)) {
2020 DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadString(
2021 input, this->mutable_name_regexp()));
2022 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
2023 this->name_regexp().data(), static_cast<int>(this->name_regexp().length()),
2024 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::PARSE,
2025 "toco.ArraysExtraInfo.Entry.name_regexp");
2026 } else {
2027 goto handle_unusual;
2028 }
2029 break;
2030 }
2031
2032 default: {
2033 handle_unusual:
2034 if (tag == 0) {
2035 goto success;
2036 }
2037 DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SkipField(
2038 input, tag, _internal_metadata_.mutable_unknown_fields()));
2039 break;
2040 }
2041 }
2042 }
2043success:
2044 // @@protoc_insertion_point(parse_success:toco.ArraysExtraInfo.Entry)
2045 return true;
2046failure:
2047 // @@protoc_insertion_point(parse_failure:toco.ArraysExtraInfo.Entry)
2048 return false;
2049#undef DO_
2050}
2051#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
2052
2053void ArraysExtraInfo_Entry::SerializeWithCachedSizes(
2054 ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const {
2055 // @@protoc_insertion_point(serialize_start:toco.ArraysExtraInfo.Entry)
2056 ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
2057 (void) cached_has_bits;
2058
2059 cached_has_bits = _has_bits_[0];
2060 // optional string name = 1;
2061 if (cached_has_bits & 0x00000001u) {
2062 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
2063 this->name().data(), static_cast<int>(this->name().length()),
2064 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
2065 "toco.ArraysExtraInfo.Entry.name");
2066 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringMaybeAliased(
2067 1, this->name(), output);
2068 }
2069
2070 // optional double min = 2;
2071 if (cached_has_bits & 0x00000008u) {
2072 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteDouble(2, this->min(), output);
2073 }
2074
2075 // optional double max = 3;
2076 if (cached_has_bits & 0x00000010u) {
2077 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteDouble(3, this->max(), output);
2078 }
2079
2080 // optional .toco.IODataType data_type = 4;
2081 if (cached_has_bits & 0x00000020u) {
2082 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnum(
2083 4, this->data_type(), output);
2084 }
2085
2086 // optional .toco.InputArrayShape shape = 5;
2087 if (cached_has_bits & 0x00000004u) {
2088 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray(
2089 5, _Internal::shape(this), output);
2090 }
2091
2092 // optional float constant_float_value = 6;
2093 if (cached_has_bits & 0x00000040u) {
2094 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloat(6, this->constant_float_value(), output);
2095 }
2096
2097 // optional string name_regexp = 7;
2098 if (cached_has_bits & 0x00000002u) {
2099 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
2100 this->name_regexp().data(), static_cast<int>(this->name_regexp().length()),
2101 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
2102 "toco.ArraysExtraInfo.Entry.name_regexp");
2103 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringMaybeAliased(
2104 7, this->name_regexp(), output);
2105 }
2106
2107 if (_internal_metadata_.have_unknown_fields()) {
2108 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields(
2109 _internal_metadata_.unknown_fields(), output);
2110 }
2111 // @@protoc_insertion_point(serialize_end:toco.ArraysExtraInfo.Entry)
2112}
2113
2114::PROTOBUF_NAMESPACE_ID::uint8* ArraysExtraInfo_Entry::InternalSerializeWithCachedSizesToArray(
2115 ::PROTOBUF_NAMESPACE_ID::uint8* target) const {
2116 // @@protoc_insertion_point(serialize_to_array_start:toco.ArraysExtraInfo.Entry)
2117 ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
2118 (void) cached_has_bits;
2119
2120 cached_has_bits = _has_bits_[0];
2121 // optional string name = 1;
2122 if (cached_has_bits & 0x00000001u) {
2123 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
2124 this->name().data(), static_cast<int>(this->name().length()),
2125 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
2126 "toco.ArraysExtraInfo.Entry.name");
2127 target =
2128 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringToArray(
2129 1, this->name(), target);
2130 }
2131
2132 // optional double min = 2;
2133 if (cached_has_bits & 0x00000008u) {
2134 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteDoubleToArray(2, this->min(), target);
2135 }
2136
2137 // optional double max = 3;
2138 if (cached_has_bits & 0x00000010u) {
2139 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteDoubleToArray(3, this->max(), target);
2140 }
2141
2142 // optional .toco.IODataType data_type = 4;
2143 if (cached_has_bits & 0x00000020u) {
2144 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
2145 4, this->data_type(), target);
2146 }
2147
2148 // optional .toco.InputArrayShape shape = 5;
2149 if (cached_has_bits & 0x00000004u) {
2150 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
2151 InternalWriteMessageToArray(
2152 5, _Internal::shape(this), target);
2153 }
2154
2155 // optional float constant_float_value = 6;
2156 if (cached_has_bits & 0x00000040u) {
2157 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(6, this->constant_float_value(), target);
2158 }
2159
2160 // optional string name_regexp = 7;
2161 if (cached_has_bits & 0x00000002u) {
2162 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
2163 this->name_regexp().data(), static_cast<int>(this->name_regexp().length()),
2164 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
2165 "toco.ArraysExtraInfo.Entry.name_regexp");
2166 target =
2167 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringToArray(
2168 7, this->name_regexp(), target);
2169 }
2170
2171 if (_internal_metadata_.have_unknown_fields()) {
2172 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray(
2173 _internal_metadata_.unknown_fields(), target);
2174 }
2175 // @@protoc_insertion_point(serialize_to_array_end:toco.ArraysExtraInfo.Entry)
2176 return target;
2177}
2178
2179size_t ArraysExtraInfo_Entry::ByteSizeLong() const {
2180// @@protoc_insertion_point(message_byte_size_start:toco.ArraysExtraInfo.Entry)
2181 size_t total_size = 0;
2182
2183 if (_internal_metadata_.have_unknown_fields()) {
2184 total_size +=
2185 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::ComputeUnknownFieldsSize(
2186 _internal_metadata_.unknown_fields());
2187 }
2188 ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
2189 // Prevent compiler warnings about cached_has_bits being unused
2190 (void) cached_has_bits;
2191
2192 cached_has_bits = _has_bits_[0];
2193 if (cached_has_bits & 0x0000007fu) {
2194 // optional string name = 1;
2195 if (cached_has_bits & 0x00000001u) {
2196 total_size += 1 +
2197 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
2198 this->name());
2199 }
2200
2201 // optional string name_regexp = 7;
2202 if (cached_has_bits & 0x00000002u) {
2203 total_size += 1 +
2204 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
2205 this->name_regexp());
2206 }
2207
2208 // optional .toco.InputArrayShape shape = 5;
2209 if (cached_has_bits & 0x00000004u) {
2210 total_size += 1 +
2211 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
2212 *shape_);
2213 }
2214
2215 // optional double min = 2;
2216 if (cached_has_bits & 0x00000008u) {
2217 total_size += 1 + 8;
2218 }
2219
2220 // optional double max = 3;
2221 if (cached_has_bits & 0x00000010u) {
2222 total_size += 1 + 8;
2223 }
2224
2225 // optional .toco.IODataType data_type = 4;
2226 if (cached_has_bits & 0x00000020u) {
2227 total_size += 1 +
2228 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->data_type());
2229 }
2230
2231 // optional float constant_float_value = 6;
2232 if (cached_has_bits & 0x00000040u) {
2233 total_size += 1 + 4;
2234 }
2235
2236 }
2237 int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
2238 SetCachedSize(cached_size);
2239 return total_size;
2240}
2241
2242void ArraysExtraInfo_Entry::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
2243// @@protoc_insertion_point(generalized_merge_from_start:toco.ArraysExtraInfo.Entry)
2244 GOOGLE_DCHECK_NE(&from, this);
2245 const ArraysExtraInfo_Entry* source =
2246 ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<ArraysExtraInfo_Entry>(
2247 &from);
2248 if (source == nullptr) {
2249 // @@protoc_insertion_point(generalized_merge_from_cast_fail:toco.ArraysExtraInfo.Entry)
2250 ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
2251 } else {
2252 // @@protoc_insertion_point(generalized_merge_from_cast_success:toco.ArraysExtraInfo.Entry)
2253 MergeFrom(*source);
2254 }
2255}
2256
2257void ArraysExtraInfo_Entry::MergeFrom(const ArraysExtraInfo_Entry& from) {
2258// @@protoc_insertion_point(class_specific_merge_from_start:toco.ArraysExtraInfo.Entry)
2259 GOOGLE_DCHECK_NE(&from, this);
2260 _internal_metadata_.MergeFrom(from._internal_metadata_);
2261 ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
2262 (void) cached_has_bits;
2263
2264 cached_has_bits = from._has_bits_[0];
2265 if (cached_has_bits & 0x0000007fu) {
2266 if (cached_has_bits & 0x00000001u) {
2267 _has_bits_[0] |= 0x00000001u;
2268 name_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.name_);
2269 }
2270 if (cached_has_bits & 0x00000002u) {
2271 _has_bits_[0] |= 0x00000002u;
2272 name_regexp_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.name_regexp_);
2273 }
2274 if (cached_has_bits & 0x00000004u) {
2275 mutable_shape()->::toco::InputArrayShape::MergeFrom(from.shape());
2276 }
2277 if (cached_has_bits & 0x00000008u) {
2278 min_ = from.min_;
2279 }
2280 if (cached_has_bits & 0x00000010u) {
2281 max_ = from.max_;
2282 }
2283 if (cached_has_bits & 0x00000020u) {
2284 data_type_ = from.data_type_;
2285 }
2286 if (cached_has_bits & 0x00000040u) {
2287 constant_float_value_ = from.constant_float_value_;
2288 }
2289 _has_bits_[0] |= cached_has_bits;
2290 }
2291}
2292
2293void ArraysExtraInfo_Entry::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
2294// @@protoc_insertion_point(generalized_copy_from_start:toco.ArraysExtraInfo.Entry)
2295 if (&from == this) return;
2296 Clear();
2297 MergeFrom(from);
2298}
2299
2300void ArraysExtraInfo_Entry::CopyFrom(const ArraysExtraInfo_Entry& from) {
2301// @@protoc_insertion_point(class_specific_copy_from_start:toco.ArraysExtraInfo.Entry)
2302 if (&from == this) return;
2303 Clear();
2304 MergeFrom(from);
2305}
2306
2307bool ArraysExtraInfo_Entry::IsInitialized() const {
2308 return true;
2309}
2310
2311void ArraysExtraInfo_Entry::InternalSwap(ArraysExtraInfo_Entry* other) {
2312 using std::swap;
2313 _internal_metadata_.Swap(&other->_internal_metadata_);
2314 swap(_has_bits_[0], other->_has_bits_[0]);
2315 name_.Swap(&other->name_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
2316 GetArenaNoVirtual());
2317 name_regexp_.Swap(&other->name_regexp_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
2318 GetArenaNoVirtual());
2319 swap(shape_, other->shape_);
2320 swap(min_, other->min_);
2321 swap(max_, other->max_);
2322 swap(data_type_, other->data_type_);
2323 swap(constant_float_value_, other->constant_float_value_);
2324}
2325
2326::PROTOBUF_NAMESPACE_ID::Metadata ArraysExtraInfo_Entry::GetMetadata() const {
2327 return GetMetadataStatic();
2328}
2329
2330
2331// ===================================================================
2332
2333void ArraysExtraInfo::InitAsDefaultInstance() {
2334}
2335class ArraysExtraInfo::_Internal {
2336 public:
2337 using HasBits = decltype(std::declval<ArraysExtraInfo>()._has_bits_);
2338};
2339
2340ArraysExtraInfo::ArraysExtraInfo()
2341 : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
2342 SharedCtor();
2343 // @@protoc_insertion_point(constructor:toco.ArraysExtraInfo)
2344}
2345ArraysExtraInfo::ArraysExtraInfo(const ArraysExtraInfo& from)
2346 : ::PROTOBUF_NAMESPACE_ID::Message(),
2347 _internal_metadata_(nullptr),
2348 _has_bits_(from._has_bits_),
2349 entries_(from.entries_) {
2350 _internal_metadata_.MergeFrom(from._internal_metadata_);
2351 // @@protoc_insertion_point(copy_constructor:toco.ArraysExtraInfo)
2352}
2353
2354void ArraysExtraInfo::SharedCtor() {
2355 ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_ArraysExtraInfo_tensorflow_2flite_2ftoco_2fmodel_5fflags_2eproto.base);
2356}
2357
2358ArraysExtraInfo::~ArraysExtraInfo() {
2359 // @@protoc_insertion_point(destructor:toco.ArraysExtraInfo)
2360 SharedDtor();
2361}
2362
2363void ArraysExtraInfo::SharedDtor() {
2364}
2365
2366void ArraysExtraInfo::SetCachedSize(int size) const {
2367 _cached_size_.Set(size);
2368}
2369const ArraysExtraInfo& ArraysExtraInfo::default_instance() {
2370 ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_ArraysExtraInfo_tensorflow_2flite_2ftoco_2fmodel_5fflags_2eproto.base);
2371 return *internal_default_instance();
2372}
2373
2374
2375void ArraysExtraInfo::Clear() {
2376// @@protoc_insertion_point(message_clear_start:toco.ArraysExtraInfo)
2377 ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
2378 // Prevent compiler warnings about cached_has_bits being unused
2379 (void) cached_has_bits;
2380
2381 entries_.Clear();
2382 _has_bits_.Clear();
2383 _internal_metadata_.Clear();
2384}
2385
2386#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
2387const char* ArraysExtraInfo::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
2388#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
2389 while (!ctx->Done(&ptr)) {
2390 ::PROTOBUF_NAMESPACE_ID::uint32 tag;
2391 ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
2392 CHK_(ptr);
2393 switch (tag >> 3) {
2394 // repeated .toco.ArraysExtraInfo.Entry entries = 1;
2395 case 1:
2396 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) {
2397 ptr -= 1;
2398 do {
2399 ptr += 1;
2400 ptr = ctx->ParseMessage(add_entries(), ptr);
2401 CHK_(ptr);
2402 if (!ctx->DataAvailable(ptr)) break;
2403 } while (::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<::PROTOBUF_NAMESPACE_ID::uint8>(ptr) == 10);
2404 } else goto handle_unusual;
2405 continue;
2406 default: {
2407 handle_unusual:
2408 if ((tag & 7) == 4 || tag == 0) {
2409 ctx->SetLastTag(tag);
2410 goto success;
2411 }
2412 ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
2413 CHK_(ptr != nullptr);
2414 continue;
2415 }
2416 } // switch
2417 } // while
2418success:
2419 return ptr;
2420failure:
2421 ptr = nullptr;
2422 goto success;
2423#undef CHK_
2424}
2425#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
2426bool ArraysExtraInfo::MergePartialFromCodedStream(
2427 ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) {
2428#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure
2429 ::PROTOBUF_NAMESPACE_ID::uint32 tag;
2430 // @@protoc_insertion_point(parse_start:toco.ArraysExtraInfo)
2431 for (;;) {
2432 ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
2433 tag = p.first;
2434 if (!p.second) goto handle_unusual;
2435 switch (::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::GetTagFieldNumber(tag)) {
2436 // repeated .toco.ArraysExtraInfo.Entry entries = 1;
2437 case 1: {
2438 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (10 & 0xFF)) {
2439 DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage(
2440 input, add_entries()));
2441 } else {
2442 goto handle_unusual;
2443 }
2444 break;
2445 }
2446
2447 default: {
2448 handle_unusual:
2449 if (tag == 0) {
2450 goto success;
2451 }
2452 DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SkipField(
2453 input, tag, _internal_metadata_.mutable_unknown_fields()));
2454 break;
2455 }
2456 }
2457 }
2458success:
2459 // @@protoc_insertion_point(parse_success:toco.ArraysExtraInfo)
2460 return true;
2461failure:
2462 // @@protoc_insertion_point(parse_failure:toco.ArraysExtraInfo)
2463 return false;
2464#undef DO_
2465}
2466#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
2467
2468void ArraysExtraInfo::SerializeWithCachedSizes(
2469 ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const {
2470 // @@protoc_insertion_point(serialize_start:toco.ArraysExtraInfo)
2471 ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
2472 (void) cached_has_bits;
2473
2474 // repeated .toco.ArraysExtraInfo.Entry entries = 1;
2475 for (unsigned int i = 0,
2476 n = static_cast<unsigned int>(this->entries_size()); i < n; i++) {
2477 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray(
2478 1,
2479 this->entries(static_cast<int>(i)),
2480 output);
2481 }
2482
2483 if (_internal_metadata_.have_unknown_fields()) {
2484 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields(
2485 _internal_metadata_.unknown_fields(), output);
2486 }
2487 // @@protoc_insertion_point(serialize_end:toco.ArraysExtraInfo)
2488}
2489
2490::PROTOBUF_NAMESPACE_ID::uint8* ArraysExtraInfo::InternalSerializeWithCachedSizesToArray(
2491 ::PROTOBUF_NAMESPACE_ID::uint8* target) const {
2492 // @@protoc_insertion_point(serialize_to_array_start:toco.ArraysExtraInfo)
2493 ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
2494 (void) cached_has_bits;
2495
2496 // repeated .toco.ArraysExtraInfo.Entry entries = 1;
2497 for (unsigned int i = 0,
2498 n = static_cast<unsigned int>(this->entries_size()); i < n; i++) {
2499 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
2500 InternalWriteMessageToArray(
2501 1, this->entries(static_cast<int>(i)), target);
2502 }
2503
2504 if (_internal_metadata_.have_unknown_fields()) {
2505 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray(
2506 _internal_metadata_.unknown_fields(), target);
2507 }
2508 // @@protoc_insertion_point(serialize_to_array_end:toco.ArraysExtraInfo)
2509 return target;
2510}
2511
2512size_t ArraysExtraInfo::ByteSizeLong() const {
2513// @@protoc_insertion_point(message_byte_size_start:toco.ArraysExtraInfo)
2514 size_t total_size = 0;
2515
2516 if (_internal_metadata_.have_unknown_fields()) {
2517 total_size +=
2518 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::ComputeUnknownFieldsSize(
2519 _internal_metadata_.unknown_fields());
2520 }
2521 ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
2522 // Prevent compiler warnings about cached_has_bits being unused
2523 (void) cached_has_bits;
2524
2525 // repeated .toco.ArraysExtraInfo.Entry entries = 1;
2526 {
2527 unsigned int count = static_cast<unsigned int>(this->entries_size());
2528 total_size += 1UL * count;
2529 for (unsigned int i = 0; i < count; i++) {
2530 total_size +=
2531 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
2532 this->entries(static_cast<int>(i)));
2533 }
2534 }
2535
2536 int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
2537 SetCachedSize(cached_size);
2538 return total_size;
2539}
2540
2541void ArraysExtraInfo::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
2542// @@protoc_insertion_point(generalized_merge_from_start:toco.ArraysExtraInfo)
2543 GOOGLE_DCHECK_NE(&from, this);
2544 const ArraysExtraInfo* source =
2545 ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<ArraysExtraInfo>(
2546 &from);
2547 if (source == nullptr) {
2548 // @@protoc_insertion_point(generalized_merge_from_cast_fail:toco.ArraysExtraInfo)
2549 ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
2550 } else {
2551 // @@protoc_insertion_point(generalized_merge_from_cast_success:toco.ArraysExtraInfo)
2552 MergeFrom(*source);
2553 }
2554}
2555
2556void ArraysExtraInfo::MergeFrom(const ArraysExtraInfo& from) {
2557// @@protoc_insertion_point(class_specific_merge_from_start:toco.ArraysExtraInfo)
2558 GOOGLE_DCHECK_NE(&from, this);
2559 _internal_metadata_.MergeFrom(from._internal_metadata_);
2560 ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
2561 (void) cached_has_bits;
2562
2563 entries_.MergeFrom(from.entries_);
2564}
2565
2566void ArraysExtraInfo::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
2567// @@protoc_insertion_point(generalized_copy_from_start:toco.ArraysExtraInfo)
2568 if (&from == this) return;
2569 Clear();
2570 MergeFrom(from);
2571}
2572
2573void ArraysExtraInfo::CopyFrom(const ArraysExtraInfo& from) {
2574// @@protoc_insertion_point(class_specific_copy_from_start:toco.ArraysExtraInfo)
2575 if (&from == this) return;
2576 Clear();
2577 MergeFrom(from);
2578}
2579
2580bool ArraysExtraInfo::IsInitialized() const {
2581 return true;
2582}
2583
2584void ArraysExtraInfo::InternalSwap(ArraysExtraInfo* other) {
2585 using std::swap;
2586 _internal_metadata_.Swap(&other->_internal_metadata_);
2587 swap(_has_bits_[0], other->_has_bits_[0]);
2588 CastToBase(&entries_)->InternalSwap(CastToBase(&other->entries_));
2589}
2590
2591::PROTOBUF_NAMESPACE_ID::Metadata ArraysExtraInfo::GetMetadata() const {
2592 return GetMetadataStatic();
2593}
2594
2595
2596// ===================================================================
2597
2598void ModelFlags_ModelCheck::InitAsDefaultInstance() {
2599}
2600class ModelFlags_ModelCheck::_Internal {
2601 public:
2602 using HasBits = decltype(std::declval<ModelFlags_ModelCheck>()._has_bits_);
2603 static void set_has_count_type(HasBits* has_bits) {
2604 (*has_bits)[0] |= 1u;
2605 }
2606 static void set_has_count_min(HasBits* has_bits) {
2607 (*has_bits)[0] |= 2u;
2608 }
2609 static void set_has_count_max(HasBits* has_bits) {
2610 (*has_bits)[0] |= 4u;
2611 }
2612};
2613
2614::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<std::string> ModelFlags_ModelCheck::_i_give_permission_to_break_this_code_default_count_type_;
2615ModelFlags_ModelCheck::ModelFlags_ModelCheck()
2616 : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
2617 SharedCtor();
2618 // @@protoc_insertion_point(constructor:toco.ModelFlags.ModelCheck)
2619}
2620ModelFlags_ModelCheck::ModelFlags_ModelCheck(const ModelFlags_ModelCheck& from)
2621 : ::PROTOBUF_NAMESPACE_ID::Message(),
2622 _internal_metadata_(nullptr),
2623 _has_bits_(from._has_bits_) {
2624 _internal_metadata_.MergeFrom(from._internal_metadata_);
2625 count_type_.UnsafeSetDefault(&::toco::ModelFlags_ModelCheck::_i_give_permission_to_break_this_code_default_count_type_.get());
2626 if (from.has_count_type()) {
2627 count_type_.AssignWithDefault(&::toco::ModelFlags_ModelCheck::_i_give_permission_to_break_this_code_default_count_type_.get(), from.count_type_);
2628 }
2629 ::memcpy(&count_min_, &from.count_min_,
2630 static_cast<size_t>(reinterpret_cast<char*>(&count_max_) -
2631 reinterpret_cast<char*>(&count_min_)) + sizeof(count_max_));
2632 // @@protoc_insertion_point(copy_constructor:toco.ModelFlags.ModelCheck)
2633}
2634
2635void ModelFlags_ModelCheck::SharedCtor() {
2636 ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_ModelFlags_ModelCheck_tensorflow_2flite_2ftoco_2fmodel_5fflags_2eproto.base);
2637 count_type_.UnsafeSetDefault(&::toco::ModelFlags_ModelCheck::_i_give_permission_to_break_this_code_default_count_type_.get());
2638 count_min_ = -1;
2639 count_max_ = -1;
2640}
2641
2642ModelFlags_ModelCheck::~ModelFlags_ModelCheck() {
2643 // @@protoc_insertion_point(destructor:toco.ModelFlags.ModelCheck)
2644 SharedDtor();
2645}
2646
2647void ModelFlags_ModelCheck::SharedDtor() {
2648 count_type_.DestroyNoArena(&::toco::ModelFlags_ModelCheck::_i_give_permission_to_break_this_code_default_count_type_.get());
2649}
2650
2651void ModelFlags_ModelCheck::SetCachedSize(int size) const {
2652 _cached_size_.Set(size);
2653}
2654const ModelFlags_ModelCheck& ModelFlags_ModelCheck::default_instance() {
2655 ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_ModelFlags_ModelCheck_tensorflow_2flite_2ftoco_2fmodel_5fflags_2eproto.base);
2656 return *internal_default_instance();
2657}
2658
2659
2660void ModelFlags_ModelCheck::Clear() {
2661// @@protoc_insertion_point(message_clear_start:toco.ModelFlags.ModelCheck)
2662 ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
2663 // Prevent compiler warnings about cached_has_bits being unused
2664 (void) cached_has_bits;
2665
2666 cached_has_bits = _has_bits_[0];
2667 if (cached_has_bits & 0x00000007u) {
2668 if (cached_has_bits & 0x00000001u) {
2669 count_type_.UnsafeMutablePointer()->assign(*&::toco::ModelFlags_ModelCheck::_i_give_permission_to_break_this_code_default_count_type_.get());
2670 }
2671 count_min_ = -1;
2672 count_max_ = -1;
2673 }
2674 _has_bits_.Clear();
2675 _internal_metadata_.Clear();
2676}
2677
2678#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
2679const char* ModelFlags_ModelCheck::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
2680#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
2681 _Internal::HasBits has_bits{};
2682 while (!ctx->Done(&ptr)) {
2683 ::PROTOBUF_NAMESPACE_ID::uint32 tag;
2684 ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
2685 CHK_(ptr);
2686 switch (tag >> 3) {
2687 // optional string count_type = 1 [default = "None"];
2688 case 1:
2689 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) {
2690 ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParserUTF8Verify(mutable_count_type(), ptr, ctx, "toco.ModelFlags.ModelCheck.count_type");
2691 CHK_(ptr);
2692 } else goto handle_unusual;
2693 continue;
2694 // optional int32 count_min = 2 [default = -1];
2695 case 2:
2696 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) {
2697 _Internal::set_has_count_min(&has_bits);
2698 count_min_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
2699 CHK_(ptr);
2700 } else goto handle_unusual;
2701 continue;
2702 // optional int32 count_max = 3 [default = -1];
2703 case 3:
2704 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24)) {
2705 _Internal::set_has_count_max(&has_bits);
2706 count_max_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
2707 CHK_(ptr);
2708 } else goto handle_unusual;
2709 continue;
2710 default: {
2711 handle_unusual:
2712 if ((tag & 7) == 4 || tag == 0) {
2713 ctx->SetLastTag(tag);
2714 goto success;
2715 }
2716 ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
2717 CHK_(ptr != nullptr);
2718 continue;
2719 }
2720 } // switch
2721 } // while
2722success:
2723 _has_bits_.Or(has_bits);
2724 return ptr;
2725failure:
2726 ptr = nullptr;
2727 goto success;
2728#undef CHK_
2729}
2730#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
2731bool ModelFlags_ModelCheck::MergePartialFromCodedStream(
2732 ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) {
2733#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure
2734 ::PROTOBUF_NAMESPACE_ID::uint32 tag;
2735 // @@protoc_insertion_point(parse_start:toco.ModelFlags.ModelCheck)
2736 for (;;) {
2737 ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
2738 tag = p.first;
2739 if (!p.second) goto handle_unusual;
2740 switch (::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::GetTagFieldNumber(tag)) {
2741 // optional string count_type = 1 [default = "None"];
2742 case 1: {
2743 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (10 & 0xFF)) {
2744 DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadString(
2745 input, this->mutable_count_type()));
2746 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
2747 this->count_type().data(), static_cast<int>(this->count_type().length()),
2748 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::PARSE,
2749 "toco.ModelFlags.ModelCheck.count_type");
2750 } else {
2751 goto handle_unusual;
2752 }
2753 break;
2754 }
2755
2756 // optional int32 count_min = 2 [default = -1];
2757 case 2: {
2758 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (16 & 0xFF)) {
2759 _Internal::set_has_count_min(&_has_bits_);
2760 DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
2761 ::PROTOBUF_NAMESPACE_ID::int32, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT32>(
2762 input, &count_min_)));
2763 } else {
2764 goto handle_unusual;
2765 }
2766 break;
2767 }
2768
2769 // optional int32 count_max = 3 [default = -1];
2770 case 3: {
2771 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (24 & 0xFF)) {
2772 _Internal::set_has_count_max(&_has_bits_);
2773 DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
2774 ::PROTOBUF_NAMESPACE_ID::int32, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT32>(
2775 input, &count_max_)));
2776 } else {
2777 goto handle_unusual;
2778 }
2779 break;
2780 }
2781
2782 default: {
2783 handle_unusual:
2784 if (tag == 0) {
2785 goto success;
2786 }
2787 DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SkipField(
2788 input, tag, _internal_metadata_.mutable_unknown_fields()));
2789 break;
2790 }
2791 }
2792 }
2793success:
2794 // @@protoc_insertion_point(parse_success:toco.ModelFlags.ModelCheck)
2795 return true;
2796failure:
2797 // @@protoc_insertion_point(parse_failure:toco.ModelFlags.ModelCheck)
2798 return false;
2799#undef DO_
2800}
2801#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
2802
2803void ModelFlags_ModelCheck::SerializeWithCachedSizes(
2804 ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const {
2805 // @@protoc_insertion_point(serialize_start:toco.ModelFlags.ModelCheck)
2806 ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
2807 (void) cached_has_bits;
2808
2809 cached_has_bits = _has_bits_[0];
2810 // optional string count_type = 1 [default = "None"];
2811 if (cached_has_bits & 0x00000001u) {
2812 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
2813 this->count_type().data(), static_cast<int>(this->count_type().length()),
2814 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
2815 "toco.ModelFlags.ModelCheck.count_type");
2816 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringMaybeAliased(
2817 1, this->count_type(), output);
2818 }
2819
2820 // optional int32 count_min = 2 [default = -1];
2821 if (cached_has_bits & 0x00000002u) {
2822 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32(2, this->count_min(), output);
2823 }
2824
2825 // optional int32 count_max = 3 [default = -1];
2826 if (cached_has_bits & 0x00000004u) {
2827 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32(3, this->count_max(), output);
2828 }
2829
2830 if (_internal_metadata_.have_unknown_fields()) {
2831 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields(
2832 _internal_metadata_.unknown_fields(), output);
2833 }
2834 // @@protoc_insertion_point(serialize_end:toco.ModelFlags.ModelCheck)
2835}
2836
2837::PROTOBUF_NAMESPACE_ID::uint8* ModelFlags_ModelCheck::InternalSerializeWithCachedSizesToArray(
2838 ::PROTOBUF_NAMESPACE_ID::uint8* target) const {
2839 // @@protoc_insertion_point(serialize_to_array_start:toco.ModelFlags.ModelCheck)
2840 ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
2841 (void) cached_has_bits;
2842
2843 cached_has_bits = _has_bits_[0];
2844 // optional string count_type = 1 [default = "None"];
2845 if (cached_has_bits & 0x00000001u) {
2846 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
2847 this->count_type().data(), static_cast<int>(this->count_type().length()),
2848 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
2849 "toco.ModelFlags.ModelCheck.count_type");
2850 target =
2851 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringToArray(
2852 1, this->count_type(), target);
2853 }
2854
2855 // optional int32 count_min = 2 [default = -1];
2856 if (cached_has_bits & 0x00000002u) {
2857 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(2, this->count_min(), target);
2858 }
2859
2860 // optional int32 count_max = 3 [default = -1];
2861 if (cached_has_bits & 0x00000004u) {
2862 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(3, this->count_max(), target);
2863 }
2864
2865 if (_internal_metadata_.have_unknown_fields()) {
2866 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray(
2867 _internal_metadata_.unknown_fields(), target);
2868 }
2869 // @@protoc_insertion_point(serialize_to_array_end:toco.ModelFlags.ModelCheck)
2870 return target;
2871}
2872
2873size_t ModelFlags_ModelCheck::ByteSizeLong() const {
2874// @@protoc_insertion_point(message_byte_size_start:toco.ModelFlags.ModelCheck)
2875 size_t total_size = 0;
2876
2877 if (_internal_metadata_.have_unknown_fields()) {
2878 total_size +=
2879 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::ComputeUnknownFieldsSize(
2880 _internal_metadata_.unknown_fields());
2881 }
2882 ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
2883 // Prevent compiler warnings about cached_has_bits being unused
2884 (void) cached_has_bits;
2885
2886 cached_has_bits = _has_bits_[0];
2887 if (cached_has_bits & 0x00000007u) {
2888 // optional string count_type = 1 [default = "None"];
2889 if (cached_has_bits & 0x00000001u) {
2890 total_size += 1 +
2891 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
2892 this->count_type());
2893 }
2894
2895 // optional int32 count_min = 2 [default = -1];
2896 if (cached_has_bits & 0x00000002u) {
2897 total_size += 1 +
2898 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
2899 this->count_min());
2900 }
2901
2902 // optional int32 count_max = 3 [default = -1];
2903 if (cached_has_bits & 0x00000004u) {
2904 total_size += 1 +
2905 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
2906 this->count_max());
2907 }
2908
2909 }
2910 int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
2911 SetCachedSize(cached_size);
2912 return total_size;
2913}
2914
2915void ModelFlags_ModelCheck::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
2916// @@protoc_insertion_point(generalized_merge_from_start:toco.ModelFlags.ModelCheck)
2917 GOOGLE_DCHECK_NE(&from, this);
2918 const ModelFlags_ModelCheck* source =
2919 ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<ModelFlags_ModelCheck>(
2920 &from);
2921 if (source == nullptr) {
2922 // @@protoc_insertion_point(generalized_merge_from_cast_fail:toco.ModelFlags.ModelCheck)
2923 ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
2924 } else {
2925 // @@protoc_insertion_point(generalized_merge_from_cast_success:toco.ModelFlags.ModelCheck)
2926 MergeFrom(*source);
2927 }
2928}
2929
2930void ModelFlags_ModelCheck::MergeFrom(const ModelFlags_ModelCheck& from) {
2931// @@protoc_insertion_point(class_specific_merge_from_start:toco.ModelFlags.ModelCheck)
2932 GOOGLE_DCHECK_NE(&from, this);
2933 _internal_metadata_.MergeFrom(from._internal_metadata_);
2934 ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
2935 (void) cached_has_bits;
2936
2937 cached_has_bits = from._has_bits_[0];
2938 if (cached_has_bits & 0x00000007u) {
2939 if (cached_has_bits & 0x00000001u) {
2940 _has_bits_[0] |= 0x00000001u;
2941 count_type_.AssignWithDefault(&::toco::ModelFlags_ModelCheck::_i_give_permission_to_break_this_code_default_count_type_.get(), from.count_type_);
2942 }
2943 if (cached_has_bits & 0x00000002u) {
2944 count_min_ = from.count_min_;
2945 }
2946 if (cached_has_bits & 0x00000004u) {
2947 count_max_ = from.count_max_;
2948 }
2949 _has_bits_[0] |= cached_has_bits;
2950 }
2951}
2952
2953void ModelFlags_ModelCheck::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
2954// @@protoc_insertion_point(generalized_copy_from_start:toco.ModelFlags.ModelCheck)
2955 if (&from == this) return;
2956 Clear();
2957 MergeFrom(from);
2958}
2959
2960void ModelFlags_ModelCheck::CopyFrom(const ModelFlags_ModelCheck& from) {
2961// @@protoc_insertion_point(class_specific_copy_from_start:toco.ModelFlags.ModelCheck)
2962 if (&from == this) return;
2963 Clear();
2964 MergeFrom(from);
2965}
2966
2967bool ModelFlags_ModelCheck::IsInitialized() const {
2968 return true;
2969}
2970
2971void ModelFlags_ModelCheck::InternalSwap(ModelFlags_ModelCheck* other) {
2972 using std::swap;
2973 _internal_metadata_.Swap(&other->_internal_metadata_);
2974 swap(_has_bits_[0], other->_has_bits_[0]);
2975 count_type_.Swap(&other->count_type_, &::toco::ModelFlags_ModelCheck::_i_give_permission_to_break_this_code_default_count_type_.get(),
2976 GetArenaNoVirtual());
2977 swap(count_min_, other->count_min_);
2978 swap(count_max_, other->count_max_);
2979}
2980
2981::PROTOBUF_NAMESPACE_ID::Metadata ModelFlags_ModelCheck::GetMetadata() const {
2982 return GetMetadataStatic();
2983}
2984
2985
2986// ===================================================================
2987
2988void ModelFlags::InitAsDefaultInstance() {
2989 ::toco::_ModelFlags_default_instance_._instance.get_mutable()->arrays_extra_info_ = const_cast< ::toco::ArraysExtraInfo*>(
2990 ::toco::ArraysExtraInfo::internal_default_instance());
2991}
2992class ModelFlags::_Internal {
2993 public:
2994 using HasBits = decltype(std::declval<ModelFlags>()._has_bits_);
2995 static void set_has_variable_batch(HasBits* has_bits) {
2996 (*has_bits)[0] |= 8u;
2997 }
2998 static void set_has_allow_nonexistent_arrays(HasBits* has_bits) {
2999 (*has_bits)[0] |= 16u;
3000 }
3001 static void set_has_allow_nonascii_arrays(HasBits* has_bits) {
3002 (*has_bits)[0] |= 32u;
3003 }
3004 static const ::toco::ArraysExtraInfo& arrays_extra_info(const ModelFlags* msg);
3005 static void set_has_arrays_extra_info(HasBits* has_bits) {
3006 (*has_bits)[0] |= 2u;
3007 }
3008 static void set_has_change_concat_input_ranges(HasBits* has_bits) {
3009 (*has_bits)[0] |= 256u;
3010 }
3011 static void set_has_saved_model_dir(HasBits* has_bits) {
3012 (*has_bits)[0] |= 1u;
3013 }
3014 static void set_has_saved_model_version(HasBits* has_bits) {
3015 (*has_bits)[0] |= 128u;
3016 }
3017 static void set_has_use_hlo_import(HasBits* has_bits) {
3018 (*has_bits)[0] |= 64u;
3019 }
3020 static void set_has_hlo_file_type(HasBits* has_bits) {
3021 (*has_bits)[0] |= 4u;
3022 }
3023};
3024
3025const ::toco::ArraysExtraInfo&
3026ModelFlags::_Internal::arrays_extra_info(const ModelFlags* msg) {
3027 return *msg->arrays_extra_info_;
3028}
3029ModelFlags::ModelFlags()
3030 : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
3031 SharedCtor();
3032 // @@protoc_insertion_point(constructor:toco.ModelFlags)
3033}
3034ModelFlags::ModelFlags(const ModelFlags& from)
3035 : ::PROTOBUF_NAMESPACE_ID::Message(),
3036 _internal_metadata_(nullptr),
3037 _has_bits_(from._has_bits_),
3038 input_arrays_(from.input_arrays_),
3039 output_arrays_(from.output_arrays_),
3040 rnn_states_(from.rnn_states_),
3041 model_checks_(from.model_checks_),
3042 saved_model_tags_(from.saved_model_tags_),
3043 saved_model_exported_names_(from.saved_model_exported_names_),
3044 control_output_arrays_(from.control_output_arrays_) {
3045 _internal_metadata_.MergeFrom(from._internal_metadata_);
3046 saved_model_dir_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
3047 if (from.has_saved_model_dir()) {
3048 saved_model_dir_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.saved_model_dir_);
3049 }
3050 if (from.has_arrays_extra_info()) {
3051 arrays_extra_info_ = new ::toco::ArraysExtraInfo(*from.arrays_extra_info_);
3052 } else {
3053 arrays_extra_info_ = nullptr;
3054 }
3055 ::memcpy(&hlo_file_type_, &from.hlo_file_type_,
3056 static_cast<size_t>(reinterpret_cast<char*>(&change_concat_input_ranges_) -
3057 reinterpret_cast<char*>(&hlo_file_type_)) + sizeof(change_concat_input_ranges_));
3058 // @@protoc_insertion_point(copy_constructor:toco.ModelFlags)
3059}
3060
3061void ModelFlags::SharedCtor() {
3062 ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_ModelFlags_tensorflow_2flite_2ftoco_2fmodel_5fflags_2eproto.base);
3063 saved_model_dir_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
3064 ::memset(&arrays_extra_info_, 0, static_cast<size_t>(
3065 reinterpret_cast<char*>(&saved_model_version_) -
3066 reinterpret_cast<char*>(&arrays_extra_info_)) + sizeof(saved_model_version_));
3067 change_concat_input_ranges_ = true;
3068}
3069
3070ModelFlags::~ModelFlags() {
3071 // @@protoc_insertion_point(destructor:toco.ModelFlags)
3072 SharedDtor();
3073}
3074
3075void ModelFlags::SharedDtor() {
3076 saved_model_dir_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
3077 if (this != internal_default_instance()) delete arrays_extra_info_;
3078}
3079
3080void ModelFlags::SetCachedSize(int size) const {
3081 _cached_size_.Set(size);
3082}
3083const ModelFlags& ModelFlags::default_instance() {
3084 ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_ModelFlags_tensorflow_2flite_2ftoco_2fmodel_5fflags_2eproto.base);
3085 return *internal_default_instance();
3086}
3087
3088
3089void ModelFlags::Clear() {
3090// @@protoc_insertion_point(message_clear_start:toco.ModelFlags)
3091 ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
3092 // Prevent compiler warnings about cached_has_bits being unused
3093 (void) cached_has_bits;
3094
3095 input_arrays_.Clear();
3096 output_arrays_.Clear();
3097 rnn_states_.Clear();
3098 model_checks_.Clear();
3099 saved_model_tags_.Clear();
3100 saved_model_exported_names_.Clear();
3101 control_output_arrays_.Clear();
3102 cached_has_bits = _has_bits_[0];
3103 if (cached_has_bits & 0x00000003u) {
3104 if (cached_has_bits & 0x00000001u) {
3105 saved_model_dir_.ClearNonDefaultToEmptyNoArena();
3106 }
3107 if (cached_has_bits & 0x00000002u) {
3108 GOOGLE_DCHECK(arrays_extra_info_ != nullptr);
3109 arrays_extra_info_->Clear();
3110 }
3111 }
3112 if (cached_has_bits & 0x000000fcu) {
3113 ::memset(&hlo_file_type_, 0, static_cast<size_t>(
3114 reinterpret_cast<char*>(&saved_model_version_) -
3115 reinterpret_cast<char*>(&hlo_file_type_)) + sizeof(saved_model_version_));
3116 }
3117 change_concat_input_ranges_ = true;
3118 _has_bits_.Clear();
3119 _internal_metadata_.Clear();
3120}
3121
3122#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
3123const char* ModelFlags::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
3124#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
3125 _Internal::HasBits has_bits{};
3126 while (!ctx->Done(&ptr)) {
3127 ::PROTOBUF_NAMESPACE_ID::uint32 tag;
3128 ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
3129 CHK_(ptr);
3130 switch (tag >> 3) {
3131 // repeated .toco.InputArray input_arrays = 1;
3132 case 1:
3133 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) {
3134 ptr -= 1;
3135 do {
3136 ptr += 1;
3137 ptr = ctx->ParseMessage(add_input_arrays(), ptr);
3138 CHK_(ptr);
3139 if (!ctx->DataAvailable(ptr)) break;
3140 } while (::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<::PROTOBUF_NAMESPACE_ID::uint8>(ptr) == 10);
3141 } else goto handle_unusual;
3142 continue;
3143 // repeated string output_arrays = 2;
3144 case 2:
3145 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) {
3146 ptr -= 1;
3147 do {
3148 ptr += 1;
3149 ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParserUTF8Verify(add_output_arrays(), ptr, ctx, "toco.ModelFlags.output_arrays");
3150 CHK_(ptr);
3151 if (!ctx->DataAvailable(ptr)) break;
3152 } while (::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<::PROTOBUF_NAMESPACE_ID::uint8>(ptr) == 18);
3153 } else goto handle_unusual;
3154 continue;
3155 // optional bool variable_batch = 10;
3156 case 10:
3157 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 80)) {
3158 _Internal::set_has_variable_batch(&has_bits);
3159 variable_batch_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
3160 CHK_(ptr);
3161 } else goto handle_unusual;
3162 continue;
3163 // repeated .toco.RnnState rnn_states = 12;
3164 case 12:
3165 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 98)) {
3166 ptr -= 1;
3167 do {
3168 ptr += 1;
3169 ptr = ctx->ParseMessage(add_rnn_states(), ptr);
3170 CHK_(ptr);
3171 if (!ctx->DataAvailable(ptr)) break;
3172 } while (::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<::PROTOBUF_NAMESPACE_ID::uint8>(ptr) == 98);
3173 } else goto handle_unusual;
3174 continue;
3175 // repeated .toco.ModelFlags.ModelCheck model_checks = 14;
3176 case 14:
3177 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 114)) {
3178 ptr -= 1;
3179 do {
3180 ptr += 1;
3181 ptr = ctx->ParseMessage(add_model_checks(), ptr);
3182 CHK_(ptr);
3183 if (!ctx->DataAvailable(ptr)) break;
3184 } while (::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<::PROTOBUF_NAMESPACE_ID::uint8>(ptr) == 114);
3185 } else goto handle_unusual;
3186 continue;
3187 // optional bool allow_nonexistent_arrays = 16;
3188 case 16:
3189 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 128)) {
3190 _Internal::set_has_allow_nonexistent_arrays(&has_bits);
3191 allow_nonexistent_arrays_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
3192 CHK_(ptr);
3193 } else goto handle_unusual;
3194 continue;
3195 // optional bool allow_nonascii_arrays = 17;
3196 case 17:
3197 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 136)) {
3198 _Internal::set_has_allow_nonascii_arrays(&has_bits);
3199 allow_nonascii_arrays_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
3200 CHK_(ptr);
3201 } else goto handle_unusual;
3202 continue;
3203 // optional .toco.ArraysExtraInfo arrays_extra_info = 18;
3204 case 18:
3205 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 146)) {
3206 ptr = ctx->ParseMessage(mutable_arrays_extra_info(), ptr);
3207 CHK_(ptr);
3208 } else goto handle_unusual;
3209 continue;
3210 // optional bool change_concat_input_ranges = 19 [default = true];
3211 case 19:
3212 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 152)) {
3213 _Internal::set_has_change_concat_input_ranges(&has_bits);
3214 change_concat_input_ranges_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
3215 CHK_(ptr);
3216 } else goto handle_unusual;
3217 continue;
3218 // optional string saved_model_dir = 20;
3219 case 20:
3220 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 162)) {
3221 ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParserUTF8Verify(mutable_saved_model_dir(), ptr, ctx, "toco.ModelFlags.saved_model_dir");
3222 CHK_(ptr);
3223 } else goto handle_unusual;
3224 continue;
3225 // optional int32 saved_model_version = 21;
3226 case 21:
3227 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 168)) {
3228 _Internal::set_has_saved_model_version(&has_bits);
3229 saved_model_version_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
3230 CHK_(ptr);
3231 } else goto handle_unusual;
3232 continue;
3233 // repeated string saved_model_tags = 22;
3234 case 22:
3235 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 178)) {
3236 ptr -= 2;
3237 do {
3238 ptr += 2;
3239 ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParserUTF8Verify(add_saved_model_tags(), ptr, ctx, "toco.ModelFlags.saved_model_tags");
3240 CHK_(ptr);
3241 if (!ctx->DataAvailable(ptr)) break;
3242 } while (::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<::PROTOBUF_NAMESPACE_ID::uint16>(ptr) == 434);
3243 } else goto handle_unusual;
3244 continue;
3245 // repeated string saved_model_exported_names = 23;
3246 case 23:
3247 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 186)) {
3248 ptr -= 2;
3249 do {
3250 ptr += 2;
3251 ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParserUTF8Verify(add_saved_model_exported_names(), ptr, ctx, "toco.ModelFlags.saved_model_exported_names");
3252 CHK_(ptr);
3253 if (!ctx->DataAvailable(ptr)) break;
3254 } while (::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<::PROTOBUF_NAMESPACE_ID::uint16>(ptr) == 442);
3255 } else goto handle_unusual;
3256 continue;
3257 // repeated string control_output_arrays = 24;
3258 case 24:
3259 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 194)) {
3260 ptr -= 2;
3261 do {
3262 ptr += 2;
3263 ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParserUTF8Verify(add_control_output_arrays(), ptr, ctx, "toco.ModelFlags.control_output_arrays");
3264 CHK_(ptr);
3265 if (!ctx->DataAvailable(ptr)) break;
3266 } while (::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<::PROTOBUF_NAMESPACE_ID::uint16>(ptr) == 450);
3267 } else goto handle_unusual;
3268 continue;
3269 // optional bool use_hlo_import = 25;
3270 case 25:
3271 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 200)) {
3272 _Internal::set_has_use_hlo_import(&has_bits);
3273 use_hlo_import_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
3274 CHK_(ptr);
3275 } else goto handle_unusual;
3276 continue;
3277 // optional .toco.ModelFlags.HloFileType hlo_file_type = 26;
3278 case 26:
3279 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 208)) {
3280 ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
3281 CHK_(ptr);
3282 if (PROTOBUF_PREDICT_TRUE(::toco::ModelFlags_HloFileType_IsValid(val))) {
3283 set_hlo_file_type(static_cast<::toco::ModelFlags_HloFileType>(val));
3284 } else {
3285 ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(26, val, mutable_unknown_fields());
3286 }
3287 } else goto handle_unusual;
3288 continue;
3289 default: {
3290 handle_unusual:
3291 if ((tag & 7) == 4 || tag == 0) {
3292 ctx->SetLastTag(tag);
3293 goto success;
3294 }
3295 ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
3296 CHK_(ptr != nullptr);
3297 continue;
3298 }
3299 } // switch
3300 } // while
3301success:
3302 _has_bits_.Or(has_bits);
3303 return ptr;
3304failure:
3305 ptr = nullptr;
3306 goto success;
3307#undef CHK_
3308}
3309#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
3310bool ModelFlags::MergePartialFromCodedStream(
3311 ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) {
3312#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure
3313 ::PROTOBUF_NAMESPACE_ID::uint32 tag;
3314 // @@protoc_insertion_point(parse_start:toco.ModelFlags)
3315 for (;;) {
3316 ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(16383u);
3317 tag = p.first;
3318 if (!p.second) goto handle_unusual;
3319 switch (::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::GetTagFieldNumber(tag)) {
3320 // repeated .toco.InputArray input_arrays = 1;
3321 case 1: {
3322 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (10 & 0xFF)) {
3323 DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage(
3324 input, add_input_arrays()));
3325 } else {
3326 goto handle_unusual;
3327 }
3328 break;
3329 }
3330
3331 // repeated string output_arrays = 2;
3332 case 2: {
3333 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (18 & 0xFF)) {
3334 DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadString(
3335 input, this->add_output_arrays()));
3336 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
3337 this->output_arrays(this->output_arrays_size() - 1).data(),
3338 static_cast<int>(this->output_arrays(this->output_arrays_size() - 1).length()),
3339 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::PARSE,
3340 "toco.ModelFlags.output_arrays");
3341 } else {
3342 goto handle_unusual;
3343 }
3344 break;
3345 }
3346
3347 // optional bool variable_batch = 10;
3348 case 10: {
3349 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (80 & 0xFF)) {
3350 _Internal::set_has_variable_batch(&_has_bits_);
3351 DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
3352 bool, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_BOOL>(
3353 input, &variable_batch_)));
3354 } else {
3355 goto handle_unusual;
3356 }
3357 break;
3358 }
3359
3360 // repeated .toco.RnnState rnn_states = 12;
3361 case 12: {
3362 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (98 & 0xFF)) {
3363 DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage(
3364 input, add_rnn_states()));
3365 } else {
3366 goto handle_unusual;
3367 }
3368 break;
3369 }
3370
3371 // repeated .toco.ModelFlags.ModelCheck model_checks = 14;
3372 case 14: {
3373 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (114 & 0xFF)) {
3374 DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage(
3375 input, add_model_checks()));
3376 } else {
3377 goto handle_unusual;
3378 }
3379 break;
3380 }
3381
3382 // optional bool allow_nonexistent_arrays = 16;
3383 case 16: {
3384 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (128 & 0xFF)) {
3385 _Internal::set_has_allow_nonexistent_arrays(&_has_bits_);
3386 DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
3387 bool, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_BOOL>(
3388 input, &allow_nonexistent_arrays_)));
3389 } else {
3390 goto handle_unusual;
3391 }
3392 break;
3393 }
3394
3395 // optional bool allow_nonascii_arrays = 17;
3396 case 17: {
3397 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (136 & 0xFF)) {
3398 _Internal::set_has_allow_nonascii_arrays(&_has_bits_);
3399 DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
3400 bool, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_BOOL>(
3401 input, &allow_nonascii_arrays_)));
3402 } else {
3403 goto handle_unusual;
3404 }
3405 break;
3406 }
3407
3408 // optional .toco.ArraysExtraInfo arrays_extra_info = 18;
3409 case 18: {
3410 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (146 & 0xFF)) {
3411 DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage(
3412 input, mutable_arrays_extra_info()));
3413 } else {
3414 goto handle_unusual;
3415 }
3416 break;
3417 }
3418
3419 // optional bool change_concat_input_ranges = 19 [default = true];
3420 case 19: {
3421 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (152 & 0xFF)) {
3422 _Internal::set_has_change_concat_input_ranges(&_has_bits_);
3423 DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
3424 bool, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_BOOL>(
3425 input, &change_concat_input_ranges_)));
3426 } else {
3427 goto handle_unusual;
3428 }
3429 break;
3430 }
3431
3432 // optional string saved_model_dir = 20;
3433 case 20: {
3434 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (162 & 0xFF)) {
3435 DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadString(
3436 input, this->mutable_saved_model_dir()));
3437 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
3438 this->saved_model_dir().data(), static_cast<int>(this->saved_model_dir().length()),
3439 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::PARSE,
3440 "toco.ModelFlags.saved_model_dir");
3441 } else {
3442 goto handle_unusual;
3443 }
3444 break;
3445 }
3446
3447 // optional int32 saved_model_version = 21;
3448 case 21: {
3449 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (168 & 0xFF)) {
3450 _Internal::set_has_saved_model_version(&_has_bits_);
3451 DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
3452 ::PROTOBUF_NAMESPACE_ID::int32, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT32>(
3453 input, &saved_model_version_)));
3454 } else {
3455 goto handle_unusual;
3456 }
3457 break;
3458 }
3459
3460 // repeated string saved_model_tags = 22;
3461 case 22: {
3462 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (178 & 0xFF)) {
3463 DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadString(
3464 input, this->add_saved_model_tags()));
3465 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
3466 this->saved_model_tags(this->saved_model_tags_size() - 1).data(),
3467 static_cast<int>(this->saved_model_tags(this->saved_model_tags_size() - 1).length()),
3468 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::PARSE,
3469 "toco.ModelFlags.saved_model_tags");
3470 } else {
3471 goto handle_unusual;
3472 }
3473 break;
3474 }
3475
3476 // repeated string saved_model_exported_names = 23;
3477 case 23: {
3478 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (186 & 0xFF)) {
3479 DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadString(
3480 input, this->add_saved_model_exported_names()));
3481 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
3482 this->saved_model_exported_names(this->saved_model_exported_names_size() - 1).data(),
3483 static_cast<int>(this->saved_model_exported_names(this->saved_model_exported_names_size() - 1).length()),
3484 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::PARSE,
3485 "toco.ModelFlags.saved_model_exported_names");
3486 } else {
3487 goto handle_unusual;
3488 }
3489 break;
3490 }
3491
3492 // repeated string control_output_arrays = 24;
3493 case 24: {
3494 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (194 & 0xFF)) {
3495 DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadString(
3496 input, this->add_control_output_arrays()));
3497 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
3498 this->control_output_arrays(this->control_output_arrays_size() - 1).data(),
3499 static_cast<int>(this->control_output_arrays(this->control_output_arrays_size() - 1).length()),
3500 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::PARSE,
3501 "toco.ModelFlags.control_output_arrays");
3502 } else {
3503 goto handle_unusual;
3504 }
3505 break;
3506 }
3507
3508 // optional bool use_hlo_import = 25;
3509 case 25: {
3510 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (200 & 0xFF)) {
3511 _Internal::set_has_use_hlo_import(&_has_bits_);
3512 DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
3513 bool, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_BOOL>(
3514 input, &use_hlo_import_)));
3515 } else {
3516 goto handle_unusual;
3517 }
3518 break;
3519 }
3520
3521 // optional .toco.ModelFlags.HloFileType hlo_file_type = 26;
3522 case 26: {
3523 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (208 & 0xFF)) {
3524 int value = 0;
3525 DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
3526 int, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_ENUM>(
3527 input, &value)));
3528 if (::toco::ModelFlags_HloFileType_IsValid(value)) {
3529 set_hlo_file_type(static_cast< ::toco::ModelFlags_HloFileType >(value));
3530 } else {
3531 mutable_unknown_fields()->AddVarint(
3532 26, static_cast<::PROTOBUF_NAMESPACE_ID::uint64>(value));
3533 }
3534 } else {
3535 goto handle_unusual;
3536 }
3537 break;
3538 }
3539
3540 default: {
3541 handle_unusual:
3542 if (tag == 0) {
3543 goto success;
3544 }
3545 DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SkipField(
3546 input, tag, _internal_metadata_.mutable_unknown_fields()));
3547 break;
3548 }
3549 }
3550 }
3551success:
3552 // @@protoc_insertion_point(parse_success:toco.ModelFlags)
3553 return true;
3554failure:
3555 // @@protoc_insertion_point(parse_failure:toco.ModelFlags)
3556 return false;
3557#undef DO_
3558}
3559#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
3560
3561void ModelFlags::SerializeWithCachedSizes(
3562 ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const {
3563 // @@protoc_insertion_point(serialize_start:toco.ModelFlags)
3564 ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
3565 (void) cached_has_bits;
3566
3567 // repeated .toco.InputArray input_arrays = 1;
3568 for (unsigned int i = 0,
3569 n = static_cast<unsigned int>(this->input_arrays_size()); i < n; i++) {
3570 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray(
3571 1,
3572 this->input_arrays(static_cast<int>(i)),
3573 output);
3574 }
3575
3576 // repeated string output_arrays = 2;
3577 for (int i = 0, n = this->output_arrays_size(); i < n; i++) {
3578 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
3579 this->output_arrays(i).data(), static_cast<int>(this->output_arrays(i).length()),
3580 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
3581 "toco.ModelFlags.output_arrays");
3582 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteString(
3583 2, this->output_arrays(i), output);
3584 }
3585
3586 cached_has_bits = _has_bits_[0];
3587 // optional bool variable_batch = 10;
3588 if (cached_has_bits & 0x00000008u) {
3589 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBool(10, this->variable_batch(), output);
3590 }
3591
3592 // repeated .toco.RnnState rnn_states = 12;
3593 for (unsigned int i = 0,
3594 n = static_cast<unsigned int>(this->rnn_states_size()); i < n; i++) {
3595 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray(
3596 12,
3597 this->rnn_states(static_cast<int>(i)),
3598 output);
3599 }
3600
3601 // repeated .toco.ModelFlags.ModelCheck model_checks = 14;
3602 for (unsigned int i = 0,
3603 n = static_cast<unsigned int>(this->model_checks_size()); i < n; i++) {
3604 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray(
3605 14,
3606 this->model_checks(static_cast<int>(i)),
3607 output);
3608 }
3609
3610 // optional bool allow_nonexistent_arrays = 16;
3611 if (cached_has_bits & 0x00000010u) {
3612 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBool(16, this->allow_nonexistent_arrays(), output);
3613 }
3614
3615 // optional bool allow_nonascii_arrays = 17;
3616 if (cached_has_bits & 0x00000020u) {
3617 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBool(17, this->allow_nonascii_arrays(), output);
3618 }
3619
3620 // optional .toco.ArraysExtraInfo arrays_extra_info = 18;
3621 if (cached_has_bits & 0x00000002u) {
3622 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray(
3623 18, _Internal::arrays_extra_info(this), output);
3624 }
3625
3626 // optional bool change_concat_input_ranges = 19 [default = true];
3627 if (cached_has_bits & 0x00000100u) {
3628 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBool(19, this->change_concat_input_ranges(), output);
3629 }
3630
3631 // optional string saved_model_dir = 20;
3632 if (cached_has_bits & 0x00000001u) {
3633 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
3634 this->saved_model_dir().data(), static_cast<int>(this->saved_model_dir().length()),
3635 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
3636 "toco.ModelFlags.saved_model_dir");
3637 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringMaybeAliased(
3638 20, this->saved_model_dir(), output);
3639 }
3640
3641 // optional int32 saved_model_version = 21;
3642 if (cached_has_bits & 0x00000080u) {
3643 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32(21, this->saved_model_version(), output);
3644 }
3645
3646 // repeated string saved_model_tags = 22;
3647 for (int i = 0, n = this->saved_model_tags_size(); i < n; i++) {
3648 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
3649 this->saved_model_tags(i).data(), static_cast<int>(this->saved_model_tags(i).length()),
3650 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
3651 "toco.ModelFlags.saved_model_tags");
3652 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteString(
3653 22, this->saved_model_tags(i), output);
3654 }
3655
3656 // repeated string saved_model_exported_names = 23;
3657 for (int i = 0, n = this->saved_model_exported_names_size(); i < n; i++) {
3658 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
3659 this->saved_model_exported_names(i).data(), static_cast<int>(this->saved_model_exported_names(i).length()),
3660 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
3661 "toco.ModelFlags.saved_model_exported_names");
3662 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteString(
3663 23, this->saved_model_exported_names(i), output);
3664 }
3665
3666 // repeated string control_output_arrays = 24;
3667 for (int i = 0, n = this->control_output_arrays_size(); i < n; i++) {
3668 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
3669 this->control_output_arrays(i).data(), static_cast<int>(this->control_output_arrays(i).length()),
3670 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
3671 "toco.ModelFlags.control_output_arrays");
3672 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteString(
3673 24, this->control_output_arrays(i), output);
3674 }
3675
3676 // optional bool use_hlo_import = 25;
3677 if (cached_has_bits & 0x00000040u) {
3678 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBool(25, this->use_hlo_import(), output);
3679 }
3680
3681 // optional .toco.ModelFlags.HloFileType hlo_file_type = 26;
3682 if (cached_has_bits & 0x00000004u) {
3683 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnum(
3684 26, this->hlo_file_type(), output);
3685 }
3686
3687 if (_internal_metadata_.have_unknown_fields()) {
3688 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields(
3689 _internal_metadata_.unknown_fields(), output);
3690 }
3691 // @@protoc_insertion_point(serialize_end:toco.ModelFlags)
3692}
3693
3694::PROTOBUF_NAMESPACE_ID::uint8* ModelFlags::InternalSerializeWithCachedSizesToArray(
3695 ::PROTOBUF_NAMESPACE_ID::uint8* target) const {
3696 // @@protoc_insertion_point(serialize_to_array_start:toco.ModelFlags)
3697 ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
3698 (void) cached_has_bits;
3699
3700 // repeated .toco.InputArray input_arrays = 1;
3701 for (unsigned int i = 0,
3702 n = static_cast<unsigned int>(this->input_arrays_size()); i < n; i++) {
3703 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
3704 InternalWriteMessageToArray(
3705 1, this->input_arrays(static_cast<int>(i)), target);
3706 }
3707
3708 // repeated string output_arrays = 2;
3709 for (int i = 0, n = this->output_arrays_size(); i < n; i++) {
3710 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
3711 this->output_arrays(i).data(), static_cast<int>(this->output_arrays(i).length()),
3712 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
3713 "toco.ModelFlags.output_arrays");
3714 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
3715 WriteStringToArray(2, this->output_arrays(i), target);
3716 }
3717
3718 cached_has_bits = _has_bits_[0];
3719 // optional bool variable_batch = 10;
3720 if (cached_has_bits & 0x00000008u) {
3721 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(10, this->variable_batch(), target);
3722 }
3723
3724 // repeated .toco.RnnState rnn_states = 12;
3725 for (unsigned int i = 0,
3726 n = static_cast<unsigned int>(this->rnn_states_size()); i < n; i++) {
3727 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
3728 InternalWriteMessageToArray(
3729 12, this->rnn_states(static_cast<int>(i)), target);
3730 }
3731
3732 // repeated .toco.ModelFlags.ModelCheck model_checks = 14;
3733 for (unsigned int i = 0,
3734 n = static_cast<unsigned int>(this->model_checks_size()); i < n; i++) {
3735 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
3736 InternalWriteMessageToArray(
3737 14, this->model_checks(static_cast<int>(i)), target);
3738 }
3739
3740 // optional bool allow_nonexistent_arrays = 16;
3741 if (cached_has_bits & 0x00000010u) {
3742 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(16, this->allow_nonexistent_arrays(), target);
3743 }
3744
3745 // optional bool allow_nonascii_arrays = 17;
3746 if (cached_has_bits & 0x00000020u) {
3747 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(17, this->allow_nonascii_arrays(), target);
3748 }
3749
3750 // optional .toco.ArraysExtraInfo arrays_extra_info = 18;
3751 if (cached_has_bits & 0x00000002u) {
3752 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
3753 InternalWriteMessageToArray(
3754 18, _Internal::arrays_extra_info(this), target);
3755 }
3756
3757 // optional bool change_concat_input_ranges = 19 [default = true];
3758 if (cached_has_bits & 0x00000100u) {
3759 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(19, this->change_concat_input_ranges(), target);
3760 }
3761
3762 // optional string saved_model_dir = 20;
3763 if (cached_has_bits & 0x00000001u) {
3764 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
3765 this->saved_model_dir().data(), static_cast<int>(this->saved_model_dir().length()),
3766 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
3767 "toco.ModelFlags.saved_model_dir");
3768 target =
3769 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringToArray(
3770 20, this->saved_model_dir(), target);
3771 }
3772
3773 // optional int32 saved_model_version = 21;
3774 if (cached_has_bits & 0x00000080u) {
3775 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(21, this->saved_model_version(), target);
3776 }
3777
3778 // repeated string saved_model_tags = 22;
3779 for (int i = 0, n = this->saved_model_tags_size(); i < n; i++) {
3780 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
3781 this->saved_model_tags(i).data(), static_cast<int>(this->saved_model_tags(i).length()),
3782 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
3783 "toco.ModelFlags.saved_model_tags");
3784 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
3785 WriteStringToArray(22, this->saved_model_tags(i), target);
3786 }
3787
3788 // repeated string saved_model_exported_names = 23;
3789 for (int i = 0, n = this->saved_model_exported_names_size(); i < n; i++) {
3790 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
3791 this->saved_model_exported_names(i).data(), static_cast<int>(this->saved_model_exported_names(i).length()),
3792 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
3793 "toco.ModelFlags.saved_model_exported_names");
3794 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
3795 WriteStringToArray(23, this->saved_model_exported_names(i), target);
3796 }
3797
3798 // repeated string control_output_arrays = 24;
3799 for (int i = 0, n = this->control_output_arrays_size(); i < n; i++) {
3800 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
3801 this->control_output_arrays(i).data(), static_cast<int>(this->control_output_arrays(i).length()),
3802 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
3803 "toco.ModelFlags.control_output_arrays");
3804 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
3805 WriteStringToArray(24, this->control_output_arrays(i), target);
3806 }
3807
3808 // optional bool use_hlo_import = 25;
3809 if (cached_has_bits & 0x00000040u) {
3810 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(25, this->use_hlo_import(), target);
3811 }
3812
3813 // optional .toco.ModelFlags.HloFileType hlo_file_type = 26;
3814 if (cached_has_bits & 0x00000004u) {
3815 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
3816 26, this->hlo_file_type(), target);
3817 }
3818
3819 if (_internal_metadata_.have_unknown_fields()) {
3820 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray(
3821 _internal_metadata_.unknown_fields(), target);
3822 }
3823 // @@protoc_insertion_point(serialize_to_array_end:toco.ModelFlags)
3824 return target;
3825}
3826
3827size_t ModelFlags::ByteSizeLong() const {
3828// @@protoc_insertion_point(message_byte_size_start:toco.ModelFlags)
3829 size_t total_size = 0;
3830
3831 if (_internal_metadata_.have_unknown_fields()) {
3832 total_size +=
3833 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::ComputeUnknownFieldsSize(
3834 _internal_metadata_.unknown_fields());
3835 }
3836 ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
3837 // Prevent compiler warnings about cached_has_bits being unused
3838 (void) cached_has_bits;
3839
3840 // repeated .toco.InputArray input_arrays = 1;
3841 {
3842 unsigned int count = static_cast<unsigned int>(this->input_arrays_size());
3843 total_size += 1UL * count;
3844 for (unsigned int i = 0; i < count; i++) {
3845 total_size +=
3846 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
3847 this->input_arrays(static_cast<int>(i)));
3848 }
3849 }
3850
3851 // repeated string output_arrays = 2;
3852 total_size += 1 *
3853 ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(this->output_arrays_size());
3854 for (int i = 0, n = this->output_arrays_size(); i < n; i++) {
3855 total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
3856 this->output_arrays(i));
3857 }
3858
3859 // repeated .toco.RnnState rnn_states = 12;
3860 {
3861 unsigned int count = static_cast<unsigned int>(this->rnn_states_size());
3862 total_size += 1UL * count;
3863 for (unsigned int i = 0; i < count; i++) {
3864 total_size +=
3865 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
3866 this->rnn_states(static_cast<int>(i)));
3867 }
3868 }
3869
3870 // repeated .toco.ModelFlags.ModelCheck model_checks = 14;
3871 {
3872 unsigned int count = static_cast<unsigned int>(this->model_checks_size());
3873 total_size += 1UL * count;
3874 for (unsigned int i = 0; i < count; i++) {
3875 total_size +=
3876 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
3877 this->model_checks(static_cast<int>(i)));
3878 }
3879 }
3880
3881 // repeated string saved_model_tags = 22;
3882 total_size += 2 *
3883 ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(this->saved_model_tags_size());
3884 for (int i = 0, n = this->saved_model_tags_size(); i < n; i++) {
3885 total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
3886 this->saved_model_tags(i));
3887 }
3888
3889 // repeated string saved_model_exported_names = 23;
3890 total_size += 2 *
3891 ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(this->saved_model_exported_names_size());
3892 for (int i = 0, n = this->saved_model_exported_names_size(); i < n; i++) {
3893 total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
3894 this->saved_model_exported_names(i));
3895 }
3896
3897 // repeated string control_output_arrays = 24;
3898 total_size += 2 *
3899 ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(this->control_output_arrays_size());
3900 for (int i = 0, n = this->control_output_arrays_size(); i < n; i++) {
3901 total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
3902 this->control_output_arrays(i));
3903 }
3904
3905 cached_has_bits = _has_bits_[0];
3906 if (cached_has_bits & 0x000000ffu) {
3907 // optional string saved_model_dir = 20;
3908 if (cached_has_bits & 0x00000001u) {
3909 total_size += 2 +
3910 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
3911 this->saved_model_dir());
3912 }
3913
3914 // optional .toco.ArraysExtraInfo arrays_extra_info = 18;
3915 if (cached_has_bits & 0x00000002u) {
3916 total_size += 2 +
3917 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
3918 *arrays_extra_info_);
3919 }
3920
3921 // optional .toco.ModelFlags.HloFileType hlo_file_type = 26;
3922 if (cached_has_bits & 0x00000004u) {
3923 total_size += 2 +
3924 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->hlo_file_type());
3925 }
3926
3927 // optional bool variable_batch = 10;
3928 if (cached_has_bits & 0x00000008u) {
3929 total_size += 1 + 1;
3930 }
3931
3932 // optional bool allow_nonexistent_arrays = 16;
3933 if (cached_has_bits & 0x00000010u) {
3934 total_size += 2 + 1;
3935 }
3936
3937 // optional bool allow_nonascii_arrays = 17;
3938 if (cached_has_bits & 0x00000020u) {
3939 total_size += 2 + 1;
3940 }
3941
3942 // optional bool use_hlo_import = 25;
3943 if (cached_has_bits & 0x00000040u) {
3944 total_size += 2 + 1;
3945 }
3946
3947 // optional int32 saved_model_version = 21;
3948 if (cached_has_bits & 0x00000080u) {
3949 total_size += 2 +
3950 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
3951 this->saved_model_version());
3952 }
3953
3954 }
3955 // optional bool change_concat_input_ranges = 19 [default = true];
3956 if (cached_has_bits & 0x00000100u) {
3957 total_size += 2 + 1;
3958 }
3959
3960 int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
3961 SetCachedSize(cached_size);
3962 return total_size;
3963}
3964
3965void ModelFlags::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
3966// @@protoc_insertion_point(generalized_merge_from_start:toco.ModelFlags)
3967 GOOGLE_DCHECK_NE(&from, this);
3968 const ModelFlags* source =
3969 ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<ModelFlags>(
3970 &from);
3971 if (source == nullptr) {
3972 // @@protoc_insertion_point(generalized_merge_from_cast_fail:toco.ModelFlags)
3973 ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
3974 } else {
3975 // @@protoc_insertion_point(generalized_merge_from_cast_success:toco.ModelFlags)
3976 MergeFrom(*source);
3977 }
3978}
3979
3980void ModelFlags::MergeFrom(const ModelFlags& from) {
3981// @@protoc_insertion_point(class_specific_merge_from_start:toco.ModelFlags)
3982 GOOGLE_DCHECK_NE(&from, this);
3983 _internal_metadata_.MergeFrom(from._internal_metadata_);
3984 ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
3985 (void) cached_has_bits;
3986
3987 input_arrays_.MergeFrom(from.input_arrays_);
3988 output_arrays_.MergeFrom(from.output_arrays_);
3989 rnn_states_.MergeFrom(from.rnn_states_);
3990 model_checks_.MergeFrom(from.model_checks_);
3991 saved_model_tags_.MergeFrom(from.saved_model_tags_);
3992 saved_model_exported_names_.MergeFrom(from.saved_model_exported_names_);
3993 control_output_arrays_.MergeFrom(from.control_output_arrays_);
3994 cached_has_bits = from._has_bits_[0];
3995 if (cached_has_bits & 0x000000ffu) {
3996 if (cached_has_bits & 0x00000001u) {
3997 _has_bits_[0] |= 0x00000001u;
3998 saved_model_dir_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.saved_model_dir_);
3999 }
4000 if (cached_has_bits & 0x00000002u) {
4001 mutable_arrays_extra_info()->::toco::ArraysExtraInfo::MergeFrom(from.arrays_extra_info());
4002 }
4003 if (cached_has_bits & 0x00000004u) {
4004 hlo_file_type_ = from.hlo_file_type_;
4005 }
4006 if (cached_has_bits & 0x00000008u) {
4007 variable_batch_ = from.variable_batch_;
4008 }
4009 if (cached_has_bits & 0x00000010u) {
4010 allow_nonexistent_arrays_ = from.allow_nonexistent_arrays_;
4011 }
4012 if (cached_has_bits & 0x00000020u) {
4013 allow_nonascii_arrays_ = from.allow_nonascii_arrays_;
4014 }
4015 if (cached_has_bits & 0x00000040u) {
4016 use_hlo_import_ = from.use_hlo_import_;
4017 }
4018 if (cached_has_bits & 0x00000080u) {
4019 saved_model_version_ = from.saved_model_version_;
4020 }
4021 _has_bits_[0] |= cached_has_bits;
4022 }
4023 if (cached_has_bits & 0x00000100u) {
4024 set_change_concat_input_ranges(from.change_concat_input_ranges());
4025 }
4026}
4027
4028void ModelFlags::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
4029// @@protoc_insertion_point(generalized_copy_from_start:toco.ModelFlags)
4030 if (&from == this) return;
4031 Clear();
4032 MergeFrom(from);
4033}
4034
4035void ModelFlags::CopyFrom(const ModelFlags& from) {
4036// @@protoc_insertion_point(class_specific_copy_from_start:toco.ModelFlags)
4037 if (&from == this) return;
4038 Clear();
4039 MergeFrom(from);
4040}
4041
4042bool ModelFlags::IsInitialized() const {
4043 return true;
4044}
4045
4046void ModelFlags::InternalSwap(ModelFlags* other) {
4047 using std::swap;
4048 _internal_metadata_.Swap(&other->_internal_metadata_);
4049 swap(_has_bits_[0], other->_has_bits_[0]);
4050 CastToBase(&input_arrays_)->InternalSwap(CastToBase(&other->input_arrays_));
4051 output_arrays_.InternalSwap(CastToBase(&other->output_arrays_));
4052 CastToBase(&rnn_states_)->InternalSwap(CastToBase(&other->rnn_states_));
4053 CastToBase(&model_checks_)->InternalSwap(CastToBase(&other->model_checks_));
4054 saved_model_tags_.InternalSwap(CastToBase(&other->saved_model_tags_));
4055 saved_model_exported_names_.InternalSwap(CastToBase(&other->saved_model_exported_names_));
4056 control_output_arrays_.InternalSwap(CastToBase(&other->control_output_arrays_));
4057 saved_model_dir_.Swap(&other->saved_model_dir_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
4058 GetArenaNoVirtual());
4059 swap(arrays_extra_info_, other->arrays_extra_info_);
4060 swap(hlo_file_type_, other->hlo_file_type_);
4061 swap(variable_batch_, other->variable_batch_);
4062 swap(allow_nonexistent_arrays_, other->allow_nonexistent_arrays_);
4063 swap(allow_nonascii_arrays_, other->allow_nonascii_arrays_);
4064 swap(use_hlo_import_, other->use_hlo_import_);
4065 swap(saved_model_version_, other->saved_model_version_);
4066 swap(change_concat_input_ranges_, other->change_concat_input_ranges_);
4067}
4068
4069::PROTOBUF_NAMESPACE_ID::Metadata ModelFlags::GetMetadata() const {
4070 return GetMetadataStatic();
4071}
4072
4073
4074// @@protoc_insertion_point(namespace_scope)
4075} // namespace toco
4076PROTOBUF_NAMESPACE_OPEN
4077template<> PROTOBUF_NOINLINE ::toco::InputArrayShape* Arena::CreateMaybeMessage< ::toco::InputArrayShape >(Arena* arena) {
4078 return Arena::CreateInternal< ::toco::InputArrayShape >(arena);
4079}
4080template<> PROTOBUF_NOINLINE ::toco::InputArray* Arena::CreateMaybeMessage< ::toco::InputArray >(Arena* arena) {
4081 return Arena::CreateInternal< ::toco::InputArray >(arena);
4082}
4083template<> PROTOBUF_NOINLINE ::toco::RnnState* Arena::CreateMaybeMessage< ::toco::RnnState >(Arena* arena) {
4084 return Arena::CreateInternal< ::toco::RnnState >(arena);
4085}
4086template<> PROTOBUF_NOINLINE ::toco::ArraysExtraInfo_Entry* Arena::CreateMaybeMessage< ::toco::ArraysExtraInfo_Entry >(Arena* arena) {
4087 return Arena::CreateInternal< ::toco::ArraysExtraInfo_Entry >(arena);
4088}
4089template<> PROTOBUF_NOINLINE ::toco::ArraysExtraInfo* Arena::CreateMaybeMessage< ::toco::ArraysExtraInfo >(Arena* arena) {
4090 return Arena::CreateInternal< ::toco::ArraysExtraInfo >(arena);
4091}
4092template<> PROTOBUF_NOINLINE ::toco::ModelFlags_ModelCheck* Arena::CreateMaybeMessage< ::toco::ModelFlags_ModelCheck >(Arena* arena) {
4093 return Arena::CreateInternal< ::toco::ModelFlags_ModelCheck >(arena);
4094}
4095template<> PROTOBUF_NOINLINE ::toco::ModelFlags* Arena::CreateMaybeMessage< ::toco::ModelFlags >(Arena* arena) {
4096 return Arena::CreateInternal< ::toco::ModelFlags >(arena);
4097}
4098PROTOBUF_NAMESPACE_CLOSE
4099
4100// @@protoc_insertion_point(global_scope)
4101#include <google/protobuf/port_undef.inc>
4102