1#![allow(unknown_lints)]
6#![allow(clippy::all)]
7
8#![cfg_attr(rustfmt, rustfmt_skip)]
9
10#![allow(box_pointers)]
11#![allow(dead_code)]
12#![allow(missing_docs)]
13#![allow(non_camel_case_types)]
14#![allow(non_snake_case)]
15#![allow(non_upper_case_globals)]
16#![allow(trivial_casts)]
17#![allow(unsafe_code)]
18#![allow(unused_imports)]
19#![allow(unused_results)]
20use protobuf::Message as Message_imported_for_functions;
23use protobuf::ProtobufEnum as ProtobufEnum_imported_for_functions;
24
25#[derive(PartialEq,Clone,Default)]
30pub struct VariableDef {
31 pub variable_name: ::std::string::String,
33 pub initial_value_name: ::std::string::String,
34 pub initializer_name: ::std::string::String,
35 pub snapshot_name: ::std::string::String,
36 pub save_slice_info_def: ::protobuf::SingularPtrField<SaveSliceInfoDef>,
37 pub is_resource: bool,
38 pub trainable: bool,
39 pub synchronization: VariableSynchronization,
40 pub aggregation: VariableAggregation,
41 pub unknown_fields: ::protobuf::UnknownFields,
43 pub cached_size: ::protobuf::CachedSize,
44}
45
46impl<'a> ::std::default::Default for &'a VariableDef {
47 fn default() -> &'a VariableDef {
48 <VariableDef as ::protobuf::Message>::default_instance()
49 }
50}
51
52impl VariableDef {
53 pub fn new() -> VariableDef {
54 ::std::default::Default::default()
55 }
56
57 pub fn get_variable_name(&self) -> &str {
61 &self.variable_name
62 }
63 pub fn clear_variable_name(&mut self) {
64 self.variable_name.clear();
65 }
66
67 pub fn set_variable_name(&mut self, v: ::std::string::String) {
69 self.variable_name = v;
70 }
71
72 pub fn mut_variable_name(&mut self) -> &mut ::std::string::String {
75 &mut self.variable_name
76 }
77
78 pub fn take_variable_name(&mut self) -> ::std::string::String {
80 ::std::mem::replace(&mut self.variable_name, ::std::string::String::new())
81 }
82
83 pub fn get_initial_value_name(&self) -> &str {
87 &self.initial_value_name
88 }
89 pub fn clear_initial_value_name(&mut self) {
90 self.initial_value_name.clear();
91 }
92
93 pub fn set_initial_value_name(&mut self, v: ::std::string::String) {
95 self.initial_value_name = v;
96 }
97
98 pub fn mut_initial_value_name(&mut self) -> &mut ::std::string::String {
101 &mut self.initial_value_name
102 }
103
104 pub fn take_initial_value_name(&mut self) -> ::std::string::String {
106 ::std::mem::replace(&mut self.initial_value_name, ::std::string::String::new())
107 }
108
109 pub fn get_initializer_name(&self) -> &str {
113 &self.initializer_name
114 }
115 pub fn clear_initializer_name(&mut self) {
116 self.initializer_name.clear();
117 }
118
119 pub fn set_initializer_name(&mut self, v: ::std::string::String) {
121 self.initializer_name = v;
122 }
123
124 pub fn mut_initializer_name(&mut self) -> &mut ::std::string::String {
127 &mut self.initializer_name
128 }
129
130 pub fn take_initializer_name(&mut self) -> ::std::string::String {
132 ::std::mem::replace(&mut self.initializer_name, ::std::string::String::new())
133 }
134
135 pub fn get_snapshot_name(&self) -> &str {
139 &self.snapshot_name
140 }
141 pub fn clear_snapshot_name(&mut self) {
142 self.snapshot_name.clear();
143 }
144
145 pub fn set_snapshot_name(&mut self, v: ::std::string::String) {
147 self.snapshot_name = v;
148 }
149
150 pub fn mut_snapshot_name(&mut self) -> &mut ::std::string::String {
153 &mut self.snapshot_name
154 }
155
156 pub fn take_snapshot_name(&mut self) -> ::std::string::String {
158 ::std::mem::replace(&mut self.snapshot_name, ::std::string::String::new())
159 }
160
161 pub fn get_save_slice_info_def(&self) -> &SaveSliceInfoDef {
165 self.save_slice_info_def.as_ref().unwrap_or_else(|| SaveSliceInfoDef::default_instance())
166 }
167 pub fn clear_save_slice_info_def(&mut self) {
168 self.save_slice_info_def.clear();
169 }
170
171 pub fn has_save_slice_info_def(&self) -> bool {
172 self.save_slice_info_def.is_some()
173 }
174
175 pub fn set_save_slice_info_def(&mut self, v: SaveSliceInfoDef) {
177 self.save_slice_info_def = ::protobuf::SingularPtrField::some(v);
178 }
179
180 pub fn mut_save_slice_info_def(&mut self) -> &mut SaveSliceInfoDef {
183 if self.save_slice_info_def.is_none() {
184 self.save_slice_info_def.set_default();
185 }
186 self.save_slice_info_def.as_mut().unwrap()
187 }
188
189 pub fn take_save_slice_info_def(&mut self) -> SaveSliceInfoDef {
191 self.save_slice_info_def.take().unwrap_or_else(|| SaveSliceInfoDef::new())
192 }
193
194 pub fn get_is_resource(&self) -> bool {
198 self.is_resource
199 }
200 pub fn clear_is_resource(&mut self) {
201 self.is_resource = false;
202 }
203
204 pub fn set_is_resource(&mut self, v: bool) {
206 self.is_resource = v;
207 }
208
209 pub fn get_trainable(&self) -> bool {
213 self.trainable
214 }
215 pub fn clear_trainable(&mut self) {
216 self.trainable = false;
217 }
218
219 pub fn set_trainable(&mut self, v: bool) {
221 self.trainable = v;
222 }
223
224 pub fn get_synchronization(&self) -> VariableSynchronization {
228 self.synchronization
229 }
230 pub fn clear_synchronization(&mut self) {
231 self.synchronization = VariableSynchronization::VARIABLE_SYNCHRONIZATION_AUTO;
232 }
233
234 pub fn set_synchronization(&mut self, v: VariableSynchronization) {
236 self.synchronization = v;
237 }
238
239 pub fn get_aggregation(&self) -> VariableAggregation {
243 self.aggregation
244 }
245 pub fn clear_aggregation(&mut self) {
246 self.aggregation = VariableAggregation::VARIABLE_AGGREGATION_NONE;
247 }
248
249 pub fn set_aggregation(&mut self, v: VariableAggregation) {
251 self.aggregation = v;
252 }
253}
254
255impl ::protobuf::Message for VariableDef {
256 fn is_initialized(&self) -> bool {
257 for v in &self.save_slice_info_def {
258 if !v.is_initialized() {
259 return false;
260 }
261 };
262 true
263 }
264
265 fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
266 while !is.eof()? {
267 let (field_number, wire_type) = is.read_tag_unpack()?;
268 match field_number {
269 1 => {
270 ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.variable_name)?;
271 },
272 6 => {
273 ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.initial_value_name)?;
274 },
275 2 => {
276 ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.initializer_name)?;
277 },
278 3 => {
279 ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.snapshot_name)?;
280 },
281 4 => {
282 ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.save_slice_info_def)?;
283 },
284 5 => {
285 if wire_type != ::protobuf::wire_format::WireTypeVarint {
286 return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
287 }
288 let tmp = is.read_bool()?;
289 self.is_resource = tmp;
290 },
291 7 => {
292 if wire_type != ::protobuf::wire_format::WireTypeVarint {
293 return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
294 }
295 let tmp = is.read_bool()?;
296 self.trainable = tmp;
297 },
298 8 => {
299 ::protobuf::rt::read_proto3_enum_with_unknown_fields_into(wire_type, is, &mut self.synchronization, 8, &mut self.unknown_fields)?
300 },
301 9 => {
302 ::protobuf::rt::read_proto3_enum_with_unknown_fields_into(wire_type, is, &mut self.aggregation, 9, &mut self.unknown_fields)?
303 },
304 _ => {
305 ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
306 },
307 };
308 }
309 ::std::result::Result::Ok(())
310 }
311
312 #[allow(unused_variables)]
314 fn compute_size(&self) -> u32 {
315 let mut my_size = 0;
316 if !self.variable_name.is_empty() {
317 my_size += ::protobuf::rt::string_size(1, &self.variable_name);
318 }
319 if !self.initial_value_name.is_empty() {
320 my_size += ::protobuf::rt::string_size(6, &self.initial_value_name);
321 }
322 if !self.initializer_name.is_empty() {
323 my_size += ::protobuf::rt::string_size(2, &self.initializer_name);
324 }
325 if !self.snapshot_name.is_empty() {
326 my_size += ::protobuf::rt::string_size(3, &self.snapshot_name);
327 }
328 if let Some(ref v) = self.save_slice_info_def.as_ref() {
329 let len = v.compute_size();
330 my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len;
331 }
332 if self.is_resource != false {
333 my_size += 2;
334 }
335 if self.trainable != false {
336 my_size += 2;
337 }
338 if self.synchronization != VariableSynchronization::VARIABLE_SYNCHRONIZATION_AUTO {
339 my_size += ::protobuf::rt::enum_size(8, self.synchronization);
340 }
341 if self.aggregation != VariableAggregation::VARIABLE_AGGREGATION_NONE {
342 my_size += ::protobuf::rt::enum_size(9, self.aggregation);
343 }
344 my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
345 self.cached_size.set(my_size);
346 my_size
347 }
348
349 fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
350 if !self.variable_name.is_empty() {
351 os.write_string(1, &self.variable_name)?;
352 }
353 if !self.initial_value_name.is_empty() {
354 os.write_string(6, &self.initial_value_name)?;
355 }
356 if !self.initializer_name.is_empty() {
357 os.write_string(2, &self.initializer_name)?;
358 }
359 if !self.snapshot_name.is_empty() {
360 os.write_string(3, &self.snapshot_name)?;
361 }
362 if let Some(ref v) = self.save_slice_info_def.as_ref() {
363 os.write_tag(4, ::protobuf::wire_format::WireTypeLengthDelimited)?;
364 os.write_raw_varint32(v.get_cached_size())?;
365 v.write_to_with_cached_sizes(os)?;
366 }
367 if self.is_resource != false {
368 os.write_bool(5, self.is_resource)?;
369 }
370 if self.trainable != false {
371 os.write_bool(7, self.trainable)?;
372 }
373 if self.synchronization != VariableSynchronization::VARIABLE_SYNCHRONIZATION_AUTO {
374 os.write_enum(8, self.synchronization.value())?;
375 }
376 if self.aggregation != VariableAggregation::VARIABLE_AGGREGATION_NONE {
377 os.write_enum(9, self.aggregation.value())?;
378 }
379 os.write_unknown_fields(self.get_unknown_fields())?;
380 ::std::result::Result::Ok(())
381 }
382
383 fn get_cached_size(&self) -> u32 {
384 self.cached_size.get()
385 }
386
387 fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
388 &self.unknown_fields
389 }
390
391 fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
392 &mut self.unknown_fields
393 }
394
395 fn as_any(&self) -> &dyn (::std::any::Any) {
396 self as &dyn (::std::any::Any)
397 }
398 fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
399 self as &mut dyn (::std::any::Any)
400 }
401 fn into_any(self: Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
402 self
403 }
404
405 fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
406 Self::descriptor_static()
407 }
408
409 fn new() -> VariableDef {
410 VariableDef::new()
411 }
412
413 fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
414 static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy::INIT;
415 unsafe {
416 descriptor.get(|| {
417 let mut fields = ::std::vec::Vec::new();
418 fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
419 "variable_name",
420 |m: &VariableDef| { &m.variable_name },
421 |m: &mut VariableDef| { &mut m.variable_name },
422 ));
423 fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
424 "initial_value_name",
425 |m: &VariableDef| { &m.initial_value_name },
426 |m: &mut VariableDef| { &mut m.initial_value_name },
427 ));
428 fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
429 "initializer_name",
430 |m: &VariableDef| { &m.initializer_name },
431 |m: &mut VariableDef| { &mut m.initializer_name },
432 ));
433 fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
434 "snapshot_name",
435 |m: &VariableDef| { &m.snapshot_name },
436 |m: &mut VariableDef| { &mut m.snapshot_name },
437 ));
438 fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage<SaveSliceInfoDef>>(
439 "save_slice_info_def",
440 |m: &VariableDef| { &m.save_slice_info_def },
441 |m: &mut VariableDef| { &mut m.save_slice_info_def },
442 ));
443 fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBool>(
444 "is_resource",
445 |m: &VariableDef| { &m.is_resource },
446 |m: &mut VariableDef| { &mut m.is_resource },
447 ));
448 fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBool>(
449 "trainable",
450 |m: &VariableDef| { &m.trainable },
451 |m: &mut VariableDef| { &mut m.trainable },
452 ));
453 fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeEnum<VariableSynchronization>>(
454 "synchronization",
455 |m: &VariableDef| { &m.synchronization },
456 |m: &mut VariableDef| { &mut m.synchronization },
457 ));
458 fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeEnum<VariableAggregation>>(
459 "aggregation",
460 |m: &VariableDef| { &m.aggregation },
461 |m: &mut VariableDef| { &mut m.aggregation },
462 ));
463 ::protobuf::reflect::MessageDescriptor::new_pb_name::<VariableDef>(
464 "VariableDef",
465 fields,
466 file_descriptor_proto()
467 )
468 })
469 }
470 }
471
472 fn default_instance() -> &'static VariableDef {
473 static mut instance: ::protobuf::lazy::Lazy<VariableDef> = ::protobuf::lazy::Lazy::INIT;
474 unsafe {
475 instance.get(VariableDef::new)
476 }
477 }
478}
479
480impl ::protobuf::Clear for VariableDef {
481 fn clear(&mut self) {
482 self.variable_name.clear();
483 self.initial_value_name.clear();
484 self.initializer_name.clear();
485 self.snapshot_name.clear();
486 self.save_slice_info_def.clear();
487 self.is_resource = false;
488 self.trainable = false;
489 self.synchronization = VariableSynchronization::VARIABLE_SYNCHRONIZATION_AUTO;
490 self.aggregation = VariableAggregation::VARIABLE_AGGREGATION_NONE;
491 self.unknown_fields.clear();
492 }
493}
494
495impl ::std::fmt::Debug for VariableDef {
496 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
497 ::protobuf::text_format::fmt(self, f)
498 }
499}
500
501impl ::protobuf::reflect::ProtobufValue for VariableDef {
502 fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
503 ::protobuf::reflect::ReflectValueRef::Message(self)
504 }
505}
506
507#[derive(PartialEq,Clone,Default)]
508pub struct SaveSliceInfoDef {
509 pub full_name: ::std::string::String,
511 pub full_shape: ::std::vec::Vec<i64>,
512 pub var_offset: ::std::vec::Vec<i64>,
513 pub var_shape: ::std::vec::Vec<i64>,
514 pub unknown_fields: ::protobuf::UnknownFields,
516 pub cached_size: ::protobuf::CachedSize,
517}
518
519impl<'a> ::std::default::Default for &'a SaveSliceInfoDef {
520 fn default() -> &'a SaveSliceInfoDef {
521 <SaveSliceInfoDef as ::protobuf::Message>::default_instance()
522 }
523}
524
525impl SaveSliceInfoDef {
526 pub fn new() -> SaveSliceInfoDef {
527 ::std::default::Default::default()
528 }
529
530 pub fn get_full_name(&self) -> &str {
534 &self.full_name
535 }
536 pub fn clear_full_name(&mut self) {
537 self.full_name.clear();
538 }
539
540 pub fn set_full_name(&mut self, v: ::std::string::String) {
542 self.full_name = v;
543 }
544
545 pub fn mut_full_name(&mut self) -> &mut ::std::string::String {
548 &mut self.full_name
549 }
550
551 pub fn take_full_name(&mut self) -> ::std::string::String {
553 ::std::mem::replace(&mut self.full_name, ::std::string::String::new())
554 }
555
556 pub fn get_full_shape(&self) -> &[i64] {
560 &self.full_shape
561 }
562 pub fn clear_full_shape(&mut self) {
563 self.full_shape.clear();
564 }
565
566 pub fn set_full_shape(&mut self, v: ::std::vec::Vec<i64>) {
568 self.full_shape = v;
569 }
570
571 pub fn mut_full_shape(&mut self) -> &mut ::std::vec::Vec<i64> {
573 &mut self.full_shape
574 }
575
576 pub fn take_full_shape(&mut self) -> ::std::vec::Vec<i64> {
578 ::std::mem::replace(&mut self.full_shape, ::std::vec::Vec::new())
579 }
580
581 pub fn get_var_offset(&self) -> &[i64] {
585 &self.var_offset
586 }
587 pub fn clear_var_offset(&mut self) {
588 self.var_offset.clear();
589 }
590
591 pub fn set_var_offset(&mut self, v: ::std::vec::Vec<i64>) {
593 self.var_offset = v;
594 }
595
596 pub fn mut_var_offset(&mut self) -> &mut ::std::vec::Vec<i64> {
598 &mut self.var_offset
599 }
600
601 pub fn take_var_offset(&mut self) -> ::std::vec::Vec<i64> {
603 ::std::mem::replace(&mut self.var_offset, ::std::vec::Vec::new())
604 }
605
606 pub fn get_var_shape(&self) -> &[i64] {
610 &self.var_shape
611 }
612 pub fn clear_var_shape(&mut self) {
613 self.var_shape.clear();
614 }
615
616 pub fn set_var_shape(&mut self, v: ::std::vec::Vec<i64>) {
618 self.var_shape = v;
619 }
620
621 pub fn mut_var_shape(&mut self) -> &mut ::std::vec::Vec<i64> {
623 &mut self.var_shape
624 }
625
626 pub fn take_var_shape(&mut self) -> ::std::vec::Vec<i64> {
628 ::std::mem::replace(&mut self.var_shape, ::std::vec::Vec::new())
629 }
630}
631
632impl ::protobuf::Message for SaveSliceInfoDef {
633 fn is_initialized(&self) -> bool {
634 true
635 }
636
637 fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
638 while !is.eof()? {
639 let (field_number, wire_type) = is.read_tag_unpack()?;
640 match field_number {
641 1 => {
642 ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.full_name)?;
643 },
644 2 => {
645 ::protobuf::rt::read_repeated_int64_into(wire_type, is, &mut self.full_shape)?;
646 },
647 3 => {
648 ::protobuf::rt::read_repeated_int64_into(wire_type, is, &mut self.var_offset)?;
649 },
650 4 => {
651 ::protobuf::rt::read_repeated_int64_into(wire_type, is, &mut self.var_shape)?;
652 },
653 _ => {
654 ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
655 },
656 };
657 }
658 ::std::result::Result::Ok(())
659 }
660
661 #[allow(unused_variables)]
663 fn compute_size(&self) -> u32 {
664 let mut my_size = 0;
665 if !self.full_name.is_empty() {
666 my_size += ::protobuf::rt::string_size(1, &self.full_name);
667 }
668 for value in &self.full_shape {
669 my_size += ::protobuf::rt::value_size(2, *value, ::protobuf::wire_format::WireTypeVarint);
670 };
671 for value in &self.var_offset {
672 my_size += ::protobuf::rt::value_size(3, *value, ::protobuf::wire_format::WireTypeVarint);
673 };
674 for value in &self.var_shape {
675 my_size += ::protobuf::rt::value_size(4, *value, ::protobuf::wire_format::WireTypeVarint);
676 };
677 my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
678 self.cached_size.set(my_size);
679 my_size
680 }
681
682 fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
683 if !self.full_name.is_empty() {
684 os.write_string(1, &self.full_name)?;
685 }
686 for v in &self.full_shape {
687 os.write_int64(2, *v)?;
688 };
689 for v in &self.var_offset {
690 os.write_int64(3, *v)?;
691 };
692 for v in &self.var_shape {
693 os.write_int64(4, *v)?;
694 };
695 os.write_unknown_fields(self.get_unknown_fields())?;
696 ::std::result::Result::Ok(())
697 }
698
699 fn get_cached_size(&self) -> u32 {
700 self.cached_size.get()
701 }
702
703 fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
704 &self.unknown_fields
705 }
706
707 fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
708 &mut self.unknown_fields
709 }
710
711 fn as_any(&self) -> &dyn (::std::any::Any) {
712 self as &dyn (::std::any::Any)
713 }
714 fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
715 self as &mut dyn (::std::any::Any)
716 }
717 fn into_any(self: Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
718 self
719 }
720
721 fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
722 Self::descriptor_static()
723 }
724
725 fn new() -> SaveSliceInfoDef {
726 SaveSliceInfoDef::new()
727 }
728
729 fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
730 static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy::INIT;
731 unsafe {
732 descriptor.get(|| {
733 let mut fields = ::std::vec::Vec::new();
734 fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
735 "full_name",
736 |m: &SaveSliceInfoDef| { &m.full_name },
737 |m: &mut SaveSliceInfoDef| { &mut m.full_name },
738 ));
739 fields.push(::protobuf::reflect::accessor::make_vec_accessor::<_, ::protobuf::types::ProtobufTypeInt64>(
740 "full_shape",
741 |m: &SaveSliceInfoDef| { &m.full_shape },
742 |m: &mut SaveSliceInfoDef| { &mut m.full_shape },
743 ));
744 fields.push(::protobuf::reflect::accessor::make_vec_accessor::<_, ::protobuf::types::ProtobufTypeInt64>(
745 "var_offset",
746 |m: &SaveSliceInfoDef| { &m.var_offset },
747 |m: &mut SaveSliceInfoDef| { &mut m.var_offset },
748 ));
749 fields.push(::protobuf::reflect::accessor::make_vec_accessor::<_, ::protobuf::types::ProtobufTypeInt64>(
750 "var_shape",
751 |m: &SaveSliceInfoDef| { &m.var_shape },
752 |m: &mut SaveSliceInfoDef| { &mut m.var_shape },
753 ));
754 ::protobuf::reflect::MessageDescriptor::new_pb_name::<SaveSliceInfoDef>(
755 "SaveSliceInfoDef",
756 fields,
757 file_descriptor_proto()
758 )
759 })
760 }
761 }
762
763 fn default_instance() -> &'static SaveSliceInfoDef {
764 static mut instance: ::protobuf::lazy::Lazy<SaveSliceInfoDef> = ::protobuf::lazy::Lazy::INIT;
765 unsafe {
766 instance.get(SaveSliceInfoDef::new)
767 }
768 }
769}
770
771impl ::protobuf::Clear for SaveSliceInfoDef {
772 fn clear(&mut self) {
773 self.full_name.clear();
774 self.full_shape.clear();
775 self.var_offset.clear();
776 self.var_shape.clear();
777 self.unknown_fields.clear();
778 }
779}
780
781impl ::std::fmt::Debug for SaveSliceInfoDef {
782 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
783 ::protobuf::text_format::fmt(self, f)
784 }
785}
786
787impl ::protobuf::reflect::ProtobufValue for SaveSliceInfoDef {
788 fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
789 ::protobuf::reflect::ReflectValueRef::Message(self)
790 }
791}
792
793#[derive(Clone,PartialEq,Eq,Debug,Hash)]
794pub enum VariableSynchronization {
795 VARIABLE_SYNCHRONIZATION_AUTO = 0,
796 VARIABLE_SYNCHRONIZATION_NONE = 1,
797 VARIABLE_SYNCHRONIZATION_ON_WRITE = 2,
798 VARIABLE_SYNCHRONIZATION_ON_READ = 3,
799}
800
801impl ::protobuf::ProtobufEnum for VariableSynchronization {
802 fn value(&self) -> i32 {
803 *self as i32
804 }
805
806 fn from_i32(value: i32) -> ::std::option::Option<VariableSynchronization> {
807 match value {
808 0 => ::std::option::Option::Some(VariableSynchronization::VARIABLE_SYNCHRONIZATION_AUTO),
809 1 => ::std::option::Option::Some(VariableSynchronization::VARIABLE_SYNCHRONIZATION_NONE),
810 2 => ::std::option::Option::Some(VariableSynchronization::VARIABLE_SYNCHRONIZATION_ON_WRITE),
811 3 => ::std::option::Option::Some(VariableSynchronization::VARIABLE_SYNCHRONIZATION_ON_READ),
812 _ => ::std::option::Option::None
813 }
814 }
815
816 fn values() -> &'static [Self] {
817 static values: &'static [VariableSynchronization] = &[
818 VariableSynchronization::VARIABLE_SYNCHRONIZATION_AUTO,
819 VariableSynchronization::VARIABLE_SYNCHRONIZATION_NONE,
820 VariableSynchronization::VARIABLE_SYNCHRONIZATION_ON_WRITE,
821 VariableSynchronization::VARIABLE_SYNCHRONIZATION_ON_READ,
822 ];
823 values
824 }
825
826 fn enum_descriptor_static() -> &'static ::protobuf::reflect::EnumDescriptor {
827 static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::EnumDescriptor> = ::protobuf::lazy::Lazy::INIT;
828 unsafe {
829 descriptor.get(|| {
830 ::protobuf::reflect::EnumDescriptor::new_pb_name::<VariableSynchronization>("VariableSynchronization", file_descriptor_proto())
831 })
832 }
833 }
834}
835
836impl ::std::marker::Copy for VariableSynchronization {
837}
838
839impl ::std::default::Default for VariableSynchronization {
840 fn default() -> Self {
841 VariableSynchronization::VARIABLE_SYNCHRONIZATION_AUTO
842 }
843}
844
845impl ::protobuf::reflect::ProtobufValue for VariableSynchronization {
846 fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
847 ::protobuf::reflect::ReflectValueRef::Enum(self.descriptor())
848 }
849}
850
851#[derive(Clone,PartialEq,Eq,Debug,Hash)]
852pub enum VariableAggregation {
853 VARIABLE_AGGREGATION_NONE = 0,
854 VARIABLE_AGGREGATION_SUM = 1,
855 VARIABLE_AGGREGATION_MEAN = 2,
856 VARIABLE_AGGREGATION_ONLY_FIRST_REPLICA = 3,
857}
858
859impl ::protobuf::ProtobufEnum for VariableAggregation {
860 fn value(&self) -> i32 {
861 *self as i32
862 }
863
864 fn from_i32(value: i32) -> ::std::option::Option<VariableAggregation> {
865 match value {
866 0 => ::std::option::Option::Some(VariableAggregation::VARIABLE_AGGREGATION_NONE),
867 1 => ::std::option::Option::Some(VariableAggregation::VARIABLE_AGGREGATION_SUM),
868 2 => ::std::option::Option::Some(VariableAggregation::VARIABLE_AGGREGATION_MEAN),
869 3 => ::std::option::Option::Some(VariableAggregation::VARIABLE_AGGREGATION_ONLY_FIRST_REPLICA),
870 _ => ::std::option::Option::None
871 }
872 }
873
874 fn values() -> &'static [Self] {
875 static values: &'static [VariableAggregation] = &[
876 VariableAggregation::VARIABLE_AGGREGATION_NONE,
877 VariableAggregation::VARIABLE_AGGREGATION_SUM,
878 VariableAggregation::VARIABLE_AGGREGATION_MEAN,
879 VariableAggregation::VARIABLE_AGGREGATION_ONLY_FIRST_REPLICA,
880 ];
881 values
882 }
883
884 fn enum_descriptor_static() -> &'static ::protobuf::reflect::EnumDescriptor {
885 static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::EnumDescriptor> = ::protobuf::lazy::Lazy::INIT;
886 unsafe {
887 descriptor.get(|| {
888 ::protobuf::reflect::EnumDescriptor::new_pb_name::<VariableAggregation>("VariableAggregation", file_descriptor_proto())
889 })
890 }
891 }
892}
893
894impl ::std::marker::Copy for VariableAggregation {
895}
896
897impl ::std::default::Default for VariableAggregation {
898 fn default() -> Self {
899 VariableAggregation::VARIABLE_AGGREGATION_NONE
900 }
901}
902
903impl ::protobuf::reflect::ProtobufValue for VariableAggregation {
904 fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
905 ::protobuf::reflect::ReflectValueRef::Enum(self.descriptor())
906 }
907}
908
909static file_descriptor_proto_data: &'static [u8] = b"\
910 \n(tensorflow/core/framework/variable.proto\x12\ntensorflow\"\xce\x03\n\
911 \x0bVariableDef\x12#\n\rvariable_name\x18\x01\x20\x01(\tR\x0cvariableNam\
912 e\x12,\n\x12initial_value_name\x18\x06\x20\x01(\tR\x10initialValueName\
913 \x12)\n\x10initializer_name\x18\x02\x20\x01(\tR\x0finitializerName\x12#\
914 \n\rsnapshot_name\x18\x03\x20\x01(\tR\x0csnapshotName\x12K\n\x13save_sli\
915 ce_info_def\x18\x04\x20\x01(\x0b2\x1c.tensorflow.SaveSliceInfoDefR\x10sa\
916 veSliceInfoDef\x12\x1f\n\x0bis_resource\x18\x05\x20\x01(\x08R\nisResourc\
917 e\x12\x1c\n\ttrainable\x18\x07\x20\x01(\x08R\ttrainable\x12M\n\x0fsynchr\
918 onization\x18\x08\x20\x01(\x0e2#.tensorflow.VariableSynchronizationR\x0f\
919 synchronization\x12A\n\x0baggregation\x18\t\x20\x01(\x0e2\x1f.tensorflow\
920 .VariableAggregationR\x0baggregation\"\x8a\x01\n\x10SaveSliceInfoDef\x12\
921 \x1b\n\tfull_name\x18\x01\x20\x01(\tR\x08fullName\x12\x1d\n\nfull_shape\
922 \x18\x02\x20\x03(\x03R\tfullShape\x12\x1d\n\nvar_offset\x18\x03\x20\x03(\
923 \x03R\tvarOffset\x12\x1b\n\tvar_shape\x18\x04\x20\x03(\x03R\x08varShape*\
924 \xac\x01\n\x17VariableSynchronization\x12!\n\x1dVARIABLE_SYNCHRONIZATION\
925 _AUTO\x10\0\x12!\n\x1dVARIABLE_SYNCHRONIZATION_NONE\x10\x01\x12%\n!VARIA\
926 BLE_SYNCHRONIZATION_ON_WRITE\x10\x02\x12$\n\x20VARIABLE_SYNCHRONIZATION_\
927 ON_READ\x10\x03*\x9e\x01\n\x13VariableAggregation\x12\x1d\n\x19VARIABLE_\
928 AGGREGATION_NONE\x10\0\x12\x1c\n\x18VARIABLE_AGGREGATION_SUM\x10\x01\x12\
929 \x1d\n\x19VARIABLE_AGGREGATION_MEAN\x10\x02\x12+\n'VARIABLE_AGGREGATION_\
930 ONLY_FIRST_REPLICA\x10\x03B\x80\x01\n\x18org.tensorflow.frameworkB\x0eVa\
931 riableProtosP\x01ZOgithub.com/tensorflow/tensorflow/tensorflow/go/core/f\
932 ramework/variable_go_proto\xf8\x01\x01J\xcb\x17\n\x06\x12\x04\0\0S\x01\n\
933 \x08\n\x01\x0c\x12\x03\0\0\x12\n\x08\n\x01\x02\x12\x03\x02\0\x13\n\x08\n\
934 \x01\x08\x12\x03\x04\0\x1f\n\t\n\x02\x08\x1f\x12\x03\x04\0\x1f\n\x08\n\
935 \x01\x08\x12\x03\x05\0/\n\t\n\x02\x08\x08\x12\x03\x05\0/\n\x08\n\x01\x08\
936 \x12\x03\x06\0\"\n\t\n\x02\x08\n\x12\x03\x06\0\"\n\x08\n\x01\x08\x12\x03\
937 \x07\01\n\t\n\x02\x08\x01\x12\x03\x07\01\n\x08\n\x01\x08\x12\x03\x08\0f\
938 \n\t\n\x02\x08\x0b\x12\x03\x08\0f\nC\n\x02\x05\0\x12\x04\x0b\0\x1a\x01\
939 \x1a7\x20Indicates\x20when\x20a\x20distributed\x20variable\x20will\x20be\
940 \x20synced.\n\n\n\n\x03\x05\0\x01\x12\x03\x0b\x05\x1c\n\xad\x01\n\x04\
941 \x05\0\x02\0\x12\x03\x0f\x02$\x1a\x9f\x01\x20`AUTO`:\x20Indicates\x20tha\
942 t\x20the\x20synchronization\x20will\x20be\x20determined\x20by\x20the\n\
943 \x20current\x20`DistributionStrategy`\x20(eg.\x20With\x20`MirroredStrate\
944 gy`\x20this\x20would\x20be\n\x20`ON_WRITE`).\n\n\x0c\n\x05\x05\0\x02\0\
945 \x01\x12\x03\x0f\x02\x1f\n\x0c\n\x05\x05\0\x02\0\x02\x12\x03\x0f\"#\np\n\
946 \x04\x05\0\x02\x01\x12\x03\x12\x02$\x1ac\x20`NONE`:\x20Indicates\x20that\
947 \x20there\x20will\x20only\x20be\x20one\x20copy\x20of\x20the\x20variable,\
948 \x20so\n\x20there\x20is\x20no\x20need\x20to\x20sync.\n\n\x0c\n\x05\x05\0\
949 \x02\x01\x01\x12\x03\x12\x02\x1f\n\x0c\n\x05\x05\0\x02\x01\x02\x12\x03\
950 \x12\"#\np\n\x04\x05\0\x02\x02\x12\x03\x15\x02(\x1ac\x20`ON_WRITE`:\x20I\
951 ndicates\x20that\x20the\x20variable\x20will\x20be\x20updated\x20across\
952 \x20devices\n\x20every\x20time\x20it\x20is\x20written.\n\n\x0c\n\x05\x05\
953 \0\x02\x02\x01\x12\x03\x15\x02#\n\x0c\n\x05\x05\0\x02\x02\x02\x12\x03\
954 \x15&'\n\xb4\x01\n\x04\x05\0\x02\x03\x12\x03\x19\x02'\x1a\xa6\x01\x20`ON\
955 _READ`:\x20Indicates\x20that\x20the\x20variable\x20will\x20be\x20aggrega\
956 ted\x20across\x20devices\n\x20when\x20it\x20is\x20read\x20(eg.\x20when\
957 \x20checkpointing\x20or\x20when\x20evaluating\x20an\x20op\x20that\x20use\
958 s\n\x20the\x20variable).\n\n\x0c\n\x05\x05\0\x02\x03\x01\x12\x03\x19\x02\
959 \"\n\x0c\n\x05\x05\0\x02\x03\x02\x12\x03\x19%&\nF\n\x02\x05\x01\x12\x04\
960 \x1d\0*\x01\x1a:\x20Indicates\x20how\x20a\x20distributed\x20variable\x20\
961 will\x20be\x20aggregated.\n\n\n\n\x03\x05\x01\x01\x12\x03\x1d\x05\x18\n{\
962 \n\x04\x05\x01\x02\0\x12\x03\x20\x02\x20\x1an\x20`NONE`:\x20This\x20is\
963 \x20the\x20default,\x20giving\x20an\x20error\x20if\x20you\x20use\x20a\n\
964 \x20variable-update\x20operation\x20with\x20multiple\x20replicas.\n\n\
965 \x0c\n\x05\x05\x01\x02\0\x01\x12\x03\x20\x02\x1b\n\x0c\n\x05\x05\x01\x02\
966 \0\x02\x12\x03\x20\x1e\x1f\n6\n\x04\x05\x01\x02\x01\x12\x03\"\x02\x1f\
967 \x1a)\x20`SUM`:\x20Add\x20the\x20updates\x20across\x20replicas.\n\n\x0c\
968 \n\x05\x05\x01\x02\x01\x01\x12\x03\"\x02\x1a\n\x0c\n\x05\x05\x01\x02\x01\
969 \x02\x12\x03\"\x1d\x1e\n\\\n\x04\x05\x01\x02\x02\x12\x03%\x02\x20\x1aO\
970 \x20`MEAN`:\x20Take\x20the\x20arithmetic\x20mean\x20(\"average\")\x20of\
971 \x20the\x20updates\x20across\n\x20replicas.\n\n\x0c\n\x05\x05\x01\x02\
972 \x02\x01\x12\x03%\x02\x1b\n\x0c\n\x05\x05\x01\x02\x02\x02\x12\x03%\x1e\
973 \x1f\n\xbb\x01\n\x04\x05\x01\x02\x03\x12\x03)\x02.\x1a\xad\x01\x20`ONLY_\
974 FIRST_REPLICA`:\x20This\x20is\x20for\x20when\x20every\x20replica\x20is\
975 \x20performing\x20the\x20same\n\x20update,\x20but\x20we\x20only\x20want\
976 \x20to\x20perform\x20the\x20update\x20once.\x20Used,\x20e.g.,\x20for\x20\
977 the\n\x20global\x20step\x20counter.\n\n\x0c\n\x05\x05\x01\x02\x03\x01\
978 \x12\x03)\x02)\n\x0c\n\x05\x05\x01\x02\x03\x02\x12\x03),-\n6\n\x02\x04\0\
979 \x12\x04-\0H\x01\x1a*\x20Protocol\x20buffer\x20representing\x20a\x20Vari\
980 able.\n\n\n\n\x03\x04\0\x01\x12\x03-\x08\x13\n+\n\x04\x04\0\x02\0\x12\
981 \x03/\x02\x1b\x1a\x1e\x20Name\x20of\x20the\x20variable\x20tensor.\n\n\
982 \x0c\n\x05\x04\0\x02\0\x05\x12\x03/\x02\x08\n\x0c\n\x05\x04\0\x02\0\x01\
983 \x12\x03/\t\x16\n\x0c\n\x05\x04\0\x02\0\x03\x12\x03/\x19\x1a\nG\n\x04\
984 \x04\0\x02\x01\x12\x032\x02\x20\x1a:\x20Name\x20of\x20the\x20tensor\x20h\
985 olding\x20the\x20variable's\x20initial\x20value.\n\n\x0c\n\x05\x04\0\x02\
986 \x01\x05\x12\x032\x02\x08\n\x0c\n\x05\x04\0\x02\x01\x01\x12\x032\t\x1b\n\
987 \x0c\n\x05\x04\0\x02\x01\x03\x12\x032\x1e\x1f\n*\n\x04\x04\0\x02\x02\x12\
988 \x035\x02\x1e\x1a\x1d\x20Name\x20of\x20the\x20initializer\x20op.\n\n\x0c\
989 \n\x05\x04\0\x02\x02\x05\x12\x035\x02\x08\n\x0c\n\x05\x04\0\x02\x02\x01\
990 \x12\x035\t\x19\n\x0c\n\x05\x04\0\x02\x02\x03\x12\x035\x1c\x1d\n+\n\x04\
991 \x04\0\x02\x03\x12\x038\x02\x1b\x1a\x1e\x20Name\x20of\x20the\x20snapshot\
992 \x20tensor.\n\n\x0c\n\x05\x04\0\x02\x03\x05\x12\x038\x02\x08\n\x0c\n\x05\
993 \x04\0\x02\x03\x01\x12\x038\t\x16\n\x0c\n\x05\x04\0\x02\x03\x03\x12\x038\
994 \x19\x1a\nK\n\x04\x04\0\x02\x04\x12\x03;\x02+\x1a>\x20Support\x20for\x20\
995 saving\x20variables\x20as\x20slices\x20of\x20a\x20larger\x20variable.\n\
996 \n\x0c\n\x05\x04\0\x02\x04\x06\x12\x03;\x02\x12\n\x0c\n\x05\x04\0\x02\
997 \x04\x01\x12\x03;\x13&\n\x0c\n\x05\x04\0\x02\x04\x03\x12\x03;)*\n?\n\x04\
998 \x04\0\x02\x05\x12\x03>\x02\x17\x1a2\x20Whether\x20to\x20represent\x20th\
999 is\x20as\x20a\x20ResourceVariable.\n\n\x0c\n\x05\x04\0\x02\x05\x05\x12\
1000 \x03>\x02\x06\n\x0c\n\x05\x04\0\x02\x05\x01\x12\x03>\x07\x12\n\x0c\n\x05\
1001 \x04\0\x02\x05\x03\x12\x03>\x15\x16\n7\n\x04\x04\0\x02\x06\x12\x03A\x02\
1002 \x15\x1a*\x20Whether\x20this\x20variable\x20should\x20be\x20trained.\n\n\
1003 \x0c\n\x05\x04\0\x02\x06\x05\x12\x03A\x02\x06\n\x0c\n\x05\x04\0\x02\x06\
1004 \x01\x12\x03A\x07\x10\n\x0c\n\x05\x04\0\x02\x06\x03\x12\x03A\x13\x14\nD\
1005 \n\x04\x04\0\x02\x07\x12\x03D\x02.\x1a7\x20Indicates\x20when\x20a\x20dis\
1006 tributed\x20variable\x20will\x20be\x20synced.\n\n\x0c\n\x05\x04\0\x02\
1007 \x07\x06\x12\x03D\x02\x19\n\x0c\n\x05\x04\0\x02\x07\x01\x12\x03D\x1a)\n\
1008 \x0c\n\x05\x04\0\x02\x07\x03\x12\x03D,-\nG\n\x04\x04\0\x02\x08\x12\x03G\
1009 \x02&\x1a:\x20Indicates\x20how\x20a\x20distributed\x20variable\x20will\
1010 \x20be\x20aggregated.\n\n\x0c\n\x05\x04\0\x02\x08\x06\x12\x03G\x02\x15\n\
1011 \x0c\n\x05\x04\0\x02\x08\x01\x12\x03G\x16!\n\x0c\n\x05\x04\0\x02\x08\x03\
1012 \x12\x03G$%\n\n\n\x02\x04\x01\x12\x04J\0S\x01\n\n\n\x03\x04\x01\x01\x12\
1013 \x03J\x08\x18\nB\n\x04\x04\x01\x02\0\x12\x03L\x02\x17\x1a5\x20Name\x20of\
1014 \x20the\x20full\x20variable\x20of\x20which\x20this\x20is\x20a\x20slice.\
1015 \n\n\x0c\n\x05\x04\x01\x02\0\x05\x12\x03L\x02\x08\n\x0c\n\x05\x04\x01\
1016 \x02\0\x01\x12\x03L\t\x12\n\x0c\n\x05\x04\x01\x02\0\x03\x12\x03L\x15\x16\
1017 \n*\n\x04\x04\x01\x02\x01\x12\x03N\x02\x20\x1a\x1d\x20Shape\x20of\x20the\
1018 \x20full\x20variable.\n\n\x0c\n\x05\x04\x01\x02\x01\x04\x12\x03N\x02\n\n\
1019 \x0c\n\x05\x04\x01\x02\x01\x05\x12\x03N\x0b\x10\n\x0c\n\x05\x04\x01\x02\
1020 \x01\x01\x12\x03N\x11\x1b\n\x0c\n\x05\x04\x01\x02\x01\x03\x12\x03N\x1e\
1021 \x1f\n>\n\x04\x04\x01\x02\x02\x12\x03P\x02\x20\x1a1\x20Offset\x20of\x20t\
1022 his\x20variable\x20into\x20the\x20full\x20variable.\n\n\x0c\n\x05\x04\
1023 \x01\x02\x02\x04\x12\x03P\x02\n\n\x0c\n\x05\x04\x01\x02\x02\x05\x12\x03P\
1024 \x0b\x10\n\x0c\n\x05\x04\x01\x02\x02\x01\x12\x03P\x11\x1b\n\x0c\n\x05\
1025 \x04\x01\x02\x02\x03\x12\x03P\x1e\x1f\n&\n\x04\x04\x01\x02\x03\x12\x03R\
1026 \x02\x1f\x1a\x19\x20Shape\x20of\x20this\x20variable.\n\n\x0c\n\x05\x04\
1027 \x01\x02\x03\x04\x12\x03R\x02\n\n\x0c\n\x05\x04\x01\x02\x03\x05\x12\x03R\
1028 \x0b\x10\n\x0c\n\x05\x04\x01\x02\x03\x01\x12\x03R\x11\x1a\n\x0c\n\x05\
1029 \x04\x01\x02\x03\x03\x12\x03R\x1d\x1eb\x06proto3\
1030";
1031
1032static mut file_descriptor_proto_lazy: ::protobuf::lazy::Lazy<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::lazy::Lazy::INIT;
1033
1034fn parse_descriptor_proto() -> ::protobuf::descriptor::FileDescriptorProto {
1035 ::protobuf::parse_from_bytes(file_descriptor_proto_data).unwrap()
1036}
1037
1038pub fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto {
1039 unsafe {
1040 file_descriptor_proto_lazy.get(|| {
1041 parse_descriptor_proto()
1042 })
1043 }
1044}