1// Generated by the protocol buffer compiler. DO NOT EDIT!
2// source: tensorflow/core/protobuf/rewriter_config.proto
3
4#include "tensorflow/core/protobuf/rewriter_config.pb.h"
5
6#include <algorithm>
7
8#include <google/protobuf/stubs/common.h>
9#include <google/protobuf/io/coded_stream.h>
10#include <google/protobuf/extension_set.h>
11#include <google/protobuf/wire_format_lite.h>
12#include <google/protobuf/descriptor.h>
13#include <google/protobuf/generated_message_reflection.h>
14#include <google/protobuf/reflection_ops.h>
15#include <google/protobuf/wire_format.h>
16// @@protoc_insertion_point(includes)
17#include <google/protobuf/port_def.inc>
18extern PROTOBUF_INTERNAL_EXPORT_tensorflow_2fcore_2fframework_2fattr_5fvalue_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<2> scc_info_AttrValue_tensorflow_2fcore_2fframework_2fattr_5fvalue_2eproto;
19extern PROTOBUF_INTERNAL_EXPORT_tensorflow_2fcore_2fprotobuf_2frewriter_5fconfig_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_AutoParallelOptions_tensorflow_2fcore_2fprotobuf_2frewriter_5fconfig_2eproto;
20extern PROTOBUF_INTERNAL_EXPORT_tensorflow_2fcore_2fprotobuf_2frewriter_5fconfig_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_RewriterConfig_CustomGraphOptimizer_tensorflow_2fcore_2fprotobuf_2frewriter_5fconfig_2eproto;
21extern PROTOBUF_INTERNAL_EXPORT_tensorflow_2fcore_2fprotobuf_2frewriter_5fconfig_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_RewriterConfig_CustomGraphOptimizer_ParameterMapEntry_DoNotUse_tensorflow_2fcore_2fprotobuf_2frewriter_5fconfig_2eproto;
22extern PROTOBUF_INTERNAL_EXPORT_tensorflow_2fcore_2fprotobuf_2frewriter_5fconfig_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_ScopedAllocatorOptions_tensorflow_2fcore_2fprotobuf_2frewriter_5fconfig_2eproto;
23extern PROTOBUF_INTERNAL_EXPORT_tensorflow_2fcore_2fprotobuf_2fverifier_5fconfig_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_VerifierConfig_tensorflow_2fcore_2fprotobuf_2fverifier_5fconfig_2eproto;
24namespace tensorflow {
25class AutoParallelOptionsDefaultTypeInternal {
26 public:
27 ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<AutoParallelOptions> _instance;
28} _AutoParallelOptions_default_instance_;
29class ScopedAllocatorOptionsDefaultTypeInternal {
30 public:
31 ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<ScopedAllocatorOptions> _instance;
32} _ScopedAllocatorOptions_default_instance_;
33class RewriterConfig_CustomGraphOptimizer_ParameterMapEntry_DoNotUseDefaultTypeInternal {
34 public:
35 ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<RewriterConfig_CustomGraphOptimizer_ParameterMapEntry_DoNotUse> _instance;
36} _RewriterConfig_CustomGraphOptimizer_ParameterMapEntry_DoNotUse_default_instance_;
37class RewriterConfig_CustomGraphOptimizerDefaultTypeInternal {
38 public:
39 ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<RewriterConfig_CustomGraphOptimizer> _instance;
40} _RewriterConfig_CustomGraphOptimizer_default_instance_;
41class RewriterConfigDefaultTypeInternal {
42 public:
43 ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<RewriterConfig> _instance;
44} _RewriterConfig_default_instance_;
45} // namespace tensorflow
46static void InitDefaultsscc_info_AutoParallelOptions_tensorflow_2fcore_2fprotobuf_2frewriter_5fconfig_2eproto() {
47 GOOGLE_PROTOBUF_VERIFY_VERSION;
48
49 {
50 void* ptr = &::tensorflow::_AutoParallelOptions_default_instance_;
51 new (ptr) ::tensorflow::AutoParallelOptions();
52 ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
53 }
54 ::tensorflow::AutoParallelOptions::InitAsDefaultInstance();
55}
56
57::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_AutoParallelOptions_tensorflow_2fcore_2fprotobuf_2frewriter_5fconfig_2eproto =
58 {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsscc_info_AutoParallelOptions_tensorflow_2fcore_2fprotobuf_2frewriter_5fconfig_2eproto}, {}};
59
60static void InitDefaultsscc_info_RewriterConfig_tensorflow_2fcore_2fprotobuf_2frewriter_5fconfig_2eproto() {
61 GOOGLE_PROTOBUF_VERIFY_VERSION;
62
63 {
64 void* ptr = &::tensorflow::_RewriterConfig_default_instance_;
65 new (ptr) ::tensorflow::RewriterConfig();
66 ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
67 }
68 ::tensorflow::RewriterConfig::InitAsDefaultInstance();
69}
70
71::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<4> scc_info_RewriterConfig_tensorflow_2fcore_2fprotobuf_2frewriter_5fconfig_2eproto =
72 {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 4, InitDefaultsscc_info_RewriterConfig_tensorflow_2fcore_2fprotobuf_2frewriter_5fconfig_2eproto}, {
73 &scc_info_AutoParallelOptions_tensorflow_2fcore_2fprotobuf_2frewriter_5fconfig_2eproto.base,
74 &scc_info_ScopedAllocatorOptions_tensorflow_2fcore_2fprotobuf_2frewriter_5fconfig_2eproto.base,
75 &scc_info_RewriterConfig_CustomGraphOptimizer_tensorflow_2fcore_2fprotobuf_2frewriter_5fconfig_2eproto.base,
76 &scc_info_VerifierConfig_tensorflow_2fcore_2fprotobuf_2fverifier_5fconfig_2eproto.base,}};
77
78static void InitDefaultsscc_info_RewriterConfig_CustomGraphOptimizer_tensorflow_2fcore_2fprotobuf_2frewriter_5fconfig_2eproto() {
79 GOOGLE_PROTOBUF_VERIFY_VERSION;
80
81 {
82 void* ptr = &::tensorflow::_RewriterConfig_CustomGraphOptimizer_default_instance_;
83 new (ptr) ::tensorflow::RewriterConfig_CustomGraphOptimizer();
84 ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
85 }
86 ::tensorflow::RewriterConfig_CustomGraphOptimizer::InitAsDefaultInstance();
87}
88
89::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_RewriterConfig_CustomGraphOptimizer_tensorflow_2fcore_2fprotobuf_2frewriter_5fconfig_2eproto =
90 {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsscc_info_RewriterConfig_CustomGraphOptimizer_tensorflow_2fcore_2fprotobuf_2frewriter_5fconfig_2eproto}, {
91 &scc_info_RewriterConfig_CustomGraphOptimizer_ParameterMapEntry_DoNotUse_tensorflow_2fcore_2fprotobuf_2frewriter_5fconfig_2eproto.base,}};
92
93static void InitDefaultsscc_info_RewriterConfig_CustomGraphOptimizer_ParameterMapEntry_DoNotUse_tensorflow_2fcore_2fprotobuf_2frewriter_5fconfig_2eproto() {
94 GOOGLE_PROTOBUF_VERIFY_VERSION;
95
96 {
97 void* ptr = &::tensorflow::_RewriterConfig_CustomGraphOptimizer_ParameterMapEntry_DoNotUse_default_instance_;
98 new (ptr) ::tensorflow::RewriterConfig_CustomGraphOptimizer_ParameterMapEntry_DoNotUse();
99 }
100 ::tensorflow::RewriterConfig_CustomGraphOptimizer_ParameterMapEntry_DoNotUse::InitAsDefaultInstance();
101}
102
103::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_RewriterConfig_CustomGraphOptimizer_ParameterMapEntry_DoNotUse_tensorflow_2fcore_2fprotobuf_2frewriter_5fconfig_2eproto =
104 {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsscc_info_RewriterConfig_CustomGraphOptimizer_ParameterMapEntry_DoNotUse_tensorflow_2fcore_2fprotobuf_2frewriter_5fconfig_2eproto}, {
105 &scc_info_AttrValue_tensorflow_2fcore_2fframework_2fattr_5fvalue_2eproto.base,}};
106
107static void InitDefaultsscc_info_ScopedAllocatorOptions_tensorflow_2fcore_2fprotobuf_2frewriter_5fconfig_2eproto() {
108 GOOGLE_PROTOBUF_VERIFY_VERSION;
109
110 {
111 void* ptr = &::tensorflow::_ScopedAllocatorOptions_default_instance_;
112 new (ptr) ::tensorflow::ScopedAllocatorOptions();
113 ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
114 }
115 ::tensorflow::ScopedAllocatorOptions::InitAsDefaultInstance();
116}
117
118::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_ScopedAllocatorOptions_tensorflow_2fcore_2fprotobuf_2frewriter_5fconfig_2eproto =
119 {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsscc_info_ScopedAllocatorOptions_tensorflow_2fcore_2fprotobuf_2frewriter_5fconfig_2eproto}, {}};
120
121static ::PROTOBUF_NAMESPACE_ID::Metadata file_level_metadata_tensorflow_2fcore_2fprotobuf_2frewriter_5fconfig_2eproto[5];
122static const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* file_level_enum_descriptors_tensorflow_2fcore_2fprotobuf_2frewriter_5fconfig_2eproto[4];
123static constexpr ::PROTOBUF_NAMESPACE_ID::ServiceDescriptor const** file_level_service_descriptors_tensorflow_2fcore_2fprotobuf_2frewriter_5fconfig_2eproto = nullptr;
124
125const ::PROTOBUF_NAMESPACE_ID::uint32 TableStruct_tensorflow_2fcore_2fprotobuf_2frewriter_5fconfig_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
126 ~0u, // no _has_bits_
127 PROTOBUF_FIELD_OFFSET(::tensorflow::AutoParallelOptions, _internal_metadata_),
128 ~0u, // no _extensions_
129 ~0u, // no _oneof_case_
130 ~0u, // no _weak_field_map_
131 PROTOBUF_FIELD_OFFSET(::tensorflow::AutoParallelOptions, enable_),
132 PROTOBUF_FIELD_OFFSET(::tensorflow::AutoParallelOptions, num_replicas_),
133 ~0u, // no _has_bits_
134 PROTOBUF_FIELD_OFFSET(::tensorflow::ScopedAllocatorOptions, _internal_metadata_),
135 ~0u, // no _extensions_
136 ~0u, // no _oneof_case_
137 ~0u, // no _weak_field_map_
138 PROTOBUF_FIELD_OFFSET(::tensorflow::ScopedAllocatorOptions, enable_op_),
139 PROTOBUF_FIELD_OFFSET(::tensorflow::RewriterConfig_CustomGraphOptimizer_ParameterMapEntry_DoNotUse, _has_bits_),
140 PROTOBUF_FIELD_OFFSET(::tensorflow::RewriterConfig_CustomGraphOptimizer_ParameterMapEntry_DoNotUse, _internal_metadata_),
141 ~0u, // no _extensions_
142 ~0u, // no _oneof_case_
143 ~0u, // no _weak_field_map_
144 PROTOBUF_FIELD_OFFSET(::tensorflow::RewriterConfig_CustomGraphOptimizer_ParameterMapEntry_DoNotUse, key_),
145 PROTOBUF_FIELD_OFFSET(::tensorflow::RewriterConfig_CustomGraphOptimizer_ParameterMapEntry_DoNotUse, value_),
146 0,
147 1,
148 ~0u, // no _has_bits_
149 PROTOBUF_FIELD_OFFSET(::tensorflow::RewriterConfig_CustomGraphOptimizer, _internal_metadata_),
150 ~0u, // no _extensions_
151 ~0u, // no _oneof_case_
152 ~0u, // no _weak_field_map_
153 PROTOBUF_FIELD_OFFSET(::tensorflow::RewriterConfig_CustomGraphOptimizer, name_),
154 PROTOBUF_FIELD_OFFSET(::tensorflow::RewriterConfig_CustomGraphOptimizer, parameter_map_),
155 ~0u, // no _has_bits_
156 PROTOBUF_FIELD_OFFSET(::tensorflow::RewriterConfig, _internal_metadata_),
157 ~0u, // no _extensions_
158 ~0u, // no _oneof_case_
159 ~0u, // no _weak_field_map_
160 PROTOBUF_FIELD_OFFSET(::tensorflow::RewriterConfig, cpu_layout_conversion_),
161 PROTOBUF_FIELD_OFFSET(::tensorflow::RewriterConfig, layout_optimizer_),
162 PROTOBUF_FIELD_OFFSET(::tensorflow::RewriterConfig, constant_folding_),
163 PROTOBUF_FIELD_OFFSET(::tensorflow::RewriterConfig, shape_optimization_),
164 PROTOBUF_FIELD_OFFSET(::tensorflow::RewriterConfig, remapping_),
165 PROTOBUF_FIELD_OFFSET(::tensorflow::RewriterConfig, common_subgraph_elimination_),
166 PROTOBUF_FIELD_OFFSET(::tensorflow::RewriterConfig, arithmetic_optimization_),
167 PROTOBUF_FIELD_OFFSET(::tensorflow::RewriterConfig, dependency_optimization_),
168 PROTOBUF_FIELD_OFFSET(::tensorflow::RewriterConfig, loop_optimization_),
169 PROTOBUF_FIELD_OFFSET(::tensorflow::RewriterConfig, function_optimization_),
170 PROTOBUF_FIELD_OFFSET(::tensorflow::RewriterConfig, debug_stripper_),
171 PROTOBUF_FIELD_OFFSET(::tensorflow::RewriterConfig, disable_model_pruning_),
172 PROTOBUF_FIELD_OFFSET(::tensorflow::RewriterConfig, scoped_allocator_optimization_),
173 PROTOBUF_FIELD_OFFSET(::tensorflow::RewriterConfig, pin_to_host_optimization_),
174 PROTOBUF_FIELD_OFFSET(::tensorflow::RewriterConfig, implementation_selector_),
175 PROTOBUF_FIELD_OFFSET(::tensorflow::RewriterConfig, auto_mixed_precision_),
176 PROTOBUF_FIELD_OFFSET(::tensorflow::RewriterConfig, auto_mixed_precision_mkl_),
177 PROTOBUF_FIELD_OFFSET(::tensorflow::RewriterConfig, auto_mixed_precision_onednn_bfloat16_),
178 PROTOBUF_FIELD_OFFSET(::tensorflow::RewriterConfig, auto_mixed_precision_cpu_),
179 PROTOBUF_FIELD_OFFSET(::tensorflow::RewriterConfig, disable_meta_optimizer_),
180 PROTOBUF_FIELD_OFFSET(::tensorflow::RewriterConfig, use_plugin_optimizers_),
181 PROTOBUF_FIELD_OFFSET(::tensorflow::RewriterConfig, experimental_conditional_code_motion_),
182 PROTOBUF_FIELD_OFFSET(::tensorflow::RewriterConfig, meta_optimizer_iterations_),
183 PROTOBUF_FIELD_OFFSET(::tensorflow::RewriterConfig, min_graph_nodes_),
184 PROTOBUF_FIELD_OFFSET(::tensorflow::RewriterConfig, experimental_disable_compressed_tensor_optimization_),
185 PROTOBUF_FIELD_OFFSET(::tensorflow::RewriterConfig, experimental_disable_folding_quantization_emulation_),
186 PROTOBUF_FIELD_OFFSET(::tensorflow::RewriterConfig, memory_optimization_),
187 PROTOBUF_FIELD_OFFSET(::tensorflow::RewriterConfig, memory_optimizer_target_node_name_scope_),
188 PROTOBUF_FIELD_OFFSET(::tensorflow::RewriterConfig, meta_optimizer_timeout_ms_),
189 PROTOBUF_FIELD_OFFSET(::tensorflow::RewriterConfig, auto_parallel_),
190 PROTOBUF_FIELD_OFFSET(::tensorflow::RewriterConfig, fail_on_optimizer_errors_),
191 PROTOBUF_FIELD_OFFSET(::tensorflow::RewriterConfig, scoped_allocator_opts_),
192 PROTOBUF_FIELD_OFFSET(::tensorflow::RewriterConfig, optimizers_),
193 PROTOBUF_FIELD_OFFSET(::tensorflow::RewriterConfig, custom_optimizers_),
194 PROTOBUF_FIELD_OFFSET(::tensorflow::RewriterConfig, inter_optimizer_verifier_config_),
195 PROTOBUF_FIELD_OFFSET(::tensorflow::RewriterConfig, post_optimization_verifier_config_),
196};
197static const ::PROTOBUF_NAMESPACE_ID::internal::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
198 { 0, -1, sizeof(::tensorflow::AutoParallelOptions)},
199 { 7, -1, sizeof(::tensorflow::ScopedAllocatorOptions)},
200 { 13, 20, sizeof(::tensorflow::RewriterConfig_CustomGraphOptimizer_ParameterMapEntry_DoNotUse)},
201 { 22, -1, sizeof(::tensorflow::RewriterConfig_CustomGraphOptimizer)},
202 { 29, -1, sizeof(::tensorflow::RewriterConfig)},
203};
204
205static ::PROTOBUF_NAMESPACE_ID::Message const * const file_default_instances[] = {
206 reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::tensorflow::_AutoParallelOptions_default_instance_),
207 reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::tensorflow::_ScopedAllocatorOptions_default_instance_),
208 reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::tensorflow::_RewriterConfig_CustomGraphOptimizer_ParameterMapEntry_DoNotUse_default_instance_),
209 reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::tensorflow::_RewriterConfig_CustomGraphOptimizer_default_instance_),
210 reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::tensorflow::_RewriterConfig_default_instance_),
211};
212
213const char descriptor_table_protodef_tensorflow_2fcore_2fprotobuf_2frewriter_5fconfig_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) =
214 "\n.tensorflow/core/protobuf/rewriter_conf"
215 "ig.proto\022\ntensorflow\032*tensorflow/core/fr"
216 "amework/attr_value.proto\032.tensorflow/cor"
217 "e/protobuf/verifier_config.proto\";\n\023Auto"
218 "ParallelOptions\022\016\n\006enable\030\001 \001(\010\022\024\n\014num_r"
219 "eplicas\030\002 \001(\005\"+\n\026ScopedAllocatorOptions\022"
220 "\021\n\tenable_op\030\001 \003(\t\"\366\025\n\016RewriterConfig\022C\n"
221 "\025cpu_layout_conversion\0302 \001(\0162$.tensorflo"
222 "w.RewriterConfig.CpuLayout\022;\n\020layout_opt"
223 "imizer\030\001 \001(\0162!.tensorflow.RewriterConfig"
224 ".Toggle\022;\n\020constant_folding\030\003 \001(\0162!.tens"
225 "orflow.RewriterConfig.Toggle\022=\n\022shape_op"
226 "timization\030\r \001(\0162!.tensorflow.RewriterCo"
227 "nfig.Toggle\0224\n\tremapping\030\016 \001(\0162!.tensorf"
228 "low.RewriterConfig.Toggle\022F\n\033common_subg"
229 "raph_elimination\030\030 \001(\0162!.tensorflow.Rewr"
230 "iterConfig.Toggle\022B\n\027arithmetic_optimiza"
231 "tion\030\007 \001(\0162!.tensorflow.RewriterConfig.T"
232 "oggle\022B\n\027dependency_optimization\030\010 \001(\0162!"
233 ".tensorflow.RewriterConfig.Toggle\022<\n\021loo"
234 "p_optimization\030\t \001(\0162!.tensorflow.Rewrit"
235 "erConfig.Toggle\022@\n\025function_optimization"
236 "\030\n \001(\0162!.tensorflow.RewriterConfig.Toggl"
237 "e\0229\n\016debug_stripper\030\013 \001(\0162!.tensorflow.R"
238 "ewriterConfig.Toggle\022\035\n\025disable_model_pr"
239 "uning\030\002 \001(\010\022H\n\035scoped_allocator_optimiza"
240 "tion\030\017 \001(\0162!.tensorflow.RewriterConfig.T"
241 "oggle\022C\n\030pin_to_host_optimization\030\022 \001(\0162"
242 "!.tensorflow.RewriterConfig.Toggle\022B\n\027im"
243 "plementation_selector\030\026 \001(\0162!.tensorflow"
244 ".RewriterConfig.Toggle\022\?\n\024auto_mixed_pre"
245 "cision\030\027 \001(\0162!.tensorflow.RewriterConfig"
246 ".Toggle\022C\n\030auto_mixed_precision_mkl\030\031 \001("
247 "\0162!.tensorflow.RewriterConfig.Toggle\022O\n$"
248 "auto_mixed_precision_onednn_bfloat16\030\037 \001"
249 "(\0162!.tensorflow.RewriterConfig.Toggle\022C\n"
250 "\030auto_mixed_precision_cpu\030\035 \001(\0162!.tensor"
251 "flow.RewriterConfig.Toggle\022\036\n\026disable_me"
252 "ta_optimizer\030\023 \001(\010\022@\n\025use_plugin_optimiz"
253 "ers\030\034 \001(\0162!.tensorflow.RewriterConfig.To"
254 "ggle\022O\n$experimental_conditional_code_mo"
255 "tion\030\036 \001(\0162!.tensorflow.RewriterConfig.T"
256 "oggle\022O\n\031meta_optimizer_iterations\030\014 \001(\016"
257 "2,.tensorflow.RewriterConfig.NumIteratio"
258 "nsType\022\027\n\017min_graph_nodes\030\021 \001(\005\022;\n3exper"
259 "imental_disable_compressed_tensor_optimi"
260 "zation\030\032 \001(\010\022;\n3experimental_disable_fol"
261 "ding_quantization_emulation\030\033 \001(\010\022B\n\023mem"
262 "ory_optimization\030\004 \001(\0162%.tensorflow.Rewr"
263 "iterConfig.MemOptType\022/\n\'memory_optimize"
264 "r_target_node_name_scope\030\006 \001(\t\022!\n\031meta_o"
265 "ptimizer_timeout_ms\030\024 \001(\003\0226\n\rauto_parall"
266 "el\030\005 \001(\0132\037.tensorflow.AutoParallelOption"
267 "s\022 \n\030fail_on_optimizer_errors\030\025 \001(\010\022A\n\025s"
268 "coped_allocator_opts\030\020 \001(\0132\".tensorflow."
269 "ScopedAllocatorOptions\022\022\n\noptimizers\030d \003"
270 "(\t\022K\n\021custom_optimizers\030\310\001 \003(\0132/.tensorf"
271 "low.RewriterConfig.CustomGraphOptimizer\022"
272 "D\n\037inter_optimizer_verifier_config\030\254\002 \001("
273 "\0132\032.tensorflow.VerifierConfig\022F\n!post_op"
274 "timization_verifier_config\030\255\002 \001(\0132\032.tens"
275 "orflow.VerifierConfig\032\312\001\n\024CustomGraphOpt"
276 "imizer\022\014\n\004name\030\001 \001(\t\022X\n\rparameter_map\030\002 "
277 "\003(\0132A.tensorflow.RewriterConfig.CustomGr"
278 "aphOptimizer.ParameterMapEntry\032J\n\021Parame"
279 "terMapEntry\022\013\n\003key\030\001 \001(\t\022$\n\005value\030\002 \001(\0132"
280 "\025.tensorflow.AttrValue:\0028\001\"d\n\006Toggle\022\013\n\007"
281 "DEFAULT\020\000\022\006\n\002ON\020\001\022\007\n\003OFF\020\002\022\016\n\nAGGRESSIVE"
282 "\020\003\022\025\n\021EXPERIMENTAL_MLIR\020\004\022\025\n\021EXPERIMENTA"
283 "L_BOTH\020\005\"I\n\tCpuLayout\022\030\n\024NO_CONVERSION_O"
284 "N_CPU\020\000\022\020\n\014NCHW_TO_NHWC\020\001\022\020\n\014NHWC_TO_NCH"
285 "W\020\002\"<\n\021NumIterationsType\022\025\n\021DEFAULT_NUM_"
286 "ITERS\020\000\022\007\n\003ONE\020\001\022\007\n\003TWO\020\002\"\237\001\n\nMemOptType"
287 "\022\023\n\017DEFAULT_MEM_OPT\020\000\022\016\n\nNO_MEM_OPT\020\001\022\n\n"
288 "\006MANUAL\020\002\022\027\n\023SWAPPING_HEURISTICS\020\004\022\034\n\030RE"
289 "COMPUTATION_HEURISTICS\020\005\022\031\n\025SCHEDULING_H"
290 "EURISTICS\020\006\022\016\n\nHEURISTICS\020\003B\214\001\n\030org.tens"
291 "orflow.frameworkB\024RewriterConfigProtosP\001"
292 "ZUgithub.com/tensorflow/tensorflow/tenso"
293 "rflow/go/core/protobuf/for_core_protos_g"
294 "o_proto\370\001\001b\006proto3"
295 ;
296static const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable*const descriptor_table_tensorflow_2fcore_2fprotobuf_2frewriter_5fconfig_2eproto_deps[2] = {
297 &::descriptor_table_tensorflow_2fcore_2fframework_2fattr_5fvalue_2eproto,
298 &::descriptor_table_tensorflow_2fcore_2fprotobuf_2fverifier_5fconfig_2eproto,
299};
300static ::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase*const descriptor_table_tensorflow_2fcore_2fprotobuf_2frewriter_5fconfig_2eproto_sccs[5] = {
301 &scc_info_AutoParallelOptions_tensorflow_2fcore_2fprotobuf_2frewriter_5fconfig_2eproto.base,
302 &scc_info_RewriterConfig_tensorflow_2fcore_2fprotobuf_2frewriter_5fconfig_2eproto.base,
303 &scc_info_RewriterConfig_CustomGraphOptimizer_tensorflow_2fcore_2fprotobuf_2frewriter_5fconfig_2eproto.base,
304 &scc_info_RewriterConfig_CustomGraphOptimizer_ParameterMapEntry_DoNotUse_tensorflow_2fcore_2fprotobuf_2frewriter_5fconfig_2eproto.base,
305 &scc_info_ScopedAllocatorOptions_tensorflow_2fcore_2fprotobuf_2frewriter_5fconfig_2eproto.base,
306};
307static ::PROTOBUF_NAMESPACE_ID::internal::once_flag descriptor_table_tensorflow_2fcore_2fprotobuf_2frewriter_5fconfig_2eproto_once;
308static bool descriptor_table_tensorflow_2fcore_2fprotobuf_2frewriter_5fconfig_2eproto_initialized = false;
309const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_tensorflow_2fcore_2fprotobuf_2frewriter_5fconfig_2eproto = {
310 &descriptor_table_tensorflow_2fcore_2fprotobuf_2frewriter_5fconfig_2eproto_initialized, descriptor_table_protodef_tensorflow_2fcore_2fprotobuf_2frewriter_5fconfig_2eproto, "tensorflow/core/protobuf/rewriter_config.proto", 3218,
311 &descriptor_table_tensorflow_2fcore_2fprotobuf_2frewriter_5fconfig_2eproto_once, descriptor_table_tensorflow_2fcore_2fprotobuf_2frewriter_5fconfig_2eproto_sccs, descriptor_table_tensorflow_2fcore_2fprotobuf_2frewriter_5fconfig_2eproto_deps, 5, 2,
312 schemas, file_default_instances, TableStruct_tensorflow_2fcore_2fprotobuf_2frewriter_5fconfig_2eproto::offsets,
313 file_level_metadata_tensorflow_2fcore_2fprotobuf_2frewriter_5fconfig_2eproto, 5, file_level_enum_descriptors_tensorflow_2fcore_2fprotobuf_2frewriter_5fconfig_2eproto, file_level_service_descriptors_tensorflow_2fcore_2fprotobuf_2frewriter_5fconfig_2eproto,
314};
315
316// Force running AddDescriptors() at dynamic initialization time.
317static bool dynamic_init_dummy_tensorflow_2fcore_2fprotobuf_2frewriter_5fconfig_2eproto = ( ::PROTOBUF_NAMESPACE_ID::internal::AddDescriptors(&descriptor_table_tensorflow_2fcore_2fprotobuf_2frewriter_5fconfig_2eproto), true);
318namespace tensorflow {
319const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* RewriterConfig_Toggle_descriptor() {
320 ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_tensorflow_2fcore_2fprotobuf_2frewriter_5fconfig_2eproto);
321 return file_level_enum_descriptors_tensorflow_2fcore_2fprotobuf_2frewriter_5fconfig_2eproto[0];
322}
323bool RewriterConfig_Toggle_IsValid(int value) {
324 switch (value) {
325 case 0:
326 case 1:
327 case 2:
328 case 3:
329 case 4:
330 case 5:
331 return true;
332 default:
333 return false;
334 }
335}
336
337#if (__cplusplus < 201703) && (!defined(_MSC_VER) || _MSC_VER >= 1900)
338constexpr RewriterConfig_Toggle RewriterConfig::DEFAULT;
339constexpr RewriterConfig_Toggle RewriterConfig::ON;
340constexpr RewriterConfig_Toggle RewriterConfig::OFF;
341constexpr RewriterConfig_Toggle RewriterConfig::AGGRESSIVE;
342constexpr RewriterConfig_Toggle RewriterConfig::EXPERIMENTAL_MLIR;
343constexpr RewriterConfig_Toggle RewriterConfig::EXPERIMENTAL_BOTH;
344constexpr RewriterConfig_Toggle RewriterConfig::Toggle_MIN;
345constexpr RewriterConfig_Toggle RewriterConfig::Toggle_MAX;
346constexpr int RewriterConfig::Toggle_ARRAYSIZE;
347#endif // (__cplusplus < 201703) && (!defined(_MSC_VER) || _MSC_VER >= 1900)
348const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* RewriterConfig_CpuLayout_descriptor() {
349 ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_tensorflow_2fcore_2fprotobuf_2frewriter_5fconfig_2eproto);
350 return file_level_enum_descriptors_tensorflow_2fcore_2fprotobuf_2frewriter_5fconfig_2eproto[1];
351}
352bool RewriterConfig_CpuLayout_IsValid(int value) {
353 switch (value) {
354 case 0:
355 case 1:
356 case 2:
357 return true;
358 default:
359 return false;
360 }
361}
362
363#if (__cplusplus < 201703) && (!defined(_MSC_VER) || _MSC_VER >= 1900)
364constexpr RewriterConfig_CpuLayout RewriterConfig::NO_CONVERSION_ON_CPU;
365constexpr RewriterConfig_CpuLayout RewriterConfig::NCHW_TO_NHWC;
366constexpr RewriterConfig_CpuLayout RewriterConfig::NHWC_TO_NCHW;
367constexpr RewriterConfig_CpuLayout RewriterConfig::CpuLayout_MIN;
368constexpr RewriterConfig_CpuLayout RewriterConfig::CpuLayout_MAX;
369constexpr int RewriterConfig::CpuLayout_ARRAYSIZE;
370#endif // (__cplusplus < 201703) && (!defined(_MSC_VER) || _MSC_VER >= 1900)
371const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* RewriterConfig_NumIterationsType_descriptor() {
372 ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_tensorflow_2fcore_2fprotobuf_2frewriter_5fconfig_2eproto);
373 return file_level_enum_descriptors_tensorflow_2fcore_2fprotobuf_2frewriter_5fconfig_2eproto[2];
374}
375bool RewriterConfig_NumIterationsType_IsValid(int value) {
376 switch (value) {
377 case 0:
378 case 1:
379 case 2:
380 return true;
381 default:
382 return false;
383 }
384}
385
386#if (__cplusplus < 201703) && (!defined(_MSC_VER) || _MSC_VER >= 1900)
387constexpr RewriterConfig_NumIterationsType RewriterConfig::DEFAULT_NUM_ITERS;
388constexpr RewriterConfig_NumIterationsType RewriterConfig::ONE;
389constexpr RewriterConfig_NumIterationsType RewriterConfig::TWO;
390constexpr RewriterConfig_NumIterationsType RewriterConfig::NumIterationsType_MIN;
391constexpr RewriterConfig_NumIterationsType RewriterConfig::NumIterationsType_MAX;
392constexpr int RewriterConfig::NumIterationsType_ARRAYSIZE;
393#endif // (__cplusplus < 201703) && (!defined(_MSC_VER) || _MSC_VER >= 1900)
394const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* RewriterConfig_MemOptType_descriptor() {
395 ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_tensorflow_2fcore_2fprotobuf_2frewriter_5fconfig_2eproto);
396 return file_level_enum_descriptors_tensorflow_2fcore_2fprotobuf_2frewriter_5fconfig_2eproto[3];
397}
398bool RewriterConfig_MemOptType_IsValid(int value) {
399 switch (value) {
400 case 0:
401 case 1:
402 case 2:
403 case 3:
404 case 4:
405 case 5:
406 case 6:
407 return true;
408 default:
409 return false;
410 }
411}
412
413#if (__cplusplus < 201703) && (!defined(_MSC_VER) || _MSC_VER >= 1900)
414constexpr RewriterConfig_MemOptType RewriterConfig::DEFAULT_MEM_OPT;
415constexpr RewriterConfig_MemOptType RewriterConfig::NO_MEM_OPT;
416constexpr RewriterConfig_MemOptType RewriterConfig::MANUAL;
417constexpr RewriterConfig_MemOptType RewriterConfig::SWAPPING_HEURISTICS;
418constexpr RewriterConfig_MemOptType RewriterConfig::RECOMPUTATION_HEURISTICS;
419constexpr RewriterConfig_MemOptType RewriterConfig::SCHEDULING_HEURISTICS;
420constexpr RewriterConfig_MemOptType RewriterConfig::HEURISTICS;
421constexpr RewriterConfig_MemOptType RewriterConfig::MemOptType_MIN;
422constexpr RewriterConfig_MemOptType RewriterConfig::MemOptType_MAX;
423constexpr int RewriterConfig::MemOptType_ARRAYSIZE;
424#endif // (__cplusplus < 201703) && (!defined(_MSC_VER) || _MSC_VER >= 1900)
425
426// ===================================================================
427
428void AutoParallelOptions::InitAsDefaultInstance() {
429}
430class AutoParallelOptions::_Internal {
431 public:
432};
433
434AutoParallelOptions::AutoParallelOptions()
435 : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
436 SharedCtor();
437 // @@protoc_insertion_point(constructor:tensorflow.AutoParallelOptions)
438}
439AutoParallelOptions::AutoParallelOptions(::PROTOBUF_NAMESPACE_ID::Arena* arena)
440 : ::PROTOBUF_NAMESPACE_ID::Message(),
441 _internal_metadata_(arena) {
442 SharedCtor();
443 RegisterArenaDtor(arena);
444 // @@protoc_insertion_point(arena_constructor:tensorflow.AutoParallelOptions)
445}
446AutoParallelOptions::AutoParallelOptions(const AutoParallelOptions& from)
447 : ::PROTOBUF_NAMESPACE_ID::Message(),
448 _internal_metadata_(nullptr) {
449 _internal_metadata_.MergeFrom(from._internal_metadata_);
450 ::memcpy(&enable_, &from.enable_,
451 static_cast<size_t>(reinterpret_cast<char*>(&num_replicas_) -
452 reinterpret_cast<char*>(&enable_)) + sizeof(num_replicas_));
453 // @@protoc_insertion_point(copy_constructor:tensorflow.AutoParallelOptions)
454}
455
456void AutoParallelOptions::SharedCtor() {
457 ::memset(&enable_, 0, static_cast<size_t>(
458 reinterpret_cast<char*>(&num_replicas_) -
459 reinterpret_cast<char*>(&enable_)) + sizeof(num_replicas_));
460}
461
462AutoParallelOptions::~AutoParallelOptions() {
463 // @@protoc_insertion_point(destructor:tensorflow.AutoParallelOptions)
464 SharedDtor();
465}
466
467void AutoParallelOptions::SharedDtor() {
468 GOOGLE_DCHECK(GetArenaNoVirtual() == nullptr);
469}
470
471void AutoParallelOptions::ArenaDtor(void* object) {
472 AutoParallelOptions* _this = reinterpret_cast< AutoParallelOptions* >(object);
473 (void)_this;
474}
475void AutoParallelOptions::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
476}
477void AutoParallelOptions::SetCachedSize(int size) const {
478 _cached_size_.Set(size);
479}
480const AutoParallelOptions& AutoParallelOptions::default_instance() {
481 ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_AutoParallelOptions_tensorflow_2fcore_2fprotobuf_2frewriter_5fconfig_2eproto.base);
482 return *internal_default_instance();
483}
484
485
486void AutoParallelOptions::Clear() {
487// @@protoc_insertion_point(message_clear_start:tensorflow.AutoParallelOptions)
488 ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
489 // Prevent compiler warnings about cached_has_bits being unused
490 (void) cached_has_bits;
491
492 ::memset(&enable_, 0, static_cast<size_t>(
493 reinterpret_cast<char*>(&num_replicas_) -
494 reinterpret_cast<char*>(&enable_)) + sizeof(num_replicas_));
495 _internal_metadata_.Clear();
496}
497
498#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
499const char* AutoParallelOptions::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
500#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
501 ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArenaNoVirtual(); (void)arena;
502 while (!ctx->Done(&ptr)) {
503 ::PROTOBUF_NAMESPACE_ID::uint32 tag;
504 ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
505 CHK_(ptr);
506 switch (tag >> 3) {
507 // bool enable = 1;
508 case 1:
509 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) {
510 enable_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
511 CHK_(ptr);
512 } else goto handle_unusual;
513 continue;
514 // int32 num_replicas = 2;
515 case 2:
516 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) {
517 num_replicas_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
518 CHK_(ptr);
519 } else goto handle_unusual;
520 continue;
521 default: {
522 handle_unusual:
523 if ((tag & 7) == 4 || tag == 0) {
524 ctx->SetLastTag(tag);
525 goto success;
526 }
527 ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
528 CHK_(ptr != nullptr);
529 continue;
530 }
531 } // switch
532 } // while
533success:
534 return ptr;
535failure:
536 ptr = nullptr;
537 goto success;
538#undef CHK_
539}
540#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
541bool AutoParallelOptions::MergePartialFromCodedStream(
542 ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) {
543#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure
544 ::PROTOBUF_NAMESPACE_ID::uint32 tag;
545 // @@protoc_insertion_point(parse_start:tensorflow.AutoParallelOptions)
546 for (;;) {
547 ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
548 tag = p.first;
549 if (!p.second) goto handle_unusual;
550 switch (::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::GetTagFieldNumber(tag)) {
551 // bool enable = 1;
552 case 1: {
553 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (8 & 0xFF)) {
554
555 DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
556 bool, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_BOOL>(
557 input, &enable_)));
558 } else {
559 goto handle_unusual;
560 }
561 break;
562 }
563
564 // int32 num_replicas = 2;
565 case 2: {
566 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (16 & 0xFF)) {
567
568 DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
569 ::PROTOBUF_NAMESPACE_ID::int32, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT32>(
570 input, &num_replicas_)));
571 } else {
572 goto handle_unusual;
573 }
574 break;
575 }
576
577 default: {
578 handle_unusual:
579 if (tag == 0) {
580 goto success;
581 }
582 DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SkipField(
583 input, tag, _internal_metadata_.mutable_unknown_fields()));
584 break;
585 }
586 }
587 }
588success:
589 // @@protoc_insertion_point(parse_success:tensorflow.AutoParallelOptions)
590 return true;
591failure:
592 // @@protoc_insertion_point(parse_failure:tensorflow.AutoParallelOptions)
593 return false;
594#undef DO_
595}
596#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
597
598void AutoParallelOptions::SerializeWithCachedSizes(
599 ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const {
600 // @@protoc_insertion_point(serialize_start:tensorflow.AutoParallelOptions)
601 ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
602 (void) cached_has_bits;
603
604 // bool enable = 1;
605 if (this->enable() != 0) {
606 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBool(1, this->enable(), output);
607 }
608
609 // int32 num_replicas = 2;
610 if (this->num_replicas() != 0) {
611 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32(2, this->num_replicas(), output);
612 }
613
614 if (_internal_metadata_.have_unknown_fields()) {
615 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields(
616 _internal_metadata_.unknown_fields(), output);
617 }
618 // @@protoc_insertion_point(serialize_end:tensorflow.AutoParallelOptions)
619}
620
621::PROTOBUF_NAMESPACE_ID::uint8* AutoParallelOptions::InternalSerializeWithCachedSizesToArray(
622 ::PROTOBUF_NAMESPACE_ID::uint8* target) const {
623 // @@protoc_insertion_point(serialize_to_array_start:tensorflow.AutoParallelOptions)
624 ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
625 (void) cached_has_bits;
626
627 // bool enable = 1;
628 if (this->enable() != 0) {
629 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(1, this->enable(), target);
630 }
631
632 // int32 num_replicas = 2;
633 if (this->num_replicas() != 0) {
634 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(2, this->num_replicas(), target);
635 }
636
637 if (_internal_metadata_.have_unknown_fields()) {
638 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray(
639 _internal_metadata_.unknown_fields(), target);
640 }
641 // @@protoc_insertion_point(serialize_to_array_end:tensorflow.AutoParallelOptions)
642 return target;
643}
644
645size_t AutoParallelOptions::ByteSizeLong() const {
646// @@protoc_insertion_point(message_byte_size_start:tensorflow.AutoParallelOptions)
647 size_t total_size = 0;
648
649 if (_internal_metadata_.have_unknown_fields()) {
650 total_size +=
651 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::ComputeUnknownFieldsSize(
652 _internal_metadata_.unknown_fields());
653 }
654 ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
655 // Prevent compiler warnings about cached_has_bits being unused
656 (void) cached_has_bits;
657
658 // bool enable = 1;
659 if (this->enable() != 0) {
660 total_size += 1 + 1;
661 }
662
663 // int32 num_replicas = 2;
664 if (this->num_replicas() != 0) {
665 total_size += 1 +
666 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
667 this->num_replicas());
668 }
669
670 int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
671 SetCachedSize(cached_size);
672 return total_size;
673}
674
675void AutoParallelOptions::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
676// @@protoc_insertion_point(generalized_merge_from_start:tensorflow.AutoParallelOptions)
677 GOOGLE_DCHECK_NE(&from, this);
678 const AutoParallelOptions* source =
679 ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<AutoParallelOptions>(
680 &from);
681 if (source == nullptr) {
682 // @@protoc_insertion_point(generalized_merge_from_cast_fail:tensorflow.AutoParallelOptions)
683 ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
684 } else {
685 // @@protoc_insertion_point(generalized_merge_from_cast_success:tensorflow.AutoParallelOptions)
686 MergeFrom(*source);
687 }
688}
689
690void AutoParallelOptions::MergeFrom(const AutoParallelOptions& from) {
691// @@protoc_insertion_point(class_specific_merge_from_start:tensorflow.AutoParallelOptions)
692 GOOGLE_DCHECK_NE(&from, this);
693 _internal_metadata_.MergeFrom(from._internal_metadata_);
694 ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
695 (void) cached_has_bits;
696
697 if (from.enable() != 0) {
698 set_enable(from.enable());
699 }
700 if (from.num_replicas() != 0) {
701 set_num_replicas(from.num_replicas());
702 }
703}
704
705void AutoParallelOptions::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
706// @@protoc_insertion_point(generalized_copy_from_start:tensorflow.AutoParallelOptions)
707 if (&from == this) return;
708 Clear();
709 MergeFrom(from);
710}
711
712void AutoParallelOptions::CopyFrom(const AutoParallelOptions& from) {
713// @@protoc_insertion_point(class_specific_copy_from_start:tensorflow.AutoParallelOptions)
714 if (&from == this) return;
715 Clear();
716 MergeFrom(from);
717}
718
719bool AutoParallelOptions::IsInitialized() const {
720 return true;
721}
722
723void AutoParallelOptions::InternalSwap(AutoParallelOptions* other) {
724 using std::swap;
725 _internal_metadata_.Swap(&other->_internal_metadata_);
726 swap(enable_, other->enable_);
727 swap(num_replicas_, other->num_replicas_);
728}
729
730::PROTOBUF_NAMESPACE_ID::Metadata AutoParallelOptions::GetMetadata() const {
731 return GetMetadataStatic();
732}
733
734
735// ===================================================================
736
737void ScopedAllocatorOptions::InitAsDefaultInstance() {
738}
739class ScopedAllocatorOptions::_Internal {
740 public:
741};
742
743ScopedAllocatorOptions::ScopedAllocatorOptions()
744 : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
745 SharedCtor();
746 // @@protoc_insertion_point(constructor:tensorflow.ScopedAllocatorOptions)
747}
748ScopedAllocatorOptions::ScopedAllocatorOptions(::PROTOBUF_NAMESPACE_ID::Arena* arena)
749 : ::PROTOBUF_NAMESPACE_ID::Message(),
750 _internal_metadata_(arena),
751 enable_op_(arena) {
752 SharedCtor();
753 RegisterArenaDtor(arena);
754 // @@protoc_insertion_point(arena_constructor:tensorflow.ScopedAllocatorOptions)
755}
756ScopedAllocatorOptions::ScopedAllocatorOptions(const ScopedAllocatorOptions& from)
757 : ::PROTOBUF_NAMESPACE_ID::Message(),
758 _internal_metadata_(nullptr),
759 enable_op_(from.enable_op_) {
760 _internal_metadata_.MergeFrom(from._internal_metadata_);
761 // @@protoc_insertion_point(copy_constructor:tensorflow.ScopedAllocatorOptions)
762}
763
764void ScopedAllocatorOptions::SharedCtor() {
765 ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_ScopedAllocatorOptions_tensorflow_2fcore_2fprotobuf_2frewriter_5fconfig_2eproto.base);
766}
767
768ScopedAllocatorOptions::~ScopedAllocatorOptions() {
769 // @@protoc_insertion_point(destructor:tensorflow.ScopedAllocatorOptions)
770 SharedDtor();
771}
772
773void ScopedAllocatorOptions::SharedDtor() {
774 GOOGLE_DCHECK(GetArenaNoVirtual() == nullptr);
775}
776
777void ScopedAllocatorOptions::ArenaDtor(void* object) {
778 ScopedAllocatorOptions* _this = reinterpret_cast< ScopedAllocatorOptions* >(object);
779 (void)_this;
780}
781void ScopedAllocatorOptions::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
782}
783void ScopedAllocatorOptions::SetCachedSize(int size) const {
784 _cached_size_.Set(size);
785}
786const ScopedAllocatorOptions& ScopedAllocatorOptions::default_instance() {
787 ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_ScopedAllocatorOptions_tensorflow_2fcore_2fprotobuf_2frewriter_5fconfig_2eproto.base);
788 return *internal_default_instance();
789}
790
791
792void ScopedAllocatorOptions::Clear() {
793// @@protoc_insertion_point(message_clear_start:tensorflow.ScopedAllocatorOptions)
794 ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
795 // Prevent compiler warnings about cached_has_bits being unused
796 (void) cached_has_bits;
797
798 enable_op_.Clear();
799 _internal_metadata_.Clear();
800}
801
802#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
803const char* ScopedAllocatorOptions::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
804#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
805 ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArenaNoVirtual(); (void)arena;
806 while (!ctx->Done(&ptr)) {
807 ::PROTOBUF_NAMESPACE_ID::uint32 tag;
808 ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
809 CHK_(ptr);
810 switch (tag >> 3) {
811 // repeated string enable_op = 1;
812 case 1:
813 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) {
814 ptr -= 1;
815 do {
816 ptr += 1;
817 ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParserUTF8(add_enable_op(), ptr, ctx, "tensorflow.ScopedAllocatorOptions.enable_op");
818 CHK_(ptr);
819 if (!ctx->DataAvailable(ptr)) break;
820 } while (::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<::PROTOBUF_NAMESPACE_ID::uint8>(ptr) == 10);
821 } else goto handle_unusual;
822 continue;
823 default: {
824 handle_unusual:
825 if ((tag & 7) == 4 || tag == 0) {
826 ctx->SetLastTag(tag);
827 goto success;
828 }
829 ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
830 CHK_(ptr != nullptr);
831 continue;
832 }
833 } // switch
834 } // while
835success:
836 return ptr;
837failure:
838 ptr = nullptr;
839 goto success;
840#undef CHK_
841}
842#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
843bool ScopedAllocatorOptions::MergePartialFromCodedStream(
844 ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) {
845#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure
846 ::PROTOBUF_NAMESPACE_ID::uint32 tag;
847 // @@protoc_insertion_point(parse_start:tensorflow.ScopedAllocatorOptions)
848 for (;;) {
849 ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
850 tag = p.first;
851 if (!p.second) goto handle_unusual;
852 switch (::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::GetTagFieldNumber(tag)) {
853 // repeated string enable_op = 1;
854 case 1: {
855 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (10 & 0xFF)) {
856 DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadString(
857 input, this->add_enable_op()));
858 DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
859 this->enable_op(this->enable_op_size() - 1).data(),
860 static_cast<int>(this->enable_op(this->enable_op_size() - 1).length()),
861 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::PARSE,
862 "tensorflow.ScopedAllocatorOptions.enable_op"));
863 } else {
864 goto handle_unusual;
865 }
866 break;
867 }
868
869 default: {
870 handle_unusual:
871 if (tag == 0) {
872 goto success;
873 }
874 DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SkipField(
875 input, tag, _internal_metadata_.mutable_unknown_fields()));
876 break;
877 }
878 }
879 }
880success:
881 // @@protoc_insertion_point(parse_success:tensorflow.ScopedAllocatorOptions)
882 return true;
883failure:
884 // @@protoc_insertion_point(parse_failure:tensorflow.ScopedAllocatorOptions)
885 return false;
886#undef DO_
887}
888#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
889
890void ScopedAllocatorOptions::SerializeWithCachedSizes(
891 ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const {
892 // @@protoc_insertion_point(serialize_start:tensorflow.ScopedAllocatorOptions)
893 ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
894 (void) cached_has_bits;
895
896 // repeated string enable_op = 1;
897 for (int i = 0, n = this->enable_op_size(); i < n; i++) {
898 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
899 this->enable_op(i).data(), static_cast<int>(this->enable_op(i).length()),
900 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
901 "tensorflow.ScopedAllocatorOptions.enable_op");
902 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteString(
903 1, this->enable_op(i), output);
904 }
905
906 if (_internal_metadata_.have_unknown_fields()) {
907 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields(
908 _internal_metadata_.unknown_fields(), output);
909 }
910 // @@protoc_insertion_point(serialize_end:tensorflow.ScopedAllocatorOptions)
911}
912
913::PROTOBUF_NAMESPACE_ID::uint8* ScopedAllocatorOptions::InternalSerializeWithCachedSizesToArray(
914 ::PROTOBUF_NAMESPACE_ID::uint8* target) const {
915 // @@protoc_insertion_point(serialize_to_array_start:tensorflow.ScopedAllocatorOptions)
916 ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
917 (void) cached_has_bits;
918
919 // repeated string enable_op = 1;
920 for (int i = 0, n = this->enable_op_size(); i < n; i++) {
921 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
922 this->enable_op(i).data(), static_cast<int>(this->enable_op(i).length()),
923 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
924 "tensorflow.ScopedAllocatorOptions.enable_op");
925 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
926 WriteStringToArray(1, this->enable_op(i), target);
927 }
928
929 if (_internal_metadata_.have_unknown_fields()) {
930 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray(
931 _internal_metadata_.unknown_fields(), target);
932 }
933 // @@protoc_insertion_point(serialize_to_array_end:tensorflow.ScopedAllocatorOptions)
934 return target;
935}
936
937size_t ScopedAllocatorOptions::ByteSizeLong() const {
938// @@protoc_insertion_point(message_byte_size_start:tensorflow.ScopedAllocatorOptions)
939 size_t total_size = 0;
940
941 if (_internal_metadata_.have_unknown_fields()) {
942 total_size +=
943 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::ComputeUnknownFieldsSize(
944 _internal_metadata_.unknown_fields());
945 }
946 ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
947 // Prevent compiler warnings about cached_has_bits being unused
948 (void) cached_has_bits;
949
950 // repeated string enable_op = 1;
951 total_size += 1 *
952 ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(this->enable_op_size());
953 for (int i = 0, n = this->enable_op_size(); i < n; i++) {
954 total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
955 this->enable_op(i));
956 }
957
958 int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
959 SetCachedSize(cached_size);
960 return total_size;
961}
962
963void ScopedAllocatorOptions::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
964// @@protoc_insertion_point(generalized_merge_from_start:tensorflow.ScopedAllocatorOptions)
965 GOOGLE_DCHECK_NE(&from, this);
966 const ScopedAllocatorOptions* source =
967 ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<ScopedAllocatorOptions>(
968 &from);
969 if (source == nullptr) {
970 // @@protoc_insertion_point(generalized_merge_from_cast_fail:tensorflow.ScopedAllocatorOptions)
971 ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
972 } else {
973 // @@protoc_insertion_point(generalized_merge_from_cast_success:tensorflow.ScopedAllocatorOptions)
974 MergeFrom(*source);
975 }
976}
977
978void ScopedAllocatorOptions::MergeFrom(const ScopedAllocatorOptions& from) {
979// @@protoc_insertion_point(class_specific_merge_from_start:tensorflow.ScopedAllocatorOptions)
980 GOOGLE_DCHECK_NE(&from, this);
981 _internal_metadata_.MergeFrom(from._internal_metadata_);
982 ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
983 (void) cached_has_bits;
984
985 enable_op_.MergeFrom(from.enable_op_);
986}
987
988void ScopedAllocatorOptions::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
989// @@protoc_insertion_point(generalized_copy_from_start:tensorflow.ScopedAllocatorOptions)
990 if (&from == this) return;
991 Clear();
992 MergeFrom(from);
993}
994
995void ScopedAllocatorOptions::CopyFrom(const ScopedAllocatorOptions& from) {
996// @@protoc_insertion_point(class_specific_copy_from_start:tensorflow.ScopedAllocatorOptions)
997 if (&from == this) return;
998 Clear();
999 MergeFrom(from);
1000}
1001
1002bool ScopedAllocatorOptions::IsInitialized() const {
1003 return true;
1004}
1005
1006void ScopedAllocatorOptions::InternalSwap(ScopedAllocatorOptions* other) {
1007 using std::swap;
1008 _internal_metadata_.Swap(&other->_internal_metadata_);
1009 enable_op_.InternalSwap(CastToBase(&other->enable_op_));
1010}
1011
1012::PROTOBUF_NAMESPACE_ID::Metadata ScopedAllocatorOptions::GetMetadata() const {
1013 return GetMetadataStatic();
1014}
1015
1016
1017// ===================================================================
1018
1019RewriterConfig_CustomGraphOptimizer_ParameterMapEntry_DoNotUse::RewriterConfig_CustomGraphOptimizer_ParameterMapEntry_DoNotUse() {}
1020RewriterConfig_CustomGraphOptimizer_ParameterMapEntry_DoNotUse::RewriterConfig_CustomGraphOptimizer_ParameterMapEntry_DoNotUse(::PROTOBUF_NAMESPACE_ID::Arena* arena)
1021 : SuperType(arena) {}
1022void RewriterConfig_CustomGraphOptimizer_ParameterMapEntry_DoNotUse::MergeFrom(const RewriterConfig_CustomGraphOptimizer_ParameterMapEntry_DoNotUse& other) {
1023 MergeFromInternal(other);
1024}
1025::PROTOBUF_NAMESPACE_ID::Metadata RewriterConfig_CustomGraphOptimizer_ParameterMapEntry_DoNotUse::GetMetadata() const {
1026 return GetMetadataStatic();
1027}
1028void RewriterConfig_CustomGraphOptimizer_ParameterMapEntry_DoNotUse::MergeFrom(
1029 const ::PROTOBUF_NAMESPACE_ID::Message& other) {
1030 ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom(other);
1031}
1032
1033
1034// ===================================================================
1035
1036void RewriterConfig_CustomGraphOptimizer::InitAsDefaultInstance() {
1037}
1038class RewriterConfig_CustomGraphOptimizer::_Internal {
1039 public:
1040};
1041
1042void RewriterConfig_CustomGraphOptimizer::clear_parameter_map() {
1043 parameter_map_.Clear();
1044}
1045RewriterConfig_CustomGraphOptimizer::RewriterConfig_CustomGraphOptimizer()
1046 : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
1047 SharedCtor();
1048 // @@protoc_insertion_point(constructor:tensorflow.RewriterConfig.CustomGraphOptimizer)
1049}
1050RewriterConfig_CustomGraphOptimizer::RewriterConfig_CustomGraphOptimizer(::PROTOBUF_NAMESPACE_ID::Arena* arena)
1051 : ::PROTOBUF_NAMESPACE_ID::Message(),
1052 _internal_metadata_(arena),
1053 parameter_map_(arena) {
1054 SharedCtor();
1055 RegisterArenaDtor(arena);
1056 // @@protoc_insertion_point(arena_constructor:tensorflow.RewriterConfig.CustomGraphOptimizer)
1057}
1058RewriterConfig_CustomGraphOptimizer::RewriterConfig_CustomGraphOptimizer(const RewriterConfig_CustomGraphOptimizer& from)
1059 : ::PROTOBUF_NAMESPACE_ID::Message(),
1060 _internal_metadata_(nullptr) {
1061 _internal_metadata_.MergeFrom(from._internal_metadata_);
1062 parameter_map_.MergeFrom(from.parameter_map_);
1063 name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
1064 if (!from.name().empty()) {
1065 name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.name(),
1066 GetArenaNoVirtual());
1067 }
1068 // @@protoc_insertion_point(copy_constructor:tensorflow.RewriterConfig.CustomGraphOptimizer)
1069}
1070
1071void RewriterConfig_CustomGraphOptimizer::SharedCtor() {
1072 ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_RewriterConfig_CustomGraphOptimizer_tensorflow_2fcore_2fprotobuf_2frewriter_5fconfig_2eproto.base);
1073 name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
1074}
1075
1076RewriterConfig_CustomGraphOptimizer::~RewriterConfig_CustomGraphOptimizer() {
1077 // @@protoc_insertion_point(destructor:tensorflow.RewriterConfig.CustomGraphOptimizer)
1078 SharedDtor();
1079}
1080
1081void RewriterConfig_CustomGraphOptimizer::SharedDtor() {
1082 GOOGLE_DCHECK(GetArenaNoVirtual() == nullptr);
1083 name_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
1084}
1085
1086void RewriterConfig_CustomGraphOptimizer::ArenaDtor(void* object) {
1087 RewriterConfig_CustomGraphOptimizer* _this = reinterpret_cast< RewriterConfig_CustomGraphOptimizer* >(object);
1088 (void)_this;
1089}
1090void RewriterConfig_CustomGraphOptimizer::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
1091}
1092void RewriterConfig_CustomGraphOptimizer::SetCachedSize(int size) const {
1093 _cached_size_.Set(size);
1094}
1095const RewriterConfig_CustomGraphOptimizer& RewriterConfig_CustomGraphOptimizer::default_instance() {
1096 ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_RewriterConfig_CustomGraphOptimizer_tensorflow_2fcore_2fprotobuf_2frewriter_5fconfig_2eproto.base);
1097 return *internal_default_instance();
1098}
1099
1100
1101void RewriterConfig_CustomGraphOptimizer::Clear() {
1102// @@protoc_insertion_point(message_clear_start:tensorflow.RewriterConfig.CustomGraphOptimizer)
1103 ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
1104 // Prevent compiler warnings about cached_has_bits being unused
1105 (void) cached_has_bits;
1106
1107 parameter_map_.Clear();
1108 name_.ClearToEmpty(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
1109 _internal_metadata_.Clear();
1110}
1111
1112#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
1113const char* RewriterConfig_CustomGraphOptimizer::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
1114#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
1115 ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArenaNoVirtual(); (void)arena;
1116 while (!ctx->Done(&ptr)) {
1117 ::PROTOBUF_NAMESPACE_ID::uint32 tag;
1118 ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
1119 CHK_(ptr);
1120 switch (tag >> 3) {
1121 // string name = 1;
1122 case 1:
1123 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) {
1124 ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParserUTF8(mutable_name(), ptr, ctx, "tensorflow.RewriterConfig.CustomGraphOptimizer.name");
1125 CHK_(ptr);
1126 } else goto handle_unusual;
1127 continue;
1128 // map<string, .tensorflow.AttrValue> parameter_map = 2;
1129 case 2:
1130 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) {
1131 ptr -= 1;
1132 do {
1133 ptr += 1;
1134 ptr = ctx->ParseMessage(&parameter_map_, ptr);
1135 CHK_(ptr);
1136 if (!ctx->DataAvailable(ptr)) break;
1137 } while (::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<::PROTOBUF_NAMESPACE_ID::uint8>(ptr) == 18);
1138 } else goto handle_unusual;
1139 continue;
1140 default: {
1141 handle_unusual:
1142 if ((tag & 7) == 4 || tag == 0) {
1143 ctx->SetLastTag(tag);
1144 goto success;
1145 }
1146 ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
1147 CHK_(ptr != nullptr);
1148 continue;
1149 }
1150 } // switch
1151 } // while
1152success:
1153 return ptr;
1154failure:
1155 ptr = nullptr;
1156 goto success;
1157#undef CHK_
1158}
1159#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
1160bool RewriterConfig_CustomGraphOptimizer::MergePartialFromCodedStream(
1161 ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) {
1162#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure
1163 ::PROTOBUF_NAMESPACE_ID::uint32 tag;
1164 // @@protoc_insertion_point(parse_start:tensorflow.RewriterConfig.CustomGraphOptimizer)
1165 for (;;) {
1166 ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
1167 tag = p.first;
1168 if (!p.second) goto handle_unusual;
1169 switch (::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::GetTagFieldNumber(tag)) {
1170 // string name = 1;
1171 case 1: {
1172 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (10 & 0xFF)) {
1173 DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadString(
1174 input, this->mutable_name()));
1175 DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
1176 this->name().data(), static_cast<int>(this->name().length()),
1177 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::PARSE,
1178 "tensorflow.RewriterConfig.CustomGraphOptimizer.name"));
1179 } else {
1180 goto handle_unusual;
1181 }
1182 break;
1183 }
1184
1185 // map<string, .tensorflow.AttrValue> parameter_map = 2;
1186 case 2: {
1187 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (18 & 0xFF)) {
1188 RewriterConfig_CustomGraphOptimizer_ParameterMapEntry_DoNotUse::Parser< ::PROTOBUF_NAMESPACE_ID::internal::MapField<
1189 RewriterConfig_CustomGraphOptimizer_ParameterMapEntry_DoNotUse,
1190 std::string, ::tensorflow::AttrValue,
1191 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_STRING,
1192 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_MESSAGE,
1193 0 >,
1194 ::PROTOBUF_NAMESPACE_ID::Map< std::string, ::tensorflow::AttrValue > > parser(&parameter_map_);
1195 DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessageNoVirtual(
1196 input, &parser));
1197 DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
1198 parser.key().data(), static_cast<int>(parser.key().length()),
1199 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::PARSE,
1200 "tensorflow.RewriterConfig.CustomGraphOptimizer.ParameterMapEntry.key"));
1201 } else {
1202 goto handle_unusual;
1203 }
1204 break;
1205 }
1206
1207 default: {
1208 handle_unusual:
1209 if (tag == 0) {
1210 goto success;
1211 }
1212 DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SkipField(
1213 input, tag, _internal_metadata_.mutable_unknown_fields()));
1214 break;
1215 }
1216 }
1217 }
1218success:
1219 // @@protoc_insertion_point(parse_success:tensorflow.RewriterConfig.CustomGraphOptimizer)
1220 return true;
1221failure:
1222 // @@protoc_insertion_point(parse_failure:tensorflow.RewriterConfig.CustomGraphOptimizer)
1223 return false;
1224#undef DO_
1225}
1226#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
1227
1228void RewriterConfig_CustomGraphOptimizer::SerializeWithCachedSizes(
1229 ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const {
1230 // @@protoc_insertion_point(serialize_start:tensorflow.RewriterConfig.CustomGraphOptimizer)
1231 ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
1232 (void) cached_has_bits;
1233
1234 // string name = 1;
1235 if (this->name().size() > 0) {
1236 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
1237 this->name().data(), static_cast<int>(this->name().length()),
1238 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
1239 "tensorflow.RewriterConfig.CustomGraphOptimizer.name");
1240 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringMaybeAliased(
1241 1, this->name(), output);
1242 }
1243
1244 // map<string, .tensorflow.AttrValue> parameter_map = 2;
1245 if (!this->parameter_map().empty()) {
1246 typedef ::PROTOBUF_NAMESPACE_ID::Map< std::string, ::tensorflow::AttrValue >::const_pointer
1247 ConstPtr;
1248 typedef ConstPtr SortItem;
1249 typedef ::PROTOBUF_NAMESPACE_ID::internal::CompareByDerefFirst<SortItem> Less;
1250 struct Utf8Check {
1251 static void Check(ConstPtr p) {
1252 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
1253 p->first.data(), static_cast<int>(p->first.length()),
1254 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
1255 "tensorflow.RewriterConfig.CustomGraphOptimizer.ParameterMapEntry.key");
1256 }
1257 };
1258
1259 if (output->IsSerializationDeterministic() &&
1260 this->parameter_map().size() > 1) {
1261 ::std::unique_ptr<SortItem[]> items(
1262 new SortItem[this->parameter_map().size()]);
1263 typedef ::PROTOBUF_NAMESPACE_ID::Map< std::string, ::tensorflow::AttrValue >::size_type size_type;
1264 size_type n = 0;
1265 for (::PROTOBUF_NAMESPACE_ID::Map< std::string, ::tensorflow::AttrValue >::const_iterator
1266 it = this->parameter_map().begin();
1267 it != this->parameter_map().end(); ++it, ++n) {
1268 items[static_cast<ptrdiff_t>(n)] = SortItem(&*it);
1269 }
1270 ::std::sort(&items[0], &items[static_cast<ptrdiff_t>(n)], Less());
1271 for (size_type i = 0; i < n; i++) {
1272 RewriterConfig_CustomGraphOptimizer_ParameterMapEntry_DoNotUse::Funcs::SerializeToCodedStream(2, items[static_cast<ptrdiff_t>(i)]->first, items[static_cast<ptrdiff_t>(i)]->second, output);
1273 Utf8Check::Check(&(*items[static_cast<ptrdiff_t>(i)]));
1274 }
1275 } else {
1276 for (::PROTOBUF_NAMESPACE_ID::Map< std::string, ::tensorflow::AttrValue >::const_iterator
1277 it = this->parameter_map().begin();
1278 it != this->parameter_map().end(); ++it) {
1279 RewriterConfig_CustomGraphOptimizer_ParameterMapEntry_DoNotUse::Funcs::SerializeToCodedStream(2, it->first, it->second, output);
1280 Utf8Check::Check(&(*it));
1281 }
1282 }
1283 }
1284
1285 if (_internal_metadata_.have_unknown_fields()) {
1286 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields(
1287 _internal_metadata_.unknown_fields(), output);
1288 }
1289 // @@protoc_insertion_point(serialize_end:tensorflow.RewriterConfig.CustomGraphOptimizer)
1290}
1291
1292::PROTOBUF_NAMESPACE_ID::uint8* RewriterConfig_CustomGraphOptimizer::InternalSerializeWithCachedSizesToArray(
1293 ::PROTOBUF_NAMESPACE_ID::uint8* target) const {
1294 // @@protoc_insertion_point(serialize_to_array_start:tensorflow.RewriterConfig.CustomGraphOptimizer)
1295 ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
1296 (void) cached_has_bits;
1297
1298 // string name = 1;
1299 if (this->name().size() > 0) {
1300 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
1301 this->name().data(), static_cast<int>(this->name().length()),
1302 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
1303 "tensorflow.RewriterConfig.CustomGraphOptimizer.name");
1304 target =
1305 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringToArray(
1306 1, this->name(), target);
1307 }
1308
1309 // map<string, .tensorflow.AttrValue> parameter_map = 2;
1310 if (!this->parameter_map().empty()) {
1311 typedef ::PROTOBUF_NAMESPACE_ID::Map< std::string, ::tensorflow::AttrValue >::const_pointer
1312 ConstPtr;
1313 typedef ConstPtr SortItem;
1314 typedef ::PROTOBUF_NAMESPACE_ID::internal::CompareByDerefFirst<SortItem> Less;
1315 struct Utf8Check {
1316 static void Check(ConstPtr p) {
1317 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
1318 p->first.data(), static_cast<int>(p->first.length()),
1319 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
1320 "tensorflow.RewriterConfig.CustomGraphOptimizer.ParameterMapEntry.key");
1321 }
1322 };
1323
1324 if (false &&
1325 this->parameter_map().size() > 1) {
1326 ::std::unique_ptr<SortItem[]> items(
1327 new SortItem[this->parameter_map().size()]);
1328 typedef ::PROTOBUF_NAMESPACE_ID::Map< std::string, ::tensorflow::AttrValue >::size_type size_type;
1329 size_type n = 0;
1330 for (::PROTOBUF_NAMESPACE_ID::Map< std::string, ::tensorflow::AttrValue >::const_iterator
1331 it = this->parameter_map().begin();
1332 it != this->parameter_map().end(); ++it, ++n) {
1333 items[static_cast<ptrdiff_t>(n)] = SortItem(&*it);
1334 }
1335 ::std::sort(&items[0], &items[static_cast<ptrdiff_t>(n)], Less());
1336 for (size_type i = 0; i < n; i++) {
1337 target = RewriterConfig_CustomGraphOptimizer_ParameterMapEntry_DoNotUse::Funcs::SerializeToArray(2, items[static_cast<ptrdiff_t>(i)]->first, items[static_cast<ptrdiff_t>(i)]->second, target);
1338 Utf8Check::Check(&(*items[static_cast<ptrdiff_t>(i)]));
1339 }
1340 } else {
1341 for (::PROTOBUF_NAMESPACE_ID::Map< std::string, ::tensorflow::AttrValue >::const_iterator
1342 it = this->parameter_map().begin();
1343 it != this->parameter_map().end(); ++it) {
1344 target = RewriterConfig_CustomGraphOptimizer_ParameterMapEntry_DoNotUse::Funcs::SerializeToArray(2, it->first, it->second, target);
1345 Utf8Check::Check(&(*it));
1346 }
1347 }
1348 }
1349
1350 if (_internal_metadata_.have_unknown_fields()) {
1351 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray(
1352 _internal_metadata_.unknown_fields(), target);
1353 }
1354 // @@protoc_insertion_point(serialize_to_array_end:tensorflow.RewriterConfig.CustomGraphOptimizer)
1355 return target;
1356}
1357
1358size_t RewriterConfig_CustomGraphOptimizer::ByteSizeLong() const {
1359// @@protoc_insertion_point(message_byte_size_start:tensorflow.RewriterConfig.CustomGraphOptimizer)
1360 size_t total_size = 0;
1361
1362 if (_internal_metadata_.have_unknown_fields()) {
1363 total_size +=
1364 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::ComputeUnknownFieldsSize(
1365 _internal_metadata_.unknown_fields());
1366 }
1367 ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
1368 // Prevent compiler warnings about cached_has_bits being unused
1369 (void) cached_has_bits;
1370
1371 // map<string, .tensorflow.AttrValue> parameter_map = 2;
1372 total_size += 1 *
1373 ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(this->parameter_map_size());
1374 for (::PROTOBUF_NAMESPACE_ID::Map< std::string, ::tensorflow::AttrValue >::const_iterator
1375 it = this->parameter_map().begin();
1376 it != this->parameter_map().end(); ++it) {
1377 total_size += RewriterConfig_CustomGraphOptimizer_ParameterMapEntry_DoNotUse::Funcs::ByteSizeLong(it->first, it->second);
1378 }
1379
1380 // string name = 1;
1381 if (this->name().size() > 0) {
1382 total_size += 1 +
1383 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
1384 this->name());
1385 }
1386
1387 int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
1388 SetCachedSize(cached_size);
1389 return total_size;
1390}
1391
1392void RewriterConfig_CustomGraphOptimizer::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
1393// @@protoc_insertion_point(generalized_merge_from_start:tensorflow.RewriterConfig.CustomGraphOptimizer)
1394 GOOGLE_DCHECK_NE(&from, this);
1395 const RewriterConfig_CustomGraphOptimizer* source =
1396 ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<RewriterConfig_CustomGraphOptimizer>(
1397 &from);
1398 if (source == nullptr) {
1399 // @@protoc_insertion_point(generalized_merge_from_cast_fail:tensorflow.RewriterConfig.CustomGraphOptimizer)
1400 ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
1401 } else {
1402 // @@protoc_insertion_point(generalized_merge_from_cast_success:tensorflow.RewriterConfig.CustomGraphOptimizer)
1403 MergeFrom(*source);
1404 }
1405}
1406
1407void RewriterConfig_CustomGraphOptimizer::MergeFrom(const RewriterConfig_CustomGraphOptimizer& from) {
1408// @@protoc_insertion_point(class_specific_merge_from_start:tensorflow.RewriterConfig.CustomGraphOptimizer)
1409 GOOGLE_DCHECK_NE(&from, this);
1410 _internal_metadata_.MergeFrom(from._internal_metadata_);
1411 ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
1412 (void) cached_has_bits;
1413
1414 parameter_map_.MergeFrom(from.parameter_map_);
1415 if (from.name().size() > 0) {
1416 set_name(from.name());
1417 }
1418}
1419
1420void RewriterConfig_CustomGraphOptimizer::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
1421// @@protoc_insertion_point(generalized_copy_from_start:tensorflow.RewriterConfig.CustomGraphOptimizer)
1422 if (&from == this) return;
1423 Clear();
1424 MergeFrom(from);
1425}
1426
1427void RewriterConfig_CustomGraphOptimizer::CopyFrom(const RewriterConfig_CustomGraphOptimizer& from) {
1428// @@protoc_insertion_point(class_specific_copy_from_start:tensorflow.RewriterConfig.CustomGraphOptimizer)
1429 if (&from == this) return;
1430 Clear();
1431 MergeFrom(from);
1432}
1433
1434bool RewriterConfig_CustomGraphOptimizer::IsInitialized() const {
1435 return true;
1436}
1437
1438void RewriterConfig_CustomGraphOptimizer::InternalSwap(RewriterConfig_CustomGraphOptimizer* other) {
1439 using std::swap;
1440 _internal_metadata_.Swap(&other->_internal_metadata_);
1441 parameter_map_.Swap(&other->parameter_map_);
1442 name_.Swap(&other->name_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
1443 GetArenaNoVirtual());
1444}
1445
1446::PROTOBUF_NAMESPACE_ID::Metadata RewriterConfig_CustomGraphOptimizer::GetMetadata() const {
1447 return GetMetadataStatic();
1448}
1449
1450
1451// ===================================================================
1452
1453void RewriterConfig::InitAsDefaultInstance() {
1454 ::tensorflow::_RewriterConfig_default_instance_._instance.get_mutable()->auto_parallel_ = const_cast< ::tensorflow::AutoParallelOptions*>(
1455 ::tensorflow::AutoParallelOptions::internal_default_instance());
1456 ::tensorflow::_RewriterConfig_default_instance_._instance.get_mutable()->scoped_allocator_opts_ = const_cast< ::tensorflow::ScopedAllocatorOptions*>(
1457 ::tensorflow::ScopedAllocatorOptions::internal_default_instance());
1458 ::tensorflow::_RewriterConfig_default_instance_._instance.get_mutable()->inter_optimizer_verifier_config_ = const_cast< ::tensorflow::VerifierConfig*>(
1459 ::tensorflow::VerifierConfig::internal_default_instance());
1460 ::tensorflow::_RewriterConfig_default_instance_._instance.get_mutable()->post_optimization_verifier_config_ = const_cast< ::tensorflow::VerifierConfig*>(
1461 ::tensorflow::VerifierConfig::internal_default_instance());
1462}
1463class RewriterConfig::_Internal {
1464 public:
1465 static const ::tensorflow::AutoParallelOptions& auto_parallel(const RewriterConfig* msg);
1466 static const ::tensorflow::ScopedAllocatorOptions& scoped_allocator_opts(const RewriterConfig* msg);
1467 static const ::tensorflow::VerifierConfig& inter_optimizer_verifier_config(const RewriterConfig* msg);
1468 static const ::tensorflow::VerifierConfig& post_optimization_verifier_config(const RewriterConfig* msg);
1469};
1470
1471const ::tensorflow::AutoParallelOptions&
1472RewriterConfig::_Internal::auto_parallel(const RewriterConfig* msg) {
1473 return *msg->auto_parallel_;
1474}
1475const ::tensorflow::ScopedAllocatorOptions&
1476RewriterConfig::_Internal::scoped_allocator_opts(const RewriterConfig* msg) {
1477 return *msg->scoped_allocator_opts_;
1478}
1479const ::tensorflow::VerifierConfig&
1480RewriterConfig::_Internal::inter_optimizer_verifier_config(const RewriterConfig* msg) {
1481 return *msg->inter_optimizer_verifier_config_;
1482}
1483const ::tensorflow::VerifierConfig&
1484RewriterConfig::_Internal::post_optimization_verifier_config(const RewriterConfig* msg) {
1485 return *msg->post_optimization_verifier_config_;
1486}
1487void RewriterConfig::unsafe_arena_set_allocated_auto_parallel(
1488 ::tensorflow::AutoParallelOptions* auto_parallel) {
1489 if (GetArenaNoVirtual() == nullptr) {
1490 delete auto_parallel_;
1491 }
1492 auto_parallel_ = auto_parallel;
1493 if (auto_parallel) {
1494
1495 } else {
1496
1497 }
1498 // @@protoc_insertion_point(field_unsafe_arena_set_allocated:tensorflow.RewriterConfig.auto_parallel)
1499}
1500void RewriterConfig::unsafe_arena_set_allocated_scoped_allocator_opts(
1501 ::tensorflow::ScopedAllocatorOptions* scoped_allocator_opts) {
1502 if (GetArenaNoVirtual() == nullptr) {
1503 delete scoped_allocator_opts_;
1504 }
1505 scoped_allocator_opts_ = scoped_allocator_opts;
1506 if (scoped_allocator_opts) {
1507
1508 } else {
1509
1510 }
1511 // @@protoc_insertion_point(field_unsafe_arena_set_allocated:tensorflow.RewriterConfig.scoped_allocator_opts)
1512}
1513void RewriterConfig::unsafe_arena_set_allocated_inter_optimizer_verifier_config(
1514 ::tensorflow::VerifierConfig* inter_optimizer_verifier_config) {
1515 if (GetArenaNoVirtual() == nullptr) {
1516 delete inter_optimizer_verifier_config_;
1517 }
1518 inter_optimizer_verifier_config_ = inter_optimizer_verifier_config;
1519 if (inter_optimizer_verifier_config) {
1520
1521 } else {
1522
1523 }
1524 // @@protoc_insertion_point(field_unsafe_arena_set_allocated:tensorflow.RewriterConfig.inter_optimizer_verifier_config)
1525}
1526void RewriterConfig::clear_inter_optimizer_verifier_config() {
1527 if (GetArenaNoVirtual() == nullptr && inter_optimizer_verifier_config_ != nullptr) {
1528 delete inter_optimizer_verifier_config_;
1529 }
1530 inter_optimizer_verifier_config_ = nullptr;
1531}
1532void RewriterConfig::unsafe_arena_set_allocated_post_optimization_verifier_config(
1533 ::tensorflow::VerifierConfig* post_optimization_verifier_config) {
1534 if (GetArenaNoVirtual() == nullptr) {
1535 delete post_optimization_verifier_config_;
1536 }
1537 post_optimization_verifier_config_ = post_optimization_verifier_config;
1538 if (post_optimization_verifier_config) {
1539
1540 } else {
1541
1542 }
1543 // @@protoc_insertion_point(field_unsafe_arena_set_allocated:tensorflow.RewriterConfig.post_optimization_verifier_config)
1544}
1545void RewriterConfig::clear_post_optimization_verifier_config() {
1546 if (GetArenaNoVirtual() == nullptr && post_optimization_verifier_config_ != nullptr) {
1547 delete post_optimization_verifier_config_;
1548 }
1549 post_optimization_verifier_config_ = nullptr;
1550}
1551RewriterConfig::RewriterConfig()
1552 : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
1553 SharedCtor();
1554 // @@protoc_insertion_point(constructor:tensorflow.RewriterConfig)
1555}
1556RewriterConfig::RewriterConfig(::PROTOBUF_NAMESPACE_ID::Arena* arena)
1557 : ::PROTOBUF_NAMESPACE_ID::Message(),
1558 _internal_metadata_(arena),
1559 optimizers_(arena),
1560 custom_optimizers_(arena) {
1561 SharedCtor();
1562 RegisterArenaDtor(arena);
1563 // @@protoc_insertion_point(arena_constructor:tensorflow.RewriterConfig)
1564}
1565RewriterConfig::RewriterConfig(const RewriterConfig& from)
1566 : ::PROTOBUF_NAMESPACE_ID::Message(),
1567 _internal_metadata_(nullptr),
1568 optimizers_(from.optimizers_),
1569 custom_optimizers_(from.custom_optimizers_) {
1570 _internal_metadata_.MergeFrom(from._internal_metadata_);
1571 memory_optimizer_target_node_name_scope_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
1572 if (!from.memory_optimizer_target_node_name_scope().empty()) {
1573 memory_optimizer_target_node_name_scope_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.memory_optimizer_target_node_name_scope(),
1574 GetArenaNoVirtual());
1575 }
1576 if (from.has_auto_parallel()) {
1577 auto_parallel_ = new ::tensorflow::AutoParallelOptions(*from.auto_parallel_);
1578 } else {
1579 auto_parallel_ = nullptr;
1580 }
1581 if (from.has_scoped_allocator_opts()) {
1582 scoped_allocator_opts_ = new ::tensorflow::ScopedAllocatorOptions(*from.scoped_allocator_opts_);
1583 } else {
1584 scoped_allocator_opts_ = nullptr;
1585 }
1586 if (from.has_inter_optimizer_verifier_config()) {
1587 inter_optimizer_verifier_config_ = new ::tensorflow::VerifierConfig(*from.inter_optimizer_verifier_config_);
1588 } else {
1589 inter_optimizer_verifier_config_ = nullptr;
1590 }
1591 if (from.has_post_optimization_verifier_config()) {
1592 post_optimization_verifier_config_ = new ::tensorflow::VerifierConfig(*from.post_optimization_verifier_config_);
1593 } else {
1594 post_optimization_verifier_config_ = nullptr;
1595 }
1596 ::memcpy(&layout_optimizer_, &from.layout_optimizer_,
1597 static_cast<size_t>(reinterpret_cast<char*>(&cpu_layout_conversion_) -
1598 reinterpret_cast<char*>(&layout_optimizer_)) + sizeof(cpu_layout_conversion_));
1599 // @@protoc_insertion_point(copy_constructor:tensorflow.RewriterConfig)
1600}
1601
1602void RewriterConfig::SharedCtor() {
1603 ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_RewriterConfig_tensorflow_2fcore_2fprotobuf_2frewriter_5fconfig_2eproto.base);
1604 memory_optimizer_target_node_name_scope_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
1605 ::memset(&auto_parallel_, 0, static_cast<size_t>(
1606 reinterpret_cast<char*>(&cpu_layout_conversion_) -
1607 reinterpret_cast<char*>(&auto_parallel_)) + sizeof(cpu_layout_conversion_));
1608}
1609
1610RewriterConfig::~RewriterConfig() {
1611 // @@protoc_insertion_point(destructor:tensorflow.RewriterConfig)
1612 SharedDtor();
1613}
1614
1615void RewriterConfig::SharedDtor() {
1616 GOOGLE_DCHECK(GetArenaNoVirtual() == nullptr);
1617 memory_optimizer_target_node_name_scope_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
1618 if (this != internal_default_instance()) delete auto_parallel_;
1619 if (this != internal_default_instance()) delete scoped_allocator_opts_;
1620 if (this != internal_default_instance()) delete inter_optimizer_verifier_config_;
1621 if (this != internal_default_instance()) delete post_optimization_verifier_config_;
1622}
1623
1624void RewriterConfig::ArenaDtor(void* object) {
1625 RewriterConfig* _this = reinterpret_cast< RewriterConfig* >(object);
1626 (void)_this;
1627}
1628void RewriterConfig::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
1629}
1630void RewriterConfig::SetCachedSize(int size) const {
1631 _cached_size_.Set(size);
1632}
1633const RewriterConfig& RewriterConfig::default_instance() {
1634 ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_RewriterConfig_tensorflow_2fcore_2fprotobuf_2frewriter_5fconfig_2eproto.base);
1635 return *internal_default_instance();
1636}
1637
1638
1639void RewriterConfig::Clear() {
1640// @@protoc_insertion_point(message_clear_start:tensorflow.RewriterConfig)
1641 ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
1642 // Prevent compiler warnings about cached_has_bits being unused
1643 (void) cached_has_bits;
1644
1645 optimizers_.Clear();
1646 custom_optimizers_.Clear();
1647 memory_optimizer_target_node_name_scope_.ClearToEmpty(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
1648 if (GetArenaNoVirtual() == nullptr && auto_parallel_ != nullptr) {
1649 delete auto_parallel_;
1650 }
1651 auto_parallel_ = nullptr;
1652 if (GetArenaNoVirtual() == nullptr && scoped_allocator_opts_ != nullptr) {
1653 delete scoped_allocator_opts_;
1654 }
1655 scoped_allocator_opts_ = nullptr;
1656 if (GetArenaNoVirtual() == nullptr && inter_optimizer_verifier_config_ != nullptr) {
1657 delete inter_optimizer_verifier_config_;
1658 }
1659 inter_optimizer_verifier_config_ = nullptr;
1660 if (GetArenaNoVirtual() == nullptr && post_optimization_verifier_config_ != nullptr) {
1661 delete post_optimization_verifier_config_;
1662 }
1663 post_optimization_verifier_config_ = nullptr;
1664 ::memset(&layout_optimizer_, 0, static_cast<size_t>(
1665 reinterpret_cast<char*>(&cpu_layout_conversion_) -
1666 reinterpret_cast<char*>(&layout_optimizer_)) + sizeof(cpu_layout_conversion_));
1667 _internal_metadata_.Clear();
1668}
1669
1670#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
1671const char* RewriterConfig::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
1672#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
1673 ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArenaNoVirtual(); (void)arena;
1674 while (!ctx->Done(&ptr)) {
1675 ::PROTOBUF_NAMESPACE_ID::uint32 tag;
1676 ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
1677 CHK_(ptr);
1678 switch (tag >> 3) {
1679 // .tensorflow.RewriterConfig.Toggle layout_optimizer = 1;
1680 case 1:
1681 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) {
1682 ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
1683 CHK_(ptr);
1684 set_layout_optimizer(static_cast<::tensorflow::RewriterConfig_Toggle>(val));
1685 } else goto handle_unusual;
1686 continue;
1687 // bool disable_model_pruning = 2;
1688 case 2:
1689 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) {
1690 disable_model_pruning_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
1691 CHK_(ptr);
1692 } else goto handle_unusual;
1693 continue;
1694 // .tensorflow.RewriterConfig.Toggle constant_folding = 3;
1695 case 3:
1696 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24)) {
1697 ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
1698 CHK_(ptr);
1699 set_constant_folding(static_cast<::tensorflow::RewriterConfig_Toggle>(val));
1700 } else goto handle_unusual;
1701 continue;
1702 // .tensorflow.RewriterConfig.MemOptType memory_optimization = 4;
1703 case 4:
1704 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 32)) {
1705 ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
1706 CHK_(ptr);
1707 set_memory_optimization(static_cast<::tensorflow::RewriterConfig_MemOptType>(val));
1708 } else goto handle_unusual;
1709 continue;
1710 // .tensorflow.AutoParallelOptions auto_parallel = 5;
1711 case 5:
1712 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 42)) {
1713 ptr = ctx->ParseMessage(mutable_auto_parallel(), ptr);
1714 CHK_(ptr);
1715 } else goto handle_unusual;
1716 continue;
1717 // string memory_optimizer_target_node_name_scope = 6;
1718 case 6:
1719 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 50)) {
1720 ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParserUTF8(mutable_memory_optimizer_target_node_name_scope(), ptr, ctx, "tensorflow.RewriterConfig.memory_optimizer_target_node_name_scope");
1721 CHK_(ptr);
1722 } else goto handle_unusual;
1723 continue;
1724 // .tensorflow.RewriterConfig.Toggle arithmetic_optimization = 7;
1725 case 7:
1726 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 56)) {
1727 ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
1728 CHK_(ptr);
1729 set_arithmetic_optimization(static_cast<::tensorflow::RewriterConfig_Toggle>(val));
1730 } else goto handle_unusual;
1731 continue;
1732 // .tensorflow.RewriterConfig.Toggle dependency_optimization = 8;
1733 case 8:
1734 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 64)) {
1735 ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
1736 CHK_(ptr);
1737 set_dependency_optimization(static_cast<::tensorflow::RewriterConfig_Toggle>(val));
1738 } else goto handle_unusual;
1739 continue;
1740 // .tensorflow.RewriterConfig.Toggle loop_optimization = 9;
1741 case 9:
1742 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 72)) {
1743 ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
1744 CHK_(ptr);
1745 set_loop_optimization(static_cast<::tensorflow::RewriterConfig_Toggle>(val));
1746 } else goto handle_unusual;
1747 continue;
1748 // .tensorflow.RewriterConfig.Toggle function_optimization = 10;
1749 case 10:
1750 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 80)) {
1751 ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
1752 CHK_(ptr);
1753 set_function_optimization(static_cast<::tensorflow::RewriterConfig_Toggle>(val));
1754 } else goto handle_unusual;
1755 continue;
1756 // .tensorflow.RewriterConfig.Toggle debug_stripper = 11;
1757 case 11:
1758 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 88)) {
1759 ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
1760 CHK_(ptr);
1761 set_debug_stripper(static_cast<::tensorflow::RewriterConfig_Toggle>(val));
1762 } else goto handle_unusual;
1763 continue;
1764 // .tensorflow.RewriterConfig.NumIterationsType meta_optimizer_iterations = 12;
1765 case 12:
1766 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 96)) {
1767 ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
1768 CHK_(ptr);
1769 set_meta_optimizer_iterations(static_cast<::tensorflow::RewriterConfig_NumIterationsType>(val));
1770 } else goto handle_unusual;
1771 continue;
1772 // .tensorflow.RewriterConfig.Toggle shape_optimization = 13;
1773 case 13:
1774 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 104)) {
1775 ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
1776 CHK_(ptr);
1777 set_shape_optimization(static_cast<::tensorflow::RewriterConfig_Toggle>(val));
1778 } else goto handle_unusual;
1779 continue;
1780 // .tensorflow.RewriterConfig.Toggle remapping = 14;
1781 case 14:
1782 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 112)) {
1783 ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
1784 CHK_(ptr);
1785 set_remapping(static_cast<::tensorflow::RewriterConfig_Toggle>(val));
1786 } else goto handle_unusual;
1787 continue;
1788 // .tensorflow.RewriterConfig.Toggle scoped_allocator_optimization = 15;
1789 case 15:
1790 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 120)) {
1791 ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
1792 CHK_(ptr);
1793 set_scoped_allocator_optimization(static_cast<::tensorflow::RewriterConfig_Toggle>(val));
1794 } else goto handle_unusual;
1795 continue;
1796 // .tensorflow.ScopedAllocatorOptions scoped_allocator_opts = 16;
1797 case 16:
1798 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 130)) {
1799 ptr = ctx->ParseMessage(mutable_scoped_allocator_opts(), ptr);
1800 CHK_(ptr);
1801 } else goto handle_unusual;
1802 continue;
1803 // int32 min_graph_nodes = 17;
1804 case 17:
1805 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 136)) {
1806 min_graph_nodes_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
1807 CHK_(ptr);
1808 } else goto handle_unusual;
1809 continue;
1810 // .tensorflow.RewriterConfig.Toggle pin_to_host_optimization = 18;
1811 case 18:
1812 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 144)) {
1813 ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
1814 CHK_(ptr);
1815 set_pin_to_host_optimization(static_cast<::tensorflow::RewriterConfig_Toggle>(val));
1816 } else goto handle_unusual;
1817 continue;
1818 // bool disable_meta_optimizer = 19;
1819 case 19:
1820 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 152)) {
1821 disable_meta_optimizer_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
1822 CHK_(ptr);
1823 } else goto handle_unusual;
1824 continue;
1825 // int64 meta_optimizer_timeout_ms = 20;
1826 case 20:
1827 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 160)) {
1828 meta_optimizer_timeout_ms_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
1829 CHK_(ptr);
1830 } else goto handle_unusual;
1831 continue;
1832 // bool fail_on_optimizer_errors = 21;
1833 case 21:
1834 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 168)) {
1835 fail_on_optimizer_errors_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
1836 CHK_(ptr);
1837 } else goto handle_unusual;
1838 continue;
1839 // .tensorflow.RewriterConfig.Toggle implementation_selector = 22;
1840 case 22:
1841 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 176)) {
1842 ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
1843 CHK_(ptr);
1844 set_implementation_selector(static_cast<::tensorflow::RewriterConfig_Toggle>(val));
1845 } else goto handle_unusual;
1846 continue;
1847 // .tensorflow.RewriterConfig.Toggle auto_mixed_precision = 23;
1848 case 23:
1849 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 184)) {
1850 ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
1851 CHK_(ptr);
1852 set_auto_mixed_precision(static_cast<::tensorflow::RewriterConfig_Toggle>(val));
1853 } else goto handle_unusual;
1854 continue;
1855 // .tensorflow.RewriterConfig.Toggle common_subgraph_elimination = 24;
1856 case 24:
1857 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 192)) {
1858 ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
1859 CHK_(ptr);
1860 set_common_subgraph_elimination(static_cast<::tensorflow::RewriterConfig_Toggle>(val));
1861 } else goto handle_unusual;
1862 continue;
1863 // .tensorflow.RewriterConfig.Toggle auto_mixed_precision_mkl = 25;
1864 case 25:
1865 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 200)) {
1866 ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
1867 CHK_(ptr);
1868 set_auto_mixed_precision_mkl(static_cast<::tensorflow::RewriterConfig_Toggle>(val));
1869 } else goto handle_unusual;
1870 continue;
1871 // bool experimental_disable_compressed_tensor_optimization = 26;
1872 case 26:
1873 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 208)) {
1874 experimental_disable_compressed_tensor_optimization_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
1875 CHK_(ptr);
1876 } else goto handle_unusual;
1877 continue;
1878 // bool experimental_disable_folding_quantization_emulation = 27;
1879 case 27:
1880 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 216)) {
1881 experimental_disable_folding_quantization_emulation_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
1882 CHK_(ptr);
1883 } else goto handle_unusual;
1884 continue;
1885 // .tensorflow.RewriterConfig.Toggle use_plugin_optimizers = 28;
1886 case 28:
1887 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 224)) {
1888 ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
1889 CHK_(ptr);
1890 set_use_plugin_optimizers(static_cast<::tensorflow::RewriterConfig_Toggle>(val));
1891 } else goto handle_unusual;
1892 continue;
1893 // .tensorflow.RewriterConfig.Toggle auto_mixed_precision_cpu = 29;
1894 case 29:
1895 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 232)) {
1896 ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
1897 CHK_(ptr);
1898 set_auto_mixed_precision_cpu(static_cast<::tensorflow::RewriterConfig_Toggle>(val));
1899 } else goto handle_unusual;
1900 continue;
1901 // .tensorflow.RewriterConfig.Toggle experimental_conditional_code_motion = 30;
1902 case 30:
1903 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 240)) {
1904 ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
1905 CHK_(ptr);
1906 set_experimental_conditional_code_motion(static_cast<::tensorflow::RewriterConfig_Toggle>(val));
1907 } else goto handle_unusual;
1908 continue;
1909 // .tensorflow.RewriterConfig.Toggle auto_mixed_precision_onednn_bfloat16 = 31;
1910 case 31:
1911 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 248)) {
1912 ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
1913 CHK_(ptr);
1914 set_auto_mixed_precision_onednn_bfloat16(static_cast<::tensorflow::RewriterConfig_Toggle>(val));
1915 } else goto handle_unusual;
1916 continue;
1917 // .tensorflow.RewriterConfig.CpuLayout cpu_layout_conversion = 50;
1918 case 50:
1919 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 144)) {
1920 ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
1921 CHK_(ptr);
1922 set_cpu_layout_conversion(static_cast<::tensorflow::RewriterConfig_CpuLayout>(val));
1923 } else goto handle_unusual;
1924 continue;
1925 // repeated string optimizers = 100;
1926 case 100:
1927 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 34)) {
1928 ptr -= 2;
1929 do {
1930 ptr += 2;
1931 ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParserUTF8(add_optimizers(), ptr, ctx, "tensorflow.RewriterConfig.optimizers");
1932 CHK_(ptr);
1933 if (!ctx->DataAvailable(ptr)) break;
1934 } while (::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<::PROTOBUF_NAMESPACE_ID::uint16>(ptr) == 1698);
1935 } else goto handle_unusual;
1936 continue;
1937 // repeated .tensorflow.RewriterConfig.CustomGraphOptimizer custom_optimizers = 200;
1938 case 200:
1939 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 66)) {
1940 ptr -= 2;
1941 do {
1942 ptr += 2;
1943 ptr = ctx->ParseMessage(add_custom_optimizers(), ptr);
1944 CHK_(ptr);
1945 if (!ctx->DataAvailable(ptr)) break;
1946 } while (::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<::PROTOBUF_NAMESPACE_ID::uint16>(ptr) == 3266);
1947 } else goto handle_unusual;
1948 continue;
1949 // .tensorflow.VerifierConfig inter_optimizer_verifier_config = 300;
1950 case 300:
1951 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 98)) {
1952 ptr = ctx->ParseMessage(mutable_inter_optimizer_verifier_config(), ptr);
1953 CHK_(ptr);
1954 } else goto handle_unusual;
1955 continue;
1956 // .tensorflow.VerifierConfig post_optimization_verifier_config = 301;
1957 case 301:
1958 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 106)) {
1959 ptr = ctx->ParseMessage(mutable_post_optimization_verifier_config(), ptr);
1960 CHK_(ptr);
1961 } else goto handle_unusual;
1962 continue;
1963 default: {
1964 handle_unusual:
1965 if ((tag & 7) == 4 || tag == 0) {
1966 ctx->SetLastTag(tag);
1967 goto success;
1968 }
1969 ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
1970 CHK_(ptr != nullptr);
1971 continue;
1972 }
1973 } // switch
1974 } // while
1975success:
1976 return ptr;
1977failure:
1978 ptr = nullptr;
1979 goto success;
1980#undef CHK_
1981}
1982#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
1983bool RewriterConfig::MergePartialFromCodedStream(
1984 ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) {
1985#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure
1986 ::PROTOBUF_NAMESPACE_ID::uint32 tag;
1987 // @@protoc_insertion_point(parse_start:tensorflow.RewriterConfig)
1988 for (;;) {
1989 ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(16383u);
1990 tag = p.first;
1991 if (!p.second) goto handle_unusual;
1992 switch (::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::GetTagFieldNumber(tag)) {
1993 // .tensorflow.RewriterConfig.Toggle layout_optimizer = 1;
1994 case 1: {
1995 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (8 & 0xFF)) {
1996 int value = 0;
1997 DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
1998 int, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_ENUM>(
1999 input, &value)));
2000 set_layout_optimizer(static_cast< ::tensorflow::RewriterConfig_Toggle >(value));
2001 } else {
2002 goto handle_unusual;
2003 }
2004 break;
2005 }
2006
2007 // bool disable_model_pruning = 2;
2008 case 2: {
2009 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (16 & 0xFF)) {
2010
2011 DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
2012 bool, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_BOOL>(
2013 input, &disable_model_pruning_)));
2014 } else {
2015 goto handle_unusual;
2016 }
2017 break;
2018 }
2019
2020 // .tensorflow.RewriterConfig.Toggle constant_folding = 3;
2021 case 3: {
2022 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (24 & 0xFF)) {
2023 int value = 0;
2024 DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
2025 int, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_ENUM>(
2026 input, &value)));
2027 set_constant_folding(static_cast< ::tensorflow::RewriterConfig_Toggle >(value));
2028 } else {
2029 goto handle_unusual;
2030 }
2031 break;
2032 }
2033
2034 // .tensorflow.RewriterConfig.MemOptType memory_optimization = 4;
2035 case 4: {
2036 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (32 & 0xFF)) {
2037 int value = 0;
2038 DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
2039 int, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_ENUM>(
2040 input, &value)));
2041 set_memory_optimization(static_cast< ::tensorflow::RewriterConfig_MemOptType >(value));
2042 } else {
2043 goto handle_unusual;
2044 }
2045 break;
2046 }
2047
2048 // .tensorflow.AutoParallelOptions auto_parallel = 5;
2049 case 5: {
2050 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (42 & 0xFF)) {
2051 DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage(
2052 input, mutable_auto_parallel()));
2053 } else {
2054 goto handle_unusual;
2055 }
2056 break;
2057 }
2058
2059 // string memory_optimizer_target_node_name_scope = 6;
2060 case 6: {
2061 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (50 & 0xFF)) {
2062 DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadString(
2063 input, this->mutable_memory_optimizer_target_node_name_scope()));
2064 DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
2065 this->memory_optimizer_target_node_name_scope().data(), static_cast<int>(this->memory_optimizer_target_node_name_scope().length()),
2066 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::PARSE,
2067 "tensorflow.RewriterConfig.memory_optimizer_target_node_name_scope"));
2068 } else {
2069 goto handle_unusual;
2070 }
2071 break;
2072 }
2073
2074 // .tensorflow.RewriterConfig.Toggle arithmetic_optimization = 7;
2075 case 7: {
2076 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (56 & 0xFF)) {
2077 int value = 0;
2078 DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
2079 int, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_ENUM>(
2080 input, &value)));
2081 set_arithmetic_optimization(static_cast< ::tensorflow::RewriterConfig_Toggle >(value));
2082 } else {
2083 goto handle_unusual;
2084 }
2085 break;
2086 }
2087
2088 // .tensorflow.RewriterConfig.Toggle dependency_optimization = 8;
2089 case 8: {
2090 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (64 & 0xFF)) {
2091 int value = 0;
2092 DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
2093 int, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_ENUM>(
2094 input, &value)));
2095 set_dependency_optimization(static_cast< ::tensorflow::RewriterConfig_Toggle >(value));
2096 } else {
2097 goto handle_unusual;
2098 }
2099 break;
2100 }
2101
2102 // .tensorflow.RewriterConfig.Toggle loop_optimization = 9;
2103 case 9: {
2104 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (72 & 0xFF)) {
2105 int value = 0;
2106 DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
2107 int, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_ENUM>(
2108 input, &value)));
2109 set_loop_optimization(static_cast< ::tensorflow::RewriterConfig_Toggle >(value));
2110 } else {
2111 goto handle_unusual;
2112 }
2113 break;
2114 }
2115
2116 // .tensorflow.RewriterConfig.Toggle function_optimization = 10;
2117 case 10: {
2118 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (80 & 0xFF)) {
2119 int value = 0;
2120 DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
2121 int, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_ENUM>(
2122 input, &value)));
2123 set_function_optimization(static_cast< ::tensorflow::RewriterConfig_Toggle >(value));
2124 } else {
2125 goto handle_unusual;
2126 }
2127 break;
2128 }
2129
2130 // .tensorflow.RewriterConfig.Toggle debug_stripper = 11;
2131 case 11: {
2132 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (88 & 0xFF)) {
2133 int value = 0;
2134 DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
2135 int, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_ENUM>(
2136 input, &value)));
2137 set_debug_stripper(static_cast< ::tensorflow::RewriterConfig_Toggle >(value));
2138 } else {
2139 goto handle_unusual;
2140 }
2141 break;
2142 }
2143
2144 // .tensorflow.RewriterConfig.NumIterationsType meta_optimizer_iterations = 12;
2145 case 12: {
2146 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (96 & 0xFF)) {
2147 int value = 0;
2148 DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
2149 int, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_ENUM>(
2150 input, &value)));
2151 set_meta_optimizer_iterations(static_cast< ::tensorflow::RewriterConfig_NumIterationsType >(value));
2152 } else {
2153 goto handle_unusual;
2154 }
2155 break;
2156 }
2157
2158 // .tensorflow.RewriterConfig.Toggle shape_optimization = 13;
2159 case 13: {
2160 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (104 & 0xFF)) {
2161 int value = 0;
2162 DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
2163 int, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_ENUM>(
2164 input, &value)));
2165 set_shape_optimization(static_cast< ::tensorflow::RewriterConfig_Toggle >(value));
2166 } else {
2167 goto handle_unusual;
2168 }
2169 break;
2170 }
2171
2172 // .tensorflow.RewriterConfig.Toggle remapping = 14;
2173 case 14: {
2174 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (112 & 0xFF)) {
2175 int value = 0;
2176 DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
2177 int, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_ENUM>(
2178 input, &value)));
2179 set_remapping(static_cast< ::tensorflow::RewriterConfig_Toggle >(value));
2180 } else {
2181 goto handle_unusual;
2182 }
2183 break;
2184 }
2185
2186 // .tensorflow.RewriterConfig.Toggle scoped_allocator_optimization = 15;
2187 case 15: {
2188 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (120 & 0xFF)) {
2189 int value = 0;
2190 DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
2191 int, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_ENUM>(
2192 input, &value)));
2193 set_scoped_allocator_optimization(static_cast< ::tensorflow::RewriterConfig_Toggle >(value));
2194 } else {
2195 goto handle_unusual;
2196 }
2197 break;
2198 }
2199
2200 // .tensorflow.ScopedAllocatorOptions scoped_allocator_opts = 16;
2201 case 16: {
2202 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (130 & 0xFF)) {
2203 DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage(
2204 input, mutable_scoped_allocator_opts()));
2205 } else {
2206 goto handle_unusual;
2207 }
2208 break;
2209 }
2210
2211 // int32 min_graph_nodes = 17;
2212 case 17: {
2213 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (136 & 0xFF)) {
2214
2215 DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
2216 ::PROTOBUF_NAMESPACE_ID::int32, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT32>(
2217 input, &min_graph_nodes_)));
2218 } else {
2219 goto handle_unusual;
2220 }
2221 break;
2222 }
2223
2224 // .tensorflow.RewriterConfig.Toggle pin_to_host_optimization = 18;
2225 case 18: {
2226 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (144 & 0xFF)) {
2227 int value = 0;
2228 DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
2229 int, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_ENUM>(
2230 input, &value)));
2231 set_pin_to_host_optimization(static_cast< ::tensorflow::RewriterConfig_Toggle >(value));
2232 } else {
2233 goto handle_unusual;
2234 }
2235 break;
2236 }
2237
2238 // bool disable_meta_optimizer = 19;
2239 case 19: {
2240 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (152 & 0xFF)) {
2241
2242 DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
2243 bool, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_BOOL>(
2244 input, &disable_meta_optimizer_)));
2245 } else {
2246 goto handle_unusual;
2247 }
2248 break;
2249 }
2250
2251 // int64 meta_optimizer_timeout_ms = 20;
2252 case 20: {
2253 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (160 & 0xFF)) {
2254
2255 DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
2256 ::PROTOBUF_NAMESPACE_ID::int64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT64>(
2257 input, &meta_optimizer_timeout_ms_)));
2258 } else {
2259 goto handle_unusual;
2260 }
2261 break;
2262 }
2263
2264 // bool fail_on_optimizer_errors = 21;
2265 case 21: {
2266 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (168 & 0xFF)) {
2267
2268 DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
2269 bool, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_BOOL>(
2270 input, &fail_on_optimizer_errors_)));
2271 } else {
2272 goto handle_unusual;
2273 }
2274 break;
2275 }
2276
2277 // .tensorflow.RewriterConfig.Toggle implementation_selector = 22;
2278 case 22: {
2279 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (176 & 0xFF)) {
2280 int value = 0;
2281 DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
2282 int, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_ENUM>(
2283 input, &value)));
2284 set_implementation_selector(static_cast< ::tensorflow::RewriterConfig_Toggle >(value));
2285 } else {
2286 goto handle_unusual;
2287 }
2288 break;
2289 }
2290
2291 // .tensorflow.RewriterConfig.Toggle auto_mixed_precision = 23;
2292 case 23: {
2293 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (184 & 0xFF)) {
2294 int value = 0;
2295 DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
2296 int, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_ENUM>(
2297 input, &value)));
2298 set_auto_mixed_precision(static_cast< ::tensorflow::RewriterConfig_Toggle >(value));
2299 } else {
2300 goto handle_unusual;
2301 }
2302 break;
2303 }
2304
2305 // .tensorflow.RewriterConfig.Toggle common_subgraph_elimination = 24;
2306 case 24: {
2307 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (192 & 0xFF)) {
2308 int value = 0;
2309 DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
2310 int, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_ENUM>(
2311 input, &value)));
2312 set_common_subgraph_elimination(static_cast< ::tensorflow::RewriterConfig_Toggle >(value));
2313 } else {
2314 goto handle_unusual;
2315 }
2316 break;
2317 }
2318
2319 // .tensorflow.RewriterConfig.Toggle auto_mixed_precision_mkl = 25;
2320 case 25: {
2321 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (200 & 0xFF)) {
2322 int value = 0;
2323 DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
2324 int, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_ENUM>(
2325 input, &value)));
2326 set_auto_mixed_precision_mkl(static_cast< ::tensorflow::RewriterConfig_Toggle >(value));
2327 } else {
2328 goto handle_unusual;
2329 }
2330 break;
2331 }
2332
2333 // bool experimental_disable_compressed_tensor_optimization = 26;
2334 case 26: {
2335 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (208 & 0xFF)) {
2336
2337 DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
2338 bool, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_BOOL>(
2339 input, &experimental_disable_compressed_tensor_optimization_)));
2340 } else {
2341 goto handle_unusual;
2342 }
2343 break;
2344 }
2345
2346 // bool experimental_disable_folding_quantization_emulation = 27;
2347 case 27: {
2348 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (216 & 0xFF)) {
2349
2350 DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
2351 bool, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_BOOL>(
2352 input, &experimental_disable_folding_quantization_emulation_)));
2353 } else {
2354 goto handle_unusual;
2355 }
2356 break;
2357 }
2358
2359 // .tensorflow.RewriterConfig.Toggle use_plugin_optimizers = 28;
2360 case 28: {
2361 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (224 & 0xFF)) {
2362 int value = 0;
2363 DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
2364 int, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_ENUM>(
2365 input, &value)));
2366 set_use_plugin_optimizers(static_cast< ::tensorflow::RewriterConfig_Toggle >(value));
2367 } else {
2368 goto handle_unusual;
2369 }
2370 break;
2371 }
2372
2373 // .tensorflow.RewriterConfig.Toggle auto_mixed_precision_cpu = 29;
2374 case 29: {
2375 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (232 & 0xFF)) {
2376 int value = 0;
2377 DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
2378 int, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_ENUM>(
2379 input, &value)));
2380 set_auto_mixed_precision_cpu(static_cast< ::tensorflow::RewriterConfig_Toggle >(value));
2381 } else {
2382 goto handle_unusual;
2383 }
2384 break;
2385 }
2386
2387 // .tensorflow.RewriterConfig.Toggle experimental_conditional_code_motion = 30;
2388 case 30: {
2389 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (240 & 0xFF)) {
2390 int value = 0;
2391 DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
2392 int, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_ENUM>(
2393 input, &value)));
2394 set_experimental_conditional_code_motion(static_cast< ::tensorflow::RewriterConfig_Toggle >(value));
2395 } else {
2396 goto handle_unusual;
2397 }
2398 break;
2399 }
2400
2401 // .tensorflow.RewriterConfig.Toggle auto_mixed_precision_onednn_bfloat16 = 31;
2402 case 31: {
2403 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (248 & 0xFF)) {
2404 int value = 0;
2405 DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
2406 int, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_ENUM>(
2407 input, &value)));
2408 set_auto_mixed_precision_onednn_bfloat16(static_cast< ::tensorflow::RewriterConfig_Toggle >(value));
2409 } else {
2410 goto handle_unusual;
2411 }
2412 break;
2413 }
2414
2415 // .tensorflow.RewriterConfig.CpuLayout cpu_layout_conversion = 50;
2416 case 50: {
2417 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (400 & 0xFF)) {
2418 int value = 0;
2419 DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
2420 int, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_ENUM>(
2421 input, &value)));
2422 set_cpu_layout_conversion(static_cast< ::tensorflow::RewriterConfig_CpuLayout >(value));
2423 } else {
2424 goto handle_unusual;
2425 }
2426 break;
2427 }
2428
2429 // repeated string optimizers = 100;
2430 case 100: {
2431 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (802 & 0xFF)) {
2432 DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadString(
2433 input, this->add_optimizers()));
2434 DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
2435 this->optimizers(this->optimizers_size() - 1).data(),
2436 static_cast<int>(this->optimizers(this->optimizers_size() - 1).length()),
2437 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::PARSE,
2438 "tensorflow.RewriterConfig.optimizers"));
2439 } else {
2440 goto handle_unusual;
2441 }
2442 break;
2443 }
2444
2445 // repeated .tensorflow.RewriterConfig.CustomGraphOptimizer custom_optimizers = 200;
2446 case 200: {
2447 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (1602 & 0xFF)) {
2448 DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage(
2449 input, add_custom_optimizers()));
2450 } else {
2451 goto handle_unusual;
2452 }
2453 break;
2454 }
2455
2456 // .tensorflow.VerifierConfig inter_optimizer_verifier_config = 300;
2457 case 300: {
2458 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (2402 & 0xFF)) {
2459 DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage(
2460 input, mutable_inter_optimizer_verifier_config()));
2461 } else {
2462 goto handle_unusual;
2463 }
2464 break;
2465 }
2466
2467 // .tensorflow.VerifierConfig post_optimization_verifier_config = 301;
2468 case 301: {
2469 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (2410 & 0xFF)) {
2470 DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage(
2471 input, mutable_post_optimization_verifier_config()));
2472 } else {
2473 goto handle_unusual;
2474 }
2475 break;
2476 }
2477
2478 default: {
2479 handle_unusual:
2480 if (tag == 0) {
2481 goto success;
2482 }
2483 DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SkipField(
2484 input, tag, _internal_metadata_.mutable_unknown_fields()));
2485 break;
2486 }
2487 }
2488 }
2489success:
2490 // @@protoc_insertion_point(parse_success:tensorflow.RewriterConfig)
2491 return true;
2492failure:
2493 // @@protoc_insertion_point(parse_failure:tensorflow.RewriterConfig)
2494 return false;
2495#undef DO_
2496}
2497#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
2498
2499void RewriterConfig::SerializeWithCachedSizes(
2500 ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const {
2501 // @@protoc_insertion_point(serialize_start:tensorflow.RewriterConfig)
2502 ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
2503 (void) cached_has_bits;
2504
2505 // .tensorflow.RewriterConfig.Toggle layout_optimizer = 1;
2506 if (this->layout_optimizer() != 0) {
2507 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnum(
2508 1, this->layout_optimizer(), output);
2509 }
2510
2511 // bool disable_model_pruning = 2;
2512 if (this->disable_model_pruning() != 0) {
2513 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBool(2, this->disable_model_pruning(), output);
2514 }
2515
2516 // .tensorflow.RewriterConfig.Toggle constant_folding = 3;
2517 if (this->constant_folding() != 0) {
2518 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnum(
2519 3, this->constant_folding(), output);
2520 }
2521
2522 // .tensorflow.RewriterConfig.MemOptType memory_optimization = 4;
2523 if (this->memory_optimization() != 0) {
2524 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnum(
2525 4, this->memory_optimization(), output);
2526 }
2527
2528 // .tensorflow.AutoParallelOptions auto_parallel = 5;
2529 if (this->has_auto_parallel()) {
2530 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray(
2531 5, _Internal::auto_parallel(this), output);
2532 }
2533
2534 // string memory_optimizer_target_node_name_scope = 6;
2535 if (this->memory_optimizer_target_node_name_scope().size() > 0) {
2536 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
2537 this->memory_optimizer_target_node_name_scope().data(), static_cast<int>(this->memory_optimizer_target_node_name_scope().length()),
2538 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
2539 "tensorflow.RewriterConfig.memory_optimizer_target_node_name_scope");
2540 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringMaybeAliased(
2541 6, this->memory_optimizer_target_node_name_scope(), output);
2542 }
2543
2544 // .tensorflow.RewriterConfig.Toggle arithmetic_optimization = 7;
2545 if (this->arithmetic_optimization() != 0) {
2546 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnum(
2547 7, this->arithmetic_optimization(), output);
2548 }
2549
2550 // .tensorflow.RewriterConfig.Toggle dependency_optimization = 8;
2551 if (this->dependency_optimization() != 0) {
2552 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnum(
2553 8, this->dependency_optimization(), output);
2554 }
2555
2556 // .tensorflow.RewriterConfig.Toggle loop_optimization = 9;
2557 if (this->loop_optimization() != 0) {
2558 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnum(
2559 9, this->loop_optimization(), output);
2560 }
2561
2562 // .tensorflow.RewriterConfig.Toggle function_optimization = 10;
2563 if (this->function_optimization() != 0) {
2564 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnum(
2565 10, this->function_optimization(), output);
2566 }
2567
2568 // .tensorflow.RewriterConfig.Toggle debug_stripper = 11;
2569 if (this->debug_stripper() != 0) {
2570 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnum(
2571 11, this->debug_stripper(), output);
2572 }
2573
2574 // .tensorflow.RewriterConfig.NumIterationsType meta_optimizer_iterations = 12;
2575 if (this->meta_optimizer_iterations() != 0) {
2576 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnum(
2577 12, this->meta_optimizer_iterations(), output);
2578 }
2579
2580 // .tensorflow.RewriterConfig.Toggle shape_optimization = 13;
2581 if (this->shape_optimization() != 0) {
2582 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnum(
2583 13, this->shape_optimization(), output);
2584 }
2585
2586 // .tensorflow.RewriterConfig.Toggle remapping = 14;
2587 if (this->remapping() != 0) {
2588 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnum(
2589 14, this->remapping(), output);
2590 }
2591
2592 // .tensorflow.RewriterConfig.Toggle scoped_allocator_optimization = 15;
2593 if (this->scoped_allocator_optimization() != 0) {
2594 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnum(
2595 15, this->scoped_allocator_optimization(), output);
2596 }
2597
2598 // .tensorflow.ScopedAllocatorOptions scoped_allocator_opts = 16;
2599 if (this->has_scoped_allocator_opts()) {
2600 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray(
2601 16, _Internal::scoped_allocator_opts(this), output);
2602 }
2603
2604 // int32 min_graph_nodes = 17;
2605 if (this->min_graph_nodes() != 0) {
2606 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32(17, this->min_graph_nodes(), output);
2607 }
2608
2609 // .tensorflow.RewriterConfig.Toggle pin_to_host_optimization = 18;
2610 if (this->pin_to_host_optimization() != 0) {
2611 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnum(
2612 18, this->pin_to_host_optimization(), output);
2613 }
2614
2615 // bool disable_meta_optimizer = 19;
2616 if (this->disable_meta_optimizer() != 0) {
2617 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBool(19, this->disable_meta_optimizer(), output);
2618 }
2619
2620 // int64 meta_optimizer_timeout_ms = 20;
2621 if (this->meta_optimizer_timeout_ms() != 0) {
2622 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64(20, this->meta_optimizer_timeout_ms(), output);
2623 }
2624
2625 // bool fail_on_optimizer_errors = 21;
2626 if (this->fail_on_optimizer_errors() != 0) {
2627 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBool(21, this->fail_on_optimizer_errors(), output);
2628 }
2629
2630 // .tensorflow.RewriterConfig.Toggle implementation_selector = 22;
2631 if (this->implementation_selector() != 0) {
2632 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnum(
2633 22, this->implementation_selector(), output);
2634 }
2635
2636 // .tensorflow.RewriterConfig.Toggle auto_mixed_precision = 23;
2637 if (this->auto_mixed_precision() != 0) {
2638 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnum(
2639 23, this->auto_mixed_precision(), output);
2640 }
2641
2642 // .tensorflow.RewriterConfig.Toggle common_subgraph_elimination = 24;
2643 if (this->common_subgraph_elimination() != 0) {
2644 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnum(
2645 24, this->common_subgraph_elimination(), output);
2646 }
2647
2648 // .tensorflow.RewriterConfig.Toggle auto_mixed_precision_mkl = 25;
2649 if (this->auto_mixed_precision_mkl() != 0) {
2650 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnum(
2651 25, this->auto_mixed_precision_mkl(), output);
2652 }
2653
2654 // bool experimental_disable_compressed_tensor_optimization = 26;
2655 if (this->experimental_disable_compressed_tensor_optimization() != 0) {
2656 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBool(26, this->experimental_disable_compressed_tensor_optimization(), output);
2657 }
2658
2659 // bool experimental_disable_folding_quantization_emulation = 27;
2660 if (this->experimental_disable_folding_quantization_emulation() != 0) {
2661 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBool(27, this->experimental_disable_folding_quantization_emulation(), output);
2662 }
2663
2664 // .tensorflow.RewriterConfig.Toggle use_plugin_optimizers = 28;
2665 if (this->use_plugin_optimizers() != 0) {
2666 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnum(
2667 28, this->use_plugin_optimizers(), output);
2668 }
2669
2670 // .tensorflow.RewriterConfig.Toggle auto_mixed_precision_cpu = 29;
2671 if (this->auto_mixed_precision_cpu() != 0) {
2672 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnum(
2673 29, this->auto_mixed_precision_cpu(), output);
2674 }
2675
2676 // .tensorflow.RewriterConfig.Toggle experimental_conditional_code_motion = 30;
2677 if (this->experimental_conditional_code_motion() != 0) {
2678 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnum(
2679 30, this->experimental_conditional_code_motion(), output);
2680 }
2681
2682 // .tensorflow.RewriterConfig.Toggle auto_mixed_precision_onednn_bfloat16 = 31;
2683 if (this->auto_mixed_precision_onednn_bfloat16() != 0) {
2684 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnum(
2685 31, this->auto_mixed_precision_onednn_bfloat16(), output);
2686 }
2687
2688 // .tensorflow.RewriterConfig.CpuLayout cpu_layout_conversion = 50;
2689 if (this->cpu_layout_conversion() != 0) {
2690 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnum(
2691 50, this->cpu_layout_conversion(), output);
2692 }
2693
2694 // repeated string optimizers = 100;
2695 for (int i = 0, n = this->optimizers_size(); i < n; i++) {
2696 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
2697 this->optimizers(i).data(), static_cast<int>(this->optimizers(i).length()),
2698 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
2699 "tensorflow.RewriterConfig.optimizers");
2700 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteString(
2701 100, this->optimizers(i), output);
2702 }
2703
2704 // repeated .tensorflow.RewriterConfig.CustomGraphOptimizer custom_optimizers = 200;
2705 for (unsigned int i = 0,
2706 n = static_cast<unsigned int>(this->custom_optimizers_size()); i < n; i++) {
2707 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray(
2708 200,
2709 this->custom_optimizers(static_cast<int>(i)),
2710 output);
2711 }
2712
2713 // .tensorflow.VerifierConfig inter_optimizer_verifier_config = 300;
2714 if (this->has_inter_optimizer_verifier_config()) {
2715 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray(
2716 300, _Internal::inter_optimizer_verifier_config(this), output);
2717 }
2718
2719 // .tensorflow.VerifierConfig post_optimization_verifier_config = 301;
2720 if (this->has_post_optimization_verifier_config()) {
2721 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray(
2722 301, _Internal::post_optimization_verifier_config(this), output);
2723 }
2724
2725 if (_internal_metadata_.have_unknown_fields()) {
2726 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields(
2727 _internal_metadata_.unknown_fields(), output);
2728 }
2729 // @@protoc_insertion_point(serialize_end:tensorflow.RewriterConfig)
2730}
2731
2732::PROTOBUF_NAMESPACE_ID::uint8* RewriterConfig::InternalSerializeWithCachedSizesToArray(
2733 ::PROTOBUF_NAMESPACE_ID::uint8* target) const {
2734 // @@protoc_insertion_point(serialize_to_array_start:tensorflow.RewriterConfig)
2735 ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
2736 (void) cached_has_bits;
2737
2738 // .tensorflow.RewriterConfig.Toggle layout_optimizer = 1;
2739 if (this->layout_optimizer() != 0) {
2740 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
2741 1, this->layout_optimizer(), target);
2742 }
2743
2744 // bool disable_model_pruning = 2;
2745 if (this->disable_model_pruning() != 0) {
2746 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(2, this->disable_model_pruning(), target);
2747 }
2748
2749 // .tensorflow.RewriterConfig.Toggle constant_folding = 3;
2750 if (this->constant_folding() != 0) {
2751 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
2752 3, this->constant_folding(), target);
2753 }
2754
2755 // .tensorflow.RewriterConfig.MemOptType memory_optimization = 4;
2756 if (this->memory_optimization() != 0) {
2757 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
2758 4, this->memory_optimization(), target);
2759 }
2760
2761 // .tensorflow.AutoParallelOptions auto_parallel = 5;
2762 if (this->has_auto_parallel()) {
2763 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
2764 InternalWriteMessageToArray(
2765 5, _Internal::auto_parallel(this), target);
2766 }
2767
2768 // string memory_optimizer_target_node_name_scope = 6;
2769 if (this->memory_optimizer_target_node_name_scope().size() > 0) {
2770 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
2771 this->memory_optimizer_target_node_name_scope().data(), static_cast<int>(this->memory_optimizer_target_node_name_scope().length()),
2772 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
2773 "tensorflow.RewriterConfig.memory_optimizer_target_node_name_scope");
2774 target =
2775 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringToArray(
2776 6, this->memory_optimizer_target_node_name_scope(), target);
2777 }
2778
2779 // .tensorflow.RewriterConfig.Toggle arithmetic_optimization = 7;
2780 if (this->arithmetic_optimization() != 0) {
2781 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
2782 7, this->arithmetic_optimization(), target);
2783 }
2784
2785 // .tensorflow.RewriterConfig.Toggle dependency_optimization = 8;
2786 if (this->dependency_optimization() != 0) {
2787 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
2788 8, this->dependency_optimization(), target);
2789 }
2790
2791 // .tensorflow.RewriterConfig.Toggle loop_optimization = 9;
2792 if (this->loop_optimization() != 0) {
2793 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
2794 9, this->loop_optimization(), target);
2795 }
2796
2797 // .tensorflow.RewriterConfig.Toggle function_optimization = 10;
2798 if (this->function_optimization() != 0) {
2799 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
2800 10, this->function_optimization(), target);
2801 }
2802
2803 // .tensorflow.RewriterConfig.Toggle debug_stripper = 11;
2804 if (this->debug_stripper() != 0) {
2805 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
2806 11, this->debug_stripper(), target);
2807 }
2808
2809 // .tensorflow.RewriterConfig.NumIterationsType meta_optimizer_iterations = 12;
2810 if (this->meta_optimizer_iterations() != 0) {
2811 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
2812 12, this->meta_optimizer_iterations(), target);
2813 }
2814
2815 // .tensorflow.RewriterConfig.Toggle shape_optimization = 13;
2816 if (this->shape_optimization() != 0) {
2817 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
2818 13, this->shape_optimization(), target);
2819 }
2820
2821 // .tensorflow.RewriterConfig.Toggle remapping = 14;
2822 if (this->remapping() != 0) {
2823 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
2824 14, this->remapping(), target);
2825 }
2826
2827 // .tensorflow.RewriterConfig.Toggle scoped_allocator_optimization = 15;
2828 if (this->scoped_allocator_optimization() != 0) {
2829 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
2830 15, this->scoped_allocator_optimization(), target);
2831 }
2832
2833 // .tensorflow.ScopedAllocatorOptions scoped_allocator_opts = 16;
2834 if (this->has_scoped_allocator_opts()) {
2835 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
2836 InternalWriteMessageToArray(
2837 16, _Internal::scoped_allocator_opts(this), target);
2838 }
2839
2840 // int32 min_graph_nodes = 17;
2841 if (this->min_graph_nodes() != 0) {
2842 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(17, this->min_graph_nodes(), target);
2843 }
2844
2845 // .tensorflow.RewriterConfig.Toggle pin_to_host_optimization = 18;
2846 if (this->pin_to_host_optimization() != 0) {
2847 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
2848 18, this->pin_to_host_optimization(), target);
2849 }
2850
2851 // bool disable_meta_optimizer = 19;
2852 if (this->disable_meta_optimizer() != 0) {
2853 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(19, this->disable_meta_optimizer(), target);
2854 }
2855
2856 // int64 meta_optimizer_timeout_ms = 20;
2857 if (this->meta_optimizer_timeout_ms() != 0) {
2858 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(20, this->meta_optimizer_timeout_ms(), target);
2859 }
2860
2861 // bool fail_on_optimizer_errors = 21;
2862 if (this->fail_on_optimizer_errors() != 0) {
2863 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(21, this->fail_on_optimizer_errors(), target);
2864 }
2865
2866 // .tensorflow.RewriterConfig.Toggle implementation_selector = 22;
2867 if (this->implementation_selector() != 0) {
2868 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
2869 22, this->implementation_selector(), target);
2870 }
2871
2872 // .tensorflow.RewriterConfig.Toggle auto_mixed_precision = 23;
2873 if (this->auto_mixed_precision() != 0) {
2874 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
2875 23, this->auto_mixed_precision(), target);
2876 }
2877
2878 // .tensorflow.RewriterConfig.Toggle common_subgraph_elimination = 24;
2879 if (this->common_subgraph_elimination() != 0) {
2880 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
2881 24, this->common_subgraph_elimination(), target);
2882 }
2883
2884 // .tensorflow.RewriterConfig.Toggle auto_mixed_precision_mkl = 25;
2885 if (this->auto_mixed_precision_mkl() != 0) {
2886 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
2887 25, this->auto_mixed_precision_mkl(), target);
2888 }
2889
2890 // bool experimental_disable_compressed_tensor_optimization = 26;
2891 if (this->experimental_disable_compressed_tensor_optimization() != 0) {
2892 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(26, this->experimental_disable_compressed_tensor_optimization(), target);
2893 }
2894
2895 // bool experimental_disable_folding_quantization_emulation = 27;
2896 if (this->experimental_disable_folding_quantization_emulation() != 0) {
2897 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(27, this->experimental_disable_folding_quantization_emulation(), target);
2898 }
2899
2900 // .tensorflow.RewriterConfig.Toggle use_plugin_optimizers = 28;
2901 if (this->use_plugin_optimizers() != 0) {
2902 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
2903 28, this->use_plugin_optimizers(), target);
2904 }
2905
2906 // .tensorflow.RewriterConfig.Toggle auto_mixed_precision_cpu = 29;
2907 if (this->auto_mixed_precision_cpu() != 0) {
2908 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
2909 29, this->auto_mixed_precision_cpu(), target);
2910 }
2911
2912 // .tensorflow.RewriterConfig.Toggle experimental_conditional_code_motion = 30;
2913 if (this->experimental_conditional_code_motion() != 0) {
2914 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
2915 30, this->experimental_conditional_code_motion(), target);
2916 }
2917
2918 // .tensorflow.RewriterConfig.Toggle auto_mixed_precision_onednn_bfloat16 = 31;
2919 if (this->auto_mixed_precision_onednn_bfloat16() != 0) {
2920 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
2921 31, this->auto_mixed_precision_onednn_bfloat16(), target);
2922 }
2923
2924 // .tensorflow.RewriterConfig.CpuLayout cpu_layout_conversion = 50;
2925 if (this->cpu_layout_conversion() != 0) {
2926 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
2927 50, this->cpu_layout_conversion(), target);
2928 }
2929
2930 // repeated string optimizers = 100;
2931 for (int i = 0, n = this->optimizers_size(); i < n; i++) {
2932 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
2933 this->optimizers(i).data(), static_cast<int>(this->optimizers(i).length()),
2934 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
2935 "tensorflow.RewriterConfig.optimizers");
2936 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
2937 WriteStringToArray(100, this->optimizers(i), target);
2938 }
2939
2940 // repeated .tensorflow.RewriterConfig.CustomGraphOptimizer custom_optimizers = 200;
2941 for (unsigned int i = 0,
2942 n = static_cast<unsigned int>(this->custom_optimizers_size()); i < n; i++) {
2943 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
2944 InternalWriteMessageToArray(
2945 200, this->custom_optimizers(static_cast<int>(i)), target);
2946 }
2947
2948 // .tensorflow.VerifierConfig inter_optimizer_verifier_config = 300;
2949 if (this->has_inter_optimizer_verifier_config()) {
2950 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
2951 InternalWriteMessageToArray(
2952 300, _Internal::inter_optimizer_verifier_config(this), target);
2953 }
2954
2955 // .tensorflow.VerifierConfig post_optimization_verifier_config = 301;
2956 if (this->has_post_optimization_verifier_config()) {
2957 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
2958 InternalWriteMessageToArray(
2959 301, _Internal::post_optimization_verifier_config(this), target);
2960 }
2961
2962 if (_internal_metadata_.have_unknown_fields()) {
2963 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray(
2964 _internal_metadata_.unknown_fields(), target);
2965 }
2966 // @@protoc_insertion_point(serialize_to_array_end:tensorflow.RewriterConfig)
2967 return target;
2968}
2969
2970size_t RewriterConfig::ByteSizeLong() const {
2971// @@protoc_insertion_point(message_byte_size_start:tensorflow.RewriterConfig)
2972 size_t total_size = 0;
2973
2974 if (_internal_metadata_.have_unknown_fields()) {
2975 total_size +=
2976 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::ComputeUnknownFieldsSize(
2977 _internal_metadata_.unknown_fields());
2978 }
2979 ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
2980 // Prevent compiler warnings about cached_has_bits being unused
2981 (void) cached_has_bits;
2982
2983 // repeated string optimizers = 100;
2984 total_size += 2 *
2985 ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(this->optimizers_size());
2986 for (int i = 0, n = this->optimizers_size(); i < n; i++) {
2987 total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
2988 this->optimizers(i));
2989 }
2990
2991 // repeated .tensorflow.RewriterConfig.CustomGraphOptimizer custom_optimizers = 200;
2992 {
2993 unsigned int count = static_cast<unsigned int>(this->custom_optimizers_size());
2994 total_size += 2UL * count;
2995 for (unsigned int i = 0; i < count; i++) {
2996 total_size +=
2997 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
2998 this->custom_optimizers(static_cast<int>(i)));
2999 }
3000 }
3001
3002 // string memory_optimizer_target_node_name_scope = 6;
3003 if (this->memory_optimizer_target_node_name_scope().size() > 0) {
3004 total_size += 1 +
3005 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
3006 this->memory_optimizer_target_node_name_scope());
3007 }
3008
3009 // .tensorflow.AutoParallelOptions auto_parallel = 5;
3010 if (this->has_auto_parallel()) {
3011 total_size += 1 +
3012 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
3013 *auto_parallel_);
3014 }
3015
3016 // .tensorflow.ScopedAllocatorOptions scoped_allocator_opts = 16;
3017 if (this->has_scoped_allocator_opts()) {
3018 total_size += 2 +
3019 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
3020 *scoped_allocator_opts_);
3021 }
3022
3023 // .tensorflow.VerifierConfig inter_optimizer_verifier_config = 300;
3024 if (this->has_inter_optimizer_verifier_config()) {
3025 total_size += 2 +
3026 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
3027 *inter_optimizer_verifier_config_);
3028 }
3029
3030 // .tensorflow.VerifierConfig post_optimization_verifier_config = 301;
3031 if (this->has_post_optimization_verifier_config()) {
3032 total_size += 2 +
3033 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
3034 *post_optimization_verifier_config_);
3035 }
3036
3037 // .tensorflow.RewriterConfig.Toggle layout_optimizer = 1;
3038 if (this->layout_optimizer() != 0) {
3039 total_size += 1 +
3040 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->layout_optimizer());
3041 }
3042
3043 // .tensorflow.RewriterConfig.Toggle constant_folding = 3;
3044 if (this->constant_folding() != 0) {
3045 total_size += 1 +
3046 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->constant_folding());
3047 }
3048
3049 // .tensorflow.RewriterConfig.MemOptType memory_optimization = 4;
3050 if (this->memory_optimization() != 0) {
3051 total_size += 1 +
3052 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->memory_optimization());
3053 }
3054
3055 // .tensorflow.RewriterConfig.Toggle arithmetic_optimization = 7;
3056 if (this->arithmetic_optimization() != 0) {
3057 total_size += 1 +
3058 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->arithmetic_optimization());
3059 }
3060
3061 // .tensorflow.RewriterConfig.Toggle dependency_optimization = 8;
3062 if (this->dependency_optimization() != 0) {
3063 total_size += 1 +
3064 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->dependency_optimization());
3065 }
3066
3067 // .tensorflow.RewriterConfig.Toggle loop_optimization = 9;
3068 if (this->loop_optimization() != 0) {
3069 total_size += 1 +
3070 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->loop_optimization());
3071 }
3072
3073 // .tensorflow.RewriterConfig.Toggle function_optimization = 10;
3074 if (this->function_optimization() != 0) {
3075 total_size += 1 +
3076 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->function_optimization());
3077 }
3078
3079 // .tensorflow.RewriterConfig.Toggle debug_stripper = 11;
3080 if (this->debug_stripper() != 0) {
3081 total_size += 1 +
3082 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->debug_stripper());
3083 }
3084
3085 // .tensorflow.RewriterConfig.NumIterationsType meta_optimizer_iterations = 12;
3086 if (this->meta_optimizer_iterations() != 0) {
3087 total_size += 1 +
3088 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->meta_optimizer_iterations());
3089 }
3090
3091 // .tensorflow.RewriterConfig.Toggle shape_optimization = 13;
3092 if (this->shape_optimization() != 0) {
3093 total_size += 1 +
3094 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->shape_optimization());
3095 }
3096
3097 // .tensorflow.RewriterConfig.Toggle remapping = 14;
3098 if (this->remapping() != 0) {
3099 total_size += 1 +
3100 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->remapping());
3101 }
3102
3103 // .tensorflow.RewriterConfig.Toggle scoped_allocator_optimization = 15;
3104 if (this->scoped_allocator_optimization() != 0) {
3105 total_size += 1 +
3106 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->scoped_allocator_optimization());
3107 }
3108
3109 // int32 min_graph_nodes = 17;
3110 if (this->min_graph_nodes() != 0) {
3111 total_size += 2 +
3112 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
3113 this->min_graph_nodes());
3114 }
3115
3116 // .tensorflow.RewriterConfig.Toggle pin_to_host_optimization = 18;
3117 if (this->pin_to_host_optimization() != 0) {
3118 total_size += 2 +
3119 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->pin_to_host_optimization());
3120 }
3121
3122 // bool disable_model_pruning = 2;
3123 if (this->disable_model_pruning() != 0) {
3124 total_size += 1 + 1;
3125 }
3126
3127 // bool disable_meta_optimizer = 19;
3128 if (this->disable_meta_optimizer() != 0) {
3129 total_size += 2 + 1;
3130 }
3131
3132 // bool experimental_disable_compressed_tensor_optimization = 26;
3133 if (this->experimental_disable_compressed_tensor_optimization() != 0) {
3134 total_size += 2 + 1;
3135 }
3136
3137 // bool experimental_disable_folding_quantization_emulation = 27;
3138 if (this->experimental_disable_folding_quantization_emulation() != 0) {
3139 total_size += 2 + 1;
3140 }
3141
3142 // bool fail_on_optimizer_errors = 21;
3143 if (this->fail_on_optimizer_errors() != 0) {
3144 total_size += 2 + 1;
3145 }
3146
3147 // int64 meta_optimizer_timeout_ms = 20;
3148 if (this->meta_optimizer_timeout_ms() != 0) {
3149 total_size += 2 +
3150 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64Size(
3151 this->meta_optimizer_timeout_ms());
3152 }
3153
3154 // .tensorflow.RewriterConfig.Toggle implementation_selector = 22;
3155 if (this->implementation_selector() != 0) {
3156 total_size += 2 +
3157 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->implementation_selector());
3158 }
3159
3160 // .tensorflow.RewriterConfig.Toggle auto_mixed_precision = 23;
3161 if (this->auto_mixed_precision() != 0) {
3162 total_size += 2 +
3163 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->auto_mixed_precision());
3164 }
3165
3166 // .tensorflow.RewriterConfig.Toggle common_subgraph_elimination = 24;
3167 if (this->common_subgraph_elimination() != 0) {
3168 total_size += 2 +
3169 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->common_subgraph_elimination());
3170 }
3171
3172 // .tensorflow.RewriterConfig.Toggle auto_mixed_precision_mkl = 25;
3173 if (this->auto_mixed_precision_mkl() != 0) {
3174 total_size += 2 +
3175 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->auto_mixed_precision_mkl());
3176 }
3177
3178 // .tensorflow.RewriterConfig.Toggle use_plugin_optimizers = 28;
3179 if (this->use_plugin_optimizers() != 0) {
3180 total_size += 2 +
3181 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->use_plugin_optimizers());
3182 }
3183
3184 // .tensorflow.RewriterConfig.Toggle auto_mixed_precision_cpu = 29;
3185 if (this->auto_mixed_precision_cpu() != 0) {
3186 total_size += 2 +
3187 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->auto_mixed_precision_cpu());
3188 }
3189
3190 // .tensorflow.RewriterConfig.Toggle experimental_conditional_code_motion = 30;
3191 if (this->experimental_conditional_code_motion() != 0) {
3192 total_size += 2 +
3193 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->experimental_conditional_code_motion());
3194 }
3195
3196 // .tensorflow.RewriterConfig.Toggle auto_mixed_precision_onednn_bfloat16 = 31;
3197 if (this->auto_mixed_precision_onednn_bfloat16() != 0) {
3198 total_size += 2 +
3199 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->auto_mixed_precision_onednn_bfloat16());
3200 }
3201
3202 // .tensorflow.RewriterConfig.CpuLayout cpu_layout_conversion = 50;
3203 if (this->cpu_layout_conversion() != 0) {
3204 total_size += 2 +
3205 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->cpu_layout_conversion());
3206 }
3207
3208 int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
3209 SetCachedSize(cached_size);
3210 return total_size;
3211}
3212
3213void RewriterConfig::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
3214// @@protoc_insertion_point(generalized_merge_from_start:tensorflow.RewriterConfig)
3215 GOOGLE_DCHECK_NE(&from, this);
3216 const RewriterConfig* source =
3217 ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<RewriterConfig>(
3218 &from);
3219 if (source == nullptr) {
3220 // @@protoc_insertion_point(generalized_merge_from_cast_fail:tensorflow.RewriterConfig)
3221 ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
3222 } else {
3223 // @@protoc_insertion_point(generalized_merge_from_cast_success:tensorflow.RewriterConfig)
3224 MergeFrom(*source);
3225 }
3226}
3227
3228void RewriterConfig::MergeFrom(const RewriterConfig& from) {
3229// @@protoc_insertion_point(class_specific_merge_from_start:tensorflow.RewriterConfig)
3230 GOOGLE_DCHECK_NE(&from, this);
3231 _internal_metadata_.MergeFrom(from._internal_metadata_);
3232 ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
3233 (void) cached_has_bits;
3234
3235 optimizers_.MergeFrom(from.optimizers_);
3236 custom_optimizers_.MergeFrom(from.custom_optimizers_);
3237 if (from.memory_optimizer_target_node_name_scope().size() > 0) {
3238 set_memory_optimizer_target_node_name_scope(from.memory_optimizer_target_node_name_scope());
3239 }
3240 if (from.has_auto_parallel()) {
3241 mutable_auto_parallel()->::tensorflow::AutoParallelOptions::MergeFrom(from.auto_parallel());
3242 }
3243 if (from.has_scoped_allocator_opts()) {
3244 mutable_scoped_allocator_opts()->::tensorflow::ScopedAllocatorOptions::MergeFrom(from.scoped_allocator_opts());
3245 }
3246 if (from.has_inter_optimizer_verifier_config()) {
3247 mutable_inter_optimizer_verifier_config()->::tensorflow::VerifierConfig::MergeFrom(from.inter_optimizer_verifier_config());
3248 }
3249 if (from.has_post_optimization_verifier_config()) {
3250 mutable_post_optimization_verifier_config()->::tensorflow::VerifierConfig::MergeFrom(from.post_optimization_verifier_config());
3251 }
3252 if (from.layout_optimizer() != 0) {
3253 set_layout_optimizer(from.layout_optimizer());
3254 }
3255 if (from.constant_folding() != 0) {
3256 set_constant_folding(from.constant_folding());
3257 }
3258 if (from.memory_optimization() != 0) {
3259 set_memory_optimization(from.memory_optimization());
3260 }
3261 if (from.arithmetic_optimization() != 0) {
3262 set_arithmetic_optimization(from.arithmetic_optimization());
3263 }
3264 if (from.dependency_optimization() != 0) {
3265 set_dependency_optimization(from.dependency_optimization());
3266 }
3267 if (from.loop_optimization() != 0) {
3268 set_loop_optimization(from.loop_optimization());
3269 }
3270 if (from.function_optimization() != 0) {
3271 set_function_optimization(from.function_optimization());
3272 }
3273 if (from.debug_stripper() != 0) {
3274 set_debug_stripper(from.debug_stripper());
3275 }
3276 if (from.meta_optimizer_iterations() != 0) {
3277 set_meta_optimizer_iterations(from.meta_optimizer_iterations());
3278 }
3279 if (from.shape_optimization() != 0) {
3280 set_shape_optimization(from.shape_optimization());
3281 }
3282 if (from.remapping() != 0) {
3283 set_remapping(from.remapping());
3284 }
3285 if (from.scoped_allocator_optimization() != 0) {
3286 set_scoped_allocator_optimization(from.scoped_allocator_optimization());
3287 }
3288 if (from.min_graph_nodes() != 0) {
3289 set_min_graph_nodes(from.min_graph_nodes());
3290 }
3291 if (from.pin_to_host_optimization() != 0) {
3292 set_pin_to_host_optimization(from.pin_to_host_optimization());
3293 }
3294 if (from.disable_model_pruning() != 0) {
3295 set_disable_model_pruning(from.disable_model_pruning());
3296 }
3297 if (from.disable_meta_optimizer() != 0) {
3298 set_disable_meta_optimizer(from.disable_meta_optimizer());
3299 }
3300 if (from.experimental_disable_compressed_tensor_optimization() != 0) {
3301 set_experimental_disable_compressed_tensor_optimization(from.experimental_disable_compressed_tensor_optimization());
3302 }
3303 if (from.experimental_disable_folding_quantization_emulation() != 0) {
3304 set_experimental_disable_folding_quantization_emulation(from.experimental_disable_folding_quantization_emulation());
3305 }
3306 if (from.fail_on_optimizer_errors() != 0) {
3307 set_fail_on_optimizer_errors(from.fail_on_optimizer_errors());
3308 }
3309 if (from.meta_optimizer_timeout_ms() != 0) {
3310 set_meta_optimizer_timeout_ms(from.meta_optimizer_timeout_ms());
3311 }
3312 if (from.implementation_selector() != 0) {
3313 set_implementation_selector(from.implementation_selector());
3314 }
3315 if (from.auto_mixed_precision() != 0) {
3316 set_auto_mixed_precision(from.auto_mixed_precision());
3317 }
3318 if (from.common_subgraph_elimination() != 0) {
3319 set_common_subgraph_elimination(from.common_subgraph_elimination());
3320 }
3321 if (from.auto_mixed_precision_mkl() != 0) {
3322 set_auto_mixed_precision_mkl(from.auto_mixed_precision_mkl());
3323 }
3324 if (from.use_plugin_optimizers() != 0) {
3325 set_use_plugin_optimizers(from.use_plugin_optimizers());
3326 }
3327 if (from.auto_mixed_precision_cpu() != 0) {
3328 set_auto_mixed_precision_cpu(from.auto_mixed_precision_cpu());
3329 }
3330 if (from.experimental_conditional_code_motion() != 0) {
3331 set_experimental_conditional_code_motion(from.experimental_conditional_code_motion());
3332 }
3333 if (from.auto_mixed_precision_onednn_bfloat16() != 0) {
3334 set_auto_mixed_precision_onednn_bfloat16(from.auto_mixed_precision_onednn_bfloat16());
3335 }
3336 if (from.cpu_layout_conversion() != 0) {
3337 set_cpu_layout_conversion(from.cpu_layout_conversion());
3338 }
3339}
3340
3341void RewriterConfig::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
3342// @@protoc_insertion_point(generalized_copy_from_start:tensorflow.RewriterConfig)
3343 if (&from == this) return;
3344 Clear();
3345 MergeFrom(from);
3346}
3347
3348void RewriterConfig::CopyFrom(const RewriterConfig& from) {
3349// @@protoc_insertion_point(class_specific_copy_from_start:tensorflow.RewriterConfig)
3350 if (&from == this) return;
3351 Clear();
3352 MergeFrom(from);
3353}
3354
3355bool RewriterConfig::IsInitialized() const {
3356 return true;
3357}
3358
3359void RewriterConfig::InternalSwap(RewriterConfig* other) {
3360 using std::swap;
3361 _internal_metadata_.Swap(&other->_internal_metadata_);
3362 optimizers_.InternalSwap(CastToBase(&other->optimizers_));
3363 CastToBase(&custom_optimizers_)->InternalSwap(CastToBase(&other->custom_optimizers_));
3364 memory_optimizer_target_node_name_scope_.Swap(&other->memory_optimizer_target_node_name_scope_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
3365 GetArenaNoVirtual());
3366 swap(auto_parallel_, other->auto_parallel_);
3367 swap(scoped_allocator_opts_, other->scoped_allocator_opts_);
3368 swap(inter_optimizer_verifier_config_, other->inter_optimizer_verifier_config_);
3369 swap(post_optimization_verifier_config_, other->post_optimization_verifier_config_);
3370 swap(layout_optimizer_, other->layout_optimizer_);
3371 swap(constant_folding_, other->constant_folding_);
3372 swap(memory_optimization_, other->memory_optimization_);
3373 swap(arithmetic_optimization_, other->arithmetic_optimization_);
3374 swap(dependency_optimization_, other->dependency_optimization_);
3375 swap(loop_optimization_, other->loop_optimization_);
3376 swap(function_optimization_, other->function_optimization_);
3377 swap(debug_stripper_, other->debug_stripper_);
3378 swap(meta_optimizer_iterations_, other->meta_optimizer_iterations_);
3379 swap(shape_optimization_, other->shape_optimization_);
3380 swap(remapping_, other->remapping_);
3381 swap(scoped_allocator_optimization_, other->scoped_allocator_optimization_);
3382 swap(min_graph_nodes_, other->min_graph_nodes_);
3383 swap(pin_to_host_optimization_, other->pin_to_host_optimization_);
3384 swap(disable_model_pruning_, other->disable_model_pruning_);
3385 swap(disable_meta_optimizer_, other->disable_meta_optimizer_);
3386 swap(experimental_disable_compressed_tensor_optimization_, other->experimental_disable_compressed_tensor_optimization_);
3387 swap(experimental_disable_folding_quantization_emulation_, other->experimental_disable_folding_quantization_emulation_);
3388 swap(fail_on_optimizer_errors_, other->fail_on_optimizer_errors_);
3389 swap(meta_optimizer_timeout_ms_, other->meta_optimizer_timeout_ms_);
3390 swap(implementation_selector_, other->implementation_selector_);
3391 swap(auto_mixed_precision_, other->auto_mixed_precision_);
3392 swap(common_subgraph_elimination_, other->common_subgraph_elimination_);
3393 swap(auto_mixed_precision_mkl_, other->auto_mixed_precision_mkl_);
3394 swap(use_plugin_optimizers_, other->use_plugin_optimizers_);
3395 swap(auto_mixed_precision_cpu_, other->auto_mixed_precision_cpu_);
3396 swap(experimental_conditional_code_motion_, other->experimental_conditional_code_motion_);
3397 swap(auto_mixed_precision_onednn_bfloat16_, other->auto_mixed_precision_onednn_bfloat16_);
3398 swap(cpu_layout_conversion_, other->cpu_layout_conversion_);
3399}
3400
3401::PROTOBUF_NAMESPACE_ID::Metadata RewriterConfig::GetMetadata() const {
3402 return GetMetadataStatic();
3403}
3404
3405
3406// @@protoc_insertion_point(namespace_scope)
3407} // namespace tensorflow
3408PROTOBUF_NAMESPACE_OPEN
3409template<> PROTOBUF_NOINLINE ::tensorflow::AutoParallelOptions* Arena::CreateMaybeMessage< ::tensorflow::AutoParallelOptions >(Arena* arena) {
3410 return Arena::CreateMessageInternal< ::tensorflow::AutoParallelOptions >(arena);
3411}
3412template<> PROTOBUF_NOINLINE ::tensorflow::ScopedAllocatorOptions* Arena::CreateMaybeMessage< ::tensorflow::ScopedAllocatorOptions >(Arena* arena) {
3413 return Arena::CreateMessageInternal< ::tensorflow::ScopedAllocatorOptions >(arena);
3414}
3415template<> PROTOBUF_NOINLINE ::tensorflow::RewriterConfig_CustomGraphOptimizer_ParameterMapEntry_DoNotUse* Arena::CreateMaybeMessage< ::tensorflow::RewriterConfig_CustomGraphOptimizer_ParameterMapEntry_DoNotUse >(Arena* arena) {
3416 return Arena::CreateMessageInternal< ::tensorflow::RewriterConfig_CustomGraphOptimizer_ParameterMapEntry_DoNotUse >(arena);
3417}
3418template<> PROTOBUF_NOINLINE ::tensorflow::RewriterConfig_CustomGraphOptimizer* Arena::CreateMaybeMessage< ::tensorflow::RewriterConfig_CustomGraphOptimizer >(Arena* arena) {
3419 return Arena::CreateMessageInternal< ::tensorflow::RewriterConfig_CustomGraphOptimizer >(arena);
3420}
3421template<> PROTOBUF_NOINLINE ::tensorflow::RewriterConfig* Arena::CreateMaybeMessage< ::tensorflow::RewriterConfig >(Arena* arena) {
3422 return Arena::CreateMessageInternal< ::tensorflow::RewriterConfig >(arena);
3423}
3424PROTOBUF_NAMESPACE_CLOSE
3425
3426// @@protoc_insertion_point(global_scope)
3427#include <google/protobuf/port_undef.inc>
3428