1// Generated by the protocol buffer compiler. DO NOT EDIT!
2// source: tensorflow/lite/toco/toco_flags.proto
3
4#include "tensorflow/lite/toco/toco_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>
18namespace toco {
19class TocoFlagsDefaultTypeInternal {
20 public:
21 ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<TocoFlags> _instance;
22} _TocoFlags_default_instance_;
23} // namespace toco
24static void InitDefaultsscc_info_TocoFlags_tensorflow_2flite_2ftoco_2ftoco_5fflags_2eproto() {
25 GOOGLE_PROTOBUF_VERIFY_VERSION;
26
27 {
28 void* ptr = &::toco::_TocoFlags_default_instance_;
29 new (ptr) ::toco::TocoFlags();
30 ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
31 }
32 ::toco::TocoFlags::InitAsDefaultInstance();
33}
34
35::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_TocoFlags_tensorflow_2flite_2ftoco_2ftoco_5fflags_2eproto =
36 {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsscc_info_TocoFlags_tensorflow_2flite_2ftoco_2ftoco_5fflags_2eproto}, {}};
37
38static ::PROTOBUF_NAMESPACE_ID::Metadata file_level_metadata_tensorflow_2flite_2ftoco_2ftoco_5fflags_2eproto[1];
39static const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* file_level_enum_descriptors_tensorflow_2flite_2ftoco_2ftoco_5fflags_2eproto[1];
40static constexpr ::PROTOBUF_NAMESPACE_ID::ServiceDescriptor const** file_level_service_descriptors_tensorflow_2flite_2ftoco_2ftoco_5fflags_2eproto = nullptr;
41
42const ::PROTOBUF_NAMESPACE_ID::uint32 TableStruct_tensorflow_2flite_2ftoco_2ftoco_5fflags_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
43 PROTOBUF_FIELD_OFFSET(::toco::TocoFlags, _has_bits_),
44 PROTOBUF_FIELD_OFFSET(::toco::TocoFlags, _internal_metadata_),
45 ~0u, // no _extensions_
46 ~0u, // no _oneof_case_
47 ~0u, // no _weak_field_map_
48 PROTOBUF_FIELD_OFFSET(::toco::TocoFlags, input_format_),
49 PROTOBUF_FIELD_OFFSET(::toco::TocoFlags, output_format_),
50 PROTOBUF_FIELD_OFFSET(::toco::TocoFlags, inference_input_type_),
51 PROTOBUF_FIELD_OFFSET(::toco::TocoFlags, inference_type_),
52 PROTOBUF_FIELD_OFFSET(::toco::TocoFlags, default_ranges_min_),
53 PROTOBUF_FIELD_OFFSET(::toco::TocoFlags, default_ranges_max_),
54 PROTOBUF_FIELD_OFFSET(::toco::TocoFlags, default_int16_ranges_min_),
55 PROTOBUF_FIELD_OFFSET(::toco::TocoFlags, default_int16_ranges_max_),
56 PROTOBUF_FIELD_OFFSET(::toco::TocoFlags, drop_fake_quant_),
57 PROTOBUF_FIELD_OFFSET(::toco::TocoFlags, reorder_across_fake_quant_),
58 PROTOBUF_FIELD_OFFSET(::toco::TocoFlags, allow_custom_ops_),
59 PROTOBUF_FIELD_OFFSET(::toco::TocoFlags, drop_control_dependency_),
60 PROTOBUF_FIELD_OFFSET(::toco::TocoFlags, debug_disable_recurrent_cell_fusion_),
61 PROTOBUF_FIELD_OFFSET(::toco::TocoFlags, propagate_fake_quant_num_bits_),
62 PROTOBUF_FIELD_OFFSET(::toco::TocoFlags, allow_nudging_weights_to_use_fast_gemm_kernel_),
63 PROTOBUF_FIELD_OFFSET(::toco::TocoFlags, dedupe_array_min_size_bytes_),
64 PROTOBUF_FIELD_OFFSET(::toco::TocoFlags, split_tflite_lstm_inputs_),
65 PROTOBUF_FIELD_OFFSET(::toco::TocoFlags, quantize_weights_),
66 PROTOBUF_FIELD_OFFSET(::toco::TocoFlags, dump_graphviz_dir_),
67 PROTOBUF_FIELD_OFFSET(::toco::TocoFlags, dump_graphviz_include_video_),
68 PROTOBUF_FIELD_OFFSET(::toco::TocoFlags, post_training_quantize_),
69 PROTOBUF_FIELD_OFFSET(::toco::TocoFlags, enable_select_tf_ops_),
70 PROTOBUF_FIELD_OFFSET(::toco::TocoFlags, force_select_tf_ops_),
71 PROTOBUF_FIELD_OFFSET(::toco::TocoFlags, quantize_to_float16_),
72 PROTOBUF_FIELD_OFFSET(::toco::TocoFlags, allow_dynamic_tensors_),
73 PROTOBUF_FIELD_OFFSET(::toco::TocoFlags, conversion_summary_dir_),
74 PROTOBUF_FIELD_OFFSET(::toco::TocoFlags, custom_opdefs_),
75 PROTOBUF_FIELD_OFFSET(::toco::TocoFlags, select_user_tf_ops_),
76 PROTOBUF_FIELD_OFFSET(::toco::TocoFlags, enable_tflite_resource_variables_),
77 PROTOBUF_FIELD_OFFSET(::toco::TocoFlags, unfold_batchmatmul_),
78 PROTOBUF_FIELD_OFFSET(::toco::TocoFlags, lower_tensor_list_ops_),
79 PROTOBUF_FIELD_OFFSET(::toco::TocoFlags, accumulation_type_),
80 PROTOBUF_FIELD_OFFSET(::toco::TocoFlags, allow_bfloat16_),
81 PROTOBUF_FIELD_OFFSET(::toco::TocoFlags, allow_all_select_tf_ops_),
82 PROTOBUF_FIELD_OFFSET(::toco::TocoFlags, unfold_large_splat_constant_),
83 PROTOBUF_FIELD_OFFSET(::toco::TocoFlags, supported_backends_),
84 PROTOBUF_FIELD_OFFSET(::toco::TocoFlags, default_to_single_batch_in_tensor_list_ops_),
85 PROTOBUF_FIELD_OFFSET(::toco::TocoFlags, disable_per_channel_quantization_),
86 PROTOBUF_FIELD_OFFSET(::toco::TocoFlags, enable_mlir_dynamic_range_quantizer_),
87 PROTOBUF_FIELD_OFFSET(::toco::TocoFlags, tf_quantization_mode_),
88 PROTOBUF_FIELD_OFFSET(::toco::TocoFlags, disable_infer_tensor_range_),
89 PROTOBUF_FIELD_OFFSET(::toco::TocoFlags, use_fake_quant_num_bits_),
90 PROTOBUF_FIELD_OFFSET(::toco::TocoFlags, enable_dynamic_update_slice_),
91 PROTOBUF_FIELD_OFFSET(::toco::TocoFlags, preserve_assert_op_),
92 PROTOBUF_FIELD_OFFSET(::toco::TocoFlags, guarantee_all_funcs_one_use_),
93 3,
94 4,
95 12,
96 5,
97 6,
98 7,
99 13,
100 14,
101 8,
102 9,
103 10,
104 11,
105 15,
106 16,
107 17,
108 36,
109 37,
110 18,
111 0,
112 19,
113 20,
114 21,
115 22,
116 23,
117 38,
118 1,
119 ~0u,
120 ~0u,
121 39,
122 40,
123 41,
124 27,
125 24,
126 25,
127 26,
128 ~0u,
129 28,
130 29,
131 30,
132 2,
133 31,
134 32,
135 33,
136 34,
137 35,
138};
139static const ::PROTOBUF_NAMESPACE_ID::internal::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
140 { 0, 50, sizeof(::toco::TocoFlags)},
141};
142
143static ::PROTOBUF_NAMESPACE_ID::Message const * const file_default_instances[] = {
144 reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::toco::_TocoFlags_default_instance_),
145};
146
147const char descriptor_table_protodef_tensorflow_2flite_2ftoco_2ftoco_5fflags_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) =
148 "\n%tensorflow/lite/toco/toco_flags.proto\022"
149 "\004toco\032 tensorflow/lite/toco/types.proto\""
150 "\256\r\n\tTocoFlags\022&\n\014input_format\030\001 \001(\0162\020.to"
151 "co.FileFormat\022\'\n\routput_format\030\002 \001(\0162\020.t"
152 "oco.FileFormat\022.\n\024inference_input_type\030\013"
153 " \001(\0162\020.toco.IODataType\022(\n\016inference_type"
154 "\030\004 \001(\0162\020.toco.IODataType\022\032\n\022default_rang"
155 "es_min\030\005 \001(\002\022\032\n\022default_ranges_max\030\006 \001(\002"
156 "\022 \n\030default_int16_ranges_min\030\017 \001(\002\022 \n\030de"
157 "fault_int16_ranges_max\030\020 \001(\002\022\027\n\017drop_fak"
158 "e_quant\030\007 \001(\010\022!\n\031reorder_across_fake_qua"
159 "nt\030\010 \001(\010\022\030\n\020allow_custom_ops\030\n \001(\010\022\037\n\027dr"
160 "op_control_dependency\030\014 \001(\010\022+\n#debug_dis"
161 "able_recurrent_cell_fusion\030\r \001(\010\022%\n\035prop"
162 "agate_fake_quant_num_bits\030\016 \001(\010\0225\n-allow"
163 "_nudging_weights_to_use_fast_gemm_kernel"
164 "\030\021 \001(\010\022\'\n\033dedupe_array_min_size_bytes\030\022 "
165 "\001(\003:\00264\022&\n\030split_tflite_lstm_inputs\030\023 \001("
166 "\010:\004true\022\037\n\020quantize_weights\030\024 \001(\010:\005false"
167 "\022\031\n\021dump_graphviz_dir\030\030 \001(\t\022#\n\033dump_grap"
168 "hviz_include_video\030\031 \001(\010\022%\n\026post_trainin"
169 "g_quantize\030\032 \001(\010:\005false\022#\n\024enable_select"
170 "_tf_ops\030\033 \001(\010:\005false\022\"\n\023force_select_tf_"
171 "ops\030\034 \001(\010:\005false\022\"\n\023quantize_to_float16\030"
172 "\035 \001(\010:\005false\022#\n\025allow_dynamic_tensors\030\036 "
173 "\001(\010:\004true\022\036\n\026conversion_summary_dir\030\037 \001("
174 "\t\022\031\n\rcustom_opdefs\030 \003(\tB\002\030\001\022\032\n\022select_u"
175 "ser_tf_ops\030! \003(\t\022.\n enable_tflite_resour"
176 "ce_variables\030\" \001(\010:\004true\022 \n\022unfold_batch"
177 "matmul\030# \001(\010:\004true\022#\n\025lower_tensor_list_"
178 "ops\030$ \001(\010:\004true\022+\n\021accumulation_type\030% \001"
179 "(\0162\020.toco.IODataType\022\035\n\016allow_bfloat16\030&"
180 " \001(\010:\005false\022\037\n\027allow_all_select_tf_ops\030\'"
181 " \001(\010\022*\n\033unfold_large_splat_constant\030( \001("
182 "\010:\005false\022\032\n\022supported_backends\030) \003(\t\0229\n*"
183 "default_to_single_batch_in_tensor_list_o"
184 "ps\030* \001(\010:\005false\022/\n disable_per_channel_q"
185 "uantization\030+ \001(\010:\005false\0222\n#enable_mlir_"
186 "dynamic_range_quantizer\030, \001(\010:\005false\022\034\n\024"
187 "tf_quantization_mode\030- \001(\t\022)\n\032disable_in"
188 "fer_tensor_range\030. \001(\010:\005false\022&\n\027use_fak"
189 "e_quant_num_bits\030/ \001(\010:\005false\022*\n\033enable_"
190 "dynamic_update_slice\0300 \001(\010:\005false\022!\n\022pre"
191 "serve_assert_op\0301 \001(\010:\005false\022*\n\033guarante"
192 "e_all_funcs_one_use\0302 \001(\010:\005false*\\\n\nFile"
193 "Format\022\027\n\023FILE_FORMAT_UNKNOWN\020\000\022\027\n\023TENSO"
194 "RFLOW_GRAPHDEF\020\001\022\n\n\006TFLITE\020\002\022\020\n\014GRAPHVIZ"
195 "_DOT\020\003"
196 ;
197static const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable*const descriptor_table_tensorflow_2flite_2ftoco_2ftoco_5fflags_2eproto_deps[1] = {
198 &::descriptor_table_tensorflow_2flite_2ftoco_2ftypes_2eproto,
199};
200static ::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase*const descriptor_table_tensorflow_2flite_2ftoco_2ftoco_5fflags_2eproto_sccs[1] = {
201 &scc_info_TocoFlags_tensorflow_2flite_2ftoco_2ftoco_5fflags_2eproto.base,
202};
203static ::PROTOBUF_NAMESPACE_ID::internal::once_flag descriptor_table_tensorflow_2flite_2ftoco_2ftoco_5fflags_2eproto_once;
204static bool descriptor_table_tensorflow_2flite_2ftoco_2ftoco_5fflags_2eproto_initialized = false;
205const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_tensorflow_2flite_2ftoco_2ftoco_5fflags_2eproto = {
206 &descriptor_table_tensorflow_2flite_2ftoco_2ftoco_5fflags_2eproto_initialized, descriptor_table_protodef_tensorflow_2flite_2ftoco_2ftoco_5fflags_2eproto, "tensorflow/lite/toco/toco_flags.proto", 1886,
207 &descriptor_table_tensorflow_2flite_2ftoco_2ftoco_5fflags_2eproto_once, descriptor_table_tensorflow_2flite_2ftoco_2ftoco_5fflags_2eproto_sccs, descriptor_table_tensorflow_2flite_2ftoco_2ftoco_5fflags_2eproto_deps, 1, 1,
208 schemas, file_default_instances, TableStruct_tensorflow_2flite_2ftoco_2ftoco_5fflags_2eproto::offsets,
209 file_level_metadata_tensorflow_2flite_2ftoco_2ftoco_5fflags_2eproto, 1, file_level_enum_descriptors_tensorflow_2flite_2ftoco_2ftoco_5fflags_2eproto, file_level_service_descriptors_tensorflow_2flite_2ftoco_2ftoco_5fflags_2eproto,
210};
211
212// Force running AddDescriptors() at dynamic initialization time.
213static bool dynamic_init_dummy_tensorflow_2flite_2ftoco_2ftoco_5fflags_2eproto = ( ::PROTOBUF_NAMESPACE_ID::internal::AddDescriptors(&descriptor_table_tensorflow_2flite_2ftoco_2ftoco_5fflags_2eproto), true);
214namespace toco {
215const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* FileFormat_descriptor() {
216 ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_tensorflow_2flite_2ftoco_2ftoco_5fflags_2eproto);
217 return file_level_enum_descriptors_tensorflow_2flite_2ftoco_2ftoco_5fflags_2eproto[0];
218}
219bool FileFormat_IsValid(int value) {
220 switch (value) {
221 case 0:
222 case 1:
223 case 2:
224 case 3:
225 return true;
226 default:
227 return false;
228 }
229}
230
231
232// ===================================================================
233
234void TocoFlags::InitAsDefaultInstance() {
235}
236class TocoFlags::_Internal {
237 public:
238 using HasBits = decltype(std::declval<TocoFlags>()._has_bits_);
239 static void set_has_input_format(HasBits* has_bits) {
240 (*has_bits)[0] |= 8u;
241 }
242 static void set_has_output_format(HasBits* has_bits) {
243 (*has_bits)[0] |= 16u;
244 }
245 static void set_has_inference_input_type(HasBits* has_bits) {
246 (*has_bits)[0] |= 4096u;
247 }
248 static void set_has_inference_type(HasBits* has_bits) {
249 (*has_bits)[0] |= 32u;
250 }
251 static void set_has_default_ranges_min(HasBits* has_bits) {
252 (*has_bits)[0] |= 64u;
253 }
254 static void set_has_default_ranges_max(HasBits* has_bits) {
255 (*has_bits)[0] |= 128u;
256 }
257 static void set_has_default_int16_ranges_min(HasBits* has_bits) {
258 (*has_bits)[0] |= 8192u;
259 }
260 static void set_has_default_int16_ranges_max(HasBits* has_bits) {
261 (*has_bits)[0] |= 16384u;
262 }
263 static void set_has_drop_fake_quant(HasBits* has_bits) {
264 (*has_bits)[0] |= 256u;
265 }
266 static void set_has_reorder_across_fake_quant(HasBits* has_bits) {
267 (*has_bits)[0] |= 512u;
268 }
269 static void set_has_allow_custom_ops(HasBits* has_bits) {
270 (*has_bits)[0] |= 1024u;
271 }
272 static void set_has_drop_control_dependency(HasBits* has_bits) {
273 (*has_bits)[0] |= 2048u;
274 }
275 static void set_has_debug_disable_recurrent_cell_fusion(HasBits* has_bits) {
276 (*has_bits)[0] |= 32768u;
277 }
278 static void set_has_propagate_fake_quant_num_bits(HasBits* has_bits) {
279 (*has_bits)[0] |= 65536u;
280 }
281 static void set_has_allow_nudging_weights_to_use_fast_gemm_kernel(HasBits* has_bits) {
282 (*has_bits)[0] |= 131072u;
283 }
284 static void set_has_dedupe_array_min_size_bytes(HasBits* has_bits) {
285 (*has_bits)[1] |= 16u;
286 }
287 static void set_has_split_tflite_lstm_inputs(HasBits* has_bits) {
288 (*has_bits)[1] |= 32u;
289 }
290 static void set_has_quantize_weights(HasBits* has_bits) {
291 (*has_bits)[0] |= 262144u;
292 }
293 static void set_has_dump_graphviz_dir(HasBits* has_bits) {
294 (*has_bits)[0] |= 1u;
295 }
296 static void set_has_dump_graphviz_include_video(HasBits* has_bits) {
297 (*has_bits)[0] |= 524288u;
298 }
299 static void set_has_post_training_quantize(HasBits* has_bits) {
300 (*has_bits)[0] |= 1048576u;
301 }
302 static void set_has_enable_select_tf_ops(HasBits* has_bits) {
303 (*has_bits)[0] |= 2097152u;
304 }
305 static void set_has_force_select_tf_ops(HasBits* has_bits) {
306 (*has_bits)[0] |= 4194304u;
307 }
308 static void set_has_quantize_to_float16(HasBits* has_bits) {
309 (*has_bits)[0] |= 8388608u;
310 }
311 static void set_has_allow_dynamic_tensors(HasBits* has_bits) {
312 (*has_bits)[1] |= 64u;
313 }
314 static void set_has_conversion_summary_dir(HasBits* has_bits) {
315 (*has_bits)[0] |= 2u;
316 }
317 static void set_has_enable_tflite_resource_variables(HasBits* has_bits) {
318 (*has_bits)[1] |= 128u;
319 }
320 static void set_has_unfold_batchmatmul(HasBits* has_bits) {
321 (*has_bits)[1] |= 256u;
322 }
323 static void set_has_lower_tensor_list_ops(HasBits* has_bits) {
324 (*has_bits)[1] |= 512u;
325 }
326 static void set_has_accumulation_type(HasBits* has_bits) {
327 (*has_bits)[0] |= 134217728u;
328 }
329 static void set_has_allow_bfloat16(HasBits* has_bits) {
330 (*has_bits)[0] |= 16777216u;
331 }
332 static void set_has_allow_all_select_tf_ops(HasBits* has_bits) {
333 (*has_bits)[0] |= 33554432u;
334 }
335 static void set_has_unfold_large_splat_constant(HasBits* has_bits) {
336 (*has_bits)[0] |= 67108864u;
337 }
338 static void set_has_default_to_single_batch_in_tensor_list_ops(HasBits* has_bits) {
339 (*has_bits)[0] |= 268435456u;
340 }
341 static void set_has_disable_per_channel_quantization(HasBits* has_bits) {
342 (*has_bits)[0] |= 536870912u;
343 }
344 static void set_has_enable_mlir_dynamic_range_quantizer(HasBits* has_bits) {
345 (*has_bits)[0] |= 1073741824u;
346 }
347 static void set_has_tf_quantization_mode(HasBits* has_bits) {
348 (*has_bits)[0] |= 4u;
349 }
350 static void set_has_disable_infer_tensor_range(HasBits* has_bits) {
351 (*has_bits)[0] |= 2147483648u;
352 }
353 static void set_has_use_fake_quant_num_bits(HasBits* has_bits) {
354 (*has_bits)[1] |= 1u;
355 }
356 static void set_has_enable_dynamic_update_slice(HasBits* has_bits) {
357 (*has_bits)[1] |= 2u;
358 }
359 static void set_has_preserve_assert_op(HasBits* has_bits) {
360 (*has_bits)[1] |= 4u;
361 }
362 static void set_has_guarantee_all_funcs_one_use(HasBits* has_bits) {
363 (*has_bits)[1] |= 8u;
364 }
365};
366
367TocoFlags::TocoFlags()
368 : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
369 SharedCtor();
370 // @@protoc_insertion_point(constructor:toco.TocoFlags)
371}
372TocoFlags::TocoFlags(const TocoFlags& from)
373 : ::PROTOBUF_NAMESPACE_ID::Message(),
374 _internal_metadata_(nullptr),
375 _has_bits_(from._has_bits_),
376 custom_opdefs_(from.custom_opdefs_),
377 select_user_tf_ops_(from.select_user_tf_ops_),
378 supported_backends_(from.supported_backends_) {
379 _internal_metadata_.MergeFrom(from._internal_metadata_);
380 dump_graphviz_dir_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
381 if (from.has_dump_graphviz_dir()) {
382 dump_graphviz_dir_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.dump_graphviz_dir_);
383 }
384 conversion_summary_dir_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
385 if (from.has_conversion_summary_dir()) {
386 conversion_summary_dir_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.conversion_summary_dir_);
387 }
388 tf_quantization_mode_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
389 if (from.has_tf_quantization_mode()) {
390 tf_quantization_mode_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.tf_quantization_mode_);
391 }
392 ::memcpy(&input_format_, &from.input_format_,
393 static_cast<size_t>(reinterpret_cast<char*>(&lower_tensor_list_ops_) -
394 reinterpret_cast<char*>(&input_format_)) + sizeof(lower_tensor_list_ops_));
395 // @@protoc_insertion_point(copy_constructor:toco.TocoFlags)
396}
397
398void TocoFlags::SharedCtor() {
399 ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_TocoFlags_tensorflow_2flite_2ftoco_2ftoco_5fflags_2eproto.base);
400 dump_graphviz_dir_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
401 conversion_summary_dir_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
402 tf_quantization_mode_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
403 ::memset(&input_format_, 0, static_cast<size_t>(
404 reinterpret_cast<char*>(&guarantee_all_funcs_one_use_) -
405 reinterpret_cast<char*>(&input_format_)) + sizeof(guarantee_all_funcs_one_use_));
406 dedupe_array_min_size_bytes_ = PROTOBUF_LONGLONG(64);
407 split_tflite_lstm_inputs_ = true;
408 allow_dynamic_tensors_ = true;
409 enable_tflite_resource_variables_ = true;
410 unfold_batchmatmul_ = true;
411 lower_tensor_list_ops_ = true;
412}
413
414TocoFlags::~TocoFlags() {
415 // @@protoc_insertion_point(destructor:toco.TocoFlags)
416 SharedDtor();
417}
418
419void TocoFlags::SharedDtor() {
420 dump_graphviz_dir_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
421 conversion_summary_dir_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
422 tf_quantization_mode_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
423}
424
425void TocoFlags::SetCachedSize(int size) const {
426 _cached_size_.Set(size);
427}
428const TocoFlags& TocoFlags::default_instance() {
429 ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_TocoFlags_tensorflow_2flite_2ftoco_2ftoco_5fflags_2eproto.base);
430 return *internal_default_instance();
431}
432
433
434void TocoFlags::Clear() {
435// @@protoc_insertion_point(message_clear_start:toco.TocoFlags)
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 custom_opdefs_.Clear();
441 select_user_tf_ops_.Clear();
442 supported_backends_.Clear();
443 cached_has_bits = _has_bits_[0];
444 if (cached_has_bits & 0x00000007u) {
445 if (cached_has_bits & 0x00000001u) {
446 dump_graphviz_dir_.ClearNonDefaultToEmptyNoArena();
447 }
448 if (cached_has_bits & 0x00000002u) {
449 conversion_summary_dir_.ClearNonDefaultToEmptyNoArena();
450 }
451 if (cached_has_bits & 0x00000004u) {
452 tf_quantization_mode_.ClearNonDefaultToEmptyNoArena();
453 }
454 }
455 if (cached_has_bits & 0x000000f8u) {
456 ::memset(&input_format_, 0, static_cast<size_t>(
457 reinterpret_cast<char*>(&default_ranges_max_) -
458 reinterpret_cast<char*>(&input_format_)) + sizeof(default_ranges_max_));
459 }
460 if (cached_has_bits & 0x0000ff00u) {
461 ::memset(&drop_fake_quant_, 0, static_cast<size_t>(
462 reinterpret_cast<char*>(&debug_disable_recurrent_cell_fusion_) -
463 reinterpret_cast<char*>(&drop_fake_quant_)) + sizeof(debug_disable_recurrent_cell_fusion_));
464 }
465 if (cached_has_bits & 0x00ff0000u) {
466 ::memset(&propagate_fake_quant_num_bits_, 0, static_cast<size_t>(
467 reinterpret_cast<char*>(&quantize_to_float16_) -
468 reinterpret_cast<char*>(&propagate_fake_quant_num_bits_)) + sizeof(quantize_to_float16_));
469 }
470 if (cached_has_bits & 0xff000000u) {
471 ::memset(&allow_bfloat16_, 0, static_cast<size_t>(
472 reinterpret_cast<char*>(&disable_infer_tensor_range_) -
473 reinterpret_cast<char*>(&allow_bfloat16_)) + sizeof(disable_infer_tensor_range_));
474 }
475 cached_has_bits = _has_bits_[1];
476 if (cached_has_bits & 0x000000ffu) {
477 ::memset(&use_fake_quant_num_bits_, 0, static_cast<size_t>(
478 reinterpret_cast<char*>(&guarantee_all_funcs_one_use_) -
479 reinterpret_cast<char*>(&use_fake_quant_num_bits_)) + sizeof(guarantee_all_funcs_one_use_));
480 dedupe_array_min_size_bytes_ = PROTOBUF_LONGLONG(64);
481 split_tflite_lstm_inputs_ = true;
482 allow_dynamic_tensors_ = true;
483 enable_tflite_resource_variables_ = true;
484 }
485 if (cached_has_bits & 0x00000300u) {
486 unfold_batchmatmul_ = true;
487 lower_tensor_list_ops_ = true;
488 }
489 _has_bits_.Clear();
490 _internal_metadata_.Clear();
491}
492
493#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
494const char* TocoFlags::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
495#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
496 while (!ctx->Done(&ptr)) {
497 ::PROTOBUF_NAMESPACE_ID::uint32 tag;
498 ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
499 CHK_(ptr);
500 switch (tag >> 3) {
501 // optional .toco.FileFormat input_format = 1;
502 case 1:
503 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) {
504 ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
505 CHK_(ptr);
506 if (PROTOBUF_PREDICT_TRUE(::toco::FileFormat_IsValid(val))) {
507 set_input_format(static_cast<::toco::FileFormat>(val));
508 } else {
509 ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(1, val, mutable_unknown_fields());
510 }
511 } else goto handle_unusual;
512 continue;
513 // optional .toco.FileFormat output_format = 2;
514 case 2:
515 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) {
516 ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
517 CHK_(ptr);
518 if (PROTOBUF_PREDICT_TRUE(::toco::FileFormat_IsValid(val))) {
519 set_output_format(static_cast<::toco::FileFormat>(val));
520 } else {
521 ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(2, val, mutable_unknown_fields());
522 }
523 } else goto handle_unusual;
524 continue;
525 // optional .toco.IODataType inference_type = 4;
526 case 4:
527 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 32)) {
528 ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
529 CHK_(ptr);
530 if (PROTOBUF_PREDICT_TRUE(::toco::IODataType_IsValid(val))) {
531 set_inference_type(static_cast<::toco::IODataType>(val));
532 } else {
533 ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(4, val, mutable_unknown_fields());
534 }
535 } else goto handle_unusual;
536 continue;
537 // optional float default_ranges_min = 5;
538 case 5:
539 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 45)) {
540 _Internal::set_has_default_ranges_min(&_has_bits_);
541 default_ranges_min_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
542 ptr += sizeof(float);
543 } else goto handle_unusual;
544 continue;
545 // optional float default_ranges_max = 6;
546 case 6:
547 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 53)) {
548 _Internal::set_has_default_ranges_max(&_has_bits_);
549 default_ranges_max_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
550 ptr += sizeof(float);
551 } else goto handle_unusual;
552 continue;
553 // optional bool drop_fake_quant = 7;
554 case 7:
555 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 56)) {
556 _Internal::set_has_drop_fake_quant(&_has_bits_);
557 drop_fake_quant_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
558 CHK_(ptr);
559 } else goto handle_unusual;
560 continue;
561 // optional bool reorder_across_fake_quant = 8;
562 case 8:
563 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 64)) {
564 _Internal::set_has_reorder_across_fake_quant(&_has_bits_);
565 reorder_across_fake_quant_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
566 CHK_(ptr);
567 } else goto handle_unusual;
568 continue;
569 // optional bool allow_custom_ops = 10;
570 case 10:
571 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 80)) {
572 _Internal::set_has_allow_custom_ops(&_has_bits_);
573 allow_custom_ops_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
574 CHK_(ptr);
575 } else goto handle_unusual;
576 continue;
577 // optional .toco.IODataType inference_input_type = 11;
578 case 11:
579 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 88)) {
580 ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
581 CHK_(ptr);
582 if (PROTOBUF_PREDICT_TRUE(::toco::IODataType_IsValid(val))) {
583 set_inference_input_type(static_cast<::toco::IODataType>(val));
584 } else {
585 ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(11, val, mutable_unknown_fields());
586 }
587 } else goto handle_unusual;
588 continue;
589 // optional bool drop_control_dependency = 12;
590 case 12:
591 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 96)) {
592 _Internal::set_has_drop_control_dependency(&_has_bits_);
593 drop_control_dependency_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
594 CHK_(ptr);
595 } else goto handle_unusual;
596 continue;
597 // optional bool debug_disable_recurrent_cell_fusion = 13;
598 case 13:
599 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 104)) {
600 _Internal::set_has_debug_disable_recurrent_cell_fusion(&_has_bits_);
601 debug_disable_recurrent_cell_fusion_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
602 CHK_(ptr);
603 } else goto handle_unusual;
604 continue;
605 // optional bool propagate_fake_quant_num_bits = 14;
606 case 14:
607 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 112)) {
608 _Internal::set_has_propagate_fake_quant_num_bits(&_has_bits_);
609 propagate_fake_quant_num_bits_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
610 CHK_(ptr);
611 } else goto handle_unusual;
612 continue;
613 // optional float default_int16_ranges_min = 15;
614 case 15:
615 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 125)) {
616 _Internal::set_has_default_int16_ranges_min(&_has_bits_);
617 default_int16_ranges_min_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
618 ptr += sizeof(float);
619 } else goto handle_unusual;
620 continue;
621 // optional float default_int16_ranges_max = 16;
622 case 16:
623 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 133)) {
624 _Internal::set_has_default_int16_ranges_max(&_has_bits_);
625 default_int16_ranges_max_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
626 ptr += sizeof(float);
627 } else goto handle_unusual;
628 continue;
629 // optional bool allow_nudging_weights_to_use_fast_gemm_kernel = 17;
630 case 17:
631 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 136)) {
632 _Internal::set_has_allow_nudging_weights_to_use_fast_gemm_kernel(&_has_bits_);
633 allow_nudging_weights_to_use_fast_gemm_kernel_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
634 CHK_(ptr);
635 } else goto handle_unusual;
636 continue;
637 // optional int64 dedupe_array_min_size_bytes = 18 [default = 64];
638 case 18:
639 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 144)) {
640 _Internal::set_has_dedupe_array_min_size_bytes(&_has_bits_);
641 dedupe_array_min_size_bytes_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
642 CHK_(ptr);
643 } else goto handle_unusual;
644 continue;
645 // optional bool split_tflite_lstm_inputs = 19 [default = true];
646 case 19:
647 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 152)) {
648 _Internal::set_has_split_tflite_lstm_inputs(&_has_bits_);
649 split_tflite_lstm_inputs_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
650 CHK_(ptr);
651 } else goto handle_unusual;
652 continue;
653 // optional bool quantize_weights = 20 [default = false];
654 case 20:
655 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 160)) {
656 _Internal::set_has_quantize_weights(&_has_bits_);
657 quantize_weights_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
658 CHK_(ptr);
659 } else goto handle_unusual;
660 continue;
661 // optional string dump_graphviz_dir = 24;
662 case 24:
663 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 194)) {
664 ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParserUTF8Verify(mutable_dump_graphviz_dir(), ptr, ctx, "toco.TocoFlags.dump_graphviz_dir");
665 CHK_(ptr);
666 } else goto handle_unusual;
667 continue;
668 // optional bool dump_graphviz_include_video = 25;
669 case 25:
670 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 200)) {
671 _Internal::set_has_dump_graphviz_include_video(&_has_bits_);
672 dump_graphviz_include_video_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
673 CHK_(ptr);
674 } else goto handle_unusual;
675 continue;
676 // optional bool post_training_quantize = 26 [default = false];
677 case 26:
678 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 208)) {
679 _Internal::set_has_post_training_quantize(&_has_bits_);
680 post_training_quantize_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
681 CHK_(ptr);
682 } else goto handle_unusual;
683 continue;
684 // optional bool enable_select_tf_ops = 27 [default = false];
685 case 27:
686 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 216)) {
687 _Internal::set_has_enable_select_tf_ops(&_has_bits_);
688 enable_select_tf_ops_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
689 CHK_(ptr);
690 } else goto handle_unusual;
691 continue;
692 // optional bool force_select_tf_ops = 28 [default = false];
693 case 28:
694 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 224)) {
695 _Internal::set_has_force_select_tf_ops(&_has_bits_);
696 force_select_tf_ops_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
697 CHK_(ptr);
698 } else goto handle_unusual;
699 continue;
700 // optional bool quantize_to_float16 = 29 [default = false];
701 case 29:
702 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 232)) {
703 _Internal::set_has_quantize_to_float16(&_has_bits_);
704 quantize_to_float16_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
705 CHK_(ptr);
706 } else goto handle_unusual;
707 continue;
708 // optional bool allow_dynamic_tensors = 30 [default = true];
709 case 30:
710 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 240)) {
711 _Internal::set_has_allow_dynamic_tensors(&_has_bits_);
712 allow_dynamic_tensors_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
713 CHK_(ptr);
714 } else goto handle_unusual;
715 continue;
716 // optional string conversion_summary_dir = 31;
717 case 31:
718 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 250)) {
719 ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParserUTF8Verify(mutable_conversion_summary_dir(), ptr, ctx, "toco.TocoFlags.conversion_summary_dir");
720 CHK_(ptr);
721 } else goto handle_unusual;
722 continue;
723 // repeated string custom_opdefs = 32 [deprecated = true];
724 case 32:
725 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 2)) {
726 ptr -= 2;
727 do {
728 ptr += 2;
729 ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParserUTF8Verify(add_custom_opdefs(), ptr, ctx, "toco.TocoFlags.custom_opdefs");
730 CHK_(ptr);
731 if (!ctx->DataAvailable(ptr)) break;
732 } while (::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<::PROTOBUF_NAMESPACE_ID::uint16>(ptr) == 642);
733 } else goto handle_unusual;
734 continue;
735 // repeated string select_user_tf_ops = 33;
736 case 33:
737 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) {
738 ptr -= 2;
739 do {
740 ptr += 2;
741 ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParserUTF8Verify(add_select_user_tf_ops(), ptr, ctx, "toco.TocoFlags.select_user_tf_ops");
742 CHK_(ptr);
743 if (!ctx->DataAvailable(ptr)) break;
744 } while (::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<::PROTOBUF_NAMESPACE_ID::uint16>(ptr) == 650);
745 } else goto handle_unusual;
746 continue;
747 // optional bool enable_tflite_resource_variables = 34 [default = true];
748 case 34:
749 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) {
750 _Internal::set_has_enable_tflite_resource_variables(&_has_bits_);
751 enable_tflite_resource_variables_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
752 CHK_(ptr);
753 } else goto handle_unusual;
754 continue;
755 // optional bool unfold_batchmatmul = 35 [default = true];
756 case 35:
757 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24)) {
758 _Internal::set_has_unfold_batchmatmul(&_has_bits_);
759 unfold_batchmatmul_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
760 CHK_(ptr);
761 } else goto handle_unusual;
762 continue;
763 // optional bool lower_tensor_list_ops = 36 [default = true];
764 case 36:
765 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 32)) {
766 _Internal::set_has_lower_tensor_list_ops(&_has_bits_);
767 lower_tensor_list_ops_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
768 CHK_(ptr);
769 } else goto handle_unusual;
770 continue;
771 // optional .toco.IODataType accumulation_type = 37;
772 case 37:
773 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 40)) {
774 ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
775 CHK_(ptr);
776 if (PROTOBUF_PREDICT_TRUE(::toco::IODataType_IsValid(val))) {
777 set_accumulation_type(static_cast<::toco::IODataType>(val));
778 } else {
779 ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(37, val, mutable_unknown_fields());
780 }
781 } else goto handle_unusual;
782 continue;
783 // optional bool allow_bfloat16 = 38 [default = false];
784 case 38:
785 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 48)) {
786 _Internal::set_has_allow_bfloat16(&_has_bits_);
787 allow_bfloat16_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
788 CHK_(ptr);
789 } else goto handle_unusual;
790 continue;
791 // optional bool allow_all_select_tf_ops = 39;
792 case 39:
793 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 56)) {
794 _Internal::set_has_allow_all_select_tf_ops(&_has_bits_);
795 allow_all_select_tf_ops_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
796 CHK_(ptr);
797 } else goto handle_unusual;
798 continue;
799 // optional bool unfold_large_splat_constant = 40 [default = false];
800 case 40:
801 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 64)) {
802 _Internal::set_has_unfold_large_splat_constant(&_has_bits_);
803 unfold_large_splat_constant_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
804 CHK_(ptr);
805 } else goto handle_unusual;
806 continue;
807 // repeated string supported_backends = 41;
808 case 41:
809 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 74)) {
810 ptr -= 2;
811 do {
812 ptr += 2;
813 ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParserUTF8Verify(add_supported_backends(), ptr, ctx, "toco.TocoFlags.supported_backends");
814 CHK_(ptr);
815 if (!ctx->DataAvailable(ptr)) break;
816 } while (::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<::PROTOBUF_NAMESPACE_ID::uint16>(ptr) == 714);
817 } else goto handle_unusual;
818 continue;
819 // optional bool default_to_single_batch_in_tensor_list_ops = 42 [default = false];
820 case 42:
821 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 80)) {
822 _Internal::set_has_default_to_single_batch_in_tensor_list_ops(&_has_bits_);
823 default_to_single_batch_in_tensor_list_ops_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
824 CHK_(ptr);
825 } else goto handle_unusual;
826 continue;
827 // optional bool disable_per_channel_quantization = 43 [default = false];
828 case 43:
829 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 88)) {
830 _Internal::set_has_disable_per_channel_quantization(&_has_bits_);
831 disable_per_channel_quantization_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
832 CHK_(ptr);
833 } else goto handle_unusual;
834 continue;
835 // optional bool enable_mlir_dynamic_range_quantizer = 44 [default = false];
836 case 44:
837 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 96)) {
838 _Internal::set_has_enable_mlir_dynamic_range_quantizer(&_has_bits_);
839 enable_mlir_dynamic_range_quantizer_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
840 CHK_(ptr);
841 } else goto handle_unusual;
842 continue;
843 // optional string tf_quantization_mode = 45;
844 case 45:
845 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 106)) {
846 ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParserUTF8Verify(mutable_tf_quantization_mode(), ptr, ctx, "toco.TocoFlags.tf_quantization_mode");
847 CHK_(ptr);
848 } else goto handle_unusual;
849 continue;
850 // optional bool disable_infer_tensor_range = 46 [default = false];
851 case 46:
852 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 112)) {
853 _Internal::set_has_disable_infer_tensor_range(&_has_bits_);
854 disable_infer_tensor_range_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
855 CHK_(ptr);
856 } else goto handle_unusual;
857 continue;
858 // optional bool use_fake_quant_num_bits = 47 [default = false];
859 case 47:
860 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 120)) {
861 _Internal::set_has_use_fake_quant_num_bits(&_has_bits_);
862 use_fake_quant_num_bits_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
863 CHK_(ptr);
864 } else goto handle_unusual;
865 continue;
866 // optional bool enable_dynamic_update_slice = 48 [default = false];
867 case 48:
868 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 128)) {
869 _Internal::set_has_enable_dynamic_update_slice(&_has_bits_);
870 enable_dynamic_update_slice_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
871 CHK_(ptr);
872 } else goto handle_unusual;
873 continue;
874 // optional bool preserve_assert_op = 49 [default = false];
875 case 49:
876 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 136)) {
877 _Internal::set_has_preserve_assert_op(&_has_bits_);
878 preserve_assert_op_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
879 CHK_(ptr);
880 } else goto handle_unusual;
881 continue;
882 // optional bool guarantee_all_funcs_one_use = 50 [default = false];
883 case 50:
884 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 144)) {
885 _Internal::set_has_guarantee_all_funcs_one_use(&_has_bits_);
886 guarantee_all_funcs_one_use_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
887 CHK_(ptr);
888 } else goto handle_unusual;
889 continue;
890 default: {
891 handle_unusual:
892 if ((tag & 7) == 4 || tag == 0) {
893 ctx->SetLastTag(tag);
894 goto success;
895 }
896 ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
897 CHK_(ptr != nullptr);
898 continue;
899 }
900 } // switch
901 } // while
902success:
903 return ptr;
904failure:
905 ptr = nullptr;
906 goto success;
907#undef CHK_
908}
909#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
910bool TocoFlags::MergePartialFromCodedStream(
911 ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) {
912#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure
913 ::PROTOBUF_NAMESPACE_ID::uint32 tag;
914 // @@protoc_insertion_point(parse_start:toco.TocoFlags)
915 for (;;) {
916 ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(16383u);
917 tag = p.first;
918 if (!p.second) goto handle_unusual;
919 switch (::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::GetTagFieldNumber(tag)) {
920 // optional .toco.FileFormat input_format = 1;
921 case 1: {
922 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (8 & 0xFF)) {
923 int value = 0;
924 DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
925 int, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_ENUM>(
926 input, &value)));
927 if (::toco::FileFormat_IsValid(value)) {
928 set_input_format(static_cast< ::toco::FileFormat >(value));
929 } else {
930 mutable_unknown_fields()->AddVarint(
931 1, static_cast<::PROTOBUF_NAMESPACE_ID::uint64>(value));
932 }
933 } else {
934 goto handle_unusual;
935 }
936 break;
937 }
938
939 // optional .toco.FileFormat output_format = 2;
940 case 2: {
941 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (16 & 0xFF)) {
942 int value = 0;
943 DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
944 int, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_ENUM>(
945 input, &value)));
946 if (::toco::FileFormat_IsValid(value)) {
947 set_output_format(static_cast< ::toco::FileFormat >(value));
948 } else {
949 mutable_unknown_fields()->AddVarint(
950 2, static_cast<::PROTOBUF_NAMESPACE_ID::uint64>(value));
951 }
952 } else {
953 goto handle_unusual;
954 }
955 break;
956 }
957
958 // optional .toco.IODataType inference_type = 4;
959 case 4: {
960 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (32 & 0xFF)) {
961 int value = 0;
962 DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
963 int, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_ENUM>(
964 input, &value)));
965 if (::toco::IODataType_IsValid(value)) {
966 set_inference_type(static_cast< ::toco::IODataType >(value));
967 } else {
968 mutable_unknown_fields()->AddVarint(
969 4, static_cast<::PROTOBUF_NAMESPACE_ID::uint64>(value));
970 }
971 } else {
972 goto handle_unusual;
973 }
974 break;
975 }
976
977 // optional float default_ranges_min = 5;
978 case 5: {
979 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (45 & 0xFF)) {
980 _Internal::set_has_default_ranges_min(&_has_bits_);
981 DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
982 float, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_FLOAT>(
983 input, &default_ranges_min_)));
984 } else {
985 goto handle_unusual;
986 }
987 break;
988 }
989
990 // optional float default_ranges_max = 6;
991 case 6: {
992 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (53 & 0xFF)) {
993 _Internal::set_has_default_ranges_max(&_has_bits_);
994 DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
995 float, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_FLOAT>(
996 input, &default_ranges_max_)));
997 } else {
998 goto handle_unusual;
999 }
1000 break;
1001 }
1002
1003 // optional bool drop_fake_quant = 7;
1004 case 7: {
1005 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (56 & 0xFF)) {
1006 _Internal::set_has_drop_fake_quant(&_has_bits_);
1007 DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
1008 bool, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_BOOL>(
1009 input, &drop_fake_quant_)));
1010 } else {
1011 goto handle_unusual;
1012 }
1013 break;
1014 }
1015
1016 // optional bool reorder_across_fake_quant = 8;
1017 case 8: {
1018 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (64 & 0xFF)) {
1019 _Internal::set_has_reorder_across_fake_quant(&_has_bits_);
1020 DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
1021 bool, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_BOOL>(
1022 input, &reorder_across_fake_quant_)));
1023 } else {
1024 goto handle_unusual;
1025 }
1026 break;
1027 }
1028
1029 // optional bool allow_custom_ops = 10;
1030 case 10: {
1031 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (80 & 0xFF)) {
1032 _Internal::set_has_allow_custom_ops(&_has_bits_);
1033 DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
1034 bool, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_BOOL>(
1035 input, &allow_custom_ops_)));
1036 } else {
1037 goto handle_unusual;
1038 }
1039 break;
1040 }
1041
1042 // optional .toco.IODataType inference_input_type = 11;
1043 case 11: {
1044 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (88 & 0xFF)) {
1045 int value = 0;
1046 DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
1047 int, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_ENUM>(
1048 input, &value)));
1049 if (::toco::IODataType_IsValid(value)) {
1050 set_inference_input_type(static_cast< ::toco::IODataType >(value));
1051 } else {
1052 mutable_unknown_fields()->AddVarint(
1053 11, static_cast<::PROTOBUF_NAMESPACE_ID::uint64>(value));
1054 }
1055 } else {
1056 goto handle_unusual;
1057 }
1058 break;
1059 }
1060
1061 // optional bool drop_control_dependency = 12;
1062 case 12: {
1063 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (96 & 0xFF)) {
1064 _Internal::set_has_drop_control_dependency(&_has_bits_);
1065 DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
1066 bool, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_BOOL>(
1067 input, &drop_control_dependency_)));
1068 } else {
1069 goto handle_unusual;
1070 }
1071 break;
1072 }
1073
1074 // optional bool debug_disable_recurrent_cell_fusion = 13;
1075 case 13: {
1076 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (104 & 0xFF)) {
1077 _Internal::set_has_debug_disable_recurrent_cell_fusion(&_has_bits_);
1078 DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
1079 bool, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_BOOL>(
1080 input, &debug_disable_recurrent_cell_fusion_)));
1081 } else {
1082 goto handle_unusual;
1083 }
1084 break;
1085 }
1086
1087 // optional bool propagate_fake_quant_num_bits = 14;
1088 case 14: {
1089 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (112 & 0xFF)) {
1090 _Internal::set_has_propagate_fake_quant_num_bits(&_has_bits_);
1091 DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
1092 bool, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_BOOL>(
1093 input, &propagate_fake_quant_num_bits_)));
1094 } else {
1095 goto handle_unusual;
1096 }
1097 break;
1098 }
1099
1100 // optional float default_int16_ranges_min = 15;
1101 case 15: {
1102 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (125 & 0xFF)) {
1103 _Internal::set_has_default_int16_ranges_min(&_has_bits_);
1104 DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
1105 float, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_FLOAT>(
1106 input, &default_int16_ranges_min_)));
1107 } else {
1108 goto handle_unusual;
1109 }
1110 break;
1111 }
1112
1113 // optional float default_int16_ranges_max = 16;
1114 case 16: {
1115 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (133 & 0xFF)) {
1116 _Internal::set_has_default_int16_ranges_max(&_has_bits_);
1117 DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
1118 float, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_FLOAT>(
1119 input, &default_int16_ranges_max_)));
1120 } else {
1121 goto handle_unusual;
1122 }
1123 break;
1124 }
1125
1126 // optional bool allow_nudging_weights_to_use_fast_gemm_kernel = 17;
1127 case 17: {
1128 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (136 & 0xFF)) {
1129 _Internal::set_has_allow_nudging_weights_to_use_fast_gemm_kernel(&_has_bits_);
1130 DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
1131 bool, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_BOOL>(
1132 input, &allow_nudging_weights_to_use_fast_gemm_kernel_)));
1133 } else {
1134 goto handle_unusual;
1135 }
1136 break;
1137 }
1138
1139 // optional int64 dedupe_array_min_size_bytes = 18 [default = 64];
1140 case 18: {
1141 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (144 & 0xFF)) {
1142 _Internal::set_has_dedupe_array_min_size_bytes(&_has_bits_);
1143 DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
1144 ::PROTOBUF_NAMESPACE_ID::int64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT64>(
1145 input, &dedupe_array_min_size_bytes_)));
1146 } else {
1147 goto handle_unusual;
1148 }
1149 break;
1150 }
1151
1152 // optional bool split_tflite_lstm_inputs = 19 [default = true];
1153 case 19: {
1154 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (152 & 0xFF)) {
1155 _Internal::set_has_split_tflite_lstm_inputs(&_has_bits_);
1156 DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
1157 bool, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_BOOL>(
1158 input, &split_tflite_lstm_inputs_)));
1159 } else {
1160 goto handle_unusual;
1161 }
1162 break;
1163 }
1164
1165 // optional bool quantize_weights = 20 [default = false];
1166 case 20: {
1167 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (160 & 0xFF)) {
1168 _Internal::set_has_quantize_weights(&_has_bits_);
1169 DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
1170 bool, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_BOOL>(
1171 input, &quantize_weights_)));
1172 } else {
1173 goto handle_unusual;
1174 }
1175 break;
1176 }
1177
1178 // optional string dump_graphviz_dir = 24;
1179 case 24: {
1180 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (194 & 0xFF)) {
1181 DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadString(
1182 input, this->mutable_dump_graphviz_dir()));
1183 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
1184 this->dump_graphviz_dir().data(), static_cast<int>(this->dump_graphviz_dir().length()),
1185 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::PARSE,
1186 "toco.TocoFlags.dump_graphviz_dir");
1187 } else {
1188 goto handle_unusual;
1189 }
1190 break;
1191 }
1192
1193 // optional bool dump_graphviz_include_video = 25;
1194 case 25: {
1195 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (200 & 0xFF)) {
1196 _Internal::set_has_dump_graphviz_include_video(&_has_bits_);
1197 DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
1198 bool, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_BOOL>(
1199 input, &dump_graphviz_include_video_)));
1200 } else {
1201 goto handle_unusual;
1202 }
1203 break;
1204 }
1205
1206 // optional bool post_training_quantize = 26 [default = false];
1207 case 26: {
1208 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (208 & 0xFF)) {
1209 _Internal::set_has_post_training_quantize(&_has_bits_);
1210 DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
1211 bool, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_BOOL>(
1212 input, &post_training_quantize_)));
1213 } else {
1214 goto handle_unusual;
1215 }
1216 break;
1217 }
1218
1219 // optional bool enable_select_tf_ops = 27 [default = false];
1220 case 27: {
1221 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (216 & 0xFF)) {
1222 _Internal::set_has_enable_select_tf_ops(&_has_bits_);
1223 DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
1224 bool, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_BOOL>(
1225 input, &enable_select_tf_ops_)));
1226 } else {
1227 goto handle_unusual;
1228 }
1229 break;
1230 }
1231
1232 // optional bool force_select_tf_ops = 28 [default = false];
1233 case 28: {
1234 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (224 & 0xFF)) {
1235 _Internal::set_has_force_select_tf_ops(&_has_bits_);
1236 DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
1237 bool, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_BOOL>(
1238 input, &force_select_tf_ops_)));
1239 } else {
1240 goto handle_unusual;
1241 }
1242 break;
1243 }
1244
1245 // optional bool quantize_to_float16 = 29 [default = false];
1246 case 29: {
1247 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (232 & 0xFF)) {
1248 _Internal::set_has_quantize_to_float16(&_has_bits_);
1249 DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
1250 bool, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_BOOL>(
1251 input, &quantize_to_float16_)));
1252 } else {
1253 goto handle_unusual;
1254 }
1255 break;
1256 }
1257
1258 // optional bool allow_dynamic_tensors = 30 [default = true];
1259 case 30: {
1260 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (240 & 0xFF)) {
1261 _Internal::set_has_allow_dynamic_tensors(&_has_bits_);
1262 DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
1263 bool, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_BOOL>(
1264 input, &allow_dynamic_tensors_)));
1265 } else {
1266 goto handle_unusual;
1267 }
1268 break;
1269 }
1270
1271 // optional string conversion_summary_dir = 31;
1272 case 31: {
1273 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (250 & 0xFF)) {
1274 DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadString(
1275 input, this->mutable_conversion_summary_dir()));
1276 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
1277 this->conversion_summary_dir().data(), static_cast<int>(this->conversion_summary_dir().length()),
1278 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::PARSE,
1279 "toco.TocoFlags.conversion_summary_dir");
1280 } else {
1281 goto handle_unusual;
1282 }
1283 break;
1284 }
1285
1286 // repeated string custom_opdefs = 32 [deprecated = true];
1287 case 32: {
1288 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (258 & 0xFF)) {
1289 DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadString(
1290 input, this->add_custom_opdefs()));
1291 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
1292 this->custom_opdefs(this->custom_opdefs_size() - 1).data(),
1293 static_cast<int>(this->custom_opdefs(this->custom_opdefs_size() - 1).length()),
1294 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::PARSE,
1295 "toco.TocoFlags.custom_opdefs");
1296 } else {
1297 goto handle_unusual;
1298 }
1299 break;
1300 }
1301
1302 // repeated string select_user_tf_ops = 33;
1303 case 33: {
1304 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (266 & 0xFF)) {
1305 DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadString(
1306 input, this->add_select_user_tf_ops()));
1307 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
1308 this->select_user_tf_ops(this->select_user_tf_ops_size() - 1).data(),
1309 static_cast<int>(this->select_user_tf_ops(this->select_user_tf_ops_size() - 1).length()),
1310 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::PARSE,
1311 "toco.TocoFlags.select_user_tf_ops");
1312 } else {
1313 goto handle_unusual;
1314 }
1315 break;
1316 }
1317
1318 // optional bool enable_tflite_resource_variables = 34 [default = true];
1319 case 34: {
1320 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (272 & 0xFF)) {
1321 _Internal::set_has_enable_tflite_resource_variables(&_has_bits_);
1322 DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
1323 bool, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_BOOL>(
1324 input, &enable_tflite_resource_variables_)));
1325 } else {
1326 goto handle_unusual;
1327 }
1328 break;
1329 }
1330
1331 // optional bool unfold_batchmatmul = 35 [default = true];
1332 case 35: {
1333 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (280 & 0xFF)) {
1334 _Internal::set_has_unfold_batchmatmul(&_has_bits_);
1335 DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
1336 bool, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_BOOL>(
1337 input, &unfold_batchmatmul_)));
1338 } else {
1339 goto handle_unusual;
1340 }
1341 break;
1342 }
1343
1344 // optional bool lower_tensor_list_ops = 36 [default = true];
1345 case 36: {
1346 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (288 & 0xFF)) {
1347 _Internal::set_has_lower_tensor_list_ops(&_has_bits_);
1348 DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
1349 bool, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_BOOL>(
1350 input, &lower_tensor_list_ops_)));
1351 } else {
1352 goto handle_unusual;
1353 }
1354 break;
1355 }
1356
1357 // optional .toco.IODataType accumulation_type = 37;
1358 case 37: {
1359 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (296 & 0xFF)) {
1360 int value = 0;
1361 DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
1362 int, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_ENUM>(
1363 input, &value)));
1364 if (::toco::IODataType_IsValid(value)) {
1365 set_accumulation_type(static_cast< ::toco::IODataType >(value));
1366 } else {
1367 mutable_unknown_fields()->AddVarint(
1368 37, static_cast<::PROTOBUF_NAMESPACE_ID::uint64>(value));
1369 }
1370 } else {
1371 goto handle_unusual;
1372 }
1373 break;
1374 }
1375
1376 // optional bool allow_bfloat16 = 38 [default = false];
1377 case 38: {
1378 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (304 & 0xFF)) {
1379 _Internal::set_has_allow_bfloat16(&_has_bits_);
1380 DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
1381 bool, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_BOOL>(
1382 input, &allow_bfloat16_)));
1383 } else {
1384 goto handle_unusual;
1385 }
1386 break;
1387 }
1388
1389 // optional bool allow_all_select_tf_ops = 39;
1390 case 39: {
1391 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (312 & 0xFF)) {
1392 _Internal::set_has_allow_all_select_tf_ops(&_has_bits_);
1393 DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
1394 bool, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_BOOL>(
1395 input, &allow_all_select_tf_ops_)));
1396 } else {
1397 goto handle_unusual;
1398 }
1399 break;
1400 }
1401
1402 // optional bool unfold_large_splat_constant = 40 [default = false];
1403 case 40: {
1404 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (320 & 0xFF)) {
1405 _Internal::set_has_unfold_large_splat_constant(&_has_bits_);
1406 DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
1407 bool, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_BOOL>(
1408 input, &unfold_large_splat_constant_)));
1409 } else {
1410 goto handle_unusual;
1411 }
1412 break;
1413 }
1414
1415 // repeated string supported_backends = 41;
1416 case 41: {
1417 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (330 & 0xFF)) {
1418 DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadString(
1419 input, this->add_supported_backends()));
1420 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
1421 this->supported_backends(this->supported_backends_size() - 1).data(),
1422 static_cast<int>(this->supported_backends(this->supported_backends_size() - 1).length()),
1423 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::PARSE,
1424 "toco.TocoFlags.supported_backends");
1425 } else {
1426 goto handle_unusual;
1427 }
1428 break;
1429 }
1430
1431 // optional bool default_to_single_batch_in_tensor_list_ops = 42 [default = false];
1432 case 42: {
1433 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (336 & 0xFF)) {
1434 _Internal::set_has_default_to_single_batch_in_tensor_list_ops(&_has_bits_);
1435 DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
1436 bool, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_BOOL>(
1437 input, &default_to_single_batch_in_tensor_list_ops_)));
1438 } else {
1439 goto handle_unusual;
1440 }
1441 break;
1442 }
1443
1444 // optional bool disable_per_channel_quantization = 43 [default = false];
1445 case 43: {
1446 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (344 & 0xFF)) {
1447 _Internal::set_has_disable_per_channel_quantization(&_has_bits_);
1448 DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
1449 bool, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_BOOL>(
1450 input, &disable_per_channel_quantization_)));
1451 } else {
1452 goto handle_unusual;
1453 }
1454 break;
1455 }
1456
1457 // optional bool enable_mlir_dynamic_range_quantizer = 44 [default = false];
1458 case 44: {
1459 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (352 & 0xFF)) {
1460 _Internal::set_has_enable_mlir_dynamic_range_quantizer(&_has_bits_);
1461 DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
1462 bool, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_BOOL>(
1463 input, &enable_mlir_dynamic_range_quantizer_)));
1464 } else {
1465 goto handle_unusual;
1466 }
1467 break;
1468 }
1469
1470 // optional string tf_quantization_mode = 45;
1471 case 45: {
1472 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (362 & 0xFF)) {
1473 DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadString(
1474 input, this->mutable_tf_quantization_mode()));
1475 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
1476 this->tf_quantization_mode().data(), static_cast<int>(this->tf_quantization_mode().length()),
1477 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::PARSE,
1478 "toco.TocoFlags.tf_quantization_mode");
1479 } else {
1480 goto handle_unusual;
1481 }
1482 break;
1483 }
1484
1485 // optional bool disable_infer_tensor_range = 46 [default = false];
1486 case 46: {
1487 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (368 & 0xFF)) {
1488 _Internal::set_has_disable_infer_tensor_range(&_has_bits_);
1489 DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
1490 bool, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_BOOL>(
1491 input, &disable_infer_tensor_range_)));
1492 } else {
1493 goto handle_unusual;
1494 }
1495 break;
1496 }
1497
1498 // optional bool use_fake_quant_num_bits = 47 [default = false];
1499 case 47: {
1500 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (376 & 0xFF)) {
1501 _Internal::set_has_use_fake_quant_num_bits(&_has_bits_);
1502 DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
1503 bool, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_BOOL>(
1504 input, &use_fake_quant_num_bits_)));
1505 } else {
1506 goto handle_unusual;
1507 }
1508 break;
1509 }
1510
1511 // optional bool enable_dynamic_update_slice = 48 [default = false];
1512 case 48: {
1513 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (384 & 0xFF)) {
1514 _Internal::set_has_enable_dynamic_update_slice(&_has_bits_);
1515 DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
1516 bool, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_BOOL>(
1517 input, &enable_dynamic_update_slice_)));
1518 } else {
1519 goto handle_unusual;
1520 }
1521 break;
1522 }
1523
1524 // optional bool preserve_assert_op = 49 [default = false];
1525 case 49: {
1526 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (392 & 0xFF)) {
1527 _Internal::set_has_preserve_assert_op(&_has_bits_);
1528 DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
1529 bool, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_BOOL>(
1530 input, &preserve_assert_op_)));
1531 } else {
1532 goto handle_unusual;
1533 }
1534 break;
1535 }
1536
1537 // optional bool guarantee_all_funcs_one_use = 50 [default = false];
1538 case 50: {
1539 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (400 & 0xFF)) {
1540 _Internal::set_has_guarantee_all_funcs_one_use(&_has_bits_);
1541 DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
1542 bool, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_BOOL>(
1543 input, &guarantee_all_funcs_one_use_)));
1544 } else {
1545 goto handle_unusual;
1546 }
1547 break;
1548 }
1549
1550 default: {
1551 handle_unusual:
1552 if (tag == 0) {
1553 goto success;
1554 }
1555 DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SkipField(
1556 input, tag, _internal_metadata_.mutable_unknown_fields()));
1557 break;
1558 }
1559 }
1560 }
1561success:
1562 // @@protoc_insertion_point(parse_success:toco.TocoFlags)
1563 return true;
1564failure:
1565 // @@protoc_insertion_point(parse_failure:toco.TocoFlags)
1566 return false;
1567#undef DO_
1568}
1569#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
1570
1571void TocoFlags::SerializeWithCachedSizes(
1572 ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const {
1573 // @@protoc_insertion_point(serialize_start:toco.TocoFlags)
1574 ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
1575 (void) cached_has_bits;
1576
1577 cached_has_bits = _has_bits_[0];
1578 // optional .toco.FileFormat input_format = 1;
1579 if (cached_has_bits & 0x00000008u) {
1580 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnum(
1581 1, this->input_format(), output);
1582 }
1583
1584 // optional .toco.FileFormat output_format = 2;
1585 if (cached_has_bits & 0x00000010u) {
1586 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnum(
1587 2, this->output_format(), output);
1588 }
1589
1590 // optional .toco.IODataType inference_type = 4;
1591 if (cached_has_bits & 0x00000020u) {
1592 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnum(
1593 4, this->inference_type(), output);
1594 }
1595
1596 // optional float default_ranges_min = 5;
1597 if (cached_has_bits & 0x00000040u) {
1598 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloat(5, this->default_ranges_min(), output);
1599 }
1600
1601 // optional float default_ranges_max = 6;
1602 if (cached_has_bits & 0x00000080u) {
1603 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloat(6, this->default_ranges_max(), output);
1604 }
1605
1606 // optional bool drop_fake_quant = 7;
1607 if (cached_has_bits & 0x00000100u) {
1608 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBool(7, this->drop_fake_quant(), output);
1609 }
1610
1611 // optional bool reorder_across_fake_quant = 8;
1612 if (cached_has_bits & 0x00000200u) {
1613 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBool(8, this->reorder_across_fake_quant(), output);
1614 }
1615
1616 // optional bool allow_custom_ops = 10;
1617 if (cached_has_bits & 0x00000400u) {
1618 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBool(10, this->allow_custom_ops(), output);
1619 }
1620
1621 // optional .toco.IODataType inference_input_type = 11;
1622 if (cached_has_bits & 0x00001000u) {
1623 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnum(
1624 11, this->inference_input_type(), output);
1625 }
1626
1627 // optional bool drop_control_dependency = 12;
1628 if (cached_has_bits & 0x00000800u) {
1629 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBool(12, this->drop_control_dependency(), output);
1630 }
1631
1632 // optional bool debug_disable_recurrent_cell_fusion = 13;
1633 if (cached_has_bits & 0x00008000u) {
1634 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBool(13, this->debug_disable_recurrent_cell_fusion(), output);
1635 }
1636
1637 // optional bool propagate_fake_quant_num_bits = 14;
1638 if (cached_has_bits & 0x00010000u) {
1639 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBool(14, this->propagate_fake_quant_num_bits(), output);
1640 }
1641
1642 // optional float default_int16_ranges_min = 15;
1643 if (cached_has_bits & 0x00002000u) {
1644 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloat(15, this->default_int16_ranges_min(), output);
1645 }
1646
1647 // optional float default_int16_ranges_max = 16;
1648 if (cached_has_bits & 0x00004000u) {
1649 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloat(16, this->default_int16_ranges_max(), output);
1650 }
1651
1652 // optional bool allow_nudging_weights_to_use_fast_gemm_kernel = 17;
1653 if (cached_has_bits & 0x00020000u) {
1654 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBool(17, this->allow_nudging_weights_to_use_fast_gemm_kernel(), output);
1655 }
1656
1657 cached_has_bits = _has_bits_[1];
1658 // optional int64 dedupe_array_min_size_bytes = 18 [default = 64];
1659 if (cached_has_bits & 0x00000010u) {
1660 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64(18, this->dedupe_array_min_size_bytes(), output);
1661 }
1662
1663 // optional bool split_tflite_lstm_inputs = 19 [default = true];
1664 if (cached_has_bits & 0x00000020u) {
1665 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBool(19, this->split_tflite_lstm_inputs(), output);
1666 }
1667
1668 cached_has_bits = _has_bits_[0];
1669 // optional bool quantize_weights = 20 [default = false];
1670 if (cached_has_bits & 0x00040000u) {
1671 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBool(20, this->quantize_weights(), output);
1672 }
1673
1674 // optional string dump_graphviz_dir = 24;
1675 if (cached_has_bits & 0x00000001u) {
1676 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
1677 this->dump_graphviz_dir().data(), static_cast<int>(this->dump_graphviz_dir().length()),
1678 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
1679 "toco.TocoFlags.dump_graphviz_dir");
1680 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringMaybeAliased(
1681 24, this->dump_graphviz_dir(), output);
1682 }
1683
1684 // optional bool dump_graphviz_include_video = 25;
1685 if (cached_has_bits & 0x00080000u) {
1686 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBool(25, this->dump_graphviz_include_video(), output);
1687 }
1688
1689 // optional bool post_training_quantize = 26 [default = false];
1690 if (cached_has_bits & 0x00100000u) {
1691 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBool(26, this->post_training_quantize(), output);
1692 }
1693
1694 // optional bool enable_select_tf_ops = 27 [default = false];
1695 if (cached_has_bits & 0x00200000u) {
1696 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBool(27, this->enable_select_tf_ops(), output);
1697 }
1698
1699 // optional bool force_select_tf_ops = 28 [default = false];
1700 if (cached_has_bits & 0x00400000u) {
1701 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBool(28, this->force_select_tf_ops(), output);
1702 }
1703
1704 // optional bool quantize_to_float16 = 29 [default = false];
1705 if (cached_has_bits & 0x00800000u) {
1706 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBool(29, this->quantize_to_float16(), output);
1707 }
1708
1709 cached_has_bits = _has_bits_[1];
1710 // optional bool allow_dynamic_tensors = 30 [default = true];
1711 if (cached_has_bits & 0x00000040u) {
1712 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBool(30, this->allow_dynamic_tensors(), output);
1713 }
1714
1715 cached_has_bits = _has_bits_[0];
1716 // optional string conversion_summary_dir = 31;
1717 if (cached_has_bits & 0x00000002u) {
1718 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
1719 this->conversion_summary_dir().data(), static_cast<int>(this->conversion_summary_dir().length()),
1720 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
1721 "toco.TocoFlags.conversion_summary_dir");
1722 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringMaybeAliased(
1723 31, this->conversion_summary_dir(), output);
1724 }
1725
1726 // repeated string custom_opdefs = 32 [deprecated = true];
1727 for (int i = 0, n = this->custom_opdefs_size(); i < n; i++) {
1728 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
1729 this->custom_opdefs(i).data(), static_cast<int>(this->custom_opdefs(i).length()),
1730 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
1731 "toco.TocoFlags.custom_opdefs");
1732 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteString(
1733 32, this->custom_opdefs(i), output);
1734 }
1735
1736 // repeated string select_user_tf_ops = 33;
1737 for (int i = 0, n = this->select_user_tf_ops_size(); i < n; i++) {
1738 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
1739 this->select_user_tf_ops(i).data(), static_cast<int>(this->select_user_tf_ops(i).length()),
1740 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
1741 "toco.TocoFlags.select_user_tf_ops");
1742 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteString(
1743 33, this->select_user_tf_ops(i), output);
1744 }
1745
1746 cached_has_bits = _has_bits_[1];
1747 // optional bool enable_tflite_resource_variables = 34 [default = true];
1748 if (cached_has_bits & 0x00000080u) {
1749 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBool(34, this->enable_tflite_resource_variables(), output);
1750 }
1751
1752 // optional bool unfold_batchmatmul = 35 [default = true];
1753 if (cached_has_bits & 0x00000100u) {
1754 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBool(35, this->unfold_batchmatmul(), output);
1755 }
1756
1757 // optional bool lower_tensor_list_ops = 36 [default = true];
1758 if (cached_has_bits & 0x00000200u) {
1759 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBool(36, this->lower_tensor_list_ops(), output);
1760 }
1761
1762 cached_has_bits = _has_bits_[0];
1763 // optional .toco.IODataType accumulation_type = 37;
1764 if (cached_has_bits & 0x08000000u) {
1765 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnum(
1766 37, this->accumulation_type(), output);
1767 }
1768
1769 // optional bool allow_bfloat16 = 38 [default = false];
1770 if (cached_has_bits & 0x01000000u) {
1771 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBool(38, this->allow_bfloat16(), output);
1772 }
1773
1774 // optional bool allow_all_select_tf_ops = 39;
1775 if (cached_has_bits & 0x02000000u) {
1776 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBool(39, this->allow_all_select_tf_ops(), output);
1777 }
1778
1779 // optional bool unfold_large_splat_constant = 40 [default = false];
1780 if (cached_has_bits & 0x04000000u) {
1781 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBool(40, this->unfold_large_splat_constant(), output);
1782 }
1783
1784 // repeated string supported_backends = 41;
1785 for (int i = 0, n = this->supported_backends_size(); i < n; i++) {
1786 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
1787 this->supported_backends(i).data(), static_cast<int>(this->supported_backends(i).length()),
1788 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
1789 "toco.TocoFlags.supported_backends");
1790 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteString(
1791 41, this->supported_backends(i), output);
1792 }
1793
1794 // optional bool default_to_single_batch_in_tensor_list_ops = 42 [default = false];
1795 if (cached_has_bits & 0x10000000u) {
1796 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBool(42, this->default_to_single_batch_in_tensor_list_ops(), output);
1797 }
1798
1799 // optional bool disable_per_channel_quantization = 43 [default = false];
1800 if (cached_has_bits & 0x20000000u) {
1801 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBool(43, this->disable_per_channel_quantization(), output);
1802 }
1803
1804 // optional bool enable_mlir_dynamic_range_quantizer = 44 [default = false];
1805 if (cached_has_bits & 0x40000000u) {
1806 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBool(44, this->enable_mlir_dynamic_range_quantizer(), output);
1807 }
1808
1809 // optional string tf_quantization_mode = 45;
1810 if (cached_has_bits & 0x00000004u) {
1811 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
1812 this->tf_quantization_mode().data(), static_cast<int>(this->tf_quantization_mode().length()),
1813 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
1814 "toco.TocoFlags.tf_quantization_mode");
1815 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringMaybeAliased(
1816 45, this->tf_quantization_mode(), output);
1817 }
1818
1819 // optional bool disable_infer_tensor_range = 46 [default = false];
1820 if (cached_has_bits & 0x80000000u) {
1821 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBool(46, this->disable_infer_tensor_range(), output);
1822 }
1823
1824 cached_has_bits = _has_bits_[1];
1825 // optional bool use_fake_quant_num_bits = 47 [default = false];
1826 if (cached_has_bits & 0x00000001u) {
1827 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBool(47, this->use_fake_quant_num_bits(), output);
1828 }
1829
1830 // optional bool enable_dynamic_update_slice = 48 [default = false];
1831 if (cached_has_bits & 0x00000002u) {
1832 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBool(48, this->enable_dynamic_update_slice(), output);
1833 }
1834
1835 // optional bool preserve_assert_op = 49 [default = false];
1836 if (cached_has_bits & 0x00000004u) {
1837 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBool(49, this->preserve_assert_op(), output);
1838 }
1839
1840 // optional bool guarantee_all_funcs_one_use = 50 [default = false];
1841 if (cached_has_bits & 0x00000008u) {
1842 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBool(50, this->guarantee_all_funcs_one_use(), output);
1843 }
1844
1845 if (_internal_metadata_.have_unknown_fields()) {
1846 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields(
1847 _internal_metadata_.unknown_fields(), output);
1848 }
1849 // @@protoc_insertion_point(serialize_end:toco.TocoFlags)
1850}
1851
1852::PROTOBUF_NAMESPACE_ID::uint8* TocoFlags::InternalSerializeWithCachedSizesToArray(
1853 ::PROTOBUF_NAMESPACE_ID::uint8* target) const {
1854 // @@protoc_insertion_point(serialize_to_array_start:toco.TocoFlags)
1855 ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
1856 (void) cached_has_bits;
1857
1858 cached_has_bits = _has_bits_[0];
1859 // optional .toco.FileFormat input_format = 1;
1860 if (cached_has_bits & 0x00000008u) {
1861 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
1862 1, this->input_format(), target);
1863 }
1864
1865 // optional .toco.FileFormat output_format = 2;
1866 if (cached_has_bits & 0x00000010u) {
1867 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
1868 2, this->output_format(), target);
1869 }
1870
1871 // optional .toco.IODataType inference_type = 4;
1872 if (cached_has_bits & 0x00000020u) {
1873 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
1874 4, this->inference_type(), target);
1875 }
1876
1877 // optional float default_ranges_min = 5;
1878 if (cached_has_bits & 0x00000040u) {
1879 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(5, this->default_ranges_min(), target);
1880 }
1881
1882 // optional float default_ranges_max = 6;
1883 if (cached_has_bits & 0x00000080u) {
1884 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(6, this->default_ranges_max(), target);
1885 }
1886
1887 // optional bool drop_fake_quant = 7;
1888 if (cached_has_bits & 0x00000100u) {
1889 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(7, this->drop_fake_quant(), target);
1890 }
1891
1892 // optional bool reorder_across_fake_quant = 8;
1893 if (cached_has_bits & 0x00000200u) {
1894 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(8, this->reorder_across_fake_quant(), target);
1895 }
1896
1897 // optional bool allow_custom_ops = 10;
1898 if (cached_has_bits & 0x00000400u) {
1899 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(10, this->allow_custom_ops(), target);
1900 }
1901
1902 // optional .toco.IODataType inference_input_type = 11;
1903 if (cached_has_bits & 0x00001000u) {
1904 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
1905 11, this->inference_input_type(), target);
1906 }
1907
1908 // optional bool drop_control_dependency = 12;
1909 if (cached_has_bits & 0x00000800u) {
1910 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(12, this->drop_control_dependency(), target);
1911 }
1912
1913 // optional bool debug_disable_recurrent_cell_fusion = 13;
1914 if (cached_has_bits & 0x00008000u) {
1915 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(13, this->debug_disable_recurrent_cell_fusion(), target);
1916 }
1917
1918 // optional bool propagate_fake_quant_num_bits = 14;
1919 if (cached_has_bits & 0x00010000u) {
1920 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(14, this->propagate_fake_quant_num_bits(), target);
1921 }
1922
1923 // optional float default_int16_ranges_min = 15;
1924 if (cached_has_bits & 0x00002000u) {
1925 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(15, this->default_int16_ranges_min(), target);
1926 }
1927
1928 // optional float default_int16_ranges_max = 16;
1929 if (cached_has_bits & 0x00004000u) {
1930 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(16, this->default_int16_ranges_max(), target);
1931 }
1932
1933 // optional bool allow_nudging_weights_to_use_fast_gemm_kernel = 17;
1934 if (cached_has_bits & 0x00020000u) {
1935 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(17, this->allow_nudging_weights_to_use_fast_gemm_kernel(), target);
1936 }
1937
1938 cached_has_bits = _has_bits_[1];
1939 // optional int64 dedupe_array_min_size_bytes = 18 [default = 64];
1940 if (cached_has_bits & 0x00000010u) {
1941 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(18, this->dedupe_array_min_size_bytes(), target);
1942 }
1943
1944 // optional bool split_tflite_lstm_inputs = 19 [default = true];
1945 if (cached_has_bits & 0x00000020u) {
1946 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(19, this->split_tflite_lstm_inputs(), target);
1947 }
1948
1949 cached_has_bits = _has_bits_[0];
1950 // optional bool quantize_weights = 20 [default = false];
1951 if (cached_has_bits & 0x00040000u) {
1952 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(20, this->quantize_weights(), target);
1953 }
1954
1955 // optional string dump_graphviz_dir = 24;
1956 if (cached_has_bits & 0x00000001u) {
1957 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
1958 this->dump_graphviz_dir().data(), static_cast<int>(this->dump_graphviz_dir().length()),
1959 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
1960 "toco.TocoFlags.dump_graphviz_dir");
1961 target =
1962 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringToArray(
1963 24, this->dump_graphviz_dir(), target);
1964 }
1965
1966 // optional bool dump_graphviz_include_video = 25;
1967 if (cached_has_bits & 0x00080000u) {
1968 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(25, this->dump_graphviz_include_video(), target);
1969 }
1970
1971 // optional bool post_training_quantize = 26 [default = false];
1972 if (cached_has_bits & 0x00100000u) {
1973 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(26, this->post_training_quantize(), target);
1974 }
1975
1976 // optional bool enable_select_tf_ops = 27 [default = false];
1977 if (cached_has_bits & 0x00200000u) {
1978 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(27, this->enable_select_tf_ops(), target);
1979 }
1980
1981 // optional bool force_select_tf_ops = 28 [default = false];
1982 if (cached_has_bits & 0x00400000u) {
1983 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(28, this->force_select_tf_ops(), target);
1984 }
1985
1986 // optional bool quantize_to_float16 = 29 [default = false];
1987 if (cached_has_bits & 0x00800000u) {
1988 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(29, this->quantize_to_float16(), target);
1989 }
1990
1991 cached_has_bits = _has_bits_[1];
1992 // optional bool allow_dynamic_tensors = 30 [default = true];
1993 if (cached_has_bits & 0x00000040u) {
1994 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(30, this->allow_dynamic_tensors(), target);
1995 }
1996
1997 cached_has_bits = _has_bits_[0];
1998 // optional string conversion_summary_dir = 31;
1999 if (cached_has_bits & 0x00000002u) {
2000 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
2001 this->conversion_summary_dir().data(), static_cast<int>(this->conversion_summary_dir().length()),
2002 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
2003 "toco.TocoFlags.conversion_summary_dir");
2004 target =
2005 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringToArray(
2006 31, this->conversion_summary_dir(), target);
2007 }
2008
2009 // repeated string custom_opdefs = 32 [deprecated = true];
2010 for (int i = 0, n = this->custom_opdefs_size(); i < n; i++) {
2011 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
2012 this->custom_opdefs(i).data(), static_cast<int>(this->custom_opdefs(i).length()),
2013 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
2014 "toco.TocoFlags.custom_opdefs");
2015 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
2016 WriteStringToArray(32, this->custom_opdefs(i), target);
2017 }
2018
2019 // repeated string select_user_tf_ops = 33;
2020 for (int i = 0, n = this->select_user_tf_ops_size(); i < n; i++) {
2021 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
2022 this->select_user_tf_ops(i).data(), static_cast<int>(this->select_user_tf_ops(i).length()),
2023 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
2024 "toco.TocoFlags.select_user_tf_ops");
2025 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
2026 WriteStringToArray(33, this->select_user_tf_ops(i), target);
2027 }
2028
2029 cached_has_bits = _has_bits_[1];
2030 // optional bool enable_tflite_resource_variables = 34 [default = true];
2031 if (cached_has_bits & 0x00000080u) {
2032 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(34, this->enable_tflite_resource_variables(), target);
2033 }
2034
2035 // optional bool unfold_batchmatmul = 35 [default = true];
2036 if (cached_has_bits & 0x00000100u) {
2037 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(35, this->unfold_batchmatmul(), target);
2038 }
2039
2040 // optional bool lower_tensor_list_ops = 36 [default = true];
2041 if (cached_has_bits & 0x00000200u) {
2042 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(36, this->lower_tensor_list_ops(), target);
2043 }
2044
2045 cached_has_bits = _has_bits_[0];
2046 // optional .toco.IODataType accumulation_type = 37;
2047 if (cached_has_bits & 0x08000000u) {
2048 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
2049 37, this->accumulation_type(), target);
2050 }
2051
2052 // optional bool allow_bfloat16 = 38 [default = false];
2053 if (cached_has_bits & 0x01000000u) {
2054 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(38, this->allow_bfloat16(), target);
2055 }
2056
2057 // optional bool allow_all_select_tf_ops = 39;
2058 if (cached_has_bits & 0x02000000u) {
2059 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(39, this->allow_all_select_tf_ops(), target);
2060 }
2061
2062 // optional bool unfold_large_splat_constant = 40 [default = false];
2063 if (cached_has_bits & 0x04000000u) {
2064 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(40, this->unfold_large_splat_constant(), target);
2065 }
2066
2067 // repeated string supported_backends = 41;
2068 for (int i = 0, n = this->supported_backends_size(); i < n; i++) {
2069 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
2070 this->supported_backends(i).data(), static_cast<int>(this->supported_backends(i).length()),
2071 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
2072 "toco.TocoFlags.supported_backends");
2073 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
2074 WriteStringToArray(41, this->supported_backends(i), target);
2075 }
2076
2077 // optional bool default_to_single_batch_in_tensor_list_ops = 42 [default = false];
2078 if (cached_has_bits & 0x10000000u) {
2079 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(42, this->default_to_single_batch_in_tensor_list_ops(), target);
2080 }
2081
2082 // optional bool disable_per_channel_quantization = 43 [default = false];
2083 if (cached_has_bits & 0x20000000u) {
2084 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(43, this->disable_per_channel_quantization(), target);
2085 }
2086
2087 // optional bool enable_mlir_dynamic_range_quantizer = 44 [default = false];
2088 if (cached_has_bits & 0x40000000u) {
2089 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(44, this->enable_mlir_dynamic_range_quantizer(), target);
2090 }
2091
2092 // optional string tf_quantization_mode = 45;
2093 if (cached_has_bits & 0x00000004u) {
2094 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
2095 this->tf_quantization_mode().data(), static_cast<int>(this->tf_quantization_mode().length()),
2096 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
2097 "toco.TocoFlags.tf_quantization_mode");
2098 target =
2099 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringToArray(
2100 45, this->tf_quantization_mode(), target);
2101 }
2102
2103 // optional bool disable_infer_tensor_range = 46 [default = false];
2104 if (cached_has_bits & 0x80000000u) {
2105 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(46, this->disable_infer_tensor_range(), target);
2106 }
2107
2108 cached_has_bits = _has_bits_[1];
2109 // optional bool use_fake_quant_num_bits = 47 [default = false];
2110 if (cached_has_bits & 0x00000001u) {
2111 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(47, this->use_fake_quant_num_bits(), target);
2112 }
2113
2114 // optional bool enable_dynamic_update_slice = 48 [default = false];
2115 if (cached_has_bits & 0x00000002u) {
2116 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(48, this->enable_dynamic_update_slice(), target);
2117 }
2118
2119 // optional bool preserve_assert_op = 49 [default = false];
2120 if (cached_has_bits & 0x00000004u) {
2121 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(49, this->preserve_assert_op(), target);
2122 }
2123
2124 // optional bool guarantee_all_funcs_one_use = 50 [default = false];
2125 if (cached_has_bits & 0x00000008u) {
2126 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(50, this->guarantee_all_funcs_one_use(), target);
2127 }
2128
2129 if (_internal_metadata_.have_unknown_fields()) {
2130 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray(
2131 _internal_metadata_.unknown_fields(), target);
2132 }
2133 // @@protoc_insertion_point(serialize_to_array_end:toco.TocoFlags)
2134 return target;
2135}
2136
2137size_t TocoFlags::ByteSizeLong() const {
2138// @@protoc_insertion_point(message_byte_size_start:toco.TocoFlags)
2139 size_t total_size = 0;
2140
2141 if (_internal_metadata_.have_unknown_fields()) {
2142 total_size +=
2143 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::ComputeUnknownFieldsSize(
2144 _internal_metadata_.unknown_fields());
2145 }
2146 ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
2147 // Prevent compiler warnings about cached_has_bits being unused
2148 (void) cached_has_bits;
2149
2150 // repeated string custom_opdefs = 32 [deprecated = true];
2151 total_size += 2 *
2152 ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(this->custom_opdefs_size());
2153 for (int i = 0, n = this->custom_opdefs_size(); i < n; i++) {
2154 total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
2155 this->custom_opdefs(i));
2156 }
2157
2158 // repeated string select_user_tf_ops = 33;
2159 total_size += 2 *
2160 ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(this->select_user_tf_ops_size());
2161 for (int i = 0, n = this->select_user_tf_ops_size(); i < n; i++) {
2162 total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
2163 this->select_user_tf_ops(i));
2164 }
2165
2166 // repeated string supported_backends = 41;
2167 total_size += 2 *
2168 ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(this->supported_backends_size());
2169 for (int i = 0, n = this->supported_backends_size(); i < n; i++) {
2170 total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
2171 this->supported_backends(i));
2172 }
2173
2174 cached_has_bits = _has_bits_[0];
2175 if (cached_has_bits & 0x000000ffu) {
2176 // optional string dump_graphviz_dir = 24;
2177 if (cached_has_bits & 0x00000001u) {
2178 total_size += 2 +
2179 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
2180 this->dump_graphviz_dir());
2181 }
2182
2183 // optional string conversion_summary_dir = 31;
2184 if (cached_has_bits & 0x00000002u) {
2185 total_size += 2 +
2186 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
2187 this->conversion_summary_dir());
2188 }
2189
2190 // optional string tf_quantization_mode = 45;
2191 if (cached_has_bits & 0x00000004u) {
2192 total_size += 2 +
2193 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
2194 this->tf_quantization_mode());
2195 }
2196
2197 // optional .toco.FileFormat input_format = 1;
2198 if (cached_has_bits & 0x00000008u) {
2199 total_size += 1 +
2200 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->input_format());
2201 }
2202
2203 // optional .toco.FileFormat output_format = 2;
2204 if (cached_has_bits & 0x00000010u) {
2205 total_size += 1 +
2206 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->output_format());
2207 }
2208
2209 // optional .toco.IODataType inference_type = 4;
2210 if (cached_has_bits & 0x00000020u) {
2211 total_size += 1 +
2212 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->inference_type());
2213 }
2214
2215 // optional float default_ranges_min = 5;
2216 if (cached_has_bits & 0x00000040u) {
2217 total_size += 1 + 4;
2218 }
2219
2220 // optional float default_ranges_max = 6;
2221 if (cached_has_bits & 0x00000080u) {
2222 total_size += 1 + 4;
2223 }
2224
2225 }
2226 if (cached_has_bits & 0x0000ff00u) {
2227 // optional bool drop_fake_quant = 7;
2228 if (cached_has_bits & 0x00000100u) {
2229 total_size += 1 + 1;
2230 }
2231
2232 // optional bool reorder_across_fake_quant = 8;
2233 if (cached_has_bits & 0x00000200u) {
2234 total_size += 1 + 1;
2235 }
2236
2237 // optional bool allow_custom_ops = 10;
2238 if (cached_has_bits & 0x00000400u) {
2239 total_size += 1 + 1;
2240 }
2241
2242 // optional bool drop_control_dependency = 12;
2243 if (cached_has_bits & 0x00000800u) {
2244 total_size += 1 + 1;
2245 }
2246
2247 // optional .toco.IODataType inference_input_type = 11;
2248 if (cached_has_bits & 0x00001000u) {
2249 total_size += 1 +
2250 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->inference_input_type());
2251 }
2252
2253 // optional float default_int16_ranges_min = 15;
2254 if (cached_has_bits & 0x00002000u) {
2255 total_size += 1 + 4;
2256 }
2257
2258 // optional float default_int16_ranges_max = 16;
2259 if (cached_has_bits & 0x00004000u) {
2260 total_size += 2 + 4;
2261 }
2262
2263 // optional bool debug_disable_recurrent_cell_fusion = 13;
2264 if (cached_has_bits & 0x00008000u) {
2265 total_size += 1 + 1;
2266 }
2267
2268 }
2269 if (cached_has_bits & 0x00ff0000u) {
2270 // optional bool propagate_fake_quant_num_bits = 14;
2271 if (cached_has_bits & 0x00010000u) {
2272 total_size += 1 + 1;
2273 }
2274
2275 // optional bool allow_nudging_weights_to_use_fast_gemm_kernel = 17;
2276 if (cached_has_bits & 0x00020000u) {
2277 total_size += 2 + 1;
2278 }
2279
2280 // optional bool quantize_weights = 20 [default = false];
2281 if (cached_has_bits & 0x00040000u) {
2282 total_size += 2 + 1;
2283 }
2284
2285 // optional bool dump_graphviz_include_video = 25;
2286 if (cached_has_bits & 0x00080000u) {
2287 total_size += 2 + 1;
2288 }
2289
2290 // optional bool post_training_quantize = 26 [default = false];
2291 if (cached_has_bits & 0x00100000u) {
2292 total_size += 2 + 1;
2293 }
2294
2295 // optional bool enable_select_tf_ops = 27 [default = false];
2296 if (cached_has_bits & 0x00200000u) {
2297 total_size += 2 + 1;
2298 }
2299
2300 // optional bool force_select_tf_ops = 28 [default = false];
2301 if (cached_has_bits & 0x00400000u) {
2302 total_size += 2 + 1;
2303 }
2304
2305 // optional bool quantize_to_float16 = 29 [default = false];
2306 if (cached_has_bits & 0x00800000u) {
2307 total_size += 2 + 1;
2308 }
2309
2310 }
2311 if (cached_has_bits & 0xff000000u) {
2312 // optional bool allow_bfloat16 = 38 [default = false];
2313 if (cached_has_bits & 0x01000000u) {
2314 total_size += 2 + 1;
2315 }
2316
2317 // optional bool allow_all_select_tf_ops = 39;
2318 if (cached_has_bits & 0x02000000u) {
2319 total_size += 2 + 1;
2320 }
2321
2322 // optional bool unfold_large_splat_constant = 40 [default = false];
2323 if (cached_has_bits & 0x04000000u) {
2324 total_size += 2 + 1;
2325 }
2326
2327 // optional .toco.IODataType accumulation_type = 37;
2328 if (cached_has_bits & 0x08000000u) {
2329 total_size += 2 +
2330 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->accumulation_type());
2331 }
2332
2333 // optional bool default_to_single_batch_in_tensor_list_ops = 42 [default = false];
2334 if (cached_has_bits & 0x10000000u) {
2335 total_size += 2 + 1;
2336 }
2337
2338 // optional bool disable_per_channel_quantization = 43 [default = false];
2339 if (cached_has_bits & 0x20000000u) {
2340 total_size += 2 + 1;
2341 }
2342
2343 // optional bool enable_mlir_dynamic_range_quantizer = 44 [default = false];
2344 if (cached_has_bits & 0x40000000u) {
2345 total_size += 2 + 1;
2346 }
2347
2348 // optional bool disable_infer_tensor_range = 46 [default = false];
2349 if (cached_has_bits & 0x80000000u) {
2350 total_size += 2 + 1;
2351 }
2352
2353 }
2354 cached_has_bits = _has_bits_[1];
2355 if (cached_has_bits & 0x000000ffu) {
2356 // optional bool use_fake_quant_num_bits = 47 [default = false];
2357 if (cached_has_bits & 0x00000001u) {
2358 total_size += 2 + 1;
2359 }
2360
2361 // optional bool enable_dynamic_update_slice = 48 [default = false];
2362 if (cached_has_bits & 0x00000002u) {
2363 total_size += 2 + 1;
2364 }
2365
2366 // optional bool preserve_assert_op = 49 [default = false];
2367 if (cached_has_bits & 0x00000004u) {
2368 total_size += 2 + 1;
2369 }
2370
2371 // optional bool guarantee_all_funcs_one_use = 50 [default = false];
2372 if (cached_has_bits & 0x00000008u) {
2373 total_size += 2 + 1;
2374 }
2375
2376 // optional int64 dedupe_array_min_size_bytes = 18 [default = 64];
2377 if (cached_has_bits & 0x00000010u) {
2378 total_size += 2 +
2379 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64Size(
2380 this->dedupe_array_min_size_bytes());
2381 }
2382
2383 // optional bool split_tflite_lstm_inputs = 19 [default = true];
2384 if (cached_has_bits & 0x00000020u) {
2385 total_size += 2 + 1;
2386 }
2387
2388 // optional bool allow_dynamic_tensors = 30 [default = true];
2389 if (cached_has_bits & 0x00000040u) {
2390 total_size += 2 + 1;
2391 }
2392
2393 // optional bool enable_tflite_resource_variables = 34 [default = true];
2394 if (cached_has_bits & 0x00000080u) {
2395 total_size += 2 + 1;
2396 }
2397
2398 }
2399 if (cached_has_bits & 0x00000300u) {
2400 // optional bool unfold_batchmatmul = 35 [default = true];
2401 if (cached_has_bits & 0x00000100u) {
2402 total_size += 2 + 1;
2403 }
2404
2405 // optional bool lower_tensor_list_ops = 36 [default = true];
2406 if (cached_has_bits & 0x00000200u) {
2407 total_size += 2 + 1;
2408 }
2409
2410 }
2411 int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
2412 SetCachedSize(cached_size);
2413 return total_size;
2414}
2415
2416void TocoFlags::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
2417// @@protoc_insertion_point(generalized_merge_from_start:toco.TocoFlags)
2418 GOOGLE_DCHECK_NE(&from, this);
2419 const TocoFlags* source =
2420 ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<TocoFlags>(
2421 &from);
2422 if (source == nullptr) {
2423 // @@protoc_insertion_point(generalized_merge_from_cast_fail:toco.TocoFlags)
2424 ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
2425 } else {
2426 // @@protoc_insertion_point(generalized_merge_from_cast_success:toco.TocoFlags)
2427 MergeFrom(*source);
2428 }
2429}
2430
2431void TocoFlags::MergeFrom(const TocoFlags& from) {
2432// @@protoc_insertion_point(class_specific_merge_from_start:toco.TocoFlags)
2433 GOOGLE_DCHECK_NE(&from, this);
2434 _internal_metadata_.MergeFrom(from._internal_metadata_);
2435 ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
2436 (void) cached_has_bits;
2437
2438 custom_opdefs_.MergeFrom(from.custom_opdefs_);
2439 select_user_tf_ops_.MergeFrom(from.select_user_tf_ops_);
2440 supported_backends_.MergeFrom(from.supported_backends_);
2441 cached_has_bits = from._has_bits_[0];
2442 if (cached_has_bits & 0x000000ffu) {
2443 if (cached_has_bits & 0x00000001u) {
2444 _has_bits_[0] |= 0x00000001u;
2445 dump_graphviz_dir_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.dump_graphviz_dir_);
2446 }
2447 if (cached_has_bits & 0x00000002u) {
2448 _has_bits_[0] |= 0x00000002u;
2449 conversion_summary_dir_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.conversion_summary_dir_);
2450 }
2451 if (cached_has_bits & 0x00000004u) {
2452 _has_bits_[0] |= 0x00000004u;
2453 tf_quantization_mode_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.tf_quantization_mode_);
2454 }
2455 if (cached_has_bits & 0x00000008u) {
2456 input_format_ = from.input_format_;
2457 }
2458 if (cached_has_bits & 0x00000010u) {
2459 output_format_ = from.output_format_;
2460 }
2461 if (cached_has_bits & 0x00000020u) {
2462 inference_type_ = from.inference_type_;
2463 }
2464 if (cached_has_bits & 0x00000040u) {
2465 default_ranges_min_ = from.default_ranges_min_;
2466 }
2467 if (cached_has_bits & 0x00000080u) {
2468 default_ranges_max_ = from.default_ranges_max_;
2469 }
2470 _has_bits_[0] |= cached_has_bits;
2471 }
2472 if (cached_has_bits & 0x0000ff00u) {
2473 if (cached_has_bits & 0x00000100u) {
2474 drop_fake_quant_ = from.drop_fake_quant_;
2475 }
2476 if (cached_has_bits & 0x00000200u) {
2477 reorder_across_fake_quant_ = from.reorder_across_fake_quant_;
2478 }
2479 if (cached_has_bits & 0x00000400u) {
2480 allow_custom_ops_ = from.allow_custom_ops_;
2481 }
2482 if (cached_has_bits & 0x00000800u) {
2483 drop_control_dependency_ = from.drop_control_dependency_;
2484 }
2485 if (cached_has_bits & 0x00001000u) {
2486 inference_input_type_ = from.inference_input_type_;
2487 }
2488 if (cached_has_bits & 0x00002000u) {
2489 default_int16_ranges_min_ = from.default_int16_ranges_min_;
2490 }
2491 if (cached_has_bits & 0x00004000u) {
2492 default_int16_ranges_max_ = from.default_int16_ranges_max_;
2493 }
2494 if (cached_has_bits & 0x00008000u) {
2495 debug_disable_recurrent_cell_fusion_ = from.debug_disable_recurrent_cell_fusion_;
2496 }
2497 _has_bits_[0] |= cached_has_bits;
2498 }
2499 if (cached_has_bits & 0x00ff0000u) {
2500 if (cached_has_bits & 0x00010000u) {
2501 propagate_fake_quant_num_bits_ = from.propagate_fake_quant_num_bits_;
2502 }
2503 if (cached_has_bits & 0x00020000u) {
2504 allow_nudging_weights_to_use_fast_gemm_kernel_ = from.allow_nudging_weights_to_use_fast_gemm_kernel_;
2505 }
2506 if (cached_has_bits & 0x00040000u) {
2507 quantize_weights_ = from.quantize_weights_;
2508 }
2509 if (cached_has_bits & 0x00080000u) {
2510 dump_graphviz_include_video_ = from.dump_graphviz_include_video_;
2511 }
2512 if (cached_has_bits & 0x00100000u) {
2513 post_training_quantize_ = from.post_training_quantize_;
2514 }
2515 if (cached_has_bits & 0x00200000u) {
2516 enable_select_tf_ops_ = from.enable_select_tf_ops_;
2517 }
2518 if (cached_has_bits & 0x00400000u) {
2519 force_select_tf_ops_ = from.force_select_tf_ops_;
2520 }
2521 if (cached_has_bits & 0x00800000u) {
2522 quantize_to_float16_ = from.quantize_to_float16_;
2523 }
2524 _has_bits_[0] |= cached_has_bits;
2525 }
2526 if (cached_has_bits & 0xff000000u) {
2527 if (cached_has_bits & 0x01000000u) {
2528 allow_bfloat16_ = from.allow_bfloat16_;
2529 }
2530 if (cached_has_bits & 0x02000000u) {
2531 allow_all_select_tf_ops_ = from.allow_all_select_tf_ops_;
2532 }
2533 if (cached_has_bits & 0x04000000u) {
2534 unfold_large_splat_constant_ = from.unfold_large_splat_constant_;
2535 }
2536 if (cached_has_bits & 0x08000000u) {
2537 accumulation_type_ = from.accumulation_type_;
2538 }
2539 if (cached_has_bits & 0x10000000u) {
2540 default_to_single_batch_in_tensor_list_ops_ = from.default_to_single_batch_in_tensor_list_ops_;
2541 }
2542 if (cached_has_bits & 0x20000000u) {
2543 disable_per_channel_quantization_ = from.disable_per_channel_quantization_;
2544 }
2545 if (cached_has_bits & 0x40000000u) {
2546 enable_mlir_dynamic_range_quantizer_ = from.enable_mlir_dynamic_range_quantizer_;
2547 }
2548 if (cached_has_bits & 0x80000000u) {
2549 disable_infer_tensor_range_ = from.disable_infer_tensor_range_;
2550 }
2551 _has_bits_[0] |= cached_has_bits;
2552 }
2553 cached_has_bits = from._has_bits_[1];
2554 if (cached_has_bits & 0x000000ffu) {
2555 if (cached_has_bits & 0x00000001u) {
2556 use_fake_quant_num_bits_ = from.use_fake_quant_num_bits_;
2557 }
2558 if (cached_has_bits & 0x00000002u) {
2559 enable_dynamic_update_slice_ = from.enable_dynamic_update_slice_;
2560 }
2561 if (cached_has_bits & 0x00000004u) {
2562 preserve_assert_op_ = from.preserve_assert_op_;
2563 }
2564 if (cached_has_bits & 0x00000008u) {
2565 guarantee_all_funcs_one_use_ = from.guarantee_all_funcs_one_use_;
2566 }
2567 if (cached_has_bits & 0x00000010u) {
2568 dedupe_array_min_size_bytes_ = from.dedupe_array_min_size_bytes_;
2569 }
2570 if (cached_has_bits & 0x00000020u) {
2571 split_tflite_lstm_inputs_ = from.split_tflite_lstm_inputs_;
2572 }
2573 if (cached_has_bits & 0x00000040u) {
2574 allow_dynamic_tensors_ = from.allow_dynamic_tensors_;
2575 }
2576 if (cached_has_bits & 0x00000080u) {
2577 enable_tflite_resource_variables_ = from.enable_tflite_resource_variables_;
2578 }
2579 _has_bits_[1] |= cached_has_bits;
2580 }
2581 if (cached_has_bits & 0x00000300u) {
2582 if (cached_has_bits & 0x00000100u) {
2583 unfold_batchmatmul_ = from.unfold_batchmatmul_;
2584 }
2585 if (cached_has_bits & 0x00000200u) {
2586 lower_tensor_list_ops_ = from.lower_tensor_list_ops_;
2587 }
2588 _has_bits_[1] |= cached_has_bits;
2589 }
2590}
2591
2592void TocoFlags::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
2593// @@protoc_insertion_point(generalized_copy_from_start:toco.TocoFlags)
2594 if (&from == this) return;
2595 Clear();
2596 MergeFrom(from);
2597}
2598
2599void TocoFlags::CopyFrom(const TocoFlags& from) {
2600// @@protoc_insertion_point(class_specific_copy_from_start:toco.TocoFlags)
2601 if (&from == this) return;
2602 Clear();
2603 MergeFrom(from);
2604}
2605
2606bool TocoFlags::IsInitialized() const {
2607 return true;
2608}
2609
2610void TocoFlags::InternalSwap(TocoFlags* other) {
2611 using std::swap;
2612 _internal_metadata_.Swap(&other->_internal_metadata_);
2613 swap(_has_bits_[0], other->_has_bits_[0]);
2614 swap(_has_bits_[1], other->_has_bits_[1]);
2615 custom_opdefs_.InternalSwap(CastToBase(&other->custom_opdefs_));
2616 select_user_tf_ops_.InternalSwap(CastToBase(&other->select_user_tf_ops_));
2617 supported_backends_.InternalSwap(CastToBase(&other->supported_backends_));
2618 dump_graphviz_dir_.Swap(&other->dump_graphviz_dir_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
2619 GetArenaNoVirtual());
2620 conversion_summary_dir_.Swap(&other->conversion_summary_dir_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
2621 GetArenaNoVirtual());
2622 tf_quantization_mode_.Swap(&other->tf_quantization_mode_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
2623 GetArenaNoVirtual());
2624 swap(input_format_, other->input_format_);
2625 swap(output_format_, other->output_format_);
2626 swap(inference_type_, other->inference_type_);
2627 swap(default_ranges_min_, other->default_ranges_min_);
2628 swap(default_ranges_max_, other->default_ranges_max_);
2629 swap(drop_fake_quant_, other->drop_fake_quant_);
2630 swap(reorder_across_fake_quant_, other->reorder_across_fake_quant_);
2631 swap(allow_custom_ops_, other->allow_custom_ops_);
2632 swap(drop_control_dependency_, other->drop_control_dependency_);
2633 swap(inference_input_type_, other->inference_input_type_);
2634 swap(default_int16_ranges_min_, other->default_int16_ranges_min_);
2635 swap(default_int16_ranges_max_, other->default_int16_ranges_max_);
2636 swap(debug_disable_recurrent_cell_fusion_, other->debug_disable_recurrent_cell_fusion_);
2637 swap(propagate_fake_quant_num_bits_, other->propagate_fake_quant_num_bits_);
2638 swap(allow_nudging_weights_to_use_fast_gemm_kernel_, other->allow_nudging_weights_to_use_fast_gemm_kernel_);
2639 swap(quantize_weights_, other->quantize_weights_);
2640 swap(dump_graphviz_include_video_, other->dump_graphviz_include_video_);
2641 swap(post_training_quantize_, other->post_training_quantize_);
2642 swap(enable_select_tf_ops_, other->enable_select_tf_ops_);
2643 swap(force_select_tf_ops_, other->force_select_tf_ops_);
2644 swap(quantize_to_float16_, other->quantize_to_float16_);
2645 swap(allow_bfloat16_, other->allow_bfloat16_);
2646 swap(allow_all_select_tf_ops_, other->allow_all_select_tf_ops_);
2647 swap(unfold_large_splat_constant_, other->unfold_large_splat_constant_);
2648 swap(accumulation_type_, other->accumulation_type_);
2649 swap(default_to_single_batch_in_tensor_list_ops_, other->default_to_single_batch_in_tensor_list_ops_);
2650 swap(disable_per_channel_quantization_, other->disable_per_channel_quantization_);
2651 swap(enable_mlir_dynamic_range_quantizer_, other->enable_mlir_dynamic_range_quantizer_);
2652 swap(disable_infer_tensor_range_, other->disable_infer_tensor_range_);
2653 swap(use_fake_quant_num_bits_, other->use_fake_quant_num_bits_);
2654 swap(enable_dynamic_update_slice_, other->enable_dynamic_update_slice_);
2655 swap(preserve_assert_op_, other->preserve_assert_op_);
2656 swap(guarantee_all_funcs_one_use_, other->guarantee_all_funcs_one_use_);
2657 swap(dedupe_array_min_size_bytes_, other->dedupe_array_min_size_bytes_);
2658 swap(split_tflite_lstm_inputs_, other->split_tflite_lstm_inputs_);
2659 swap(allow_dynamic_tensors_, other->allow_dynamic_tensors_);
2660 swap(enable_tflite_resource_variables_, other->enable_tflite_resource_variables_);
2661 swap(unfold_batchmatmul_, other->unfold_batchmatmul_);
2662 swap(lower_tensor_list_ops_, other->lower_tensor_list_ops_);
2663}
2664
2665::PROTOBUF_NAMESPACE_ID::Metadata TocoFlags::GetMetadata() const {
2666 return GetMetadataStatic();
2667}
2668
2669
2670// @@protoc_insertion_point(namespace_scope)
2671} // namespace toco
2672PROTOBUF_NAMESPACE_OPEN
2673template<> PROTOBUF_NOINLINE ::toco::TocoFlags* Arena::CreateMaybeMessage< ::toco::TocoFlags >(Arena* arena) {
2674 return Arena::CreateInternal< ::toco::TocoFlags >(arena);
2675}
2676PROTOBUF_NAMESPACE_CLOSE
2677
2678// @@protoc_insertion_point(global_scope)
2679#include <google/protobuf/port_undef.inc>
2680