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