diff --git a/Cargo.toml b/Cargo.toml index a912e805ae..b82ad26745 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -26,6 +26,7 @@ half = "1.3.0" protobuf = "=2.17.0" # Enables conversions between ndarray::Array objects and tensorflow::Tensor ndarray = { version = "0.13.1", optional = true } +tensorflow-protos-rs = { version = "0.2", features = ["config", "function", "saved_model", "resource_handle", "variable", "verifier_config", "versions"]} [dev-dependencies] diff --git a/RELEASING.md b/RELEASING.md index 79a796f802..a82a16295b 100644 --- a/RELEASING.md +++ b/RELEASING.md @@ -1,7 +1,6 @@ ## Pre-release 1. Generate protos - 1. Run `cd tensorflow-proto-codegen; cargo run -- $PATH_TO_TENSORFLOW $PWD/..` 1. Update Cargo.toml to ensure version of protobuf exactly equals version of protoc_rust used 1. Generate ops 1. Run `cd tensorflow-op-codegen; cargo run -- $PATH_TO_TENSORFLOW $PWD/..` @@ -10,7 +9,7 @@ ## Releasing -Note that any crate not mentioned here (e.g. tensorflow-proto-codegen, tensorflow-op-codegen) is internal-only and should *not* be published to crates.io. +Note that any crate not mentioned here (e.g. tensorflow-op-codegen) is internal-only and should *not* be published to crates.io. 1. Check out a clean copy. Note that `cargo publish` packages up untracked files. Use `--allow-dirty` at your peril. 1. Fetch from the main repo diff --git a/src/lib.rs b/src/lib.rs index d64b129374..1f6f5fb1ea 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -47,6 +47,10 @@ use std::slice; use std::str::Utf8Error; use tensorflow_sys as tf; +pub(crate) mod protos { + pub use tensorflow_protos_rs::*; +} + //////////////////////// /// Will panic if `msg` contains an embedded 0 byte. @@ -172,8 +176,6 @@ macro_rules! c_enum { //////////////////////// -mod protos; - mod buffer; use crate::buffer::Buffer; diff --git a/src/ops/ops_impl.rs b/src/ops/ops_impl.rs index 073b2ce040..0d48a486a1 100644 --- a/src/ops/ops_impl.rs +++ b/src/ops/ops_impl.rs @@ -1,10 +1,5 @@ // DO NOT EDIT. Generated by tensorflow-op-codegen/src/main.rs. -#![allow( - non_snake_case, - trivial_casts, - unused_parens, - unused_qualifications -)] +#![allow(non_snake_case, trivial_casts, unused_parens, unused_qualifications)] /// Builder for the `Abort` operation. #[derive(::std::fmt::Debug, ::std::default::Default)] diff --git a/src/protos.rs b/src/protos.rs deleted file mode 100644 index 25a8d01bba..0000000000 --- a/src/protos.rs +++ /dev/null @@ -1,17 +0,0 @@ -pub mod attr_value; -pub mod function; -pub mod graph; -pub mod meta_graph; -pub mod node_def; -pub mod op_def; -pub mod resource_handle; -pub mod saved_model; -pub mod saved_object_graph; -pub mod saver; -pub mod struct_pb; -pub mod tensor; -pub mod tensor_shape; -pub mod trackable_object_graph; -pub mod types; -pub mod variable; -pub mod versions; diff --git a/src/protos/attr_value.rs b/src/protos/attr_value.rs deleted file mode 100644 index 663c4c0713..0000000000 --- a/src/protos/attr_value.rs +++ /dev/null @@ -1,1645 +0,0 @@ -// This file is generated by rust-protobuf 2.17.0. Do not edit -// @generated - -// https://github.com/rust-lang/rust-clippy/issues/702 -#![allow(unknown_lints)] -#![allow(clippy::all)] - -#![allow(unused_attributes)] -#![rustfmt::skip] - -#![allow(box_pointers)] -#![allow(dead_code)] -#![allow(missing_docs)] -#![allow(non_camel_case_types)] -#![allow(non_snake_case)] -#![allow(non_upper_case_globals)] -#![allow(trivial_casts)] -#![allow(unused_imports)] -#![allow(unused_results)] -//! Generated file from `tensorflow/core/framework/attr_value.proto` - -/// Generated files are compatible only with the same version -/// of protobuf runtime. -// const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_17_0; - -#[derive(PartialEq, Clone, Default)] -pub struct AttrValue { - // message oneof groups - pub value: ::std::option::Option, - // special fields - pub unknown_fields: ::protobuf::UnknownFields, - pub cached_size: ::protobuf::CachedSize, -} - -impl<'a> ::std::default::Default for &'a AttrValue { - fn default() -> &'a AttrValue { - ::default_instance() - } -} - -#[derive(Clone, PartialEq, Debug)] -pub enum AttrValue_oneof_value { - s(::std::vec::Vec), - i(i64), - f(f32), - b(bool), - field_type(super::types::DataType), - shape(super::tensor_shape::TensorShapeProto), - tensor(super::tensor::TensorProto), - list(AttrValue_ListValue), - func(NameAttrList), - placeholder(::std::string::String), -} - -impl AttrValue { - pub fn new() -> AttrValue { - ::std::default::Default::default() - } - - // bytes s = 2; - - pub fn get_s(&self) -> &[u8] { - match self.value { - ::std::option::Option::Some(AttrValue_oneof_value::s(ref v)) => v, - _ => &[], - } - } - pub fn clear_s(&mut self) { - self.value = ::std::option::Option::None; - } - - pub fn has_s(&self) -> bool { - match self.value { - ::std::option::Option::Some(AttrValue_oneof_value::s(..)) => true, - _ => false, - } - } - - // Param is passed by value, moved - pub fn set_s(&mut self, v: ::std::vec::Vec) { - self.value = ::std::option::Option::Some(AttrValue_oneof_value::s(v)) - } - - // Mutable pointer to the field. - pub fn mut_s(&mut self) -> &mut ::std::vec::Vec { - if let ::std::option::Option::Some(AttrValue_oneof_value::s(_)) = self.value { - } else { - self.value = - ::std::option::Option::Some(AttrValue_oneof_value::s(::std::vec::Vec::new())); - } - match self.value { - ::std::option::Option::Some(AttrValue_oneof_value::s(ref mut v)) => v, - _ => panic!(), - } - } - - // Take field - pub fn take_s(&mut self) -> ::std::vec::Vec { - if self.has_s() { - match self.value.take() { - ::std::option::Option::Some(AttrValue_oneof_value::s(v)) => v, - _ => panic!(), - } - } else { - ::std::vec::Vec::new() - } - } - - // int64 i = 3; - - pub fn get_i(&self) -> i64 { - match self.value { - ::std::option::Option::Some(AttrValue_oneof_value::i(v)) => v, - _ => 0, - } - } - pub fn clear_i(&mut self) { - self.value = ::std::option::Option::None; - } - - pub fn has_i(&self) -> bool { - match self.value { - ::std::option::Option::Some(AttrValue_oneof_value::i(..)) => true, - _ => false, - } - } - - // Param is passed by value, moved - pub fn set_i(&mut self, v: i64) { - self.value = ::std::option::Option::Some(AttrValue_oneof_value::i(v)) - } - - // float f = 4; - - pub fn get_f(&self) -> f32 { - match self.value { - ::std::option::Option::Some(AttrValue_oneof_value::f(v)) => v, - _ => 0., - } - } - pub fn clear_f(&mut self) { - self.value = ::std::option::Option::None; - } - - pub fn has_f(&self) -> bool { - match self.value { - ::std::option::Option::Some(AttrValue_oneof_value::f(..)) => true, - _ => false, - } - } - - // Param is passed by value, moved - pub fn set_f(&mut self, v: f32) { - self.value = ::std::option::Option::Some(AttrValue_oneof_value::f(v)) - } - - // bool b = 5; - - pub fn get_b(&self) -> bool { - match self.value { - ::std::option::Option::Some(AttrValue_oneof_value::b(v)) => v, - _ => false, - } - } - pub fn clear_b(&mut self) { - self.value = ::std::option::Option::None; - } - - pub fn has_b(&self) -> bool { - match self.value { - ::std::option::Option::Some(AttrValue_oneof_value::b(..)) => true, - _ => false, - } - } - - // Param is passed by value, moved - pub fn set_b(&mut self, v: bool) { - self.value = ::std::option::Option::Some(AttrValue_oneof_value::b(v)) - } - - // .tensorflow.DataType type = 6; - - pub fn get_field_type(&self) -> super::types::DataType { - match self.value { - ::std::option::Option::Some(AttrValue_oneof_value::field_type(v)) => v, - _ => super::types::DataType::DT_INVALID, - } - } - pub fn clear_field_type(&mut self) { - self.value = ::std::option::Option::None; - } - - pub fn has_field_type(&self) -> bool { - match self.value { - ::std::option::Option::Some(AttrValue_oneof_value::field_type(..)) => true, - _ => false, - } - } - - // Param is passed by value, moved - pub fn set_field_type(&mut self, v: super::types::DataType) { - self.value = ::std::option::Option::Some(AttrValue_oneof_value::field_type(v)) - } - - // .tensorflow.TensorShapeProto shape = 7; - - pub fn get_shape(&self) -> &super::tensor_shape::TensorShapeProto { - match self.value { - ::std::option::Option::Some(AttrValue_oneof_value::shape(ref v)) => v, - _ => ::default_instance(), - } - } - pub fn clear_shape(&mut self) { - self.value = ::std::option::Option::None; - } - - pub fn has_shape(&self) -> bool { - match self.value { - ::std::option::Option::Some(AttrValue_oneof_value::shape(..)) => true, - _ => false, - } - } - - // Param is passed by value, moved - pub fn set_shape(&mut self, v: super::tensor_shape::TensorShapeProto) { - self.value = ::std::option::Option::Some(AttrValue_oneof_value::shape(v)) - } - - // Mutable pointer to the field. - pub fn mut_shape(&mut self) -> &mut super::tensor_shape::TensorShapeProto { - if let ::std::option::Option::Some(AttrValue_oneof_value::shape(_)) = self.value { - } else { - self.value = ::std::option::Option::Some(AttrValue_oneof_value::shape( - super::tensor_shape::TensorShapeProto::new(), - )); - } - match self.value { - ::std::option::Option::Some(AttrValue_oneof_value::shape(ref mut v)) => v, - _ => panic!(), - } - } - - // Take field - pub fn take_shape(&mut self) -> super::tensor_shape::TensorShapeProto { - if self.has_shape() { - match self.value.take() { - ::std::option::Option::Some(AttrValue_oneof_value::shape(v)) => v, - _ => panic!(), - } - } else { - super::tensor_shape::TensorShapeProto::new() - } - } - - // .tensorflow.TensorProto tensor = 8; - - pub fn get_tensor(&self) -> &super::tensor::TensorProto { - match self.value { - ::std::option::Option::Some(AttrValue_oneof_value::tensor(ref v)) => v, - _ => ::default_instance(), - } - } - pub fn clear_tensor(&mut self) { - self.value = ::std::option::Option::None; - } - - pub fn has_tensor(&self) -> bool { - match self.value { - ::std::option::Option::Some(AttrValue_oneof_value::tensor(..)) => true, - _ => false, - } - } - - // Param is passed by value, moved - pub fn set_tensor(&mut self, v: super::tensor::TensorProto) { - self.value = ::std::option::Option::Some(AttrValue_oneof_value::tensor(v)) - } - - // Mutable pointer to the field. - pub fn mut_tensor(&mut self) -> &mut super::tensor::TensorProto { - if let ::std::option::Option::Some(AttrValue_oneof_value::tensor(_)) = self.value { - } else { - self.value = ::std::option::Option::Some(AttrValue_oneof_value::tensor( - super::tensor::TensorProto::new(), - )); - } - match self.value { - ::std::option::Option::Some(AttrValue_oneof_value::tensor(ref mut v)) => v, - _ => panic!(), - } - } - - // Take field - pub fn take_tensor(&mut self) -> super::tensor::TensorProto { - if self.has_tensor() { - match self.value.take() { - ::std::option::Option::Some(AttrValue_oneof_value::tensor(v)) => v, - _ => panic!(), - } - } else { - super::tensor::TensorProto::new() - } - } - - // .tensorflow.AttrValue.ListValue list = 1; - - pub fn get_list(&self) -> &AttrValue_ListValue { - match self.value { - ::std::option::Option::Some(AttrValue_oneof_value::list(ref v)) => v, - _ => ::default_instance(), - } - } - pub fn clear_list(&mut self) { - self.value = ::std::option::Option::None; - } - - pub fn has_list(&self) -> bool { - match self.value { - ::std::option::Option::Some(AttrValue_oneof_value::list(..)) => true, - _ => false, - } - } - - // Param is passed by value, moved - pub fn set_list(&mut self, v: AttrValue_ListValue) { - self.value = ::std::option::Option::Some(AttrValue_oneof_value::list(v)) - } - - // Mutable pointer to the field. - pub fn mut_list(&mut self) -> &mut AttrValue_ListValue { - if let ::std::option::Option::Some(AttrValue_oneof_value::list(_)) = self.value { - } else { - self.value = ::std::option::Option::Some(AttrValue_oneof_value::list( - AttrValue_ListValue::new(), - )); - } - match self.value { - ::std::option::Option::Some(AttrValue_oneof_value::list(ref mut v)) => v, - _ => panic!(), - } - } - - // Take field - pub fn take_list(&mut self) -> AttrValue_ListValue { - if self.has_list() { - match self.value.take() { - ::std::option::Option::Some(AttrValue_oneof_value::list(v)) => v, - _ => panic!(), - } - } else { - AttrValue_ListValue::new() - } - } - - // .tensorflow.NameAttrList func = 10; - - pub fn get_func(&self) -> &NameAttrList { - match self.value { - ::std::option::Option::Some(AttrValue_oneof_value::func(ref v)) => v, - _ => ::default_instance(), - } - } - pub fn clear_func(&mut self) { - self.value = ::std::option::Option::None; - } - - pub fn has_func(&self) -> bool { - match self.value { - ::std::option::Option::Some(AttrValue_oneof_value::func(..)) => true, - _ => false, - } - } - - // Param is passed by value, moved - pub fn set_func(&mut self, v: NameAttrList) { - self.value = ::std::option::Option::Some(AttrValue_oneof_value::func(v)) - } - - // Mutable pointer to the field. - pub fn mut_func(&mut self) -> &mut NameAttrList { - if let ::std::option::Option::Some(AttrValue_oneof_value::func(_)) = self.value { - } else { - self.value = - ::std::option::Option::Some(AttrValue_oneof_value::func(NameAttrList::new())); - } - match self.value { - ::std::option::Option::Some(AttrValue_oneof_value::func(ref mut v)) => v, - _ => panic!(), - } - } - - // Take field - pub fn take_func(&mut self) -> NameAttrList { - if self.has_func() { - match self.value.take() { - ::std::option::Option::Some(AttrValue_oneof_value::func(v)) => v, - _ => panic!(), - } - } else { - NameAttrList::new() - } - } - - // string placeholder = 9; - - pub fn get_placeholder(&self) -> &str { - match self.value { - ::std::option::Option::Some(AttrValue_oneof_value::placeholder(ref v)) => v, - _ => "", - } - } - pub fn clear_placeholder(&mut self) { - self.value = ::std::option::Option::None; - } - - pub fn has_placeholder(&self) -> bool { - match self.value { - ::std::option::Option::Some(AttrValue_oneof_value::placeholder(..)) => true, - _ => false, - } - } - - // Param is passed by value, moved - pub fn set_placeholder(&mut self, v: ::std::string::String) { - self.value = ::std::option::Option::Some(AttrValue_oneof_value::placeholder(v)) - } - - // Mutable pointer to the field. - pub fn mut_placeholder(&mut self) -> &mut ::std::string::String { - if let ::std::option::Option::Some(AttrValue_oneof_value::placeholder(_)) = self.value { - } else { - self.value = ::std::option::Option::Some(AttrValue_oneof_value::placeholder( - ::std::string::String::new(), - )); - } - match self.value { - ::std::option::Option::Some(AttrValue_oneof_value::placeholder(ref mut v)) => v, - _ => panic!(), - } - } - - // Take field - pub fn take_placeholder(&mut self) -> ::std::string::String { - if self.has_placeholder() { - match self.value.take() { - ::std::option::Option::Some(AttrValue_oneof_value::placeholder(v)) => v, - _ => panic!(), - } - } else { - ::std::string::String::new() - } - } -} - -impl ::protobuf::Message for AttrValue { - fn is_initialized(&self) -> bool { - if let Some(AttrValue_oneof_value::shape(ref v)) = self.value { - if !v.is_initialized() { - return false; - } - } - if let Some(AttrValue_oneof_value::tensor(ref v)) = self.value { - if !v.is_initialized() { - return false; - } - } - if let Some(AttrValue_oneof_value::list(ref v)) = self.value { - if !v.is_initialized() { - return false; - } - } - if let Some(AttrValue_oneof_value::func(ref v)) = self.value { - if !v.is_initialized() { - return false; - } - } - true - } - - fn merge_from( - &mut self, - is: &mut ::protobuf::CodedInputStream<'_>, - ) -> ::protobuf::ProtobufResult<()> { - while !is.eof()? { - let (field_number, wire_type) = is.read_tag_unpack()?; - match field_number { - 2 => { - if wire_type != ::protobuf::wire_format::WireTypeLengthDelimited { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type( - wire_type, - )); - } - self.value = - ::std::option::Option::Some(AttrValue_oneof_value::s(is.read_bytes()?)); - } - 3 => { - if wire_type != ::protobuf::wire_format::WireTypeVarint { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type( - wire_type, - )); - } - self.value = - ::std::option::Option::Some(AttrValue_oneof_value::i(is.read_int64()?)); - } - 4 => { - if wire_type != ::protobuf::wire_format::WireTypeFixed32 { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type( - wire_type, - )); - } - self.value = - ::std::option::Option::Some(AttrValue_oneof_value::f(is.read_float()?)); - } - 5 => { - if wire_type != ::protobuf::wire_format::WireTypeVarint { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type( - wire_type, - )); - } - self.value = - ::std::option::Option::Some(AttrValue_oneof_value::b(is.read_bool()?)); - } - 6 => { - if wire_type != ::protobuf::wire_format::WireTypeVarint { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type( - wire_type, - )); - } - self.value = ::std::option::Option::Some(AttrValue_oneof_value::field_type( - is.read_enum()?, - )); - } - 7 => { - if wire_type != ::protobuf::wire_format::WireTypeLengthDelimited { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type( - wire_type, - )); - } - self.value = ::std::option::Option::Some(AttrValue_oneof_value::shape( - is.read_message()?, - )); - } - 8 => { - if wire_type != ::protobuf::wire_format::WireTypeLengthDelimited { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type( - wire_type, - )); - } - self.value = ::std::option::Option::Some(AttrValue_oneof_value::tensor( - is.read_message()?, - )); - } - 1 => { - if wire_type != ::protobuf::wire_format::WireTypeLengthDelimited { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type( - wire_type, - )); - } - self.value = ::std::option::Option::Some(AttrValue_oneof_value::list( - is.read_message()?, - )); - } - 10 => { - if wire_type != ::protobuf::wire_format::WireTypeLengthDelimited { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type( - wire_type, - )); - } - self.value = ::std::option::Option::Some(AttrValue_oneof_value::func( - is.read_message()?, - )); - } - 9 => { - if wire_type != ::protobuf::wire_format::WireTypeLengthDelimited { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type( - wire_type, - )); - } - self.value = ::std::option::Option::Some(AttrValue_oneof_value::placeholder( - is.read_string()?, - )); - } - _ => { - ::protobuf::rt::read_unknown_or_skip_group( - field_number, - wire_type, - is, - self.mut_unknown_fields(), - )?; - } - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u32 { - let mut my_size = 0; - if let ::std::option::Option::Some(ref v) = self.value { - match v { - &AttrValue_oneof_value::s(ref v) => { - my_size += ::protobuf::rt::bytes_size(2, &v); - } - &AttrValue_oneof_value::i(v) => { - my_size += - ::protobuf::rt::value_size(3, v, ::protobuf::wire_format::WireTypeVarint); - } - &AttrValue_oneof_value::f(v) => { - my_size += 5; - } - &AttrValue_oneof_value::b(v) => { - my_size += 2; - } - &AttrValue_oneof_value::field_type(v) => { - my_size += ::protobuf::rt::enum_size(6, v); - } - &AttrValue_oneof_value::shape(ref v) => { - let len = v.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - } - &AttrValue_oneof_value::tensor(ref v) => { - let len = v.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - } - &AttrValue_oneof_value::list(ref v) => { - let len = v.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - } - &AttrValue_oneof_value::func(ref v) => { - let len = v.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - } - &AttrValue_oneof_value::placeholder(ref v) => { - my_size += ::protobuf::rt::string_size(9, &v); - } - }; - } - my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); - self.cached_size.set(my_size); - my_size - } - - fn write_to_with_cached_sizes( - &self, - os: &mut ::protobuf::CodedOutputStream<'_>, - ) -> ::protobuf::ProtobufResult<()> { - if let ::std::option::Option::Some(ref v) = self.value { - match v { - &AttrValue_oneof_value::s(ref v) => { - os.write_bytes(2, v)?; - } - &AttrValue_oneof_value::i(v) => { - os.write_int64(3, v)?; - } - &AttrValue_oneof_value::f(v) => { - os.write_float(4, v)?; - } - &AttrValue_oneof_value::b(v) => { - os.write_bool(5, v)?; - } - &AttrValue_oneof_value::field_type(v) => { - os.write_enum(6, ::protobuf::ProtobufEnum::value(&v))?; - } - &AttrValue_oneof_value::shape(ref v) => { - os.write_tag(7, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - } - &AttrValue_oneof_value::tensor(ref v) => { - os.write_tag(8, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - } - &AttrValue_oneof_value::list(ref v) => { - os.write_tag(1, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - } - &AttrValue_oneof_value::func(ref v) => { - os.write_tag(10, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - } - &AttrValue_oneof_value::placeholder(ref v) => { - os.write_string(9, v)?; - } - }; - } - os.write_unknown_fields(self.get_unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn get_cached_size(&self) -> u32 { - self.cached_size.get() - } - - fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { - &self.unknown_fields - } - - fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { - &mut self.unknown_fields - } - - fn as_any(&self) -> &dyn (::std::any::Any) { - self as &dyn (::std::any::Any) - } - fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { - self as &mut dyn (::std::any::Any) - } - fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { - self - } - - fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - Self::descriptor_static() - } - - fn new() -> AttrValue { - AttrValue::new() - } - - fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = - ::protobuf::rt::LazyV2::INIT; - descriptor.get(|| { - let mut fields = ::std::vec::Vec::new(); - fields.push( - ::protobuf::reflect::accessor::make_singular_bytes_accessor::<_>( - "s", - AttrValue::has_s, - AttrValue::get_s, - ), - ); - fields.push( - ::protobuf::reflect::accessor::make_singular_i64_accessor::<_>( - "i", - AttrValue::has_i, - AttrValue::get_i, - ), - ); - fields.push( - ::protobuf::reflect::accessor::make_singular_f32_accessor::<_>( - "f", - AttrValue::has_f, - AttrValue::get_f, - ), - ); - fields.push( - ::protobuf::reflect::accessor::make_singular_bool_accessor::<_>( - "b", - AttrValue::has_b, - AttrValue::get_b, - ), - ); - fields.push( - ::protobuf::reflect::accessor::make_singular_enum_accessor::< - _, - super::types::DataType, - >("type", AttrValue::has_field_type, AttrValue::get_field_type), - ); - fields.push( - ::protobuf::reflect::accessor::make_singular_message_accessor::< - _, - super::tensor_shape::TensorShapeProto, - >("shape", AttrValue::has_shape, AttrValue::get_shape), - ); - fields.push( - ::protobuf::reflect::accessor::make_singular_message_accessor::< - _, - super::tensor::TensorProto, - >("tensor", AttrValue::has_tensor, AttrValue::get_tensor), - ); - fields.push( - ::protobuf::reflect::accessor::make_singular_message_accessor::< - _, - AttrValue_ListValue, - >("list", AttrValue::has_list, AttrValue::get_list), - ); - fields.push( - ::protobuf::reflect::accessor::make_singular_message_accessor::<_, NameAttrList>( - "func", - AttrValue::has_func, - AttrValue::get_func, - ), - ); - fields.push( - ::protobuf::reflect::accessor::make_singular_string_accessor::<_>( - "placeholder", - AttrValue::has_placeholder, - AttrValue::get_placeholder, - ), - ); - ::protobuf::reflect::MessageDescriptor::new_pb_name::( - "AttrValue", - fields, - file_descriptor_proto(), - ) - }) - } - - fn default_instance() -> &'static AttrValue { - static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; - instance.get(AttrValue::new) - } -} - -impl ::protobuf::Clear for AttrValue { - fn clear(&mut self) { - self.value = ::std::option::Option::None; - self.value = ::std::option::Option::None; - self.value = ::std::option::Option::None; - self.value = ::std::option::Option::None; - self.value = ::std::option::Option::None; - self.value = ::std::option::Option::None; - self.value = ::std::option::Option::None; - self.value = ::std::option::Option::None; - self.value = ::std::option::Option::None; - self.value = ::std::option::Option::None; - self.unknown_fields.clear(); - } -} - -impl ::std::fmt::Debug for AttrValue { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for AttrValue { - fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { - ::protobuf::reflect::ReflectValueRef::Message(self) - } -} - -#[derive(PartialEq, Clone, Default)] -pub struct AttrValue_ListValue { - // message fields - pub s: ::protobuf::RepeatedField<::std::vec::Vec>, - pub i: ::std::vec::Vec, - pub f: ::std::vec::Vec, - pub b: ::std::vec::Vec, - pub field_type: ::std::vec::Vec, - pub shape: ::protobuf::RepeatedField, - pub tensor: ::protobuf::RepeatedField, - pub func: ::protobuf::RepeatedField, - // special fields - pub unknown_fields: ::protobuf::UnknownFields, - pub cached_size: ::protobuf::CachedSize, -} - -impl<'a> ::std::default::Default for &'a AttrValue_ListValue { - fn default() -> &'a AttrValue_ListValue { - ::default_instance() - } -} - -impl AttrValue_ListValue { - pub fn new() -> AttrValue_ListValue { - ::std::default::Default::default() - } - - // repeated bytes s = 2; - - pub fn get_s(&self) -> &[::std::vec::Vec] { - &self.s - } - pub fn clear_s(&mut self) { - self.s.clear(); - } - - // Param is passed by value, moved - pub fn set_s(&mut self, v: ::protobuf::RepeatedField<::std::vec::Vec>) { - self.s = v; - } - - // Mutable pointer to the field. - pub fn mut_s(&mut self) -> &mut ::protobuf::RepeatedField<::std::vec::Vec> { - &mut self.s - } - - // Take field - pub fn take_s(&mut self) -> ::protobuf::RepeatedField<::std::vec::Vec> { - ::std::mem::replace(&mut self.s, ::protobuf::RepeatedField::new()) - } - - // repeated int64 i = 3; - - pub fn get_i(&self) -> &[i64] { - &self.i - } - pub fn clear_i(&mut self) { - self.i.clear(); - } - - // Param is passed by value, moved - pub fn set_i(&mut self, v: ::std::vec::Vec) { - self.i = v; - } - - // Mutable pointer to the field. - pub fn mut_i(&mut self) -> &mut ::std::vec::Vec { - &mut self.i - } - - // Take field - pub fn take_i(&mut self) -> ::std::vec::Vec { - ::std::mem::replace(&mut self.i, ::std::vec::Vec::new()) - } - - // repeated float f = 4; - - pub fn get_f(&self) -> &[f32] { - &self.f - } - pub fn clear_f(&mut self) { - self.f.clear(); - } - - // Param is passed by value, moved - pub fn set_f(&mut self, v: ::std::vec::Vec) { - self.f = v; - } - - // Mutable pointer to the field. - pub fn mut_f(&mut self) -> &mut ::std::vec::Vec { - &mut self.f - } - - // Take field - pub fn take_f(&mut self) -> ::std::vec::Vec { - ::std::mem::replace(&mut self.f, ::std::vec::Vec::new()) - } - - // repeated bool b = 5; - - pub fn get_b(&self) -> &[bool] { - &self.b - } - pub fn clear_b(&mut self) { - self.b.clear(); - } - - // Param is passed by value, moved - pub fn set_b(&mut self, v: ::std::vec::Vec) { - self.b = v; - } - - // Mutable pointer to the field. - pub fn mut_b(&mut self) -> &mut ::std::vec::Vec { - &mut self.b - } - - // Take field - pub fn take_b(&mut self) -> ::std::vec::Vec { - ::std::mem::replace(&mut self.b, ::std::vec::Vec::new()) - } - - // repeated .tensorflow.DataType type = 6; - - pub fn get_field_type(&self) -> &[super::types::DataType] { - &self.field_type - } - pub fn clear_field_type(&mut self) { - self.field_type.clear(); - } - - // Param is passed by value, moved - pub fn set_field_type(&mut self, v: ::std::vec::Vec) { - self.field_type = v; - } - - // Mutable pointer to the field. - pub fn mut_field_type(&mut self) -> &mut ::std::vec::Vec { - &mut self.field_type - } - - // Take field - pub fn take_field_type(&mut self) -> ::std::vec::Vec { - ::std::mem::replace(&mut self.field_type, ::std::vec::Vec::new()) - } - - // repeated .tensorflow.TensorShapeProto shape = 7; - - pub fn get_shape(&self) -> &[super::tensor_shape::TensorShapeProto] { - &self.shape - } - pub fn clear_shape(&mut self) { - self.shape.clear(); - } - - // Param is passed by value, moved - pub fn set_shape( - &mut self, - v: ::protobuf::RepeatedField, - ) { - self.shape = v; - } - - // Mutable pointer to the field. - pub fn mut_shape( - &mut self, - ) -> &mut ::protobuf::RepeatedField { - &mut self.shape - } - - // Take field - pub fn take_shape( - &mut self, - ) -> ::protobuf::RepeatedField { - ::std::mem::replace(&mut self.shape, ::protobuf::RepeatedField::new()) - } - - // repeated .tensorflow.TensorProto tensor = 8; - - pub fn get_tensor(&self) -> &[super::tensor::TensorProto] { - &self.tensor - } - pub fn clear_tensor(&mut self) { - self.tensor.clear(); - } - - // Param is passed by value, moved - pub fn set_tensor(&mut self, v: ::protobuf::RepeatedField) { - self.tensor = v; - } - - // Mutable pointer to the field. - pub fn mut_tensor(&mut self) -> &mut ::protobuf::RepeatedField { - &mut self.tensor - } - - // Take field - pub fn take_tensor(&mut self) -> ::protobuf::RepeatedField { - ::std::mem::replace(&mut self.tensor, ::protobuf::RepeatedField::new()) - } - - // repeated .tensorflow.NameAttrList func = 9; - - pub fn get_func(&self) -> &[NameAttrList] { - &self.func - } - pub fn clear_func(&mut self) { - self.func.clear(); - } - - // Param is passed by value, moved - pub fn set_func(&mut self, v: ::protobuf::RepeatedField) { - self.func = v; - } - - // Mutable pointer to the field. - pub fn mut_func(&mut self) -> &mut ::protobuf::RepeatedField { - &mut self.func - } - - // Take field - pub fn take_func(&mut self) -> ::protobuf::RepeatedField { - ::std::mem::replace(&mut self.func, ::protobuf::RepeatedField::new()) - } -} - -impl ::protobuf::Message for AttrValue_ListValue { - fn is_initialized(&self) -> bool { - for v in &self.shape { - if !v.is_initialized() { - return false; - } - } - for v in &self.tensor { - if !v.is_initialized() { - return false; - } - } - for v in &self.func { - if !v.is_initialized() { - return false; - } - } - true - } - - fn merge_from( - &mut self, - is: &mut ::protobuf::CodedInputStream<'_>, - ) -> ::protobuf::ProtobufResult<()> { - while !is.eof()? { - let (field_number, wire_type) = is.read_tag_unpack()?; - match field_number { - 2 => { - ::protobuf::rt::read_repeated_bytes_into(wire_type, is, &mut self.s)?; - } - 3 => { - ::protobuf::rt::read_repeated_int64_into(wire_type, is, &mut self.i)?; - } - 4 => { - ::protobuf::rt::read_repeated_float_into(wire_type, is, &mut self.f)?; - } - 5 => { - ::protobuf::rt::read_repeated_bool_into(wire_type, is, &mut self.b)?; - } - 6 => ::protobuf::rt::read_repeated_enum_with_unknown_fields_into( - wire_type, - is, - &mut self.field_type, - 6, - &mut self.unknown_fields, - )?, - 7 => { - ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.shape)?; - } - 8 => { - ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.tensor)?; - } - 9 => { - ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.func)?; - } - _ => { - ::protobuf::rt::read_unknown_or_skip_group( - field_number, - wire_type, - is, - self.mut_unknown_fields(), - )?; - } - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u32 { - let mut my_size = 0; - for value in &self.s { - my_size += ::protobuf::rt::bytes_size(2, &value); - } - if !self.i.is_empty() { - my_size += ::protobuf::rt::vec_packed_varint_size(3, &self.i); - } - if !self.f.is_empty() { - my_size += 1 - + ::protobuf::rt::compute_raw_varint32_size((self.f.len() * 4) as u32) - + (self.f.len() * 4) as u32; - } - if !self.b.is_empty() { - my_size += 1 - + ::protobuf::rt::compute_raw_varint32_size((self.b.len() * 1) as u32) - + (self.b.len() * 1) as u32; - } - if !self.field_type.is_empty() { - my_size += ::protobuf::rt::vec_packed_enum_size(6, &self.field_type); - } - for value in &self.shape { - let len = value.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - } - for value in &self.tensor { - let len = value.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - } - for value in &self.func { - let len = value.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - } - my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); - self.cached_size.set(my_size); - my_size - } - - fn write_to_with_cached_sizes( - &self, - os: &mut ::protobuf::CodedOutputStream<'_>, - ) -> ::protobuf::ProtobufResult<()> { - for v in &self.s { - os.write_bytes(2, &v)?; - } - if !self.i.is_empty() { - os.write_tag(3, ::protobuf::wire_format::WireTypeLengthDelimited)?; - // TODO: Data size is computed again, it should be cached - os.write_raw_varint32(::protobuf::rt::vec_packed_varint_data_size(&self.i))?; - for v in &self.i { - os.write_int64_no_tag(*v)?; - } - } - if !self.f.is_empty() { - os.write_tag(4, ::protobuf::wire_format::WireTypeLengthDelimited)?; - // TODO: Data size is computed again, it should be cached - os.write_raw_varint32((self.f.len() * 4) as u32)?; - for v in &self.f { - os.write_float_no_tag(*v)?; - } - } - if !self.b.is_empty() { - os.write_tag(5, ::protobuf::wire_format::WireTypeLengthDelimited)?; - // TODO: Data size is computed again, it should be cached - os.write_raw_varint32((self.b.len() * 1) as u32)?; - for v in &self.b { - os.write_bool_no_tag(*v)?; - } - } - if !self.field_type.is_empty() { - os.write_tag(6, ::protobuf::wire_format::WireTypeLengthDelimited)?; - // TODO: Data size is computed again, it should be cached - os.write_raw_varint32(::protobuf::rt::vec_packed_enum_data_size(&self.field_type))?; - for v in &self.field_type { - os.write_enum_no_tag(::protobuf::ProtobufEnum::value(v))?; - } - } - for v in &self.shape { - os.write_tag(7, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - } - for v in &self.tensor { - os.write_tag(8, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - } - for v in &self.func { - os.write_tag(9, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - } - os.write_unknown_fields(self.get_unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn get_cached_size(&self) -> u32 { - self.cached_size.get() - } - - fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { - &self.unknown_fields - } - - fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { - &mut self.unknown_fields - } - - fn as_any(&self) -> &dyn (::std::any::Any) { - self as &dyn (::std::any::Any) - } - fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { - self as &mut dyn (::std::any::Any) - } - fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { - self - } - - fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - Self::descriptor_static() - } - - fn new() -> AttrValue_ListValue { - AttrValue_ListValue::new() - } - - fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = - ::protobuf::rt::LazyV2::INIT; - descriptor.get(|| { - let mut fields = ::std::vec::Vec::new(); - fields.push( - ::protobuf::reflect::accessor::make_repeated_field_accessor::< - _, - ::protobuf::types::ProtobufTypeBytes, - >( - "s", - |m: &AttrValue_ListValue| &m.s, - |m: &mut AttrValue_ListValue| &mut m.s, - ), - ); - fields.push(::protobuf::reflect::accessor::make_vec_accessor::< - _, - ::protobuf::types::ProtobufTypeInt64, - >( - "i", - |m: &AttrValue_ListValue| &m.i, - |m: &mut AttrValue_ListValue| &mut m.i, - )); - fields.push(::protobuf::reflect::accessor::make_vec_accessor::< - _, - ::protobuf::types::ProtobufTypeFloat, - >( - "f", - |m: &AttrValue_ListValue| &m.f, - |m: &mut AttrValue_ListValue| &mut m.f, - )); - fields.push(::protobuf::reflect::accessor::make_vec_accessor::< - _, - ::protobuf::types::ProtobufTypeBool, - >( - "b", - |m: &AttrValue_ListValue| &m.b, - |m: &mut AttrValue_ListValue| &mut m.b, - )); - fields.push(::protobuf::reflect::accessor::make_vec_accessor::< - _, - ::protobuf::types::ProtobufTypeEnum, - >( - "type", - |m: &AttrValue_ListValue| &m.field_type, - |m: &mut AttrValue_ListValue| &mut m.field_type, - )); - fields.push( - ::protobuf::reflect::accessor::make_repeated_field_accessor::< - _, - ::protobuf::types::ProtobufTypeMessage, - >( - "shape", - |m: &AttrValue_ListValue| &m.shape, - |m: &mut AttrValue_ListValue| &mut m.shape, - ), - ); - fields.push( - ::protobuf::reflect::accessor::make_repeated_field_accessor::< - _, - ::protobuf::types::ProtobufTypeMessage, - >( - "tensor", - |m: &AttrValue_ListValue| &m.tensor, - |m: &mut AttrValue_ListValue| &mut m.tensor, - ), - ); - fields.push( - ::protobuf::reflect::accessor::make_repeated_field_accessor::< - _, - ::protobuf::types::ProtobufTypeMessage, - >( - "func", - |m: &AttrValue_ListValue| &m.func, - |m: &mut AttrValue_ListValue| &mut m.func, - ), - ); - ::protobuf::reflect::MessageDescriptor::new_pb_name::( - "AttrValue.ListValue", - fields, - file_descriptor_proto(), - ) - }) - } - - fn default_instance() -> &'static AttrValue_ListValue { - static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; - instance.get(AttrValue_ListValue::new) - } -} - -impl ::protobuf::Clear for AttrValue_ListValue { - fn clear(&mut self) { - self.s.clear(); - self.i.clear(); - self.f.clear(); - self.b.clear(); - self.field_type.clear(); - self.shape.clear(); - self.tensor.clear(); - self.func.clear(); - self.unknown_fields.clear(); - } -} - -impl ::std::fmt::Debug for AttrValue_ListValue { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for AttrValue_ListValue { - fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { - ::protobuf::reflect::ReflectValueRef::Message(self) - } -} - -#[derive(PartialEq, Clone, Default)] -pub struct NameAttrList { - // message fields - pub name: ::std::string::String, - pub attr: ::std::collections::HashMap<::std::string::String, AttrValue>, - // special fields - pub unknown_fields: ::protobuf::UnknownFields, - pub cached_size: ::protobuf::CachedSize, -} - -impl<'a> ::std::default::Default for &'a NameAttrList { - fn default() -> &'a NameAttrList { - ::default_instance() - } -} - -impl NameAttrList { - pub fn new() -> NameAttrList { - ::std::default::Default::default() - } - - // string name = 1; - - pub fn get_name(&self) -> &str { - &self.name - } - pub fn clear_name(&mut self) { - self.name.clear(); - } - - // Param is passed by value, moved - pub fn set_name(&mut self, v: ::std::string::String) { - self.name = v; - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_name(&mut self) -> &mut ::std::string::String { - &mut self.name - } - - // Take field - pub fn take_name(&mut self) -> ::std::string::String { - ::std::mem::replace(&mut self.name, ::std::string::String::new()) - } - - // repeated .tensorflow.NameAttrList.AttrEntry attr = 2; - - pub fn get_attr(&self) -> &::std::collections::HashMap<::std::string::String, AttrValue> { - &self.attr - } - pub fn clear_attr(&mut self) { - self.attr.clear(); - } - - // Param is passed by value, moved - pub fn set_attr(&mut self, v: ::std::collections::HashMap<::std::string::String, AttrValue>) { - self.attr = v; - } - - // Mutable pointer to the field. - pub fn mut_attr( - &mut self, - ) -> &mut ::std::collections::HashMap<::std::string::String, AttrValue> { - &mut self.attr - } - - // Take field - pub fn take_attr(&mut self) -> ::std::collections::HashMap<::std::string::String, AttrValue> { - ::std::mem::replace(&mut self.attr, ::std::collections::HashMap::new()) - } -} - -impl ::protobuf::Message for NameAttrList { - fn is_initialized(&self) -> bool { - true - } - - fn merge_from( - &mut self, - is: &mut ::protobuf::CodedInputStream<'_>, - ) -> ::protobuf::ProtobufResult<()> { - while !is.eof()? { - let (field_number, wire_type) = is.read_tag_unpack()?; - match field_number { - 1 => { - ::protobuf::rt::read_singular_proto3_string_into( - wire_type, - is, - &mut self.name, - )?; - } - 2 => { - ::protobuf::rt::read_map_into::< - ::protobuf::types::ProtobufTypeString, - ::protobuf::types::ProtobufTypeMessage, - >(wire_type, is, &mut self.attr)?; - } - _ => { - ::protobuf::rt::read_unknown_or_skip_group( - field_number, - wire_type, - is, - self.mut_unknown_fields(), - )?; - } - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u32 { - let mut my_size = 0; - if !self.name.is_empty() { - my_size += ::protobuf::rt::string_size(1, &self.name); - } - my_size += ::protobuf::rt::compute_map_size::< - ::protobuf::types::ProtobufTypeString, - ::protobuf::types::ProtobufTypeMessage, - >(2, &self.attr); - my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); - self.cached_size.set(my_size); - my_size - } - - fn write_to_with_cached_sizes( - &self, - os: &mut ::protobuf::CodedOutputStream<'_>, - ) -> ::protobuf::ProtobufResult<()> { - if !self.name.is_empty() { - os.write_string(1, &self.name)?; - } - ::protobuf::rt::write_map_with_cached_sizes::< - ::protobuf::types::ProtobufTypeString, - ::protobuf::types::ProtobufTypeMessage, - >(2, &self.attr, os)?; - os.write_unknown_fields(self.get_unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn get_cached_size(&self) -> u32 { - self.cached_size.get() - } - - fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { - &self.unknown_fields - } - - fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { - &mut self.unknown_fields - } - - fn as_any(&self) -> &dyn (::std::any::Any) { - self as &dyn (::std::any::Any) - } - fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { - self as &mut dyn (::std::any::Any) - } - fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { - self - } - - fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - Self::descriptor_static() - } - - fn new() -> NameAttrList { - NameAttrList::new() - } - - fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = - ::protobuf::rt::LazyV2::INIT; - descriptor.get(|| { - let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::< - _, - ::protobuf::types::ProtobufTypeString, - >( - "name", - |m: &NameAttrList| &m.name, - |m: &mut NameAttrList| &mut m.name, - )); - fields.push(::protobuf::reflect::accessor::make_map_accessor::< - _, - ::protobuf::types::ProtobufTypeString, - ::protobuf::types::ProtobufTypeMessage, - >( - "attr", - |m: &NameAttrList| &m.attr, - |m: &mut NameAttrList| &mut m.attr, - )); - ::protobuf::reflect::MessageDescriptor::new_pb_name::( - "NameAttrList", - fields, - file_descriptor_proto(), - ) - }) - } - - fn default_instance() -> &'static NameAttrList { - static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; - instance.get(NameAttrList::new) - } -} - -impl ::protobuf::Clear for NameAttrList { - fn clear(&mut self) { - self.name.clear(); - self.attr.clear(); - self.unknown_fields.clear(); - } -} - -impl ::std::fmt::Debug for NameAttrList { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for NameAttrList { - fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { - ::protobuf::reflect::ReflectValueRef::Message(self) - } -} - -static file_descriptor_proto_data: &'static [u8] = b"\ - \n*tensorflow/core/framework/attr_value.proto\x12\ntensorflow\x1a&tensor\ - flow/core/framework/tensor.proto\x1a,tensorflow/core/framework/tensor_sh\ - ape.proto\x1a%tensorflow/core/framework/types.proto\"\x87\x05\n\tAttrVal\ - ue\x12\x0e\n\x01s\x18\x02\x20\x01(\x0cH\0R\x01s\x12\x0e\n\x01i\x18\x03\ - \x20\x01(\x03H\0R\x01i\x12\x0e\n\x01f\x18\x04\x20\x01(\x02H\0R\x01f\x12\ - \x0e\n\x01b\x18\x05\x20\x01(\x08H\0R\x01b\x12*\n\x04type\x18\x06\x20\x01\ - (\x0e2\x14.tensorflow.DataTypeH\0R\x04type\x124\n\x05shape\x18\x07\x20\ - \x01(\x0b2\x1c.tensorflow.TensorShapeProtoH\0R\x05shape\x121\n\x06tensor\ - \x18\x08\x20\x01(\x0b2\x17.tensorflow.TensorProtoH\0R\x06tensor\x125\n\ - \x04list\x18\x01\x20\x01(\x0b2\x1f.tensorflow.AttrValue.ListValueH\0R\ - \x04list\x12.\n\x04func\x18\n\x20\x01(\x0b2\x18.tensorflow.NameAttrListH\ - \0R\x04func\x12\"\n\x0bplaceholder\x18\t\x20\x01(\tH\0R\x0bplaceholder\ - \x1a\x90\x02\n\tListValue\x12\x0c\n\x01s\x18\x02\x20\x03(\x0cR\x01s\x12\ - \x10\n\x01i\x18\x03\x20\x03(\x03R\x01iB\x02\x10\x01\x12\x10\n\x01f\x18\ - \x04\x20\x03(\x02R\x01fB\x02\x10\x01\x12\x10\n\x01b\x18\x05\x20\x03(\x08\ - R\x01bB\x02\x10\x01\x12,\n\x04type\x18\x06\x20\x03(\x0e2\x14.tensorflow.\ - DataTypeR\x04typeB\x02\x10\x01\x122\n\x05shape\x18\x07\x20\x03(\x0b2\x1c\ - .tensorflow.TensorShapeProtoR\x05shape\x12/\n\x06tensor\x18\x08\x20\x03(\ - \x0b2\x17.tensorflow.TensorProtoR\x06tensor\x12,\n\x04func\x18\t\x20\x03\ - (\x0b2\x18.tensorflow.NameAttrListR\x04funcB\x07\n\x05value\"\xaa\x01\n\ - \x0cNameAttrList\x12\x12\n\x04name\x18\x01\x20\x01(\tR\x04name\x126\n\ - \x04attr\x18\x02\x20\x03(\x0b2\".tensorflow.NameAttrList.AttrEntryR\x04a\ - ttr\x1aN\n\tAttrEntry\x12\x10\n\x03key\x18\x01\x20\x01(\tR\x03key\x12+\n\ - \x05value\x18\x02\x20\x01(\x0b2\x15.tensorflow.AttrValueR\x05value:\x028\ - \x01Bo\n\x18org.tensorflow.frameworkB\x0fAttrValueProtosP\x01Z=github.co\ - m/tensorflow/tensorflow/tensorflow/go/core/framework\xf8\x01\x01b\x06pro\ - to3\ -"; - -static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2< - ::protobuf::descriptor::FileDescriptorProto, -> = ::protobuf::rt::LazyV2::INIT; - -fn parse_descriptor_proto() -> ::protobuf::descriptor::FileDescriptorProto { - ::protobuf::parse_from_bytes(file_descriptor_proto_data).unwrap() -} - -pub fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto { - file_descriptor_proto_lazy.get(|| parse_descriptor_proto()) -} diff --git a/src/protos/function.rs b/src/protos/function.rs deleted file mode 100644 index 81515a1b35..0000000000 --- a/src/protos/function.rs +++ /dev/null @@ -1,1186 +0,0 @@ -// This file is generated by rust-protobuf 2.17.0. Do not edit -// @generated - -// https://github.com/rust-lang/rust-clippy/issues/702 -#![allow(unknown_lints)] -#![allow(clippy::all)] - -#![allow(unused_attributes)] -#![rustfmt::skip] - -#![allow(box_pointers)] -#![allow(dead_code)] -#![allow(missing_docs)] -#![allow(non_camel_case_types)] -#![allow(non_snake_case)] -#![allow(non_upper_case_globals)] -#![allow(trivial_casts)] -#![allow(unused_imports)] -#![allow(unused_results)] -//! Generated file from `tensorflow/core/framework/function.proto` - -/// Generated files are compatible only with the same version -/// of protobuf runtime. -// const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_17_0; - -#[derive(PartialEq, Clone, Default)] -pub struct FunctionDefLibrary { - // message fields - pub function: ::protobuf::RepeatedField, - pub gradient: ::protobuf::RepeatedField, - // special fields - pub unknown_fields: ::protobuf::UnknownFields, - pub cached_size: ::protobuf::CachedSize, -} - -impl<'a> ::std::default::Default for &'a FunctionDefLibrary { - fn default() -> &'a FunctionDefLibrary { - ::default_instance() - } -} - -impl FunctionDefLibrary { - pub fn new() -> FunctionDefLibrary { - ::std::default::Default::default() - } - - // repeated .tensorflow.FunctionDef function = 1; - - pub fn get_function(&self) -> &[FunctionDef] { - &self.function - } - pub fn clear_function(&mut self) { - self.function.clear(); - } - - // Param is passed by value, moved - pub fn set_function(&mut self, v: ::protobuf::RepeatedField) { - self.function = v; - } - - // Mutable pointer to the field. - pub fn mut_function(&mut self) -> &mut ::protobuf::RepeatedField { - &mut self.function - } - - // Take field - pub fn take_function(&mut self) -> ::protobuf::RepeatedField { - ::std::mem::replace(&mut self.function, ::protobuf::RepeatedField::new()) - } - - // repeated .tensorflow.GradientDef gradient = 2; - - pub fn get_gradient(&self) -> &[GradientDef] { - &self.gradient - } - pub fn clear_gradient(&mut self) { - self.gradient.clear(); - } - - // Param is passed by value, moved - pub fn set_gradient(&mut self, v: ::protobuf::RepeatedField) { - self.gradient = v; - } - - // Mutable pointer to the field. - pub fn mut_gradient(&mut self) -> &mut ::protobuf::RepeatedField { - &mut self.gradient - } - - // Take field - pub fn take_gradient(&mut self) -> ::protobuf::RepeatedField { - ::std::mem::replace(&mut self.gradient, ::protobuf::RepeatedField::new()) - } -} - -impl ::protobuf::Message for FunctionDefLibrary { - fn is_initialized(&self) -> bool { - for v in &self.function { - if !v.is_initialized() { - return false; - } - } - for v in &self.gradient { - if !v.is_initialized() { - return false; - } - } - true - } - - fn merge_from( - &mut self, - is: &mut ::protobuf::CodedInputStream<'_>, - ) -> ::protobuf::ProtobufResult<()> { - while !is.eof()? { - let (field_number, wire_type) = is.read_tag_unpack()?; - match field_number { - 1 => { - ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.function)?; - } - 2 => { - ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.gradient)?; - } - _ => { - ::protobuf::rt::read_unknown_or_skip_group( - field_number, - wire_type, - is, - self.mut_unknown_fields(), - )?; - } - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u32 { - let mut my_size = 0; - for value in &self.function { - let len = value.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - } - for value in &self.gradient { - let len = value.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - } - my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); - self.cached_size.set(my_size); - my_size - } - - fn write_to_with_cached_sizes( - &self, - os: &mut ::protobuf::CodedOutputStream<'_>, - ) -> ::protobuf::ProtobufResult<()> { - for v in &self.function { - os.write_tag(1, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - } - for v in &self.gradient { - os.write_tag(2, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - } - os.write_unknown_fields(self.get_unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn get_cached_size(&self) -> u32 { - self.cached_size.get() - } - - fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { - &self.unknown_fields - } - - fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { - &mut self.unknown_fields - } - - fn as_any(&self) -> &dyn (::std::any::Any) { - self as &dyn (::std::any::Any) - } - fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { - self as &mut dyn (::std::any::Any) - } - fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { - self - } - - fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - Self::descriptor_static() - } - - fn new() -> FunctionDefLibrary { - FunctionDefLibrary::new() - } - - fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = - ::protobuf::rt::LazyV2::INIT; - descriptor.get(|| { - let mut fields = ::std::vec::Vec::new(); - fields.push( - ::protobuf::reflect::accessor::make_repeated_field_accessor::< - _, - ::protobuf::types::ProtobufTypeMessage, - >( - "function", - |m: &FunctionDefLibrary| &m.function, - |m: &mut FunctionDefLibrary| &mut m.function, - ), - ); - fields.push( - ::protobuf::reflect::accessor::make_repeated_field_accessor::< - _, - ::protobuf::types::ProtobufTypeMessage, - >( - "gradient", - |m: &FunctionDefLibrary| &m.gradient, - |m: &mut FunctionDefLibrary| &mut m.gradient, - ), - ); - ::protobuf::reflect::MessageDescriptor::new_pb_name::( - "FunctionDefLibrary", - fields, - file_descriptor_proto(), - ) - }) - } - - fn default_instance() -> &'static FunctionDefLibrary { - static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; - instance.get(FunctionDefLibrary::new) - } -} - -impl ::protobuf::Clear for FunctionDefLibrary { - fn clear(&mut self) { - self.function.clear(); - self.gradient.clear(); - self.unknown_fields.clear(); - } -} - -impl ::std::fmt::Debug for FunctionDefLibrary { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for FunctionDefLibrary { - fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { - ::protobuf::reflect::ReflectValueRef::Message(self) - } -} - -#[derive(PartialEq, Clone, Default)] -pub struct FunctionDef { - // message fields - pub signature: ::protobuf::SingularPtrField, - pub attr: ::std::collections::HashMap<::std::string::String, super::attr_value::AttrValue>, - pub arg_attr: ::std::collections::HashMap, - pub node_def: ::protobuf::RepeatedField, - pub ret: ::std::collections::HashMap<::std::string::String, ::std::string::String>, - pub control_ret: ::std::collections::HashMap<::std::string::String, ::std::string::String>, - // special fields - pub unknown_fields: ::protobuf::UnknownFields, - pub cached_size: ::protobuf::CachedSize, -} - -impl<'a> ::std::default::Default for &'a FunctionDef { - fn default() -> &'a FunctionDef { - ::default_instance() - } -} - -impl FunctionDef { - pub fn new() -> FunctionDef { - ::std::default::Default::default() - } - - // .tensorflow.OpDef signature = 1; - - pub fn get_signature(&self) -> &super::op_def::OpDef { - self.signature - .as_ref() - .unwrap_or_else(|| ::default_instance()) - } - pub fn clear_signature(&mut self) { - self.signature.clear(); - } - - pub fn has_signature(&self) -> bool { - self.signature.is_some() - } - - // Param is passed by value, moved - pub fn set_signature(&mut self, v: super::op_def::OpDef) { - self.signature = ::protobuf::SingularPtrField::some(v); - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_signature(&mut self) -> &mut super::op_def::OpDef { - if self.signature.is_none() { - self.signature.set_default(); - } - self.signature.as_mut().unwrap() - } - - // Take field - pub fn take_signature(&mut self) -> super::op_def::OpDef { - self.signature - .take() - .unwrap_or_else(|| super::op_def::OpDef::new()) - } - - // repeated .tensorflow.FunctionDef.AttrEntry attr = 5; - - pub fn get_attr( - &self, - ) -> &::std::collections::HashMap<::std::string::String, super::attr_value::AttrValue> { - &self.attr - } - pub fn clear_attr(&mut self) { - self.attr.clear(); - } - - // Param is passed by value, moved - pub fn set_attr( - &mut self, - v: ::std::collections::HashMap<::std::string::String, super::attr_value::AttrValue>, - ) { - self.attr = v; - } - - // Mutable pointer to the field. - pub fn mut_attr( - &mut self, - ) -> &mut ::std::collections::HashMap<::std::string::String, super::attr_value::AttrValue> { - &mut self.attr - } - - // Take field - pub fn take_attr( - &mut self, - ) -> ::std::collections::HashMap<::std::string::String, super::attr_value::AttrValue> { - ::std::mem::replace(&mut self.attr, ::std::collections::HashMap::new()) - } - - // repeated .tensorflow.FunctionDef.ArgAttrEntry arg_attr = 7; - - pub fn get_arg_attr(&self) -> &::std::collections::HashMap { - &self.arg_attr - } - pub fn clear_arg_attr(&mut self) { - self.arg_attr.clear(); - } - - // Param is passed by value, moved - pub fn set_arg_attr(&mut self, v: ::std::collections::HashMap) { - self.arg_attr = v; - } - - // Mutable pointer to the field. - pub fn mut_arg_attr(&mut self) -> &mut ::std::collections::HashMap { - &mut self.arg_attr - } - - // Take field - pub fn take_arg_attr(&mut self) -> ::std::collections::HashMap { - ::std::mem::replace(&mut self.arg_attr, ::std::collections::HashMap::new()) - } - - // repeated .tensorflow.NodeDef node_def = 3; - - pub fn get_node_def(&self) -> &[super::node_def::NodeDef] { - &self.node_def - } - pub fn clear_node_def(&mut self) { - self.node_def.clear(); - } - - // Param is passed by value, moved - pub fn set_node_def(&mut self, v: ::protobuf::RepeatedField) { - self.node_def = v; - } - - // Mutable pointer to the field. - pub fn mut_node_def(&mut self) -> &mut ::protobuf::RepeatedField { - &mut self.node_def - } - - // Take field - pub fn take_node_def(&mut self) -> ::protobuf::RepeatedField { - ::std::mem::replace(&mut self.node_def, ::protobuf::RepeatedField::new()) - } - - // repeated .tensorflow.FunctionDef.RetEntry ret = 4; - - pub fn get_ret( - &self, - ) -> &::std::collections::HashMap<::std::string::String, ::std::string::String> { - &self.ret - } - pub fn clear_ret(&mut self) { - self.ret.clear(); - } - - // Param is passed by value, moved - pub fn set_ret( - &mut self, - v: ::std::collections::HashMap<::std::string::String, ::std::string::String>, - ) { - self.ret = v; - } - - // Mutable pointer to the field. - pub fn mut_ret( - &mut self, - ) -> &mut ::std::collections::HashMap<::std::string::String, ::std::string::String> { - &mut self.ret - } - - // Take field - pub fn take_ret( - &mut self, - ) -> ::std::collections::HashMap<::std::string::String, ::std::string::String> { - ::std::mem::replace(&mut self.ret, ::std::collections::HashMap::new()) - } - - // repeated .tensorflow.FunctionDef.ControlRetEntry control_ret = 6; - - pub fn get_control_ret( - &self, - ) -> &::std::collections::HashMap<::std::string::String, ::std::string::String> { - &self.control_ret - } - pub fn clear_control_ret(&mut self) { - self.control_ret.clear(); - } - - // Param is passed by value, moved - pub fn set_control_ret( - &mut self, - v: ::std::collections::HashMap<::std::string::String, ::std::string::String>, - ) { - self.control_ret = v; - } - - // Mutable pointer to the field. - pub fn mut_control_ret( - &mut self, - ) -> &mut ::std::collections::HashMap<::std::string::String, ::std::string::String> { - &mut self.control_ret - } - - // Take field - pub fn take_control_ret( - &mut self, - ) -> ::std::collections::HashMap<::std::string::String, ::std::string::String> { - ::std::mem::replace(&mut self.control_ret, ::std::collections::HashMap::new()) - } -} - -impl ::protobuf::Message for FunctionDef { - fn is_initialized(&self) -> bool { - for v in &self.signature { - if !v.is_initialized() { - return false; - } - } - for v in &self.node_def { - if !v.is_initialized() { - return false; - } - } - true - } - - fn merge_from( - &mut self, - is: &mut ::protobuf::CodedInputStream<'_>, - ) -> ::protobuf::ProtobufResult<()> { - while !is.eof()? { - let (field_number, wire_type) = is.read_tag_unpack()?; - match field_number { - 1 => { - ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.signature)?; - } - 5 => { - ::protobuf::rt::read_map_into::< - ::protobuf::types::ProtobufTypeString, - ::protobuf::types::ProtobufTypeMessage, - >(wire_type, is, &mut self.attr)?; - } - 7 => { - ::protobuf::rt::read_map_into::< - ::protobuf::types::ProtobufTypeUint32, - ::protobuf::types::ProtobufTypeMessage, - >(wire_type, is, &mut self.arg_attr)?; - } - 3 => { - ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.node_def)?; - } - 4 => { - ::protobuf::rt::read_map_into::< - ::protobuf::types::ProtobufTypeString, - ::protobuf::types::ProtobufTypeString, - >(wire_type, is, &mut self.ret)?; - } - 6 => { - ::protobuf::rt::read_map_into::< - ::protobuf::types::ProtobufTypeString, - ::protobuf::types::ProtobufTypeString, - >(wire_type, is, &mut self.control_ret)?; - } - _ => { - ::protobuf::rt::read_unknown_or_skip_group( - field_number, - wire_type, - is, - self.mut_unknown_fields(), - )?; - } - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u32 { - let mut my_size = 0; - if let Some(ref v) = self.signature.as_ref() { - let len = v.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - } - my_size += ::protobuf::rt::compute_map_size::< - ::protobuf::types::ProtobufTypeString, - ::protobuf::types::ProtobufTypeMessage, - >(5, &self.attr); - my_size += ::protobuf::rt::compute_map_size::< - ::protobuf::types::ProtobufTypeUint32, - ::protobuf::types::ProtobufTypeMessage, - >(7, &self.arg_attr); - for value in &self.node_def { - let len = value.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - } - my_size += ::protobuf::rt::compute_map_size::< - ::protobuf::types::ProtobufTypeString, - ::protobuf::types::ProtobufTypeString, - >(4, &self.ret); - my_size += ::protobuf::rt::compute_map_size::< - ::protobuf::types::ProtobufTypeString, - ::protobuf::types::ProtobufTypeString, - >(6, &self.control_ret); - my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); - self.cached_size.set(my_size); - my_size - } - - fn write_to_with_cached_sizes( - &self, - os: &mut ::protobuf::CodedOutputStream<'_>, - ) -> ::protobuf::ProtobufResult<()> { - if let Some(ref v) = self.signature.as_ref() { - os.write_tag(1, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - } - ::protobuf::rt::write_map_with_cached_sizes::< - ::protobuf::types::ProtobufTypeString, - ::protobuf::types::ProtobufTypeMessage, - >(5, &self.attr, os)?; - ::protobuf::rt::write_map_with_cached_sizes::< - ::protobuf::types::ProtobufTypeUint32, - ::protobuf::types::ProtobufTypeMessage, - >(7, &self.arg_attr, os)?; - for v in &self.node_def { - os.write_tag(3, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - } - ::protobuf::rt::write_map_with_cached_sizes::< - ::protobuf::types::ProtobufTypeString, - ::protobuf::types::ProtobufTypeString, - >(4, &self.ret, os)?; - ::protobuf::rt::write_map_with_cached_sizes::< - ::protobuf::types::ProtobufTypeString, - ::protobuf::types::ProtobufTypeString, - >(6, &self.control_ret, os)?; - os.write_unknown_fields(self.get_unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn get_cached_size(&self) -> u32 { - self.cached_size.get() - } - - fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { - &self.unknown_fields - } - - fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { - &mut self.unknown_fields - } - - fn as_any(&self) -> &dyn (::std::any::Any) { - self as &dyn (::std::any::Any) - } - fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { - self as &mut dyn (::std::any::Any) - } - fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { - self - } - - fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - Self::descriptor_static() - } - - fn new() -> FunctionDef { - FunctionDef::new() - } - - fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = - ::protobuf::rt::LazyV2::INIT; - descriptor.get(|| { - let mut fields = ::std::vec::Vec::new(); - fields.push( - ::protobuf::reflect::accessor::make_singular_ptr_field_accessor::< - _, - ::protobuf::types::ProtobufTypeMessage, - >( - "signature", - |m: &FunctionDef| &m.signature, - |m: &mut FunctionDef| &mut m.signature, - ), - ); - fields.push(::protobuf::reflect::accessor::make_map_accessor::< - _, - ::protobuf::types::ProtobufTypeString, - ::protobuf::types::ProtobufTypeMessage, - >( - "attr", - |m: &FunctionDef| &m.attr, - |m: &mut FunctionDef| &mut m.attr, - )); - fields.push(::protobuf::reflect::accessor::make_map_accessor::< - _, - ::protobuf::types::ProtobufTypeUint32, - ::protobuf::types::ProtobufTypeMessage, - >( - "arg_attr", - |m: &FunctionDef| &m.arg_attr, - |m: &mut FunctionDef| &mut m.arg_attr, - )); - fields.push( - ::protobuf::reflect::accessor::make_repeated_field_accessor::< - _, - ::protobuf::types::ProtobufTypeMessage, - >( - "node_def", - |m: &FunctionDef| &m.node_def, - |m: &mut FunctionDef| &mut m.node_def, - ), - ); - fields.push(::protobuf::reflect::accessor::make_map_accessor::< - _, - ::protobuf::types::ProtobufTypeString, - ::protobuf::types::ProtobufTypeString, - >( - "ret", - |m: &FunctionDef| &m.ret, - |m: &mut FunctionDef| &mut m.ret, - )); - fields.push(::protobuf::reflect::accessor::make_map_accessor::< - _, - ::protobuf::types::ProtobufTypeString, - ::protobuf::types::ProtobufTypeString, - >( - "control_ret", - |m: &FunctionDef| &m.control_ret, - |m: &mut FunctionDef| &mut m.control_ret, - )); - ::protobuf::reflect::MessageDescriptor::new_pb_name::( - "FunctionDef", - fields, - file_descriptor_proto(), - ) - }) - } - - fn default_instance() -> &'static FunctionDef { - static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; - instance.get(FunctionDef::new) - } -} - -impl ::protobuf::Clear for FunctionDef { - fn clear(&mut self) { - self.signature.clear(); - self.attr.clear(); - self.arg_attr.clear(); - self.node_def.clear(); - self.ret.clear(); - self.control_ret.clear(); - self.unknown_fields.clear(); - } -} - -impl ::std::fmt::Debug for FunctionDef { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for FunctionDef { - fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { - ::protobuf::reflect::ReflectValueRef::Message(self) - } -} - -#[derive(PartialEq, Clone, Default)] -pub struct FunctionDef_ArgAttrs { - // message fields - pub attr: ::std::collections::HashMap<::std::string::String, super::attr_value::AttrValue>, - // special fields - pub unknown_fields: ::protobuf::UnknownFields, - pub cached_size: ::protobuf::CachedSize, -} - -impl<'a> ::std::default::Default for &'a FunctionDef_ArgAttrs { - fn default() -> &'a FunctionDef_ArgAttrs { - ::default_instance() - } -} - -impl FunctionDef_ArgAttrs { - pub fn new() -> FunctionDef_ArgAttrs { - ::std::default::Default::default() - } - - // repeated .tensorflow.FunctionDef.ArgAttrs.AttrEntry attr = 1; - - pub fn get_attr( - &self, - ) -> &::std::collections::HashMap<::std::string::String, super::attr_value::AttrValue> { - &self.attr - } - pub fn clear_attr(&mut self) { - self.attr.clear(); - } - - // Param is passed by value, moved - pub fn set_attr( - &mut self, - v: ::std::collections::HashMap<::std::string::String, super::attr_value::AttrValue>, - ) { - self.attr = v; - } - - // Mutable pointer to the field. - pub fn mut_attr( - &mut self, - ) -> &mut ::std::collections::HashMap<::std::string::String, super::attr_value::AttrValue> { - &mut self.attr - } - - // Take field - pub fn take_attr( - &mut self, - ) -> ::std::collections::HashMap<::std::string::String, super::attr_value::AttrValue> { - ::std::mem::replace(&mut self.attr, ::std::collections::HashMap::new()) - } -} - -impl ::protobuf::Message for FunctionDef_ArgAttrs { - fn is_initialized(&self) -> bool { - true - } - - fn merge_from( - &mut self, - is: &mut ::protobuf::CodedInputStream<'_>, - ) -> ::protobuf::ProtobufResult<()> { - while !is.eof()? { - let (field_number, wire_type) = is.read_tag_unpack()?; - match field_number { - 1 => { - ::protobuf::rt::read_map_into::< - ::protobuf::types::ProtobufTypeString, - ::protobuf::types::ProtobufTypeMessage, - >(wire_type, is, &mut self.attr)?; - } - _ => { - ::protobuf::rt::read_unknown_or_skip_group( - field_number, - wire_type, - is, - self.mut_unknown_fields(), - )?; - } - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u32 { - let mut my_size = 0; - my_size += ::protobuf::rt::compute_map_size::< - ::protobuf::types::ProtobufTypeString, - ::protobuf::types::ProtobufTypeMessage, - >(1, &self.attr); - my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); - self.cached_size.set(my_size); - my_size - } - - fn write_to_with_cached_sizes( - &self, - os: &mut ::protobuf::CodedOutputStream<'_>, - ) -> ::protobuf::ProtobufResult<()> { - ::protobuf::rt::write_map_with_cached_sizes::< - ::protobuf::types::ProtobufTypeString, - ::protobuf::types::ProtobufTypeMessage, - >(1, &self.attr, os)?; - os.write_unknown_fields(self.get_unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn get_cached_size(&self) -> u32 { - self.cached_size.get() - } - - fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { - &self.unknown_fields - } - - fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { - &mut self.unknown_fields - } - - fn as_any(&self) -> &dyn (::std::any::Any) { - self as &dyn (::std::any::Any) - } - fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { - self as &mut dyn (::std::any::Any) - } - fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { - self - } - - fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - Self::descriptor_static() - } - - fn new() -> FunctionDef_ArgAttrs { - FunctionDef_ArgAttrs::new() - } - - fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = - ::protobuf::rt::LazyV2::INIT; - descriptor.get(|| { - let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_map_accessor::< - _, - ::protobuf::types::ProtobufTypeString, - ::protobuf::types::ProtobufTypeMessage, - >( - "attr", - |m: &FunctionDef_ArgAttrs| &m.attr, - |m: &mut FunctionDef_ArgAttrs| &mut m.attr, - )); - ::protobuf::reflect::MessageDescriptor::new_pb_name::( - "FunctionDef.ArgAttrs", - fields, - file_descriptor_proto(), - ) - }) - } - - fn default_instance() -> &'static FunctionDef_ArgAttrs { - static instance: ::protobuf::rt::LazyV2 = - ::protobuf::rt::LazyV2::INIT; - instance.get(FunctionDef_ArgAttrs::new) - } -} - -impl ::protobuf::Clear for FunctionDef_ArgAttrs { - fn clear(&mut self) { - self.attr.clear(); - self.unknown_fields.clear(); - } -} - -impl ::std::fmt::Debug for FunctionDef_ArgAttrs { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for FunctionDef_ArgAttrs { - fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { - ::protobuf::reflect::ReflectValueRef::Message(self) - } -} - -#[derive(PartialEq, Clone, Default)] -pub struct GradientDef { - // message fields - pub function_name: ::std::string::String, - pub gradient_func: ::std::string::String, - // special fields - pub unknown_fields: ::protobuf::UnknownFields, - pub cached_size: ::protobuf::CachedSize, -} - -impl<'a> ::std::default::Default for &'a GradientDef { - fn default() -> &'a GradientDef { - ::default_instance() - } -} - -impl GradientDef { - pub fn new() -> GradientDef { - ::std::default::Default::default() - } - - // string function_name = 1; - - pub fn get_function_name(&self) -> &str { - &self.function_name - } - pub fn clear_function_name(&mut self) { - self.function_name.clear(); - } - - // Param is passed by value, moved - pub fn set_function_name(&mut self, v: ::std::string::String) { - self.function_name = v; - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_function_name(&mut self) -> &mut ::std::string::String { - &mut self.function_name - } - - // Take field - pub fn take_function_name(&mut self) -> ::std::string::String { - ::std::mem::replace(&mut self.function_name, ::std::string::String::new()) - } - - // string gradient_func = 2; - - pub fn get_gradient_func(&self) -> &str { - &self.gradient_func - } - pub fn clear_gradient_func(&mut self) { - self.gradient_func.clear(); - } - - // Param is passed by value, moved - pub fn set_gradient_func(&mut self, v: ::std::string::String) { - self.gradient_func = v; - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_gradient_func(&mut self) -> &mut ::std::string::String { - &mut self.gradient_func - } - - // Take field - pub fn take_gradient_func(&mut self) -> ::std::string::String { - ::std::mem::replace(&mut self.gradient_func, ::std::string::String::new()) - } -} - -impl ::protobuf::Message for GradientDef { - fn is_initialized(&self) -> bool { - true - } - - fn merge_from( - &mut self, - is: &mut ::protobuf::CodedInputStream<'_>, - ) -> ::protobuf::ProtobufResult<()> { - while !is.eof()? { - let (field_number, wire_type) = is.read_tag_unpack()?; - match field_number { - 1 => { - ::protobuf::rt::read_singular_proto3_string_into( - wire_type, - is, - &mut self.function_name, - )?; - } - 2 => { - ::protobuf::rt::read_singular_proto3_string_into( - wire_type, - is, - &mut self.gradient_func, - )?; - } - _ => { - ::protobuf::rt::read_unknown_or_skip_group( - field_number, - wire_type, - is, - self.mut_unknown_fields(), - )?; - } - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u32 { - let mut my_size = 0; - if !self.function_name.is_empty() { - my_size += ::protobuf::rt::string_size(1, &self.function_name); - } - if !self.gradient_func.is_empty() { - my_size += ::protobuf::rt::string_size(2, &self.gradient_func); - } - my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); - self.cached_size.set(my_size); - my_size - } - - fn write_to_with_cached_sizes( - &self, - os: &mut ::protobuf::CodedOutputStream<'_>, - ) -> ::protobuf::ProtobufResult<()> { - if !self.function_name.is_empty() { - os.write_string(1, &self.function_name)?; - } - if !self.gradient_func.is_empty() { - os.write_string(2, &self.gradient_func)?; - } - os.write_unknown_fields(self.get_unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn get_cached_size(&self) -> u32 { - self.cached_size.get() - } - - fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { - &self.unknown_fields - } - - fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { - &mut self.unknown_fields - } - - fn as_any(&self) -> &dyn (::std::any::Any) { - self as &dyn (::std::any::Any) - } - fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { - self as &mut dyn (::std::any::Any) - } - fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { - self - } - - fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - Self::descriptor_static() - } - - fn new() -> GradientDef { - GradientDef::new() - } - - fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = - ::protobuf::rt::LazyV2::INIT; - descriptor.get(|| { - let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::< - _, - ::protobuf::types::ProtobufTypeString, - >( - "function_name", - |m: &GradientDef| &m.function_name, - |m: &mut GradientDef| &mut m.function_name, - )); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::< - _, - ::protobuf::types::ProtobufTypeString, - >( - "gradient_func", - |m: &GradientDef| &m.gradient_func, - |m: &mut GradientDef| &mut m.gradient_func, - )); - ::protobuf::reflect::MessageDescriptor::new_pb_name::( - "GradientDef", - fields, - file_descriptor_proto(), - ) - }) - } - - fn default_instance() -> &'static GradientDef { - static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; - instance.get(GradientDef::new) - } -} - -impl ::protobuf::Clear for GradientDef { - fn clear(&mut self) { - self.function_name.clear(); - self.gradient_func.clear(); - self.unknown_fields.clear(); - } -} - -impl ::std::fmt::Debug for GradientDef { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for GradientDef { - fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { - ::protobuf::reflect::ReflectValueRef::Message(self) - } -} - -static file_descriptor_proto_data: &'static [u8] = b"\ - \n(tensorflow/core/framework/function.proto\x12\ntensorflow\x1a*tensorfl\ - ow/core/framework/attr_value.proto\x1a(tensorflow/core/framework/node_de\ - f.proto\x1a&tensorflow/core/framework/op_def.proto\"~\n\x12FunctionDefLi\ - brary\x123\n\x08function\x18\x01\x20\x03(\x0b2\x17.tensorflow.FunctionDe\ - fR\x08function\x123\n\x08gradient\x18\x02\x20\x03(\x0b2\x17.tensorflow.G\ - radientDefR\x08gradient\"\xac\x06\n\x0bFunctionDef\x12/\n\tsignature\x18\ - \x01\x20\x01(\x0b2\x11.tensorflow.OpDefR\tsignature\x125\n\x04attr\x18\ - \x05\x20\x03(\x0b2!.tensorflow.FunctionDef.AttrEntryR\x04attr\x12?\n\x08\ - arg_attr\x18\x07\x20\x03(\x0b2$.tensorflow.FunctionDef.ArgAttrEntryR\x07\ - argAttr\x12.\n\x08node_def\x18\x03\x20\x03(\x0b2\x13.tensorflow.NodeDefR\ - \x07nodeDef\x122\n\x03ret\x18\x04\x20\x03(\x0b2\x20.tensorflow.FunctionD\ - ef.RetEntryR\x03ret\x12H\n\x0bcontrol_ret\x18\x06\x20\x03(\x0b2'.tensorf\ - low.FunctionDef.ControlRetEntryR\ncontrolRet\x1aN\n\tAttrEntry\x12\x10\n\ - \x03key\x18\x01\x20\x01(\tR\x03key\x12+\n\x05value\x18\x02\x20\x01(\x0b2\ - \x15.tensorflow.AttrValueR\x05value:\x028\x01\x1a\x9a\x01\n\x08ArgAttrs\ - \x12>\n\x04attr\x18\x01\x20\x03(\x0b2*.tensorflow.FunctionDef.ArgAttrs.A\ - ttrEntryR\x04attr\x1aN\n\tAttrEntry\x12\x10\n\x03key\x18\x01\x20\x01(\tR\ - \x03key\x12+\n\x05value\x18\x02\x20\x01(\x0b2\x15.tensorflow.AttrValueR\ - \x05value:\x028\x01\x1a\\\n\x0cArgAttrEntry\x12\x10\n\x03key\x18\x01\x20\ - \x01(\rR\x03key\x126\n\x05value\x18\x02\x20\x01(\x0b2\x20.tensorflow.Fun\ - ctionDef.ArgAttrsR\x05value:\x028\x01\x1a6\n\x08RetEntry\x12\x10\n\x03ke\ - y\x18\x01\x20\x01(\tR\x03key\x12\x14\n\x05value\x18\x02\x20\x01(\tR\x05v\ - alue:\x028\x01\x1a=\n\x0fControlRetEntry\x12\x10\n\x03key\x18\x01\x20\ - \x01(\tR\x03key\x12\x14\n\x05value\x18\x02\x20\x01(\tR\x05value:\x028\ - \x01J\x04\x08\x02\x10\x03\"W\n\x0bGradientDef\x12#\n\rfunction_name\x18\ - \x01\x20\x01(\tR\x0cfunctionName\x12#\n\rgradient_func\x18\x02\x20\x01(\ - \tR\x0cgradientFuncBn\n\x18org.tensorflow.frameworkB\x0eFunctionProtosP\ - \x01Z=github.com/tensorflow/tensorflow/tensorflow/go/core/framework\xf8\ - \x01\x01b\x06proto3\ -"; - -static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2< - ::protobuf::descriptor::FileDescriptorProto, -> = ::protobuf::rt::LazyV2::INIT; - -fn parse_descriptor_proto() -> ::protobuf::descriptor::FileDescriptorProto { - ::protobuf::parse_from_bytes(file_descriptor_proto_data).unwrap() -} - -pub fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto { - file_descriptor_proto_lazy.get(|| parse_descriptor_proto()) -} diff --git a/src/protos/graph.rs b/src/protos/graph.rs deleted file mode 100644 index 2c6269cb71..0000000000 --- a/src/protos/graph.rs +++ /dev/null @@ -1,404 +0,0 @@ -// This file is generated by rust-protobuf 2.17.0. Do not edit -// @generated - -// https://github.com/rust-lang/rust-clippy/issues/702 -#![allow(unknown_lints)] -#![allow(clippy::all)] - -#![allow(unused_attributes)] -#![rustfmt::skip] - -#![allow(box_pointers)] -#![allow(dead_code)] -#![allow(missing_docs)] -#![allow(non_camel_case_types)] -#![allow(non_snake_case)] -#![allow(non_upper_case_globals)] -#![allow(trivial_casts)] -#![allow(unused_imports)] -#![allow(unused_results)] -//! Generated file from `tensorflow/core/framework/graph.proto` - -/// Generated files are compatible only with the same version -/// of protobuf runtime. -// const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_17_0; - -#[derive(PartialEq, Clone, Default)] -pub struct GraphDef { - // message fields - pub node: ::protobuf::RepeatedField, - pub versions: ::protobuf::SingularPtrField, - pub version: i32, - pub library: ::protobuf::SingularPtrField, - // special fields - pub unknown_fields: ::protobuf::UnknownFields, - pub cached_size: ::protobuf::CachedSize, -} - -impl<'a> ::std::default::Default for &'a GraphDef { - fn default() -> &'a GraphDef { - ::default_instance() - } -} - -impl GraphDef { - pub fn new() -> GraphDef { - ::std::default::Default::default() - } - - // repeated .tensorflow.NodeDef node = 1; - - pub fn get_node(&self) -> &[super::node_def::NodeDef] { - &self.node - } - pub fn clear_node(&mut self) { - self.node.clear(); - } - - // Param is passed by value, moved - pub fn set_node(&mut self, v: ::protobuf::RepeatedField) { - self.node = v; - } - - // Mutable pointer to the field. - pub fn mut_node(&mut self) -> &mut ::protobuf::RepeatedField { - &mut self.node - } - - // Take field - pub fn take_node(&mut self) -> ::protobuf::RepeatedField { - ::std::mem::replace(&mut self.node, ::protobuf::RepeatedField::new()) - } - - // .tensorflow.VersionDef versions = 4; - - pub fn get_versions(&self) -> &super::versions::VersionDef { - self.versions.as_ref().unwrap_or_else(|| { - ::default_instance() - }) - } - pub fn clear_versions(&mut self) { - self.versions.clear(); - } - - pub fn has_versions(&self) -> bool { - self.versions.is_some() - } - - // Param is passed by value, moved - pub fn set_versions(&mut self, v: super::versions::VersionDef) { - self.versions = ::protobuf::SingularPtrField::some(v); - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_versions(&mut self) -> &mut super::versions::VersionDef { - if self.versions.is_none() { - self.versions.set_default(); - } - self.versions.as_mut().unwrap() - } - - // Take field - pub fn take_versions(&mut self) -> super::versions::VersionDef { - self.versions - .take() - .unwrap_or_else(|| super::versions::VersionDef::new()) - } - - // int32 version = 3; - - pub fn get_version(&self) -> i32 { - self.version - } - pub fn clear_version(&mut self) { - self.version = 0; - } - - // Param is passed by value, moved - pub fn set_version(&mut self, v: i32) { - self.version = v; - } - - // .tensorflow.FunctionDefLibrary library = 2; - - pub fn get_library(&self) -> &super::function::FunctionDefLibrary { - self.library.as_ref().unwrap_or_else(|| { - ::default_instance() - }) - } - pub fn clear_library(&mut self) { - self.library.clear(); - } - - pub fn has_library(&self) -> bool { - self.library.is_some() - } - - // Param is passed by value, moved - pub fn set_library(&mut self, v: super::function::FunctionDefLibrary) { - self.library = ::protobuf::SingularPtrField::some(v); - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_library(&mut self) -> &mut super::function::FunctionDefLibrary { - if self.library.is_none() { - self.library.set_default(); - } - self.library.as_mut().unwrap() - } - - // Take field - pub fn take_library(&mut self) -> super::function::FunctionDefLibrary { - self.library - .take() - .unwrap_or_else(|| super::function::FunctionDefLibrary::new()) - } -} - -impl ::protobuf::Message for GraphDef { - fn is_initialized(&self) -> bool { - for v in &self.node { - if !v.is_initialized() { - return false; - } - } - for v in &self.versions { - if !v.is_initialized() { - return false; - } - } - for v in &self.library { - if !v.is_initialized() { - return false; - } - } - true - } - - fn merge_from( - &mut self, - is: &mut ::protobuf::CodedInputStream<'_>, - ) -> ::protobuf::ProtobufResult<()> { - while !is.eof()? { - let (field_number, wire_type) = is.read_tag_unpack()?; - match field_number { - 1 => { - ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.node)?; - } - 4 => { - ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.versions)?; - } - 3 => { - if wire_type != ::protobuf::wire_format::WireTypeVarint { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type( - wire_type, - )); - } - let tmp = is.read_int32()?; - self.version = tmp; - } - 2 => { - ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.library)?; - } - _ => { - ::protobuf::rt::read_unknown_or_skip_group( - field_number, - wire_type, - is, - self.mut_unknown_fields(), - )?; - } - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u32 { - let mut my_size = 0; - for value in &self.node { - let len = value.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - } - if let Some(ref v) = self.versions.as_ref() { - let len = v.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - } - if self.version != 0 { - my_size += ::protobuf::rt::value_size( - 3, - self.version, - ::protobuf::wire_format::WireTypeVarint, - ); - } - if let Some(ref v) = self.library.as_ref() { - let len = v.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - } - my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); - self.cached_size.set(my_size); - my_size - } - - fn write_to_with_cached_sizes( - &self, - os: &mut ::protobuf::CodedOutputStream<'_>, - ) -> ::protobuf::ProtobufResult<()> { - for v in &self.node { - os.write_tag(1, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - } - if let Some(ref v) = self.versions.as_ref() { - os.write_tag(4, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - } - if self.version != 0 { - os.write_int32(3, self.version)?; - } - if let Some(ref v) = self.library.as_ref() { - os.write_tag(2, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - } - os.write_unknown_fields(self.get_unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn get_cached_size(&self) -> u32 { - self.cached_size.get() - } - - fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { - &self.unknown_fields - } - - fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { - &mut self.unknown_fields - } - - fn as_any(&self) -> &dyn (::std::any::Any) { - self as &dyn (::std::any::Any) - } - fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { - self as &mut dyn (::std::any::Any) - } - fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { - self - } - - fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - Self::descriptor_static() - } - - fn new() -> GraphDef { - GraphDef::new() - } - - fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = - ::protobuf::rt::LazyV2::INIT; - descriptor.get(|| { - let mut fields = ::std::vec::Vec::new(); - fields.push( - ::protobuf::reflect::accessor::make_repeated_field_accessor::< - _, - ::protobuf::types::ProtobufTypeMessage, - >( - "node", - |m: &GraphDef| &m.node, - |m: &mut GraphDef| &mut m.node, - ), - ); - fields.push( - ::protobuf::reflect::accessor::make_singular_ptr_field_accessor::< - _, - ::protobuf::types::ProtobufTypeMessage, - >( - "versions", - |m: &GraphDef| &m.versions, - |m: &mut GraphDef| &mut m.versions, - ), - ); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::< - _, - ::protobuf::types::ProtobufTypeInt32, - >( - "version", - |m: &GraphDef| &m.version, - |m: &mut GraphDef| &mut m.version, - )); - fields.push( - ::protobuf::reflect::accessor::make_singular_ptr_field_accessor::< - _, - ::protobuf::types::ProtobufTypeMessage, - >( - "library", - |m: &GraphDef| &m.library, - |m: &mut GraphDef| &mut m.library, - ), - ); - ::protobuf::reflect::MessageDescriptor::new_pb_name::( - "GraphDef", - fields, - file_descriptor_proto(), - ) - }) - } - - fn default_instance() -> &'static GraphDef { - static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; - instance.get(GraphDef::new) - } -} - -impl ::protobuf::Clear for GraphDef { - fn clear(&mut self) { - self.node.clear(); - self.versions.clear(); - self.version = 0; - self.library.clear(); - self.unknown_fields.clear(); - } -} - -impl ::std::fmt::Debug for GraphDef { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for GraphDef { - fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { - ::protobuf::reflect::ReflectValueRef::Message(self) - } -} - -static file_descriptor_proto_data: &'static [u8] = b"\ - \n%tensorflow/core/framework/graph.proto\x12\ntensorflow\x1a(tensorflow/\ - core/framework/node_def.proto\x1a(tensorflow/core/framework/function.pro\ - to\x1a(tensorflow/core/framework/versions.proto\"\xbf\x01\n\x08GraphDef\ - \x12'\n\x04node\x18\x01\x20\x03(\x0b2\x13.tensorflow.NodeDefR\x04node\ - \x122\n\x08versions\x18\x04\x20\x01(\x0b2\x16.tensorflow.VersionDefR\x08\ - versions\x12\x1c\n\x07version\x18\x03\x20\x01(\x05R\x07versionB\x02\x18\ - \x01\x128\n\x07library\x18\x02\x20\x01(\x0b2\x1e.tensorflow.FunctionDefL\ - ibraryR\x07libraryBk\n\x18org.tensorflow.frameworkB\x0bGraphProtosP\x01Z\ - =github.com/tensorflow/tensorflow/tensorflow/go/core/framework\xf8\x01\ - \x01b\x06proto3\ -"; - -static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2< - ::protobuf::descriptor::FileDescriptorProto, -> = ::protobuf::rt::LazyV2::INIT; - -fn parse_descriptor_proto() -> ::protobuf::descriptor::FileDescriptorProto { - ::protobuf::parse_from_bytes(file_descriptor_proto_data).unwrap() -} - -pub fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto { - file_descriptor_proto_lazy.get(|| parse_descriptor_proto()) -} diff --git a/src/protos/meta_graph.rs b/src/protos/meta_graph.rs deleted file mode 100644 index 64832ed118..0000000000 --- a/src/protos/meta_graph.rs +++ /dev/null @@ -1,4199 +0,0 @@ -// This file is generated by rust-protobuf 2.17.0. Do not edit -// @generated - -// https://github.com/rust-lang/rust-clippy/issues/702 -#![allow(unknown_lints)] -#![allow(clippy::all)] - -#![allow(unused_attributes)] -#![rustfmt::skip] - -#![allow(box_pointers)] -#![allow(dead_code)] -#![allow(missing_docs)] -#![allow(non_camel_case_types)] -#![allow(non_snake_case)] -#![allow(non_upper_case_globals)] -#![allow(trivial_casts)] -#![allow(unused_imports)] -#![allow(unused_results)] -//! Generated file from `tensorflow/core/protobuf/meta_graph.proto` - -/// Generated files are compatible only with the same version -/// of protobuf runtime. -// const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_17_0; - -#[derive(PartialEq, Clone, Default)] -pub struct MetaGraphDef { - // message fields - pub meta_info_def: ::protobuf::SingularPtrField, - pub graph_def: ::protobuf::SingularPtrField, - pub saver_def: ::protobuf::SingularPtrField, - pub collection_def: ::std::collections::HashMap<::std::string::String, CollectionDef>, - pub signature_def: ::std::collections::HashMap<::std::string::String, SignatureDef>, - pub asset_file_def: ::protobuf::RepeatedField, - pub object_graph_def: ::protobuf::SingularPtrField, - // special fields - pub unknown_fields: ::protobuf::UnknownFields, - pub cached_size: ::protobuf::CachedSize, -} - -impl<'a> ::std::default::Default for &'a MetaGraphDef { - fn default() -> &'a MetaGraphDef { - ::default_instance() - } -} - -impl MetaGraphDef { - pub fn new() -> MetaGraphDef { - ::std::default::Default::default() - } - - // .tensorflow.MetaGraphDef.MetaInfoDef meta_info_def = 1; - - pub fn get_meta_info_def(&self) -> &MetaGraphDef_MetaInfoDef { - self.meta_info_def.as_ref().unwrap_or_else(|| { - ::default_instance() - }) - } - pub fn clear_meta_info_def(&mut self) { - self.meta_info_def.clear(); - } - - pub fn has_meta_info_def(&self) -> bool { - self.meta_info_def.is_some() - } - - // Param is passed by value, moved - pub fn set_meta_info_def(&mut self, v: MetaGraphDef_MetaInfoDef) { - self.meta_info_def = ::protobuf::SingularPtrField::some(v); - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_meta_info_def(&mut self) -> &mut MetaGraphDef_MetaInfoDef { - if self.meta_info_def.is_none() { - self.meta_info_def.set_default(); - } - self.meta_info_def.as_mut().unwrap() - } - - // Take field - pub fn take_meta_info_def(&mut self) -> MetaGraphDef_MetaInfoDef { - self.meta_info_def - .take() - .unwrap_or_else(|| MetaGraphDef_MetaInfoDef::new()) - } - - // .tensorflow.GraphDef graph_def = 2; - - pub fn get_graph_def(&self) -> &super::graph::GraphDef { - self.graph_def - .as_ref() - .unwrap_or_else(|| ::default_instance()) - } - pub fn clear_graph_def(&mut self) { - self.graph_def.clear(); - } - - pub fn has_graph_def(&self) -> bool { - self.graph_def.is_some() - } - - // Param is passed by value, moved - pub fn set_graph_def(&mut self, v: super::graph::GraphDef) { - self.graph_def = ::protobuf::SingularPtrField::some(v); - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_graph_def(&mut self) -> &mut super::graph::GraphDef { - if self.graph_def.is_none() { - self.graph_def.set_default(); - } - self.graph_def.as_mut().unwrap() - } - - // Take field - pub fn take_graph_def(&mut self) -> super::graph::GraphDef { - self.graph_def - .take() - .unwrap_or_else(|| super::graph::GraphDef::new()) - } - - // .tensorflow.SaverDef saver_def = 3; - - pub fn get_saver_def(&self) -> &super::saver::SaverDef { - self.saver_def - .as_ref() - .unwrap_or_else(|| ::default_instance()) - } - pub fn clear_saver_def(&mut self) { - self.saver_def.clear(); - } - - pub fn has_saver_def(&self) -> bool { - self.saver_def.is_some() - } - - // Param is passed by value, moved - pub fn set_saver_def(&mut self, v: super::saver::SaverDef) { - self.saver_def = ::protobuf::SingularPtrField::some(v); - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_saver_def(&mut self) -> &mut super::saver::SaverDef { - if self.saver_def.is_none() { - self.saver_def.set_default(); - } - self.saver_def.as_mut().unwrap() - } - - // Take field - pub fn take_saver_def(&mut self) -> super::saver::SaverDef { - self.saver_def - .take() - .unwrap_or_else(|| super::saver::SaverDef::new()) - } - - // repeated .tensorflow.MetaGraphDef.CollectionDefEntry collection_def = 4; - - pub fn get_collection_def( - &self, - ) -> &::std::collections::HashMap<::std::string::String, CollectionDef> { - &self.collection_def - } - pub fn clear_collection_def(&mut self) { - self.collection_def.clear(); - } - - // Param is passed by value, moved - pub fn set_collection_def( - &mut self, - v: ::std::collections::HashMap<::std::string::String, CollectionDef>, - ) { - self.collection_def = v; - } - - // Mutable pointer to the field. - pub fn mut_collection_def( - &mut self, - ) -> &mut ::std::collections::HashMap<::std::string::String, CollectionDef> { - &mut self.collection_def - } - - // Take field - pub fn take_collection_def( - &mut self, - ) -> ::std::collections::HashMap<::std::string::String, CollectionDef> { - ::std::mem::replace(&mut self.collection_def, ::std::collections::HashMap::new()) - } - - // repeated .tensorflow.MetaGraphDef.SignatureDefEntry signature_def = 5; - - pub fn get_signature_def( - &self, - ) -> &::std::collections::HashMap<::std::string::String, SignatureDef> { - &self.signature_def - } - pub fn clear_signature_def(&mut self) { - self.signature_def.clear(); - } - - // Param is passed by value, moved - pub fn set_signature_def( - &mut self, - v: ::std::collections::HashMap<::std::string::String, SignatureDef>, - ) { - self.signature_def = v; - } - - // Mutable pointer to the field. - pub fn mut_signature_def( - &mut self, - ) -> &mut ::std::collections::HashMap<::std::string::String, SignatureDef> { - &mut self.signature_def - } - - // Take field - pub fn take_signature_def( - &mut self, - ) -> ::std::collections::HashMap<::std::string::String, SignatureDef> { - ::std::mem::replace(&mut self.signature_def, ::std::collections::HashMap::new()) - } - - // repeated .tensorflow.AssetFileDef asset_file_def = 6; - - pub fn get_asset_file_def(&self) -> &[AssetFileDef] { - &self.asset_file_def - } - pub fn clear_asset_file_def(&mut self) { - self.asset_file_def.clear(); - } - - // Param is passed by value, moved - pub fn set_asset_file_def(&mut self, v: ::protobuf::RepeatedField) { - self.asset_file_def = v; - } - - // Mutable pointer to the field. - pub fn mut_asset_file_def(&mut self) -> &mut ::protobuf::RepeatedField { - &mut self.asset_file_def - } - - // Take field - pub fn take_asset_file_def(&mut self) -> ::protobuf::RepeatedField { - ::std::mem::replace(&mut self.asset_file_def, ::protobuf::RepeatedField::new()) - } - - // .tensorflow.SavedObjectGraph object_graph_def = 7; - - pub fn get_object_graph_def(&self) -> &super::saved_object_graph::SavedObjectGraph { - self.object_graph_def.as_ref().unwrap_or_else(|| { - ::default_instance() - }) - } - pub fn clear_object_graph_def(&mut self) { - self.object_graph_def.clear(); - } - - pub fn has_object_graph_def(&self) -> bool { - self.object_graph_def.is_some() - } - - // Param is passed by value, moved - pub fn set_object_graph_def(&mut self, v: super::saved_object_graph::SavedObjectGraph) { - self.object_graph_def = ::protobuf::SingularPtrField::some(v); - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_object_graph_def(&mut self) -> &mut super::saved_object_graph::SavedObjectGraph { - if self.object_graph_def.is_none() { - self.object_graph_def.set_default(); - } - self.object_graph_def.as_mut().unwrap() - } - - // Take field - pub fn take_object_graph_def(&mut self) -> super::saved_object_graph::SavedObjectGraph { - self.object_graph_def - .take() - .unwrap_or_else(|| super::saved_object_graph::SavedObjectGraph::new()) - } -} - -impl ::protobuf::Message for MetaGraphDef { - fn is_initialized(&self) -> bool { - for v in &self.meta_info_def { - if !v.is_initialized() { - return false; - } - } - for v in &self.graph_def { - if !v.is_initialized() { - return false; - } - } - for v in &self.saver_def { - if !v.is_initialized() { - return false; - } - } - for v in &self.asset_file_def { - if !v.is_initialized() { - return false; - } - } - for v in &self.object_graph_def { - if !v.is_initialized() { - return false; - } - } - true - } - - fn merge_from( - &mut self, - is: &mut ::protobuf::CodedInputStream<'_>, - ) -> ::protobuf::ProtobufResult<()> { - while !is.eof()? { - let (field_number, wire_type) = is.read_tag_unpack()?; - match field_number { - 1 => { - ::protobuf::rt::read_singular_message_into( - wire_type, - is, - &mut self.meta_info_def, - )?; - } - 2 => { - ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.graph_def)?; - } - 3 => { - ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.saver_def)?; - } - 4 => { - ::protobuf::rt::read_map_into::< - ::protobuf::types::ProtobufTypeString, - ::protobuf::types::ProtobufTypeMessage, - >(wire_type, is, &mut self.collection_def)?; - } - 5 => { - ::protobuf::rt::read_map_into::< - ::protobuf::types::ProtobufTypeString, - ::protobuf::types::ProtobufTypeMessage, - >(wire_type, is, &mut self.signature_def)?; - } - 6 => { - ::protobuf::rt::read_repeated_message_into( - wire_type, - is, - &mut self.asset_file_def, - )?; - } - 7 => { - ::protobuf::rt::read_singular_message_into( - wire_type, - is, - &mut self.object_graph_def, - )?; - } - _ => { - ::protobuf::rt::read_unknown_or_skip_group( - field_number, - wire_type, - is, - self.mut_unknown_fields(), - )?; - } - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u32 { - let mut my_size = 0; - if let Some(ref v) = self.meta_info_def.as_ref() { - let len = v.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - } - if let Some(ref v) = self.graph_def.as_ref() { - let len = v.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - } - if let Some(ref v) = self.saver_def.as_ref() { - let len = v.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - } - my_size += ::protobuf::rt::compute_map_size::< - ::protobuf::types::ProtobufTypeString, - ::protobuf::types::ProtobufTypeMessage, - >(4, &self.collection_def); - my_size += ::protobuf::rt::compute_map_size::< - ::protobuf::types::ProtobufTypeString, - ::protobuf::types::ProtobufTypeMessage, - >(5, &self.signature_def); - for value in &self.asset_file_def { - let len = value.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - } - if let Some(ref v) = self.object_graph_def.as_ref() { - let len = v.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - } - my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); - self.cached_size.set(my_size); - my_size - } - - fn write_to_with_cached_sizes( - &self, - os: &mut ::protobuf::CodedOutputStream<'_>, - ) -> ::protobuf::ProtobufResult<()> { - if let Some(ref v) = self.meta_info_def.as_ref() { - os.write_tag(1, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - } - if let Some(ref v) = self.graph_def.as_ref() { - os.write_tag(2, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - } - if let Some(ref v) = self.saver_def.as_ref() { - os.write_tag(3, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - } - ::protobuf::rt::write_map_with_cached_sizes::< - ::protobuf::types::ProtobufTypeString, - ::protobuf::types::ProtobufTypeMessage, - >(4, &self.collection_def, os)?; - ::protobuf::rt::write_map_with_cached_sizes::< - ::protobuf::types::ProtobufTypeString, - ::protobuf::types::ProtobufTypeMessage, - >(5, &self.signature_def, os)?; - for v in &self.asset_file_def { - os.write_tag(6, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - } - if let Some(ref v) = self.object_graph_def.as_ref() { - os.write_tag(7, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - } - os.write_unknown_fields(self.get_unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn get_cached_size(&self) -> u32 { - self.cached_size.get() - } - - fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { - &self.unknown_fields - } - - fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { - &mut self.unknown_fields - } - - fn as_any(&self) -> &dyn (::std::any::Any) { - self as &dyn (::std::any::Any) - } - fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { - self as &mut dyn (::std::any::Any) - } - fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { - self - } - - fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - Self::descriptor_static() - } - - fn new() -> MetaGraphDef { - MetaGraphDef::new() - } - - fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = - ::protobuf::rt::LazyV2::INIT; - descriptor.get(|| { - let mut fields = ::std::vec::Vec::new(); - fields.push( - ::protobuf::reflect::accessor::make_singular_ptr_field_accessor::< - _, - ::protobuf::types::ProtobufTypeMessage, - >( - "meta_info_def", - |m: &MetaGraphDef| &m.meta_info_def, - |m: &mut MetaGraphDef| &mut m.meta_info_def, - ), - ); - fields.push( - ::protobuf::reflect::accessor::make_singular_ptr_field_accessor::< - _, - ::protobuf::types::ProtobufTypeMessage, - >( - "graph_def", - |m: &MetaGraphDef| &m.graph_def, - |m: &mut MetaGraphDef| &mut m.graph_def, - ), - ); - fields.push( - ::protobuf::reflect::accessor::make_singular_ptr_field_accessor::< - _, - ::protobuf::types::ProtobufTypeMessage, - >( - "saver_def", - |m: &MetaGraphDef| &m.saver_def, - |m: &mut MetaGraphDef| &mut m.saver_def, - ), - ); - fields.push(::protobuf::reflect::accessor::make_map_accessor::< - _, - ::protobuf::types::ProtobufTypeString, - ::protobuf::types::ProtobufTypeMessage, - >( - "collection_def", - |m: &MetaGraphDef| &m.collection_def, - |m: &mut MetaGraphDef| &mut m.collection_def, - )); - fields.push(::protobuf::reflect::accessor::make_map_accessor::< - _, - ::protobuf::types::ProtobufTypeString, - ::protobuf::types::ProtobufTypeMessage, - >( - "signature_def", - |m: &MetaGraphDef| &m.signature_def, - |m: &mut MetaGraphDef| &mut m.signature_def, - )); - fields.push( - ::protobuf::reflect::accessor::make_repeated_field_accessor::< - _, - ::protobuf::types::ProtobufTypeMessage, - >( - "asset_file_def", - |m: &MetaGraphDef| &m.asset_file_def, - |m: &mut MetaGraphDef| &mut m.asset_file_def, - ), - ); - fields.push( - ::protobuf::reflect::accessor::make_singular_ptr_field_accessor::< - _, - ::protobuf::types::ProtobufTypeMessage< - super::saved_object_graph::SavedObjectGraph, - >, - >( - "object_graph_def", - |m: &MetaGraphDef| &m.object_graph_def, - |m: &mut MetaGraphDef| &mut m.object_graph_def, - ), - ); - ::protobuf::reflect::MessageDescriptor::new_pb_name::( - "MetaGraphDef", - fields, - file_descriptor_proto(), - ) - }) - } - - fn default_instance() -> &'static MetaGraphDef { - static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; - instance.get(MetaGraphDef::new) - } -} - -impl ::protobuf::Clear for MetaGraphDef { - fn clear(&mut self) { - self.meta_info_def.clear(); - self.graph_def.clear(); - self.saver_def.clear(); - self.collection_def.clear(); - self.signature_def.clear(); - self.asset_file_def.clear(); - self.object_graph_def.clear(); - self.unknown_fields.clear(); - } -} - -impl ::std::fmt::Debug for MetaGraphDef { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for MetaGraphDef { - fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { - ::protobuf::reflect::ReflectValueRef::Message(self) - } -} - -#[derive(PartialEq, Clone, Default)] -pub struct MetaGraphDef_MetaInfoDef { - // message fields - pub meta_graph_version: ::std::string::String, - pub stripped_op_list: ::protobuf::SingularPtrField, - pub any_info: ::protobuf::SingularPtrField<::protobuf::well_known_types::Any>, - pub tags: ::protobuf::RepeatedField<::std::string::String>, - pub tensorflow_version: ::std::string::String, - pub tensorflow_git_version: ::std::string::String, - pub stripped_default_attrs: bool, - // special fields - pub unknown_fields: ::protobuf::UnknownFields, - pub cached_size: ::protobuf::CachedSize, -} - -impl<'a> ::std::default::Default for &'a MetaGraphDef_MetaInfoDef { - fn default() -> &'a MetaGraphDef_MetaInfoDef { - ::default_instance() - } -} - -impl MetaGraphDef_MetaInfoDef { - pub fn new() -> MetaGraphDef_MetaInfoDef { - ::std::default::Default::default() - } - - // string meta_graph_version = 1; - - pub fn get_meta_graph_version(&self) -> &str { - &self.meta_graph_version - } - pub fn clear_meta_graph_version(&mut self) { - self.meta_graph_version.clear(); - } - - // Param is passed by value, moved - pub fn set_meta_graph_version(&mut self, v: ::std::string::String) { - self.meta_graph_version = v; - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_meta_graph_version(&mut self) -> &mut ::std::string::String { - &mut self.meta_graph_version - } - - // Take field - pub fn take_meta_graph_version(&mut self) -> ::std::string::String { - ::std::mem::replace(&mut self.meta_graph_version, ::std::string::String::new()) - } - - // .tensorflow.OpList stripped_op_list = 2; - - pub fn get_stripped_op_list(&self) -> &super::op_def::OpList { - self.stripped_op_list - .as_ref() - .unwrap_or_else(|| ::default_instance()) - } - pub fn clear_stripped_op_list(&mut self) { - self.stripped_op_list.clear(); - } - - pub fn has_stripped_op_list(&self) -> bool { - self.stripped_op_list.is_some() - } - - // Param is passed by value, moved - pub fn set_stripped_op_list(&mut self, v: super::op_def::OpList) { - self.stripped_op_list = ::protobuf::SingularPtrField::some(v); - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_stripped_op_list(&mut self) -> &mut super::op_def::OpList { - if self.stripped_op_list.is_none() { - self.stripped_op_list.set_default(); - } - self.stripped_op_list.as_mut().unwrap() - } - - // Take field - pub fn take_stripped_op_list(&mut self) -> super::op_def::OpList { - self.stripped_op_list - .take() - .unwrap_or_else(|| super::op_def::OpList::new()) - } - - // .google.protobuf.Any any_info = 3; - - pub fn get_any_info(&self) -> &::protobuf::well_known_types::Any { - self.any_info.as_ref().unwrap_or_else(|| { - <::protobuf::well_known_types::Any as ::protobuf::Message>::default_instance() - }) - } - pub fn clear_any_info(&mut self) { - self.any_info.clear(); - } - - pub fn has_any_info(&self) -> bool { - self.any_info.is_some() - } - - // Param is passed by value, moved - pub fn set_any_info(&mut self, v: ::protobuf::well_known_types::Any) { - self.any_info = ::protobuf::SingularPtrField::some(v); - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_any_info(&mut self) -> &mut ::protobuf::well_known_types::Any { - if self.any_info.is_none() { - self.any_info.set_default(); - } - self.any_info.as_mut().unwrap() - } - - // Take field - pub fn take_any_info(&mut self) -> ::protobuf::well_known_types::Any { - self.any_info - .take() - .unwrap_or_else(|| ::protobuf::well_known_types::Any::new()) - } - - // repeated string tags = 4; - - pub fn get_tags(&self) -> &[::std::string::String] { - &self.tags - } - pub fn clear_tags(&mut self) { - self.tags.clear(); - } - - // Param is passed by value, moved - pub fn set_tags(&mut self, v: ::protobuf::RepeatedField<::std::string::String>) { - self.tags = v; - } - - // Mutable pointer to the field. - pub fn mut_tags(&mut self) -> &mut ::protobuf::RepeatedField<::std::string::String> { - &mut self.tags - } - - // Take field - pub fn take_tags(&mut self) -> ::protobuf::RepeatedField<::std::string::String> { - ::std::mem::replace(&mut self.tags, ::protobuf::RepeatedField::new()) - } - - // string tensorflow_version = 5; - - pub fn get_tensorflow_version(&self) -> &str { - &self.tensorflow_version - } - pub fn clear_tensorflow_version(&mut self) { - self.tensorflow_version.clear(); - } - - // Param is passed by value, moved - pub fn set_tensorflow_version(&mut self, v: ::std::string::String) { - self.tensorflow_version = v; - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_tensorflow_version(&mut self) -> &mut ::std::string::String { - &mut self.tensorflow_version - } - - // Take field - pub fn take_tensorflow_version(&mut self) -> ::std::string::String { - ::std::mem::replace(&mut self.tensorflow_version, ::std::string::String::new()) - } - - // string tensorflow_git_version = 6; - - pub fn get_tensorflow_git_version(&self) -> &str { - &self.tensorflow_git_version - } - pub fn clear_tensorflow_git_version(&mut self) { - self.tensorflow_git_version.clear(); - } - - // Param is passed by value, moved - pub fn set_tensorflow_git_version(&mut self, v: ::std::string::String) { - self.tensorflow_git_version = v; - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_tensorflow_git_version(&mut self) -> &mut ::std::string::String { - &mut self.tensorflow_git_version - } - - // Take field - pub fn take_tensorflow_git_version(&mut self) -> ::std::string::String { - ::std::mem::replace( - &mut self.tensorflow_git_version, - ::std::string::String::new(), - ) - } - - // bool stripped_default_attrs = 7; - - pub fn get_stripped_default_attrs(&self) -> bool { - self.stripped_default_attrs - } - pub fn clear_stripped_default_attrs(&mut self) { - self.stripped_default_attrs = false; - } - - // Param is passed by value, moved - pub fn set_stripped_default_attrs(&mut self, v: bool) { - self.stripped_default_attrs = v; - } -} - -impl ::protobuf::Message for MetaGraphDef_MetaInfoDef { - fn is_initialized(&self) -> bool { - for v in &self.stripped_op_list { - if !v.is_initialized() { - return false; - } - } - for v in &self.any_info { - if !v.is_initialized() { - return false; - } - } - true - } - - fn merge_from( - &mut self, - is: &mut ::protobuf::CodedInputStream<'_>, - ) -> ::protobuf::ProtobufResult<()> { - while !is.eof()? { - let (field_number, wire_type) = is.read_tag_unpack()?; - match field_number { - 1 => { - ::protobuf::rt::read_singular_proto3_string_into( - wire_type, - is, - &mut self.meta_graph_version, - )?; - } - 2 => { - ::protobuf::rt::read_singular_message_into( - wire_type, - is, - &mut self.stripped_op_list, - )?; - } - 3 => { - ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.any_info)?; - } - 4 => { - ::protobuf::rt::read_repeated_string_into(wire_type, is, &mut self.tags)?; - } - 5 => { - ::protobuf::rt::read_singular_proto3_string_into( - wire_type, - is, - &mut self.tensorflow_version, - )?; - } - 6 => { - ::protobuf::rt::read_singular_proto3_string_into( - wire_type, - is, - &mut self.tensorflow_git_version, - )?; - } - 7 => { - if wire_type != ::protobuf::wire_format::WireTypeVarint { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type( - wire_type, - )); - } - let tmp = is.read_bool()?; - self.stripped_default_attrs = tmp; - } - _ => { - ::protobuf::rt::read_unknown_or_skip_group( - field_number, - wire_type, - is, - self.mut_unknown_fields(), - )?; - } - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u32 { - let mut my_size = 0; - if !self.meta_graph_version.is_empty() { - my_size += ::protobuf::rt::string_size(1, &self.meta_graph_version); - } - if let Some(ref v) = self.stripped_op_list.as_ref() { - let len = v.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - } - if let Some(ref v) = self.any_info.as_ref() { - let len = v.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - } - for value in &self.tags { - my_size += ::protobuf::rt::string_size(4, &value); - } - if !self.tensorflow_version.is_empty() { - my_size += ::protobuf::rt::string_size(5, &self.tensorflow_version); - } - if !self.tensorflow_git_version.is_empty() { - my_size += ::protobuf::rt::string_size(6, &self.tensorflow_git_version); - } - if self.stripped_default_attrs != false { - my_size += 2; - } - my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); - self.cached_size.set(my_size); - my_size - } - - fn write_to_with_cached_sizes( - &self, - os: &mut ::protobuf::CodedOutputStream<'_>, - ) -> ::protobuf::ProtobufResult<()> { - if !self.meta_graph_version.is_empty() { - os.write_string(1, &self.meta_graph_version)?; - } - if let Some(ref v) = self.stripped_op_list.as_ref() { - os.write_tag(2, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - } - if let Some(ref v) = self.any_info.as_ref() { - os.write_tag(3, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - } - for v in &self.tags { - os.write_string(4, &v)?; - } - if !self.tensorflow_version.is_empty() { - os.write_string(5, &self.tensorflow_version)?; - } - if !self.tensorflow_git_version.is_empty() { - os.write_string(6, &self.tensorflow_git_version)?; - } - if self.stripped_default_attrs != false { - os.write_bool(7, self.stripped_default_attrs)?; - } - os.write_unknown_fields(self.get_unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn get_cached_size(&self) -> u32 { - self.cached_size.get() - } - - fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { - &self.unknown_fields - } - - fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { - &mut self.unknown_fields - } - - fn as_any(&self) -> &dyn (::std::any::Any) { - self as &dyn (::std::any::Any) - } - fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { - self as &mut dyn (::std::any::Any) - } - fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { - self - } - - fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - Self::descriptor_static() - } - - fn new() -> MetaGraphDef_MetaInfoDef { - MetaGraphDef_MetaInfoDef::new() - } - - fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = - ::protobuf::rt::LazyV2::INIT; - descriptor.get(|| { - let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::< - _, - ::protobuf::types::ProtobufTypeString, - >( - "meta_graph_version", - |m: &MetaGraphDef_MetaInfoDef| &m.meta_graph_version, - |m: &mut MetaGraphDef_MetaInfoDef| &mut m.meta_graph_version, - )); - fields.push( - ::protobuf::reflect::accessor::make_singular_ptr_field_accessor::< - _, - ::protobuf::types::ProtobufTypeMessage, - >( - "stripped_op_list", - |m: &MetaGraphDef_MetaInfoDef| &m.stripped_op_list, - |m: &mut MetaGraphDef_MetaInfoDef| &mut m.stripped_op_list, - ), - ); - fields.push( - ::protobuf::reflect::accessor::make_singular_ptr_field_accessor::< - _, - ::protobuf::types::ProtobufTypeMessage<::protobuf::well_known_types::Any>, - >( - "any_info", - |m: &MetaGraphDef_MetaInfoDef| &m.any_info, - |m: &mut MetaGraphDef_MetaInfoDef| &mut m.any_info, - ), - ); - fields.push( - ::protobuf::reflect::accessor::make_repeated_field_accessor::< - _, - ::protobuf::types::ProtobufTypeString, - >( - "tags", - |m: &MetaGraphDef_MetaInfoDef| &m.tags, - |m: &mut MetaGraphDef_MetaInfoDef| &mut m.tags, - ), - ); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::< - _, - ::protobuf::types::ProtobufTypeString, - >( - "tensorflow_version", - |m: &MetaGraphDef_MetaInfoDef| &m.tensorflow_version, - |m: &mut MetaGraphDef_MetaInfoDef| &mut m.tensorflow_version, - )); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::< - _, - ::protobuf::types::ProtobufTypeString, - >( - "tensorflow_git_version", - |m: &MetaGraphDef_MetaInfoDef| &m.tensorflow_git_version, - |m: &mut MetaGraphDef_MetaInfoDef| &mut m.tensorflow_git_version, - )); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::< - _, - ::protobuf::types::ProtobufTypeBool, - >( - "stripped_default_attrs", - |m: &MetaGraphDef_MetaInfoDef| &m.stripped_default_attrs, - |m: &mut MetaGraphDef_MetaInfoDef| &mut m.stripped_default_attrs, - )); - ::protobuf::reflect::MessageDescriptor::new_pb_name::( - "MetaGraphDef.MetaInfoDef", - fields, - file_descriptor_proto(), - ) - }) - } - - fn default_instance() -> &'static MetaGraphDef_MetaInfoDef { - static instance: ::protobuf::rt::LazyV2 = - ::protobuf::rt::LazyV2::INIT; - instance.get(MetaGraphDef_MetaInfoDef::new) - } -} - -impl ::protobuf::Clear for MetaGraphDef_MetaInfoDef { - fn clear(&mut self) { - self.meta_graph_version.clear(); - self.stripped_op_list.clear(); - self.any_info.clear(); - self.tags.clear(); - self.tensorflow_version.clear(); - self.tensorflow_git_version.clear(); - self.stripped_default_attrs = false; - self.unknown_fields.clear(); - } -} - -impl ::std::fmt::Debug for MetaGraphDef_MetaInfoDef { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for MetaGraphDef_MetaInfoDef { - fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { - ::protobuf::reflect::ReflectValueRef::Message(self) - } -} - -#[derive(PartialEq, Clone, Default)] -pub struct CollectionDef { - // message oneof groups - pub kind: ::std::option::Option, - // special fields - pub unknown_fields: ::protobuf::UnknownFields, - pub cached_size: ::protobuf::CachedSize, -} - -impl<'a> ::std::default::Default for &'a CollectionDef { - fn default() -> &'a CollectionDef { - ::default_instance() - } -} - -#[derive(Clone, PartialEq, Debug)] -pub enum CollectionDef_oneof_kind { - node_list(CollectionDef_NodeList), - bytes_list(CollectionDef_BytesList), - int64_list(CollectionDef_Int64List), - float_list(CollectionDef_FloatList), - any_list(CollectionDef_AnyList), -} - -impl CollectionDef { - pub fn new() -> CollectionDef { - ::std::default::Default::default() - } - - // .tensorflow.CollectionDef.NodeList node_list = 1; - - pub fn get_node_list(&self) -> &CollectionDef_NodeList { - match self.kind { - ::std::option::Option::Some(CollectionDef_oneof_kind::node_list(ref v)) => v, - _ => ::default_instance(), - } - } - pub fn clear_node_list(&mut self) { - self.kind = ::std::option::Option::None; - } - - pub fn has_node_list(&self) -> bool { - match self.kind { - ::std::option::Option::Some(CollectionDef_oneof_kind::node_list(..)) => true, - _ => false, - } - } - - // Param is passed by value, moved - pub fn set_node_list(&mut self, v: CollectionDef_NodeList) { - self.kind = ::std::option::Option::Some(CollectionDef_oneof_kind::node_list(v)) - } - - // Mutable pointer to the field. - pub fn mut_node_list(&mut self) -> &mut CollectionDef_NodeList { - if let ::std::option::Option::Some(CollectionDef_oneof_kind::node_list(_)) = self.kind { - } else { - self.kind = ::std::option::Option::Some(CollectionDef_oneof_kind::node_list( - CollectionDef_NodeList::new(), - )); - } - match self.kind { - ::std::option::Option::Some(CollectionDef_oneof_kind::node_list(ref mut v)) => v, - _ => panic!(), - } - } - - // Take field - pub fn take_node_list(&mut self) -> CollectionDef_NodeList { - if self.has_node_list() { - match self.kind.take() { - ::std::option::Option::Some(CollectionDef_oneof_kind::node_list(v)) => v, - _ => panic!(), - } - } else { - CollectionDef_NodeList::new() - } - } - - // .tensorflow.CollectionDef.BytesList bytes_list = 2; - - pub fn get_bytes_list(&self) -> &CollectionDef_BytesList { - match self.kind { - ::std::option::Option::Some(CollectionDef_oneof_kind::bytes_list(ref v)) => v, - _ => ::default_instance(), - } - } - pub fn clear_bytes_list(&mut self) { - self.kind = ::std::option::Option::None; - } - - pub fn has_bytes_list(&self) -> bool { - match self.kind { - ::std::option::Option::Some(CollectionDef_oneof_kind::bytes_list(..)) => true, - _ => false, - } - } - - // Param is passed by value, moved - pub fn set_bytes_list(&mut self, v: CollectionDef_BytesList) { - self.kind = ::std::option::Option::Some(CollectionDef_oneof_kind::bytes_list(v)) - } - - // Mutable pointer to the field. - pub fn mut_bytes_list(&mut self) -> &mut CollectionDef_BytesList { - if let ::std::option::Option::Some(CollectionDef_oneof_kind::bytes_list(_)) = self.kind { - } else { - self.kind = ::std::option::Option::Some(CollectionDef_oneof_kind::bytes_list( - CollectionDef_BytesList::new(), - )); - } - match self.kind { - ::std::option::Option::Some(CollectionDef_oneof_kind::bytes_list(ref mut v)) => v, - _ => panic!(), - } - } - - // Take field - pub fn take_bytes_list(&mut self) -> CollectionDef_BytesList { - if self.has_bytes_list() { - match self.kind.take() { - ::std::option::Option::Some(CollectionDef_oneof_kind::bytes_list(v)) => v, - _ => panic!(), - } - } else { - CollectionDef_BytesList::new() - } - } - - // .tensorflow.CollectionDef.Int64List int64_list = 3; - - pub fn get_int64_list(&self) -> &CollectionDef_Int64List { - match self.kind { - ::std::option::Option::Some(CollectionDef_oneof_kind::int64_list(ref v)) => v, - _ => ::default_instance(), - } - } - pub fn clear_int64_list(&mut self) { - self.kind = ::std::option::Option::None; - } - - pub fn has_int64_list(&self) -> bool { - match self.kind { - ::std::option::Option::Some(CollectionDef_oneof_kind::int64_list(..)) => true, - _ => false, - } - } - - // Param is passed by value, moved - pub fn set_int64_list(&mut self, v: CollectionDef_Int64List) { - self.kind = ::std::option::Option::Some(CollectionDef_oneof_kind::int64_list(v)) - } - - // Mutable pointer to the field. - pub fn mut_int64_list(&mut self) -> &mut CollectionDef_Int64List { - if let ::std::option::Option::Some(CollectionDef_oneof_kind::int64_list(_)) = self.kind { - } else { - self.kind = ::std::option::Option::Some(CollectionDef_oneof_kind::int64_list( - CollectionDef_Int64List::new(), - )); - } - match self.kind { - ::std::option::Option::Some(CollectionDef_oneof_kind::int64_list(ref mut v)) => v, - _ => panic!(), - } - } - - // Take field - pub fn take_int64_list(&mut self) -> CollectionDef_Int64List { - if self.has_int64_list() { - match self.kind.take() { - ::std::option::Option::Some(CollectionDef_oneof_kind::int64_list(v)) => v, - _ => panic!(), - } - } else { - CollectionDef_Int64List::new() - } - } - - // .tensorflow.CollectionDef.FloatList float_list = 4; - - pub fn get_float_list(&self) -> &CollectionDef_FloatList { - match self.kind { - ::std::option::Option::Some(CollectionDef_oneof_kind::float_list(ref v)) => v, - _ => ::default_instance(), - } - } - pub fn clear_float_list(&mut self) { - self.kind = ::std::option::Option::None; - } - - pub fn has_float_list(&self) -> bool { - match self.kind { - ::std::option::Option::Some(CollectionDef_oneof_kind::float_list(..)) => true, - _ => false, - } - } - - // Param is passed by value, moved - pub fn set_float_list(&mut self, v: CollectionDef_FloatList) { - self.kind = ::std::option::Option::Some(CollectionDef_oneof_kind::float_list(v)) - } - - // Mutable pointer to the field. - pub fn mut_float_list(&mut self) -> &mut CollectionDef_FloatList { - if let ::std::option::Option::Some(CollectionDef_oneof_kind::float_list(_)) = self.kind { - } else { - self.kind = ::std::option::Option::Some(CollectionDef_oneof_kind::float_list( - CollectionDef_FloatList::new(), - )); - } - match self.kind { - ::std::option::Option::Some(CollectionDef_oneof_kind::float_list(ref mut v)) => v, - _ => panic!(), - } - } - - // Take field - pub fn take_float_list(&mut self) -> CollectionDef_FloatList { - if self.has_float_list() { - match self.kind.take() { - ::std::option::Option::Some(CollectionDef_oneof_kind::float_list(v)) => v, - _ => panic!(), - } - } else { - CollectionDef_FloatList::new() - } - } - - // .tensorflow.CollectionDef.AnyList any_list = 5; - - pub fn get_any_list(&self) -> &CollectionDef_AnyList { - match self.kind { - ::std::option::Option::Some(CollectionDef_oneof_kind::any_list(ref v)) => v, - _ => ::default_instance(), - } - } - pub fn clear_any_list(&mut self) { - self.kind = ::std::option::Option::None; - } - - pub fn has_any_list(&self) -> bool { - match self.kind { - ::std::option::Option::Some(CollectionDef_oneof_kind::any_list(..)) => true, - _ => false, - } - } - - // Param is passed by value, moved - pub fn set_any_list(&mut self, v: CollectionDef_AnyList) { - self.kind = ::std::option::Option::Some(CollectionDef_oneof_kind::any_list(v)) - } - - // Mutable pointer to the field. - pub fn mut_any_list(&mut self) -> &mut CollectionDef_AnyList { - if let ::std::option::Option::Some(CollectionDef_oneof_kind::any_list(_)) = self.kind { - } else { - self.kind = ::std::option::Option::Some(CollectionDef_oneof_kind::any_list( - CollectionDef_AnyList::new(), - )); - } - match self.kind { - ::std::option::Option::Some(CollectionDef_oneof_kind::any_list(ref mut v)) => v, - _ => panic!(), - } - } - - // Take field - pub fn take_any_list(&mut self) -> CollectionDef_AnyList { - if self.has_any_list() { - match self.kind.take() { - ::std::option::Option::Some(CollectionDef_oneof_kind::any_list(v)) => v, - _ => panic!(), - } - } else { - CollectionDef_AnyList::new() - } - } -} - -impl ::protobuf::Message for CollectionDef { - fn is_initialized(&self) -> bool { - if let Some(CollectionDef_oneof_kind::node_list(ref v)) = self.kind { - if !v.is_initialized() { - return false; - } - } - if let Some(CollectionDef_oneof_kind::bytes_list(ref v)) = self.kind { - if !v.is_initialized() { - return false; - } - } - if let Some(CollectionDef_oneof_kind::int64_list(ref v)) = self.kind { - if !v.is_initialized() { - return false; - } - } - if let Some(CollectionDef_oneof_kind::float_list(ref v)) = self.kind { - if !v.is_initialized() { - return false; - } - } - if let Some(CollectionDef_oneof_kind::any_list(ref v)) = self.kind { - if !v.is_initialized() { - return false; - } - } - true - } - - fn merge_from( - &mut self, - is: &mut ::protobuf::CodedInputStream<'_>, - ) -> ::protobuf::ProtobufResult<()> { - while !is.eof()? { - let (field_number, wire_type) = is.read_tag_unpack()?; - match field_number { - 1 => { - if wire_type != ::protobuf::wire_format::WireTypeLengthDelimited { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type( - wire_type, - )); - } - self.kind = ::std::option::Option::Some(CollectionDef_oneof_kind::node_list( - is.read_message()?, - )); - } - 2 => { - if wire_type != ::protobuf::wire_format::WireTypeLengthDelimited { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type( - wire_type, - )); - } - self.kind = ::std::option::Option::Some(CollectionDef_oneof_kind::bytes_list( - is.read_message()?, - )); - } - 3 => { - if wire_type != ::protobuf::wire_format::WireTypeLengthDelimited { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type( - wire_type, - )); - } - self.kind = ::std::option::Option::Some(CollectionDef_oneof_kind::int64_list( - is.read_message()?, - )); - } - 4 => { - if wire_type != ::protobuf::wire_format::WireTypeLengthDelimited { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type( - wire_type, - )); - } - self.kind = ::std::option::Option::Some(CollectionDef_oneof_kind::float_list( - is.read_message()?, - )); - } - 5 => { - if wire_type != ::protobuf::wire_format::WireTypeLengthDelimited { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type( - wire_type, - )); - } - self.kind = ::std::option::Option::Some(CollectionDef_oneof_kind::any_list( - is.read_message()?, - )); - } - _ => { - ::protobuf::rt::read_unknown_or_skip_group( - field_number, - wire_type, - is, - self.mut_unknown_fields(), - )?; - } - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u32 { - let mut my_size = 0; - if let ::std::option::Option::Some(ref v) = self.kind { - match v { - &CollectionDef_oneof_kind::node_list(ref v) => { - let len = v.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - } - &CollectionDef_oneof_kind::bytes_list(ref v) => { - let len = v.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - } - &CollectionDef_oneof_kind::int64_list(ref v) => { - let len = v.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - } - &CollectionDef_oneof_kind::float_list(ref v) => { - let len = v.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - } - &CollectionDef_oneof_kind::any_list(ref v) => { - let len = v.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - } - }; - } - my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); - self.cached_size.set(my_size); - my_size - } - - fn write_to_with_cached_sizes( - &self, - os: &mut ::protobuf::CodedOutputStream<'_>, - ) -> ::protobuf::ProtobufResult<()> { - if let ::std::option::Option::Some(ref v) = self.kind { - match v { - &CollectionDef_oneof_kind::node_list(ref v) => { - os.write_tag(1, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - } - &CollectionDef_oneof_kind::bytes_list(ref v) => { - os.write_tag(2, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - } - &CollectionDef_oneof_kind::int64_list(ref v) => { - os.write_tag(3, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - } - &CollectionDef_oneof_kind::float_list(ref v) => { - os.write_tag(4, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - } - &CollectionDef_oneof_kind::any_list(ref v) => { - os.write_tag(5, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - } - }; - } - os.write_unknown_fields(self.get_unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn get_cached_size(&self) -> u32 { - self.cached_size.get() - } - - fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { - &self.unknown_fields - } - - fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { - &mut self.unknown_fields - } - - fn as_any(&self) -> &dyn (::std::any::Any) { - self as &dyn (::std::any::Any) - } - fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { - self as &mut dyn (::std::any::Any) - } - fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { - self - } - - fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - Self::descriptor_static() - } - - fn new() -> CollectionDef { - CollectionDef::new() - } - - fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = - ::protobuf::rt::LazyV2::INIT; - descriptor.get(|| { - let mut fields = ::std::vec::Vec::new(); - fields.push( - ::protobuf::reflect::accessor::make_singular_message_accessor::< - _, - CollectionDef_NodeList, - >( - "node_list", - CollectionDef::has_node_list, - CollectionDef::get_node_list, - ), - ); - fields.push( - ::protobuf::reflect::accessor::make_singular_message_accessor::< - _, - CollectionDef_BytesList, - >( - "bytes_list", - CollectionDef::has_bytes_list, - CollectionDef::get_bytes_list, - ), - ); - fields.push( - ::protobuf::reflect::accessor::make_singular_message_accessor::< - _, - CollectionDef_Int64List, - >( - "int64_list", - CollectionDef::has_int64_list, - CollectionDef::get_int64_list, - ), - ); - fields.push( - ::protobuf::reflect::accessor::make_singular_message_accessor::< - _, - CollectionDef_FloatList, - >( - "float_list", - CollectionDef::has_float_list, - CollectionDef::get_float_list, - ), - ); - fields.push( - ::protobuf::reflect::accessor::make_singular_message_accessor::< - _, - CollectionDef_AnyList, - >( - "any_list", - CollectionDef::has_any_list, - CollectionDef::get_any_list, - ), - ); - ::protobuf::reflect::MessageDescriptor::new_pb_name::( - "CollectionDef", - fields, - file_descriptor_proto(), - ) - }) - } - - fn default_instance() -> &'static CollectionDef { - static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; - instance.get(CollectionDef::new) - } -} - -impl ::protobuf::Clear for CollectionDef { - fn clear(&mut self) { - self.kind = ::std::option::Option::None; - self.kind = ::std::option::Option::None; - self.kind = ::std::option::Option::None; - self.kind = ::std::option::Option::None; - self.kind = ::std::option::Option::None; - self.unknown_fields.clear(); - } -} - -impl ::std::fmt::Debug for CollectionDef { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for CollectionDef { - fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { - ::protobuf::reflect::ReflectValueRef::Message(self) - } -} - -#[derive(PartialEq, Clone, Default)] -pub struct CollectionDef_NodeList { - // message fields - pub value: ::protobuf::RepeatedField<::std::string::String>, - // special fields - pub unknown_fields: ::protobuf::UnknownFields, - pub cached_size: ::protobuf::CachedSize, -} - -impl<'a> ::std::default::Default for &'a CollectionDef_NodeList { - fn default() -> &'a CollectionDef_NodeList { - ::default_instance() - } -} - -impl CollectionDef_NodeList { - pub fn new() -> CollectionDef_NodeList { - ::std::default::Default::default() - } - - // repeated string value = 1; - - pub fn get_value(&self) -> &[::std::string::String] { - &self.value - } - pub fn clear_value(&mut self) { - self.value.clear(); - } - - // Param is passed by value, moved - pub fn set_value(&mut self, v: ::protobuf::RepeatedField<::std::string::String>) { - self.value = v; - } - - // Mutable pointer to the field. - pub fn mut_value(&mut self) -> &mut ::protobuf::RepeatedField<::std::string::String> { - &mut self.value - } - - // Take field - pub fn take_value(&mut self) -> ::protobuf::RepeatedField<::std::string::String> { - ::std::mem::replace(&mut self.value, ::protobuf::RepeatedField::new()) - } -} - -impl ::protobuf::Message for CollectionDef_NodeList { - fn is_initialized(&self) -> bool { - true - } - - fn merge_from( - &mut self, - is: &mut ::protobuf::CodedInputStream<'_>, - ) -> ::protobuf::ProtobufResult<()> { - while !is.eof()? { - let (field_number, wire_type) = is.read_tag_unpack()?; - match field_number { - 1 => { - ::protobuf::rt::read_repeated_string_into(wire_type, is, &mut self.value)?; - } - _ => { - ::protobuf::rt::read_unknown_or_skip_group( - field_number, - wire_type, - is, - self.mut_unknown_fields(), - )?; - } - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u32 { - let mut my_size = 0; - for value in &self.value { - my_size += ::protobuf::rt::string_size(1, &value); - } - my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); - self.cached_size.set(my_size); - my_size - } - - fn write_to_with_cached_sizes( - &self, - os: &mut ::protobuf::CodedOutputStream<'_>, - ) -> ::protobuf::ProtobufResult<()> { - for v in &self.value { - os.write_string(1, &v)?; - } - os.write_unknown_fields(self.get_unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn get_cached_size(&self) -> u32 { - self.cached_size.get() - } - - fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { - &self.unknown_fields - } - - fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { - &mut self.unknown_fields - } - - fn as_any(&self) -> &dyn (::std::any::Any) { - self as &dyn (::std::any::Any) - } - fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { - self as &mut dyn (::std::any::Any) - } - fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { - self - } - - fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - Self::descriptor_static() - } - - fn new() -> CollectionDef_NodeList { - CollectionDef_NodeList::new() - } - - fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = - ::protobuf::rt::LazyV2::INIT; - descriptor.get(|| { - let mut fields = ::std::vec::Vec::new(); - fields.push( - ::protobuf::reflect::accessor::make_repeated_field_accessor::< - _, - ::protobuf::types::ProtobufTypeString, - >( - "value", - |m: &CollectionDef_NodeList| &m.value, - |m: &mut CollectionDef_NodeList| &mut m.value, - ), - ); - ::protobuf::reflect::MessageDescriptor::new_pb_name::( - "CollectionDef.NodeList", - fields, - file_descriptor_proto(), - ) - }) - } - - fn default_instance() -> &'static CollectionDef_NodeList { - static instance: ::protobuf::rt::LazyV2 = - ::protobuf::rt::LazyV2::INIT; - instance.get(CollectionDef_NodeList::new) - } -} - -impl ::protobuf::Clear for CollectionDef_NodeList { - fn clear(&mut self) { - self.value.clear(); - self.unknown_fields.clear(); - } -} - -impl ::std::fmt::Debug for CollectionDef_NodeList { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for CollectionDef_NodeList { - fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { - ::protobuf::reflect::ReflectValueRef::Message(self) - } -} - -#[derive(PartialEq, Clone, Default)] -pub struct CollectionDef_BytesList { - // message fields - pub value: ::protobuf::RepeatedField<::std::vec::Vec>, - // special fields - pub unknown_fields: ::protobuf::UnknownFields, - pub cached_size: ::protobuf::CachedSize, -} - -impl<'a> ::std::default::Default for &'a CollectionDef_BytesList { - fn default() -> &'a CollectionDef_BytesList { - ::default_instance() - } -} - -impl CollectionDef_BytesList { - pub fn new() -> CollectionDef_BytesList { - ::std::default::Default::default() - } - - // repeated bytes value = 1; - - pub fn get_value(&self) -> &[::std::vec::Vec] { - &self.value - } - pub fn clear_value(&mut self) { - self.value.clear(); - } - - // Param is passed by value, moved - pub fn set_value(&mut self, v: ::protobuf::RepeatedField<::std::vec::Vec>) { - self.value = v; - } - - // Mutable pointer to the field. - pub fn mut_value(&mut self) -> &mut ::protobuf::RepeatedField<::std::vec::Vec> { - &mut self.value - } - - // Take field - pub fn take_value(&mut self) -> ::protobuf::RepeatedField<::std::vec::Vec> { - ::std::mem::replace(&mut self.value, ::protobuf::RepeatedField::new()) - } -} - -impl ::protobuf::Message for CollectionDef_BytesList { - fn is_initialized(&self) -> bool { - true - } - - fn merge_from( - &mut self, - is: &mut ::protobuf::CodedInputStream<'_>, - ) -> ::protobuf::ProtobufResult<()> { - while !is.eof()? { - let (field_number, wire_type) = is.read_tag_unpack()?; - match field_number { - 1 => { - ::protobuf::rt::read_repeated_bytes_into(wire_type, is, &mut self.value)?; - } - _ => { - ::protobuf::rt::read_unknown_or_skip_group( - field_number, - wire_type, - is, - self.mut_unknown_fields(), - )?; - } - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u32 { - let mut my_size = 0; - for value in &self.value { - my_size += ::protobuf::rt::bytes_size(1, &value); - } - my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); - self.cached_size.set(my_size); - my_size - } - - fn write_to_with_cached_sizes( - &self, - os: &mut ::protobuf::CodedOutputStream<'_>, - ) -> ::protobuf::ProtobufResult<()> { - for v in &self.value { - os.write_bytes(1, &v)?; - } - os.write_unknown_fields(self.get_unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn get_cached_size(&self) -> u32 { - self.cached_size.get() - } - - fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { - &self.unknown_fields - } - - fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { - &mut self.unknown_fields - } - - fn as_any(&self) -> &dyn (::std::any::Any) { - self as &dyn (::std::any::Any) - } - fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { - self as &mut dyn (::std::any::Any) - } - fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { - self - } - - fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - Self::descriptor_static() - } - - fn new() -> CollectionDef_BytesList { - CollectionDef_BytesList::new() - } - - fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = - ::protobuf::rt::LazyV2::INIT; - descriptor.get(|| { - let mut fields = ::std::vec::Vec::new(); - fields.push( - ::protobuf::reflect::accessor::make_repeated_field_accessor::< - _, - ::protobuf::types::ProtobufTypeBytes, - >( - "value", - |m: &CollectionDef_BytesList| &m.value, - |m: &mut CollectionDef_BytesList| &mut m.value, - ), - ); - ::protobuf::reflect::MessageDescriptor::new_pb_name::( - "CollectionDef.BytesList", - fields, - file_descriptor_proto(), - ) - }) - } - - fn default_instance() -> &'static CollectionDef_BytesList { - static instance: ::protobuf::rt::LazyV2 = - ::protobuf::rt::LazyV2::INIT; - instance.get(CollectionDef_BytesList::new) - } -} - -impl ::protobuf::Clear for CollectionDef_BytesList { - fn clear(&mut self) { - self.value.clear(); - self.unknown_fields.clear(); - } -} - -impl ::std::fmt::Debug for CollectionDef_BytesList { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for CollectionDef_BytesList { - fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { - ::protobuf::reflect::ReflectValueRef::Message(self) - } -} - -#[derive(PartialEq, Clone, Default)] -pub struct CollectionDef_Int64List { - // message fields - pub value: ::std::vec::Vec, - // special fields - pub unknown_fields: ::protobuf::UnknownFields, - pub cached_size: ::protobuf::CachedSize, -} - -impl<'a> ::std::default::Default for &'a CollectionDef_Int64List { - fn default() -> &'a CollectionDef_Int64List { - ::default_instance() - } -} - -impl CollectionDef_Int64List { - pub fn new() -> CollectionDef_Int64List { - ::std::default::Default::default() - } - - // repeated int64 value = 1; - - pub fn get_value(&self) -> &[i64] { - &self.value - } - pub fn clear_value(&mut self) { - self.value.clear(); - } - - // Param is passed by value, moved - pub fn set_value(&mut self, v: ::std::vec::Vec) { - self.value = v; - } - - // Mutable pointer to the field. - pub fn mut_value(&mut self) -> &mut ::std::vec::Vec { - &mut self.value - } - - // Take field - pub fn take_value(&mut self) -> ::std::vec::Vec { - ::std::mem::replace(&mut self.value, ::std::vec::Vec::new()) - } -} - -impl ::protobuf::Message for CollectionDef_Int64List { - fn is_initialized(&self) -> bool { - true - } - - fn merge_from( - &mut self, - is: &mut ::protobuf::CodedInputStream<'_>, - ) -> ::protobuf::ProtobufResult<()> { - while !is.eof()? { - let (field_number, wire_type) = is.read_tag_unpack()?; - match field_number { - 1 => { - ::protobuf::rt::read_repeated_int64_into(wire_type, is, &mut self.value)?; - } - _ => { - ::protobuf::rt::read_unknown_or_skip_group( - field_number, - wire_type, - is, - self.mut_unknown_fields(), - )?; - } - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u32 { - let mut my_size = 0; - if !self.value.is_empty() { - my_size += ::protobuf::rt::vec_packed_varint_size(1, &self.value); - } - my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); - self.cached_size.set(my_size); - my_size - } - - fn write_to_with_cached_sizes( - &self, - os: &mut ::protobuf::CodedOutputStream<'_>, - ) -> ::protobuf::ProtobufResult<()> { - if !self.value.is_empty() { - os.write_tag(1, ::protobuf::wire_format::WireTypeLengthDelimited)?; - // TODO: Data size is computed again, it should be cached - os.write_raw_varint32(::protobuf::rt::vec_packed_varint_data_size(&self.value))?; - for v in &self.value { - os.write_int64_no_tag(*v)?; - } - } - os.write_unknown_fields(self.get_unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn get_cached_size(&self) -> u32 { - self.cached_size.get() - } - - fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { - &self.unknown_fields - } - - fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { - &mut self.unknown_fields - } - - fn as_any(&self) -> &dyn (::std::any::Any) { - self as &dyn (::std::any::Any) - } - fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { - self as &mut dyn (::std::any::Any) - } - fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { - self - } - - fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - Self::descriptor_static() - } - - fn new() -> CollectionDef_Int64List { - CollectionDef_Int64List::new() - } - - fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = - ::protobuf::rt::LazyV2::INIT; - descriptor.get(|| { - let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_vec_accessor::< - _, - ::protobuf::types::ProtobufTypeInt64, - >( - "value", - |m: &CollectionDef_Int64List| &m.value, - |m: &mut CollectionDef_Int64List| &mut m.value, - )); - ::protobuf::reflect::MessageDescriptor::new_pb_name::( - "CollectionDef.Int64List", - fields, - file_descriptor_proto(), - ) - }) - } - - fn default_instance() -> &'static CollectionDef_Int64List { - static instance: ::protobuf::rt::LazyV2 = - ::protobuf::rt::LazyV2::INIT; - instance.get(CollectionDef_Int64List::new) - } -} - -impl ::protobuf::Clear for CollectionDef_Int64List { - fn clear(&mut self) { - self.value.clear(); - self.unknown_fields.clear(); - } -} - -impl ::std::fmt::Debug for CollectionDef_Int64List { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for CollectionDef_Int64List { - fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { - ::protobuf::reflect::ReflectValueRef::Message(self) - } -} - -#[derive(PartialEq, Clone, Default)] -pub struct CollectionDef_FloatList { - // message fields - pub value: ::std::vec::Vec, - // special fields - pub unknown_fields: ::protobuf::UnknownFields, - pub cached_size: ::protobuf::CachedSize, -} - -impl<'a> ::std::default::Default for &'a CollectionDef_FloatList { - fn default() -> &'a CollectionDef_FloatList { - ::default_instance() - } -} - -impl CollectionDef_FloatList { - pub fn new() -> CollectionDef_FloatList { - ::std::default::Default::default() - } - - // repeated float value = 1; - - pub fn get_value(&self) -> &[f32] { - &self.value - } - pub fn clear_value(&mut self) { - self.value.clear(); - } - - // Param is passed by value, moved - pub fn set_value(&mut self, v: ::std::vec::Vec) { - self.value = v; - } - - // Mutable pointer to the field. - pub fn mut_value(&mut self) -> &mut ::std::vec::Vec { - &mut self.value - } - - // Take field - pub fn take_value(&mut self) -> ::std::vec::Vec { - ::std::mem::replace(&mut self.value, ::std::vec::Vec::new()) - } -} - -impl ::protobuf::Message for CollectionDef_FloatList { - fn is_initialized(&self) -> bool { - true - } - - fn merge_from( - &mut self, - is: &mut ::protobuf::CodedInputStream<'_>, - ) -> ::protobuf::ProtobufResult<()> { - while !is.eof()? { - let (field_number, wire_type) = is.read_tag_unpack()?; - match field_number { - 1 => { - ::protobuf::rt::read_repeated_float_into(wire_type, is, &mut self.value)?; - } - _ => { - ::protobuf::rt::read_unknown_or_skip_group( - field_number, - wire_type, - is, - self.mut_unknown_fields(), - )?; - } - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u32 { - let mut my_size = 0; - if !self.value.is_empty() { - my_size += 1 - + ::protobuf::rt::compute_raw_varint32_size((self.value.len() * 4) as u32) - + (self.value.len() * 4) as u32; - } - my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); - self.cached_size.set(my_size); - my_size - } - - fn write_to_with_cached_sizes( - &self, - os: &mut ::protobuf::CodedOutputStream<'_>, - ) -> ::protobuf::ProtobufResult<()> { - if !self.value.is_empty() { - os.write_tag(1, ::protobuf::wire_format::WireTypeLengthDelimited)?; - // TODO: Data size is computed again, it should be cached - os.write_raw_varint32((self.value.len() * 4) as u32)?; - for v in &self.value { - os.write_float_no_tag(*v)?; - } - } - os.write_unknown_fields(self.get_unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn get_cached_size(&self) -> u32 { - self.cached_size.get() - } - - fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { - &self.unknown_fields - } - - fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { - &mut self.unknown_fields - } - - fn as_any(&self) -> &dyn (::std::any::Any) { - self as &dyn (::std::any::Any) - } - fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { - self as &mut dyn (::std::any::Any) - } - fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { - self - } - - fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - Self::descriptor_static() - } - - fn new() -> CollectionDef_FloatList { - CollectionDef_FloatList::new() - } - - fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = - ::protobuf::rt::LazyV2::INIT; - descriptor.get(|| { - let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_vec_accessor::< - _, - ::protobuf::types::ProtobufTypeFloat, - >( - "value", - |m: &CollectionDef_FloatList| &m.value, - |m: &mut CollectionDef_FloatList| &mut m.value, - )); - ::protobuf::reflect::MessageDescriptor::new_pb_name::( - "CollectionDef.FloatList", - fields, - file_descriptor_proto(), - ) - }) - } - - fn default_instance() -> &'static CollectionDef_FloatList { - static instance: ::protobuf::rt::LazyV2 = - ::protobuf::rt::LazyV2::INIT; - instance.get(CollectionDef_FloatList::new) - } -} - -impl ::protobuf::Clear for CollectionDef_FloatList { - fn clear(&mut self) { - self.value.clear(); - self.unknown_fields.clear(); - } -} - -impl ::std::fmt::Debug for CollectionDef_FloatList { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for CollectionDef_FloatList { - fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { - ::protobuf::reflect::ReflectValueRef::Message(self) - } -} - -#[derive(PartialEq, Clone, Default)] -pub struct CollectionDef_AnyList { - // message fields - pub value: ::protobuf::RepeatedField<::protobuf::well_known_types::Any>, - // special fields - pub unknown_fields: ::protobuf::UnknownFields, - pub cached_size: ::protobuf::CachedSize, -} - -impl<'a> ::std::default::Default for &'a CollectionDef_AnyList { - fn default() -> &'a CollectionDef_AnyList { - ::default_instance() - } -} - -impl CollectionDef_AnyList { - pub fn new() -> CollectionDef_AnyList { - ::std::default::Default::default() - } - - // repeated .google.protobuf.Any value = 1; - - pub fn get_value(&self) -> &[::protobuf::well_known_types::Any] { - &self.value - } - pub fn clear_value(&mut self) { - self.value.clear(); - } - - // Param is passed by value, moved - pub fn set_value(&mut self, v: ::protobuf::RepeatedField<::protobuf::well_known_types::Any>) { - self.value = v; - } - - // Mutable pointer to the field. - pub fn mut_value( - &mut self, - ) -> &mut ::protobuf::RepeatedField<::protobuf::well_known_types::Any> { - &mut self.value - } - - // Take field - pub fn take_value(&mut self) -> ::protobuf::RepeatedField<::protobuf::well_known_types::Any> { - ::std::mem::replace(&mut self.value, ::protobuf::RepeatedField::new()) - } -} - -impl ::protobuf::Message for CollectionDef_AnyList { - fn is_initialized(&self) -> bool { - for v in &self.value { - if !v.is_initialized() { - return false; - } - } - true - } - - fn merge_from( - &mut self, - is: &mut ::protobuf::CodedInputStream<'_>, - ) -> ::protobuf::ProtobufResult<()> { - while !is.eof()? { - let (field_number, wire_type) = is.read_tag_unpack()?; - match field_number { - 1 => { - ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.value)?; - } - _ => { - ::protobuf::rt::read_unknown_or_skip_group( - field_number, - wire_type, - is, - self.mut_unknown_fields(), - )?; - } - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u32 { - let mut my_size = 0; - for value in &self.value { - let len = value.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - } - my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); - self.cached_size.set(my_size); - my_size - } - - fn write_to_with_cached_sizes( - &self, - os: &mut ::protobuf::CodedOutputStream<'_>, - ) -> ::protobuf::ProtobufResult<()> { - for v in &self.value { - os.write_tag(1, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - } - os.write_unknown_fields(self.get_unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn get_cached_size(&self) -> u32 { - self.cached_size.get() - } - - fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { - &self.unknown_fields - } - - fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { - &mut self.unknown_fields - } - - fn as_any(&self) -> &dyn (::std::any::Any) { - self as &dyn (::std::any::Any) - } - fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { - self as &mut dyn (::std::any::Any) - } - fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { - self - } - - fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - Self::descriptor_static() - } - - fn new() -> CollectionDef_AnyList { - CollectionDef_AnyList::new() - } - - fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = - ::protobuf::rt::LazyV2::INIT; - descriptor.get(|| { - let mut fields = ::std::vec::Vec::new(); - fields.push( - ::protobuf::reflect::accessor::make_repeated_field_accessor::< - _, - ::protobuf::types::ProtobufTypeMessage<::protobuf::well_known_types::Any>, - >( - "value", - |m: &CollectionDef_AnyList| &m.value, - |m: &mut CollectionDef_AnyList| &mut m.value, - ), - ); - ::protobuf::reflect::MessageDescriptor::new_pb_name::( - "CollectionDef.AnyList", - fields, - file_descriptor_proto(), - ) - }) - } - - fn default_instance() -> &'static CollectionDef_AnyList { - static instance: ::protobuf::rt::LazyV2 = - ::protobuf::rt::LazyV2::INIT; - instance.get(CollectionDef_AnyList::new) - } -} - -impl ::protobuf::Clear for CollectionDef_AnyList { - fn clear(&mut self) { - self.value.clear(); - self.unknown_fields.clear(); - } -} - -impl ::std::fmt::Debug for CollectionDef_AnyList { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for CollectionDef_AnyList { - fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { - ::protobuf::reflect::ReflectValueRef::Message(self) - } -} - -#[derive(PartialEq, Clone, Default)] -pub struct TensorInfo { - // message fields - pub dtype: super::types::DataType, - pub tensor_shape: ::protobuf::SingularPtrField, - // message oneof groups - pub encoding: ::std::option::Option, - // special fields - pub unknown_fields: ::protobuf::UnknownFields, - pub cached_size: ::protobuf::CachedSize, -} - -impl<'a> ::std::default::Default for &'a TensorInfo { - fn default() -> &'a TensorInfo { - ::default_instance() - } -} - -#[derive(Clone, PartialEq, Debug)] -pub enum TensorInfo_oneof_encoding { - name(::std::string::String), - coo_sparse(TensorInfo_CooSparse), - composite_tensor(TensorInfo_CompositeTensor), -} - -impl TensorInfo { - pub fn new() -> TensorInfo { - ::std::default::Default::default() - } - - // string name = 1; - - pub fn get_name(&self) -> &str { - match self.encoding { - ::std::option::Option::Some(TensorInfo_oneof_encoding::name(ref v)) => v, - _ => "", - } - } - pub fn clear_name(&mut self) { - self.encoding = ::std::option::Option::None; - } - - pub fn has_name(&self) -> bool { - match self.encoding { - ::std::option::Option::Some(TensorInfo_oneof_encoding::name(..)) => true, - _ => false, - } - } - - // Param is passed by value, moved - pub fn set_name(&mut self, v: ::std::string::String) { - self.encoding = ::std::option::Option::Some(TensorInfo_oneof_encoding::name(v)) - } - - // Mutable pointer to the field. - pub fn mut_name(&mut self) -> &mut ::std::string::String { - if let ::std::option::Option::Some(TensorInfo_oneof_encoding::name(_)) = self.encoding { - } else { - self.encoding = ::std::option::Option::Some(TensorInfo_oneof_encoding::name( - ::std::string::String::new(), - )); - } - match self.encoding { - ::std::option::Option::Some(TensorInfo_oneof_encoding::name(ref mut v)) => v, - _ => panic!(), - } - } - - // Take field - pub fn take_name(&mut self) -> ::std::string::String { - if self.has_name() { - match self.encoding.take() { - ::std::option::Option::Some(TensorInfo_oneof_encoding::name(v)) => v, - _ => panic!(), - } - } else { - ::std::string::String::new() - } - } - - // .tensorflow.TensorInfo.CooSparse coo_sparse = 4; - - pub fn get_coo_sparse(&self) -> &TensorInfo_CooSparse { - match self.encoding { - ::std::option::Option::Some(TensorInfo_oneof_encoding::coo_sparse(ref v)) => v, - _ => ::default_instance(), - } - } - pub fn clear_coo_sparse(&mut self) { - self.encoding = ::std::option::Option::None; - } - - pub fn has_coo_sparse(&self) -> bool { - match self.encoding { - ::std::option::Option::Some(TensorInfo_oneof_encoding::coo_sparse(..)) => true, - _ => false, - } - } - - // Param is passed by value, moved - pub fn set_coo_sparse(&mut self, v: TensorInfo_CooSparse) { - self.encoding = ::std::option::Option::Some(TensorInfo_oneof_encoding::coo_sparse(v)) - } - - // Mutable pointer to the field. - pub fn mut_coo_sparse(&mut self) -> &mut TensorInfo_CooSparse { - if let ::std::option::Option::Some(TensorInfo_oneof_encoding::coo_sparse(_)) = self.encoding - { - } else { - self.encoding = ::std::option::Option::Some(TensorInfo_oneof_encoding::coo_sparse( - TensorInfo_CooSparse::new(), - )); - } - match self.encoding { - ::std::option::Option::Some(TensorInfo_oneof_encoding::coo_sparse(ref mut v)) => v, - _ => panic!(), - } - } - - // Take field - pub fn take_coo_sparse(&mut self) -> TensorInfo_CooSparse { - if self.has_coo_sparse() { - match self.encoding.take() { - ::std::option::Option::Some(TensorInfo_oneof_encoding::coo_sparse(v)) => v, - _ => panic!(), - } - } else { - TensorInfo_CooSparse::new() - } - } - - // .tensorflow.TensorInfo.CompositeTensor composite_tensor = 5; - - pub fn get_composite_tensor(&self) -> &TensorInfo_CompositeTensor { - match self.encoding { - ::std::option::Option::Some(TensorInfo_oneof_encoding::composite_tensor(ref v)) => v, - _ => ::default_instance(), - } - } - pub fn clear_composite_tensor(&mut self) { - self.encoding = ::std::option::Option::None; - } - - pub fn has_composite_tensor(&self) -> bool { - match self.encoding { - ::std::option::Option::Some(TensorInfo_oneof_encoding::composite_tensor(..)) => true, - _ => false, - } - } - - // Param is passed by value, moved - pub fn set_composite_tensor(&mut self, v: TensorInfo_CompositeTensor) { - self.encoding = ::std::option::Option::Some(TensorInfo_oneof_encoding::composite_tensor(v)) - } - - // Mutable pointer to the field. - pub fn mut_composite_tensor(&mut self) -> &mut TensorInfo_CompositeTensor { - if let ::std::option::Option::Some(TensorInfo_oneof_encoding::composite_tensor(_)) = - self.encoding - { - } else { - self.encoding = ::std::option::Option::Some( - TensorInfo_oneof_encoding::composite_tensor(TensorInfo_CompositeTensor::new()), - ); - } - match self.encoding { - ::std::option::Option::Some(TensorInfo_oneof_encoding::composite_tensor(ref mut v)) => { - v - } - _ => panic!(), - } - } - - // Take field - pub fn take_composite_tensor(&mut self) -> TensorInfo_CompositeTensor { - if self.has_composite_tensor() { - match self.encoding.take() { - ::std::option::Option::Some(TensorInfo_oneof_encoding::composite_tensor(v)) => v, - _ => panic!(), - } - } else { - TensorInfo_CompositeTensor::new() - } - } - - // .tensorflow.DataType dtype = 2; - - pub fn get_dtype(&self) -> super::types::DataType { - self.dtype - } - pub fn clear_dtype(&mut self) { - self.dtype = super::types::DataType::DT_INVALID; - } - - // Param is passed by value, moved - pub fn set_dtype(&mut self, v: super::types::DataType) { - self.dtype = v; - } - - // .tensorflow.TensorShapeProto tensor_shape = 3; - - pub fn get_tensor_shape(&self) -> &super::tensor_shape::TensorShapeProto { - self.tensor_shape.as_ref().unwrap_or_else(|| { - ::default_instance() - }) - } - pub fn clear_tensor_shape(&mut self) { - self.tensor_shape.clear(); - } - - pub fn has_tensor_shape(&self) -> bool { - self.tensor_shape.is_some() - } - - // Param is passed by value, moved - pub fn set_tensor_shape(&mut self, v: super::tensor_shape::TensorShapeProto) { - self.tensor_shape = ::protobuf::SingularPtrField::some(v); - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_tensor_shape(&mut self) -> &mut super::tensor_shape::TensorShapeProto { - if self.tensor_shape.is_none() { - self.tensor_shape.set_default(); - } - self.tensor_shape.as_mut().unwrap() - } - - // Take field - pub fn take_tensor_shape(&mut self) -> super::tensor_shape::TensorShapeProto { - self.tensor_shape - .take() - .unwrap_or_else(|| super::tensor_shape::TensorShapeProto::new()) - } -} - -impl ::protobuf::Message for TensorInfo { - fn is_initialized(&self) -> bool { - if let Some(TensorInfo_oneof_encoding::coo_sparse(ref v)) = self.encoding { - if !v.is_initialized() { - return false; - } - } - if let Some(TensorInfo_oneof_encoding::composite_tensor(ref v)) = self.encoding { - if !v.is_initialized() { - return false; - } - } - for v in &self.tensor_shape { - if !v.is_initialized() { - return false; - } - } - true - } - - fn merge_from( - &mut self, - is: &mut ::protobuf::CodedInputStream<'_>, - ) -> ::protobuf::ProtobufResult<()> { - while !is.eof()? { - let (field_number, wire_type) = is.read_tag_unpack()?; - match field_number { - 1 => { - if wire_type != ::protobuf::wire_format::WireTypeLengthDelimited { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type( - wire_type, - )); - } - self.encoding = ::std::option::Option::Some(TensorInfo_oneof_encoding::name( - is.read_string()?, - )); - } - 4 => { - if wire_type != ::protobuf::wire_format::WireTypeLengthDelimited { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type( - wire_type, - )); - } - self.encoding = ::std::option::Option::Some( - TensorInfo_oneof_encoding::coo_sparse(is.read_message()?), - ); - } - 5 => { - if wire_type != ::protobuf::wire_format::WireTypeLengthDelimited { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type( - wire_type, - )); - } - self.encoding = ::std::option::Option::Some( - TensorInfo_oneof_encoding::composite_tensor(is.read_message()?), - ); - } - 2 => ::protobuf::rt::read_proto3_enum_with_unknown_fields_into( - wire_type, - is, - &mut self.dtype, - 2, - &mut self.unknown_fields, - )?, - 3 => { - ::protobuf::rt::read_singular_message_into( - wire_type, - is, - &mut self.tensor_shape, - )?; - } - _ => { - ::protobuf::rt::read_unknown_or_skip_group( - field_number, - wire_type, - is, - self.mut_unknown_fields(), - )?; - } - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u32 { - let mut my_size = 0; - if self.dtype != super::types::DataType::DT_INVALID { - my_size += ::protobuf::rt::enum_size(2, self.dtype); - } - if let Some(ref v) = self.tensor_shape.as_ref() { - let len = v.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - } - if let ::std::option::Option::Some(ref v) = self.encoding { - match v { - &TensorInfo_oneof_encoding::name(ref v) => { - my_size += ::protobuf::rt::string_size(1, &v); - } - &TensorInfo_oneof_encoding::coo_sparse(ref v) => { - let len = v.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - } - &TensorInfo_oneof_encoding::composite_tensor(ref v) => { - let len = v.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - } - }; - } - my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); - self.cached_size.set(my_size); - my_size - } - - fn write_to_with_cached_sizes( - &self, - os: &mut ::protobuf::CodedOutputStream<'_>, - ) -> ::protobuf::ProtobufResult<()> { - if self.dtype != super::types::DataType::DT_INVALID { - os.write_enum(2, ::protobuf::ProtobufEnum::value(&self.dtype))?; - } - if let Some(ref v) = self.tensor_shape.as_ref() { - os.write_tag(3, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - } - if let ::std::option::Option::Some(ref v) = self.encoding { - match v { - &TensorInfo_oneof_encoding::name(ref v) => { - os.write_string(1, v)?; - } - &TensorInfo_oneof_encoding::coo_sparse(ref v) => { - os.write_tag(4, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - } - &TensorInfo_oneof_encoding::composite_tensor(ref v) => { - os.write_tag(5, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - } - }; - } - os.write_unknown_fields(self.get_unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn get_cached_size(&self) -> u32 { - self.cached_size.get() - } - - fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { - &self.unknown_fields - } - - fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { - &mut self.unknown_fields - } - - fn as_any(&self) -> &dyn (::std::any::Any) { - self as &dyn (::std::any::Any) - } - fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { - self as &mut dyn (::std::any::Any) - } - fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { - self - } - - fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - Self::descriptor_static() - } - - fn new() -> TensorInfo { - TensorInfo::new() - } - - fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = - ::protobuf::rt::LazyV2::INIT; - descriptor.get(|| { - let mut fields = ::std::vec::Vec::new(); - fields.push( - ::protobuf::reflect::accessor::make_singular_string_accessor::<_>( - "name", - TensorInfo::has_name, - TensorInfo::get_name, - ), - ); - fields.push( - ::protobuf::reflect::accessor::make_singular_message_accessor::< - _, - TensorInfo_CooSparse, - >( - "coo_sparse", - TensorInfo::has_coo_sparse, - TensorInfo::get_coo_sparse, - ), - ); - fields.push( - ::protobuf::reflect::accessor::make_singular_message_accessor::< - _, - TensorInfo_CompositeTensor, - >( - "composite_tensor", - TensorInfo::has_composite_tensor, - TensorInfo::get_composite_tensor, - ), - ); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::< - _, - ::protobuf::types::ProtobufTypeEnum, - >( - "dtype", - |m: &TensorInfo| &m.dtype, - |m: &mut TensorInfo| &mut m.dtype, - )); - fields.push( - ::protobuf::reflect::accessor::make_singular_ptr_field_accessor::< - _, - ::protobuf::types::ProtobufTypeMessage, - >( - "tensor_shape", - |m: &TensorInfo| &m.tensor_shape, - |m: &mut TensorInfo| &mut m.tensor_shape, - ), - ); - ::protobuf::reflect::MessageDescriptor::new_pb_name::( - "TensorInfo", - fields, - file_descriptor_proto(), - ) - }) - } - - fn default_instance() -> &'static TensorInfo { - static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; - instance.get(TensorInfo::new) - } -} - -impl ::protobuf::Clear for TensorInfo { - fn clear(&mut self) { - self.encoding = ::std::option::Option::None; - self.encoding = ::std::option::Option::None; - self.encoding = ::std::option::Option::None; - self.dtype = super::types::DataType::DT_INVALID; - self.tensor_shape.clear(); - self.unknown_fields.clear(); - } -} - -impl ::std::fmt::Debug for TensorInfo { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for TensorInfo { - fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { - ::protobuf::reflect::ReflectValueRef::Message(self) - } -} - -#[derive(PartialEq, Clone, Default)] -pub struct TensorInfo_CooSparse { - // message fields - pub values_tensor_name: ::std::string::String, - pub indices_tensor_name: ::std::string::String, - pub dense_shape_tensor_name: ::std::string::String, - // special fields - pub unknown_fields: ::protobuf::UnknownFields, - pub cached_size: ::protobuf::CachedSize, -} - -impl<'a> ::std::default::Default for &'a TensorInfo_CooSparse { - fn default() -> &'a TensorInfo_CooSparse { - ::default_instance() - } -} - -impl TensorInfo_CooSparse { - pub fn new() -> TensorInfo_CooSparse { - ::std::default::Default::default() - } - - // string values_tensor_name = 1; - - pub fn get_values_tensor_name(&self) -> &str { - &self.values_tensor_name - } - pub fn clear_values_tensor_name(&mut self) { - self.values_tensor_name.clear(); - } - - // Param is passed by value, moved - pub fn set_values_tensor_name(&mut self, v: ::std::string::String) { - self.values_tensor_name = v; - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_values_tensor_name(&mut self) -> &mut ::std::string::String { - &mut self.values_tensor_name - } - - // Take field - pub fn take_values_tensor_name(&mut self) -> ::std::string::String { - ::std::mem::replace(&mut self.values_tensor_name, ::std::string::String::new()) - } - - // string indices_tensor_name = 2; - - pub fn get_indices_tensor_name(&self) -> &str { - &self.indices_tensor_name - } - pub fn clear_indices_tensor_name(&mut self) { - self.indices_tensor_name.clear(); - } - - // Param is passed by value, moved - pub fn set_indices_tensor_name(&mut self, v: ::std::string::String) { - self.indices_tensor_name = v; - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_indices_tensor_name(&mut self) -> &mut ::std::string::String { - &mut self.indices_tensor_name - } - - // Take field - pub fn take_indices_tensor_name(&mut self) -> ::std::string::String { - ::std::mem::replace(&mut self.indices_tensor_name, ::std::string::String::new()) - } - - // string dense_shape_tensor_name = 3; - - pub fn get_dense_shape_tensor_name(&self) -> &str { - &self.dense_shape_tensor_name - } - pub fn clear_dense_shape_tensor_name(&mut self) { - self.dense_shape_tensor_name.clear(); - } - - // Param is passed by value, moved - pub fn set_dense_shape_tensor_name(&mut self, v: ::std::string::String) { - self.dense_shape_tensor_name = v; - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_dense_shape_tensor_name(&mut self) -> &mut ::std::string::String { - &mut self.dense_shape_tensor_name - } - - // Take field - pub fn take_dense_shape_tensor_name(&mut self) -> ::std::string::String { - ::std::mem::replace( - &mut self.dense_shape_tensor_name, - ::std::string::String::new(), - ) - } -} - -impl ::protobuf::Message for TensorInfo_CooSparse { - fn is_initialized(&self) -> bool { - true - } - - fn merge_from( - &mut self, - is: &mut ::protobuf::CodedInputStream<'_>, - ) -> ::protobuf::ProtobufResult<()> { - while !is.eof()? { - let (field_number, wire_type) = is.read_tag_unpack()?; - match field_number { - 1 => { - ::protobuf::rt::read_singular_proto3_string_into( - wire_type, - is, - &mut self.values_tensor_name, - )?; - } - 2 => { - ::protobuf::rt::read_singular_proto3_string_into( - wire_type, - is, - &mut self.indices_tensor_name, - )?; - } - 3 => { - ::protobuf::rt::read_singular_proto3_string_into( - wire_type, - is, - &mut self.dense_shape_tensor_name, - )?; - } - _ => { - ::protobuf::rt::read_unknown_or_skip_group( - field_number, - wire_type, - is, - self.mut_unknown_fields(), - )?; - } - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u32 { - let mut my_size = 0; - if !self.values_tensor_name.is_empty() { - my_size += ::protobuf::rt::string_size(1, &self.values_tensor_name); - } - if !self.indices_tensor_name.is_empty() { - my_size += ::protobuf::rt::string_size(2, &self.indices_tensor_name); - } - if !self.dense_shape_tensor_name.is_empty() { - my_size += ::protobuf::rt::string_size(3, &self.dense_shape_tensor_name); - } - my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); - self.cached_size.set(my_size); - my_size - } - - fn write_to_with_cached_sizes( - &self, - os: &mut ::protobuf::CodedOutputStream<'_>, - ) -> ::protobuf::ProtobufResult<()> { - if !self.values_tensor_name.is_empty() { - os.write_string(1, &self.values_tensor_name)?; - } - if !self.indices_tensor_name.is_empty() { - os.write_string(2, &self.indices_tensor_name)?; - } - if !self.dense_shape_tensor_name.is_empty() { - os.write_string(3, &self.dense_shape_tensor_name)?; - } - os.write_unknown_fields(self.get_unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn get_cached_size(&self) -> u32 { - self.cached_size.get() - } - - fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { - &self.unknown_fields - } - - fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { - &mut self.unknown_fields - } - - fn as_any(&self) -> &dyn (::std::any::Any) { - self as &dyn (::std::any::Any) - } - fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { - self as &mut dyn (::std::any::Any) - } - fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { - self - } - - fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - Self::descriptor_static() - } - - fn new() -> TensorInfo_CooSparse { - TensorInfo_CooSparse::new() - } - - fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = - ::protobuf::rt::LazyV2::INIT; - descriptor.get(|| { - let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::< - _, - ::protobuf::types::ProtobufTypeString, - >( - "values_tensor_name", - |m: &TensorInfo_CooSparse| &m.values_tensor_name, - |m: &mut TensorInfo_CooSparse| &mut m.values_tensor_name, - )); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::< - _, - ::protobuf::types::ProtobufTypeString, - >( - "indices_tensor_name", - |m: &TensorInfo_CooSparse| &m.indices_tensor_name, - |m: &mut TensorInfo_CooSparse| &mut m.indices_tensor_name, - )); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::< - _, - ::protobuf::types::ProtobufTypeString, - >( - "dense_shape_tensor_name", - |m: &TensorInfo_CooSparse| &m.dense_shape_tensor_name, - |m: &mut TensorInfo_CooSparse| &mut m.dense_shape_tensor_name, - )); - ::protobuf::reflect::MessageDescriptor::new_pb_name::( - "TensorInfo.CooSparse", - fields, - file_descriptor_proto(), - ) - }) - } - - fn default_instance() -> &'static TensorInfo_CooSparse { - static instance: ::protobuf::rt::LazyV2 = - ::protobuf::rt::LazyV2::INIT; - instance.get(TensorInfo_CooSparse::new) - } -} - -impl ::protobuf::Clear for TensorInfo_CooSparse { - fn clear(&mut self) { - self.values_tensor_name.clear(); - self.indices_tensor_name.clear(); - self.dense_shape_tensor_name.clear(); - self.unknown_fields.clear(); - } -} - -impl ::std::fmt::Debug for TensorInfo_CooSparse { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for TensorInfo_CooSparse { - fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { - ::protobuf::reflect::ReflectValueRef::Message(self) - } -} - -#[derive(PartialEq, Clone, Default)] -pub struct TensorInfo_CompositeTensor { - // message fields - pub type_spec: ::protobuf::SingularPtrField, - pub components: ::protobuf::RepeatedField, - // special fields - pub unknown_fields: ::protobuf::UnknownFields, - pub cached_size: ::protobuf::CachedSize, -} - -impl<'a> ::std::default::Default for &'a TensorInfo_CompositeTensor { - fn default() -> &'a TensorInfo_CompositeTensor { - ::default_instance() - } -} - -impl TensorInfo_CompositeTensor { - pub fn new() -> TensorInfo_CompositeTensor { - ::std::default::Default::default() - } - - // .tensorflow.TypeSpecProto type_spec = 1; - - pub fn get_type_spec(&self) -> &super::struct_pb::TypeSpecProto { - self.type_spec.as_ref().unwrap_or_else(|| { - ::default_instance() - }) - } - pub fn clear_type_spec(&mut self) { - self.type_spec.clear(); - } - - pub fn has_type_spec(&self) -> bool { - self.type_spec.is_some() - } - - // Param is passed by value, moved - pub fn set_type_spec(&mut self, v: super::struct_pb::TypeSpecProto) { - self.type_spec = ::protobuf::SingularPtrField::some(v); - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_type_spec(&mut self) -> &mut super::struct_pb::TypeSpecProto { - if self.type_spec.is_none() { - self.type_spec.set_default(); - } - self.type_spec.as_mut().unwrap() - } - - // Take field - pub fn take_type_spec(&mut self) -> super::struct_pb::TypeSpecProto { - self.type_spec - .take() - .unwrap_or_else(|| super::struct_pb::TypeSpecProto::new()) - } - - // repeated .tensorflow.TensorInfo components = 2; - - pub fn get_components(&self) -> &[TensorInfo] { - &self.components - } - pub fn clear_components(&mut self) { - self.components.clear(); - } - - // Param is passed by value, moved - pub fn set_components(&mut self, v: ::protobuf::RepeatedField) { - self.components = v; - } - - // Mutable pointer to the field. - pub fn mut_components(&mut self) -> &mut ::protobuf::RepeatedField { - &mut self.components - } - - // Take field - pub fn take_components(&mut self) -> ::protobuf::RepeatedField { - ::std::mem::replace(&mut self.components, ::protobuf::RepeatedField::new()) - } -} - -impl ::protobuf::Message for TensorInfo_CompositeTensor { - fn is_initialized(&self) -> bool { - for v in &self.type_spec { - if !v.is_initialized() { - return false; - } - } - for v in &self.components { - if !v.is_initialized() { - return false; - } - } - true - } - - fn merge_from( - &mut self, - is: &mut ::protobuf::CodedInputStream<'_>, - ) -> ::protobuf::ProtobufResult<()> { - while !is.eof()? { - let (field_number, wire_type) = is.read_tag_unpack()?; - match field_number { - 1 => { - ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.type_spec)?; - } - 2 => { - ::protobuf::rt::read_repeated_message_into( - wire_type, - is, - &mut self.components, - )?; - } - _ => { - ::protobuf::rt::read_unknown_or_skip_group( - field_number, - wire_type, - is, - self.mut_unknown_fields(), - )?; - } - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u32 { - let mut my_size = 0; - if let Some(ref v) = self.type_spec.as_ref() { - let len = v.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - } - for value in &self.components { - let len = value.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - } - my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); - self.cached_size.set(my_size); - my_size - } - - fn write_to_with_cached_sizes( - &self, - os: &mut ::protobuf::CodedOutputStream<'_>, - ) -> ::protobuf::ProtobufResult<()> { - if let Some(ref v) = self.type_spec.as_ref() { - os.write_tag(1, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - } - for v in &self.components { - os.write_tag(2, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - } - os.write_unknown_fields(self.get_unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn get_cached_size(&self) -> u32 { - self.cached_size.get() - } - - fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { - &self.unknown_fields - } - - fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { - &mut self.unknown_fields - } - - fn as_any(&self) -> &dyn (::std::any::Any) { - self as &dyn (::std::any::Any) - } - fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { - self as &mut dyn (::std::any::Any) - } - fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { - self - } - - fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - Self::descriptor_static() - } - - fn new() -> TensorInfo_CompositeTensor { - TensorInfo_CompositeTensor::new() - } - - fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = - ::protobuf::rt::LazyV2::INIT; - descriptor.get(|| { - let mut fields = ::std::vec::Vec::new(); - fields.push( - ::protobuf::reflect::accessor::make_singular_ptr_field_accessor::< - _, - ::protobuf::types::ProtobufTypeMessage, - >( - "type_spec", - |m: &TensorInfo_CompositeTensor| &m.type_spec, - |m: &mut TensorInfo_CompositeTensor| &mut m.type_spec, - ), - ); - fields.push( - ::protobuf::reflect::accessor::make_repeated_field_accessor::< - _, - ::protobuf::types::ProtobufTypeMessage, - >( - "components", - |m: &TensorInfo_CompositeTensor| &m.components, - |m: &mut TensorInfo_CompositeTensor| &mut m.components, - ), - ); - ::protobuf::reflect::MessageDescriptor::new_pb_name::( - "TensorInfo.CompositeTensor", - fields, - file_descriptor_proto(), - ) - }) - } - - fn default_instance() -> &'static TensorInfo_CompositeTensor { - static instance: ::protobuf::rt::LazyV2 = - ::protobuf::rt::LazyV2::INIT; - instance.get(TensorInfo_CompositeTensor::new) - } -} - -impl ::protobuf::Clear for TensorInfo_CompositeTensor { - fn clear(&mut self) { - self.type_spec.clear(); - self.components.clear(); - self.unknown_fields.clear(); - } -} - -impl ::std::fmt::Debug for TensorInfo_CompositeTensor { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for TensorInfo_CompositeTensor { - fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { - ::protobuf::reflect::ReflectValueRef::Message(self) - } -} - -#[derive(PartialEq, Clone, Default)] -pub struct SignatureDef { - // message fields - pub inputs: ::std::collections::HashMap<::std::string::String, TensorInfo>, - pub outputs: ::std::collections::HashMap<::std::string::String, TensorInfo>, - pub method_name: ::std::string::String, - // special fields - pub unknown_fields: ::protobuf::UnknownFields, - pub cached_size: ::protobuf::CachedSize, -} - -impl<'a> ::std::default::Default for &'a SignatureDef { - fn default() -> &'a SignatureDef { - ::default_instance() - } -} - -impl SignatureDef { - pub fn new() -> SignatureDef { - ::std::default::Default::default() - } - - // repeated .tensorflow.SignatureDef.InputsEntry inputs = 1; - - pub fn get_inputs(&self) -> &::std::collections::HashMap<::std::string::String, TensorInfo> { - &self.inputs - } - pub fn clear_inputs(&mut self) { - self.inputs.clear(); - } - - // Param is passed by value, moved - pub fn set_inputs( - &mut self, - v: ::std::collections::HashMap<::std::string::String, TensorInfo>, - ) { - self.inputs = v; - } - - // Mutable pointer to the field. - pub fn mut_inputs( - &mut self, - ) -> &mut ::std::collections::HashMap<::std::string::String, TensorInfo> { - &mut self.inputs - } - - // Take field - pub fn take_inputs( - &mut self, - ) -> ::std::collections::HashMap<::std::string::String, TensorInfo> { - ::std::mem::replace(&mut self.inputs, ::std::collections::HashMap::new()) - } - - // repeated .tensorflow.SignatureDef.OutputsEntry outputs = 2; - - pub fn get_outputs(&self) -> &::std::collections::HashMap<::std::string::String, TensorInfo> { - &self.outputs - } - pub fn clear_outputs(&mut self) { - self.outputs.clear(); - } - - // Param is passed by value, moved - pub fn set_outputs( - &mut self, - v: ::std::collections::HashMap<::std::string::String, TensorInfo>, - ) { - self.outputs = v; - } - - // Mutable pointer to the field. - pub fn mut_outputs( - &mut self, - ) -> &mut ::std::collections::HashMap<::std::string::String, TensorInfo> { - &mut self.outputs - } - - // Take field - pub fn take_outputs( - &mut self, - ) -> ::std::collections::HashMap<::std::string::String, TensorInfo> { - ::std::mem::replace(&mut self.outputs, ::std::collections::HashMap::new()) - } - - // string method_name = 3; - - pub fn get_method_name(&self) -> &str { - &self.method_name - } - pub fn clear_method_name(&mut self) { - self.method_name.clear(); - } - - // Param is passed by value, moved - pub fn set_method_name(&mut self, v: ::std::string::String) { - self.method_name = v; - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_method_name(&mut self) -> &mut ::std::string::String { - &mut self.method_name - } - - // Take field - pub fn take_method_name(&mut self) -> ::std::string::String { - ::std::mem::replace(&mut self.method_name, ::std::string::String::new()) - } -} - -impl ::protobuf::Message for SignatureDef { - fn is_initialized(&self) -> bool { - true - } - - fn merge_from( - &mut self, - is: &mut ::protobuf::CodedInputStream<'_>, - ) -> ::protobuf::ProtobufResult<()> { - while !is.eof()? { - let (field_number, wire_type) = is.read_tag_unpack()?; - match field_number { - 1 => { - ::protobuf::rt::read_map_into::< - ::protobuf::types::ProtobufTypeString, - ::protobuf::types::ProtobufTypeMessage, - >(wire_type, is, &mut self.inputs)?; - } - 2 => { - ::protobuf::rt::read_map_into::< - ::protobuf::types::ProtobufTypeString, - ::protobuf::types::ProtobufTypeMessage, - >(wire_type, is, &mut self.outputs)?; - } - 3 => { - ::protobuf::rt::read_singular_proto3_string_into( - wire_type, - is, - &mut self.method_name, - )?; - } - _ => { - ::protobuf::rt::read_unknown_or_skip_group( - field_number, - wire_type, - is, - self.mut_unknown_fields(), - )?; - } - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u32 { - let mut my_size = 0; - my_size += ::protobuf::rt::compute_map_size::< - ::protobuf::types::ProtobufTypeString, - ::protobuf::types::ProtobufTypeMessage, - >(1, &self.inputs); - my_size += ::protobuf::rt::compute_map_size::< - ::protobuf::types::ProtobufTypeString, - ::protobuf::types::ProtobufTypeMessage, - >(2, &self.outputs); - if !self.method_name.is_empty() { - my_size += ::protobuf::rt::string_size(3, &self.method_name); - } - my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); - self.cached_size.set(my_size); - my_size - } - - fn write_to_with_cached_sizes( - &self, - os: &mut ::protobuf::CodedOutputStream<'_>, - ) -> ::protobuf::ProtobufResult<()> { - ::protobuf::rt::write_map_with_cached_sizes::< - ::protobuf::types::ProtobufTypeString, - ::protobuf::types::ProtobufTypeMessage, - >(1, &self.inputs, os)?; - ::protobuf::rt::write_map_with_cached_sizes::< - ::protobuf::types::ProtobufTypeString, - ::protobuf::types::ProtobufTypeMessage, - >(2, &self.outputs, os)?; - if !self.method_name.is_empty() { - os.write_string(3, &self.method_name)?; - } - os.write_unknown_fields(self.get_unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn get_cached_size(&self) -> u32 { - self.cached_size.get() - } - - fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { - &self.unknown_fields - } - - fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { - &mut self.unknown_fields - } - - fn as_any(&self) -> &dyn (::std::any::Any) { - self as &dyn (::std::any::Any) - } - fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { - self as &mut dyn (::std::any::Any) - } - fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { - self - } - - fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - Self::descriptor_static() - } - - fn new() -> SignatureDef { - SignatureDef::new() - } - - fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = - ::protobuf::rt::LazyV2::INIT; - descriptor.get(|| { - let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_map_accessor::< - _, - ::protobuf::types::ProtobufTypeString, - ::protobuf::types::ProtobufTypeMessage, - >( - "inputs", - |m: &SignatureDef| &m.inputs, - |m: &mut SignatureDef| &mut m.inputs, - )); - fields.push(::protobuf::reflect::accessor::make_map_accessor::< - _, - ::protobuf::types::ProtobufTypeString, - ::protobuf::types::ProtobufTypeMessage, - >( - "outputs", - |m: &SignatureDef| &m.outputs, - |m: &mut SignatureDef| &mut m.outputs, - )); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::< - _, - ::protobuf::types::ProtobufTypeString, - >( - "method_name", - |m: &SignatureDef| &m.method_name, - |m: &mut SignatureDef| &mut m.method_name, - )); - ::protobuf::reflect::MessageDescriptor::new_pb_name::( - "SignatureDef", - fields, - file_descriptor_proto(), - ) - }) - } - - fn default_instance() -> &'static SignatureDef { - static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; - instance.get(SignatureDef::new) - } -} - -impl ::protobuf::Clear for SignatureDef { - fn clear(&mut self) { - self.inputs.clear(); - self.outputs.clear(); - self.method_name.clear(); - self.unknown_fields.clear(); - } -} - -impl ::std::fmt::Debug for SignatureDef { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for SignatureDef { - fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { - ::protobuf::reflect::ReflectValueRef::Message(self) - } -} - -#[derive(PartialEq, Clone, Default)] -pub struct AssetFileDef { - // message fields - pub tensor_info: ::protobuf::SingularPtrField, - pub filename: ::std::string::String, - // special fields - pub unknown_fields: ::protobuf::UnknownFields, - pub cached_size: ::protobuf::CachedSize, -} - -impl<'a> ::std::default::Default for &'a AssetFileDef { - fn default() -> &'a AssetFileDef { - ::default_instance() - } -} - -impl AssetFileDef { - pub fn new() -> AssetFileDef { - ::std::default::Default::default() - } - - // .tensorflow.TensorInfo tensor_info = 1; - - pub fn get_tensor_info(&self) -> &TensorInfo { - self.tensor_info - .as_ref() - .unwrap_or_else(|| ::default_instance()) - } - pub fn clear_tensor_info(&mut self) { - self.tensor_info.clear(); - } - - pub fn has_tensor_info(&self) -> bool { - self.tensor_info.is_some() - } - - // Param is passed by value, moved - pub fn set_tensor_info(&mut self, v: TensorInfo) { - self.tensor_info = ::protobuf::SingularPtrField::some(v); - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_tensor_info(&mut self) -> &mut TensorInfo { - if self.tensor_info.is_none() { - self.tensor_info.set_default(); - } - self.tensor_info.as_mut().unwrap() - } - - // Take field - pub fn take_tensor_info(&mut self) -> TensorInfo { - self.tensor_info.take().unwrap_or_else(|| TensorInfo::new()) - } - - // string filename = 2; - - pub fn get_filename(&self) -> &str { - &self.filename - } - pub fn clear_filename(&mut self) { - self.filename.clear(); - } - - // Param is passed by value, moved - pub fn set_filename(&mut self, v: ::std::string::String) { - self.filename = v; - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_filename(&mut self) -> &mut ::std::string::String { - &mut self.filename - } - - // Take field - pub fn take_filename(&mut self) -> ::std::string::String { - ::std::mem::replace(&mut self.filename, ::std::string::String::new()) - } -} - -impl ::protobuf::Message for AssetFileDef { - fn is_initialized(&self) -> bool { - for v in &self.tensor_info { - if !v.is_initialized() { - return false; - } - } - true - } - - fn merge_from( - &mut self, - is: &mut ::protobuf::CodedInputStream<'_>, - ) -> ::protobuf::ProtobufResult<()> { - while !is.eof()? { - let (field_number, wire_type) = is.read_tag_unpack()?; - match field_number { - 1 => { - ::protobuf::rt::read_singular_message_into( - wire_type, - is, - &mut self.tensor_info, - )?; - } - 2 => { - ::protobuf::rt::read_singular_proto3_string_into( - wire_type, - is, - &mut self.filename, - )?; - } - _ => { - ::protobuf::rt::read_unknown_or_skip_group( - field_number, - wire_type, - is, - self.mut_unknown_fields(), - )?; - } - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u32 { - let mut my_size = 0; - if let Some(ref v) = self.tensor_info.as_ref() { - let len = v.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - } - if !self.filename.is_empty() { - my_size += ::protobuf::rt::string_size(2, &self.filename); - } - my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); - self.cached_size.set(my_size); - my_size - } - - fn write_to_with_cached_sizes( - &self, - os: &mut ::protobuf::CodedOutputStream<'_>, - ) -> ::protobuf::ProtobufResult<()> { - if let Some(ref v) = self.tensor_info.as_ref() { - os.write_tag(1, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - } - if !self.filename.is_empty() { - os.write_string(2, &self.filename)?; - } - os.write_unknown_fields(self.get_unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn get_cached_size(&self) -> u32 { - self.cached_size.get() - } - - fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { - &self.unknown_fields - } - - fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { - &mut self.unknown_fields - } - - fn as_any(&self) -> &dyn (::std::any::Any) { - self as &dyn (::std::any::Any) - } - fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { - self as &mut dyn (::std::any::Any) - } - fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { - self - } - - fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - Self::descriptor_static() - } - - fn new() -> AssetFileDef { - AssetFileDef::new() - } - - fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = - ::protobuf::rt::LazyV2::INIT; - descriptor.get(|| { - let mut fields = ::std::vec::Vec::new(); - fields.push( - ::protobuf::reflect::accessor::make_singular_ptr_field_accessor::< - _, - ::protobuf::types::ProtobufTypeMessage, - >( - "tensor_info", - |m: &AssetFileDef| &m.tensor_info, - |m: &mut AssetFileDef| &mut m.tensor_info, - ), - ); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::< - _, - ::protobuf::types::ProtobufTypeString, - >( - "filename", - |m: &AssetFileDef| &m.filename, - |m: &mut AssetFileDef| &mut m.filename, - )); - ::protobuf::reflect::MessageDescriptor::new_pb_name::( - "AssetFileDef", - fields, - file_descriptor_proto(), - ) - }) - } - - fn default_instance() -> &'static AssetFileDef { - static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; - instance.get(AssetFileDef::new) - } -} - -impl ::protobuf::Clear for AssetFileDef { - fn clear(&mut self) { - self.tensor_info.clear(); - self.filename.clear(); - self.unknown_fields.clear(); - } -} - -impl ::std::fmt::Debug for AssetFileDef { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for AssetFileDef { - fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { - ::protobuf::reflect::ReflectValueRef::Message(self) - } -} - -static file_descriptor_proto_data: &'static [u8] = b"\ - \n)tensorflow/core/protobuf/meta_graph.proto\x12\ntensorflow\x1a\x19goog\ - le/protobuf/any.proto\x1a%tensorflow/core/framework/graph.proto\x1a&tens\ - orflow/core/framework/op_def.proto\x1a,tensorflow/core/framework/tensor_\ - shape.proto\x1a%tensorflow/core/framework/types.proto\x1a1tensorflow/cor\ - e/protobuf/saved_object_graph.proto\x1a$tensorflow/core/protobuf/saver.p\ - roto\x1a%tensorflow/core/protobuf/struct.proto\"\xff\x07\n\x0cMetaGraphD\ - ef\x12H\n\rmeta_info_def\x18\x01\x20\x01(\x0b2$.tensorflow.MetaGraphDef.\ - MetaInfoDefR\x0bmetaInfoDef\x121\n\tgraph_def\x18\x02\x20\x01(\x0b2\x14.\ - tensorflow.GraphDefR\x08graphDef\x121\n\tsaver_def\x18\x03\x20\x01(\x0b2\ - \x14.tensorflow.SaverDefR\x08saverDef\x12R\n\x0ecollection_def\x18\x04\ - \x20\x03(\x0b2+.tensorflow.MetaGraphDef.CollectionDefEntryR\rcollectionD\ - ef\x12O\n\rsignature_def\x18\x05\x20\x03(\x0b2*.tensorflow.MetaGraphDef.\ - SignatureDefEntryR\x0csignatureDef\x12>\n\x0easset_file_def\x18\x06\x20\ - \x03(\x0b2\x18.tensorflow.AssetFileDefR\x0cassetFileDef\x12F\n\x10object\ - _graph_def\x18\x07\x20\x01(\x0b2\x1c.tensorflow.SavedObjectGraphR\x0eobj\ - ectGraphDef\x1a\xd9\x02\n\x0bMetaInfoDef\x12,\n\x12meta_graph_version\ - \x18\x01\x20\x01(\tR\x10metaGraphVersion\x12<\n\x10stripped_op_list\x18\ - \x02\x20\x01(\x0b2\x12.tensorflow.OpListR\x0estrippedOpList\x12/\n\x08an\ - y_info\x18\x03\x20\x01(\x0b2\x14.google.protobuf.AnyR\x07anyInfo\x12\x12\ - \n\x04tags\x18\x04\x20\x03(\tR\x04tags\x12-\n\x12tensorflow_version\x18\ - \x05\x20\x01(\tR\x11tensorflowVersion\x124\n\x16tensorflow_git_version\ - \x18\x06\x20\x01(\tR\x14tensorflowGitVersion\x124\n\x16stripped_default_\ - attrs\x18\x07\x20\x01(\x08R\x14strippedDefaultAttrs\x1a[\n\x12Collection\ - DefEntry\x12\x10\n\x03key\x18\x01\x20\x01(\tR\x03key\x12/\n\x05value\x18\ - \x02\x20\x01(\x0b2\x19.tensorflow.CollectionDefR\x05value:\x028\x01\x1aY\ - \n\x11SignatureDefEntry\x12\x10\n\x03key\x18\x01\x20\x01(\tR\x03key\x12.\ - \n\x05value\x18\x02\x20\x01(\x0b2\x18.tensorflow.SignatureDefR\x05value:\ - \x028\x01\"\xb6\x04\n\rCollectionDef\x12A\n\tnode_list\x18\x01\x20\x01(\ - \x0b2\".tensorflow.CollectionDef.NodeListH\0R\x08nodeList\x12D\n\nbytes_\ - list\x18\x02\x20\x01(\x0b2#.tensorflow.CollectionDef.BytesListH\0R\tbyte\ - sList\x12D\n\nint64_list\x18\x03\x20\x01(\x0b2#.tensorflow.CollectionDef\ - .Int64ListH\0R\tint64List\x12D\n\nfloat_list\x18\x04\x20\x01(\x0b2#.tens\ - orflow.CollectionDef.FloatListH\0R\tfloatList\x12>\n\x08any_list\x18\x05\ - \x20\x01(\x0b2!.tensorflow.CollectionDef.AnyListH\0R\x07anyList\x1a\x20\ - \n\x08NodeList\x12\x14\n\x05value\x18\x01\x20\x03(\tR\x05value\x1a!\n\tB\ - ytesList\x12\x14\n\x05value\x18\x01\x20\x03(\x0cR\x05value\x1a%\n\tInt64\ - List\x12\x18\n\x05value\x18\x01\x20\x03(\x03R\x05valueB\x02\x10\x01\x1a%\ - \n\tFloatList\x12\x18\n\x05value\x18\x01\x20\x03(\x02R\x05valueB\x02\x10\ - \x01\x1a5\n\x07AnyList\x12*\n\x05value\x18\x01\x20\x03(\x0b2\x14.google.\ - protobuf.AnyR\x05valueB\x06\n\x04kind\"\xda\x04\n\nTensorInfo\x12\x14\n\ - \x04name\x18\x01\x20\x01(\tH\0R\x04name\x12A\n\ncoo_sparse\x18\x04\x20\ - \x01(\x0b2\x20.tensorflow.TensorInfo.CooSparseH\0R\tcooSparse\x12S\n\x10\ - composite_tensor\x18\x05\x20\x01(\x0b2&.tensorflow.TensorInfo.CompositeT\ - ensorH\0R\x0fcompositeTensor\x12*\n\x05dtype\x18\x02\x20\x01(\x0e2\x14.t\ - ensorflow.DataTypeR\x05dtype\x12?\n\x0ctensor_shape\x18\x03\x20\x01(\x0b\ - 2\x1c.tensorflow.TensorShapeProtoR\x0btensorShape\x1a\xa0\x01\n\tCooSpar\ - se\x12,\n\x12values_tensor_name\x18\x01\x20\x01(\tR\x10valuesTensorName\ - \x12.\n\x13indices_tensor_name\x18\x02\x20\x01(\tR\x11indicesTensorName\ - \x125\n\x17dense_shape_tensor_name\x18\x03\x20\x01(\tR\x14denseShapeTens\ - orName\x1a\x81\x01\n\x0fCompositeTensor\x126\n\ttype_spec\x18\x01\x20\ - \x01(\x0b2\x19.tensorflow.TypeSpecProtoR\x08typeSpec\x126\n\ncomponents\ - \x18\x02\x20\x03(\x0b2\x16.tensorflow.TensorInfoR\ncomponentsB\n\n\x08en\ - coding\"\xd5\x02\n\x0cSignatureDef\x12<\n\x06inputs\x18\x01\x20\x03(\x0b\ - 2$.tensorflow.SignatureDef.InputsEntryR\x06inputs\x12?\n\x07outputs\x18\ - \x02\x20\x03(\x0b2%.tensorflow.SignatureDef.OutputsEntryR\x07outputs\x12\ - \x1f\n\x0bmethod_name\x18\x03\x20\x01(\tR\nmethodName\x1aQ\n\x0bInputsEn\ - try\x12\x10\n\x03key\x18\x01\x20\x01(\tR\x03key\x12,\n\x05value\x18\x02\ - \x20\x01(\x0b2\x16.tensorflow.TensorInfoR\x05value:\x028\x01\x1aR\n\x0cO\ - utputsEntry\x12\x10\n\x03key\x18\x01\x20\x01(\tR\x03key\x12,\n\x05value\ - \x18\x02\x20\x01(\x0b2\x16.tensorflow.TensorInfoR\x05value:\x028\x01\"c\ - \n\x0cAssetFileDef\x127\n\x0btensor_info\x18\x01\x20\x01(\x0b2\x16.tenso\ - rflow.TensorInfoR\ntensorInfo\x12\x1a\n\x08filename\x18\x02\x20\x01(\tR\ - \x08filenameBn\n\x18org.tensorflow.frameworkB\x0fMetaGraphProtosP\x01Z = ::protobuf::rt::LazyV2::INIT; - -fn parse_descriptor_proto() -> ::protobuf::descriptor::FileDescriptorProto { - ::protobuf::parse_from_bytes(file_descriptor_proto_data).unwrap() -} - -pub fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto { - file_descriptor_proto_lazy.get(|| parse_descriptor_proto()) -} diff --git a/src/protos/node_def.rs b/src/protos/node_def.rs deleted file mode 100644 index 40909cbdc1..0000000000 --- a/src/protos/node_def.rs +++ /dev/null @@ -1,730 +0,0 @@ -// This file is generated by rust-protobuf 2.17.0. Do not edit -// @generated - -// https://github.com/rust-lang/rust-clippy/issues/702 -#![allow(unknown_lints)] -#![allow(clippy::all)] - -#![allow(unused_attributes)] -#![rustfmt::skip] - -#![allow(box_pointers)] -#![allow(dead_code)] -#![allow(missing_docs)] -#![allow(non_camel_case_types)] -#![allow(non_snake_case)] -#![allow(non_upper_case_globals)] -#![allow(trivial_casts)] -#![allow(unused_imports)] -#![allow(unused_results)] -//! Generated file from `tensorflow/core/framework/node_def.proto` - -/// Generated files are compatible only with the same version -/// of protobuf runtime. -// const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_17_0; - -#[derive(PartialEq, Clone, Default)] -pub struct NodeDef { - // message fields - pub name: ::std::string::String, - pub op: ::std::string::String, - pub input: ::protobuf::RepeatedField<::std::string::String>, - pub device: ::std::string::String, - pub attr: ::std::collections::HashMap<::std::string::String, super::attr_value::AttrValue>, - pub experimental_debug_info: ::protobuf::SingularPtrField, - // special fields - pub unknown_fields: ::protobuf::UnknownFields, - pub cached_size: ::protobuf::CachedSize, -} - -impl<'a> ::std::default::Default for &'a NodeDef { - fn default() -> &'a NodeDef { - ::default_instance() - } -} - -impl NodeDef { - pub fn new() -> NodeDef { - ::std::default::Default::default() - } - - // string name = 1; - - pub fn get_name(&self) -> &str { - &self.name - } - pub fn clear_name(&mut self) { - self.name.clear(); - } - - // Param is passed by value, moved - pub fn set_name(&mut self, v: ::std::string::String) { - self.name = v; - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_name(&mut self) -> &mut ::std::string::String { - &mut self.name - } - - // Take field - pub fn take_name(&mut self) -> ::std::string::String { - ::std::mem::replace(&mut self.name, ::std::string::String::new()) - } - - // string op = 2; - - pub fn get_op(&self) -> &str { - &self.op - } - pub fn clear_op(&mut self) { - self.op.clear(); - } - - // Param is passed by value, moved - pub fn set_op(&mut self, v: ::std::string::String) { - self.op = v; - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_op(&mut self) -> &mut ::std::string::String { - &mut self.op - } - - // Take field - pub fn take_op(&mut self) -> ::std::string::String { - ::std::mem::replace(&mut self.op, ::std::string::String::new()) - } - - // repeated string input = 3; - - pub fn get_input(&self) -> &[::std::string::String] { - &self.input - } - pub fn clear_input(&mut self) { - self.input.clear(); - } - - // Param is passed by value, moved - pub fn set_input(&mut self, v: ::protobuf::RepeatedField<::std::string::String>) { - self.input = v; - } - - // Mutable pointer to the field. - pub fn mut_input(&mut self) -> &mut ::protobuf::RepeatedField<::std::string::String> { - &mut self.input - } - - // Take field - pub fn take_input(&mut self) -> ::protobuf::RepeatedField<::std::string::String> { - ::std::mem::replace(&mut self.input, ::protobuf::RepeatedField::new()) - } - - // string device = 4; - - pub fn get_device(&self) -> &str { - &self.device - } - pub fn clear_device(&mut self) { - self.device.clear(); - } - - // Param is passed by value, moved - pub fn set_device(&mut self, v: ::std::string::String) { - self.device = v; - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_device(&mut self) -> &mut ::std::string::String { - &mut self.device - } - - // Take field - pub fn take_device(&mut self) -> ::std::string::String { - ::std::mem::replace(&mut self.device, ::std::string::String::new()) - } - - // repeated .tensorflow.NodeDef.AttrEntry attr = 5; - - pub fn get_attr( - &self, - ) -> &::std::collections::HashMap<::std::string::String, super::attr_value::AttrValue> { - &self.attr - } - pub fn clear_attr(&mut self) { - self.attr.clear(); - } - - // Param is passed by value, moved - pub fn set_attr( - &mut self, - v: ::std::collections::HashMap<::std::string::String, super::attr_value::AttrValue>, - ) { - self.attr = v; - } - - // Mutable pointer to the field. - pub fn mut_attr( - &mut self, - ) -> &mut ::std::collections::HashMap<::std::string::String, super::attr_value::AttrValue> { - &mut self.attr - } - - // Take field - pub fn take_attr( - &mut self, - ) -> ::std::collections::HashMap<::std::string::String, super::attr_value::AttrValue> { - ::std::mem::replace(&mut self.attr, ::std::collections::HashMap::new()) - } - - // .tensorflow.NodeDef.ExperimentalDebugInfo experimental_debug_info = 6; - - pub fn get_experimental_debug_info(&self) -> &NodeDef_ExperimentalDebugInfo { - self.experimental_debug_info.as_ref().unwrap_or_else(|| { - ::default_instance() - }) - } - pub fn clear_experimental_debug_info(&mut self) { - self.experimental_debug_info.clear(); - } - - pub fn has_experimental_debug_info(&self) -> bool { - self.experimental_debug_info.is_some() - } - - // Param is passed by value, moved - pub fn set_experimental_debug_info(&mut self, v: NodeDef_ExperimentalDebugInfo) { - self.experimental_debug_info = ::protobuf::SingularPtrField::some(v); - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_experimental_debug_info(&mut self) -> &mut NodeDef_ExperimentalDebugInfo { - if self.experimental_debug_info.is_none() { - self.experimental_debug_info.set_default(); - } - self.experimental_debug_info.as_mut().unwrap() - } - - // Take field - pub fn take_experimental_debug_info(&mut self) -> NodeDef_ExperimentalDebugInfo { - self.experimental_debug_info - .take() - .unwrap_or_else(|| NodeDef_ExperimentalDebugInfo::new()) - } -} - -impl ::protobuf::Message for NodeDef { - fn is_initialized(&self) -> bool { - for v in &self.experimental_debug_info { - if !v.is_initialized() { - return false; - } - } - true - } - - fn merge_from( - &mut self, - is: &mut ::protobuf::CodedInputStream<'_>, - ) -> ::protobuf::ProtobufResult<()> { - while !is.eof()? { - let (field_number, wire_type) = is.read_tag_unpack()?; - match field_number { - 1 => { - ::protobuf::rt::read_singular_proto3_string_into( - wire_type, - is, - &mut self.name, - )?; - } - 2 => { - ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.op)?; - } - 3 => { - ::protobuf::rt::read_repeated_string_into(wire_type, is, &mut self.input)?; - } - 4 => { - ::protobuf::rt::read_singular_proto3_string_into( - wire_type, - is, - &mut self.device, - )?; - } - 5 => { - ::protobuf::rt::read_map_into::< - ::protobuf::types::ProtobufTypeString, - ::protobuf::types::ProtobufTypeMessage, - >(wire_type, is, &mut self.attr)?; - } - 6 => { - ::protobuf::rt::read_singular_message_into( - wire_type, - is, - &mut self.experimental_debug_info, - )?; - } - _ => { - ::protobuf::rt::read_unknown_or_skip_group( - field_number, - wire_type, - is, - self.mut_unknown_fields(), - )?; - } - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u32 { - let mut my_size = 0; - if !self.name.is_empty() { - my_size += ::protobuf::rt::string_size(1, &self.name); - } - if !self.op.is_empty() { - my_size += ::protobuf::rt::string_size(2, &self.op); - } - for value in &self.input { - my_size += ::protobuf::rt::string_size(3, &value); - } - if !self.device.is_empty() { - my_size += ::protobuf::rt::string_size(4, &self.device); - } - my_size += ::protobuf::rt::compute_map_size::< - ::protobuf::types::ProtobufTypeString, - ::protobuf::types::ProtobufTypeMessage, - >(5, &self.attr); - if let Some(ref v) = self.experimental_debug_info.as_ref() { - let len = v.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - } - my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); - self.cached_size.set(my_size); - my_size - } - - fn write_to_with_cached_sizes( - &self, - os: &mut ::protobuf::CodedOutputStream<'_>, - ) -> ::protobuf::ProtobufResult<()> { - if !self.name.is_empty() { - os.write_string(1, &self.name)?; - } - if !self.op.is_empty() { - os.write_string(2, &self.op)?; - } - for v in &self.input { - os.write_string(3, &v)?; - } - if !self.device.is_empty() { - os.write_string(4, &self.device)?; - } - ::protobuf::rt::write_map_with_cached_sizes::< - ::protobuf::types::ProtobufTypeString, - ::protobuf::types::ProtobufTypeMessage, - >(5, &self.attr, os)?; - if let Some(ref v) = self.experimental_debug_info.as_ref() { - os.write_tag(6, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - } - os.write_unknown_fields(self.get_unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn get_cached_size(&self) -> u32 { - self.cached_size.get() - } - - fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { - &self.unknown_fields - } - - fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { - &mut self.unknown_fields - } - - fn as_any(&self) -> &dyn (::std::any::Any) { - self as &dyn (::std::any::Any) - } - fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { - self as &mut dyn (::std::any::Any) - } - fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { - self - } - - fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - Self::descriptor_static() - } - - fn new() -> NodeDef { - NodeDef::new() - } - - fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = - ::protobuf::rt::LazyV2::INIT; - descriptor.get(|| { - let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::< - _, - ::protobuf::types::ProtobufTypeString, - >( - "name", - |m: &NodeDef| &m.name, - |m: &mut NodeDef| &mut m.name, - )); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::< - _, - ::protobuf::types::ProtobufTypeString, - >( - "op", |m: &NodeDef| &m.op, |m: &mut NodeDef| &mut m.op - )); - fields.push( - ::protobuf::reflect::accessor::make_repeated_field_accessor::< - _, - ::protobuf::types::ProtobufTypeString, - >( - "input", - |m: &NodeDef| &m.input, - |m: &mut NodeDef| &mut m.input, - ), - ); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::< - _, - ::protobuf::types::ProtobufTypeString, - >( - "device", - |m: &NodeDef| &m.device, - |m: &mut NodeDef| &mut m.device, - )); - fields.push(::protobuf::reflect::accessor::make_map_accessor::< - _, - ::protobuf::types::ProtobufTypeString, - ::protobuf::types::ProtobufTypeMessage, - >( - "attr", - |m: &NodeDef| &m.attr, - |m: &mut NodeDef| &mut m.attr, - )); - fields.push( - ::protobuf::reflect::accessor::make_singular_ptr_field_accessor::< - _, - ::protobuf::types::ProtobufTypeMessage, - >( - "experimental_debug_info", - |m: &NodeDef| &m.experimental_debug_info, - |m: &mut NodeDef| &mut m.experimental_debug_info, - ), - ); - ::protobuf::reflect::MessageDescriptor::new_pb_name::( - "NodeDef", - fields, - file_descriptor_proto(), - ) - }) - } - - fn default_instance() -> &'static NodeDef { - static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; - instance.get(NodeDef::new) - } -} - -impl ::protobuf::Clear for NodeDef { - fn clear(&mut self) { - self.name.clear(); - self.op.clear(); - self.input.clear(); - self.device.clear(); - self.attr.clear(); - self.experimental_debug_info.clear(); - self.unknown_fields.clear(); - } -} - -impl ::std::fmt::Debug for NodeDef { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for NodeDef { - fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { - ::protobuf::reflect::ReflectValueRef::Message(self) - } -} - -#[derive(PartialEq, Clone, Default)] -pub struct NodeDef_ExperimentalDebugInfo { - // message fields - pub original_node_names: ::protobuf::RepeatedField<::std::string::String>, - pub original_func_names: ::protobuf::RepeatedField<::std::string::String>, - // special fields - pub unknown_fields: ::protobuf::UnknownFields, - pub cached_size: ::protobuf::CachedSize, -} - -impl<'a> ::std::default::Default for &'a NodeDef_ExperimentalDebugInfo { - fn default() -> &'a NodeDef_ExperimentalDebugInfo { - ::default_instance() - } -} - -impl NodeDef_ExperimentalDebugInfo { - pub fn new() -> NodeDef_ExperimentalDebugInfo { - ::std::default::Default::default() - } - - // repeated string original_node_names = 1; - - pub fn get_original_node_names(&self) -> &[::std::string::String] { - &self.original_node_names - } - pub fn clear_original_node_names(&mut self) { - self.original_node_names.clear(); - } - - // Param is passed by value, moved - pub fn set_original_node_names(&mut self, v: ::protobuf::RepeatedField<::std::string::String>) { - self.original_node_names = v; - } - - // Mutable pointer to the field. - pub fn mut_original_node_names( - &mut self, - ) -> &mut ::protobuf::RepeatedField<::std::string::String> { - &mut self.original_node_names - } - - // Take field - pub fn take_original_node_names(&mut self) -> ::protobuf::RepeatedField<::std::string::String> { - ::std::mem::replace( - &mut self.original_node_names, - ::protobuf::RepeatedField::new(), - ) - } - - // repeated string original_func_names = 2; - - pub fn get_original_func_names(&self) -> &[::std::string::String] { - &self.original_func_names - } - pub fn clear_original_func_names(&mut self) { - self.original_func_names.clear(); - } - - // Param is passed by value, moved - pub fn set_original_func_names(&mut self, v: ::protobuf::RepeatedField<::std::string::String>) { - self.original_func_names = v; - } - - // Mutable pointer to the field. - pub fn mut_original_func_names( - &mut self, - ) -> &mut ::protobuf::RepeatedField<::std::string::String> { - &mut self.original_func_names - } - - // Take field - pub fn take_original_func_names(&mut self) -> ::protobuf::RepeatedField<::std::string::String> { - ::std::mem::replace( - &mut self.original_func_names, - ::protobuf::RepeatedField::new(), - ) - } -} - -impl ::protobuf::Message for NodeDef_ExperimentalDebugInfo { - fn is_initialized(&self) -> bool { - true - } - - fn merge_from( - &mut self, - is: &mut ::protobuf::CodedInputStream<'_>, - ) -> ::protobuf::ProtobufResult<()> { - while !is.eof()? { - let (field_number, wire_type) = is.read_tag_unpack()?; - match field_number { - 1 => { - ::protobuf::rt::read_repeated_string_into( - wire_type, - is, - &mut self.original_node_names, - )?; - } - 2 => { - ::protobuf::rt::read_repeated_string_into( - wire_type, - is, - &mut self.original_func_names, - )?; - } - _ => { - ::protobuf::rt::read_unknown_or_skip_group( - field_number, - wire_type, - is, - self.mut_unknown_fields(), - )?; - } - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u32 { - let mut my_size = 0; - for value in &self.original_node_names { - my_size += ::protobuf::rt::string_size(1, &value); - } - for value in &self.original_func_names { - my_size += ::protobuf::rt::string_size(2, &value); - } - my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); - self.cached_size.set(my_size); - my_size - } - - fn write_to_with_cached_sizes( - &self, - os: &mut ::protobuf::CodedOutputStream<'_>, - ) -> ::protobuf::ProtobufResult<()> { - for v in &self.original_node_names { - os.write_string(1, &v)?; - } - for v in &self.original_func_names { - os.write_string(2, &v)?; - } - os.write_unknown_fields(self.get_unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn get_cached_size(&self) -> u32 { - self.cached_size.get() - } - - fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { - &self.unknown_fields - } - - fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { - &mut self.unknown_fields - } - - fn as_any(&self) -> &dyn (::std::any::Any) { - self as &dyn (::std::any::Any) - } - fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { - self as &mut dyn (::std::any::Any) - } - fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { - self - } - - fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - Self::descriptor_static() - } - - fn new() -> NodeDef_ExperimentalDebugInfo { - NodeDef_ExperimentalDebugInfo::new() - } - - fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = - ::protobuf::rt::LazyV2::INIT; - descriptor.get(|| { - let mut fields = ::std::vec::Vec::new(); - fields.push( - ::protobuf::reflect::accessor::make_repeated_field_accessor::< - _, - ::protobuf::types::ProtobufTypeString, - >( - "original_node_names", - |m: &NodeDef_ExperimentalDebugInfo| &m.original_node_names, - |m: &mut NodeDef_ExperimentalDebugInfo| &mut m.original_node_names, - ), - ); - fields.push( - ::protobuf::reflect::accessor::make_repeated_field_accessor::< - _, - ::protobuf::types::ProtobufTypeString, - >( - "original_func_names", - |m: &NodeDef_ExperimentalDebugInfo| &m.original_func_names, - |m: &mut NodeDef_ExperimentalDebugInfo| &mut m.original_func_names, - ), - ); - ::protobuf::reflect::MessageDescriptor::new_pb_name::( - "NodeDef.ExperimentalDebugInfo", - fields, - file_descriptor_proto(), - ) - }) - } - - fn default_instance() -> &'static NodeDef_ExperimentalDebugInfo { - static instance: ::protobuf::rt::LazyV2 = - ::protobuf::rt::LazyV2::INIT; - instance.get(NodeDef_ExperimentalDebugInfo::new) - } -} - -impl ::protobuf::Clear for NodeDef_ExperimentalDebugInfo { - fn clear(&mut self) { - self.original_node_names.clear(); - self.original_func_names.clear(); - self.unknown_fields.clear(); - } -} - -impl ::std::fmt::Debug for NodeDef_ExperimentalDebugInfo { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for NodeDef_ExperimentalDebugInfo { - fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { - ::protobuf::reflect::ReflectValueRef::Message(self) - } -} - -static file_descriptor_proto_data: &'static [u8] = b"\ - \n(tensorflow/core/framework/node_def.proto\x12\ntensorflow\x1a*tensorfl\ - ow/core/framework/attr_value.proto\"\xba\x03\n\x07NodeDef\x12\x12\n\x04n\ - ame\x18\x01\x20\x01(\tR\x04name\x12\x0e\n\x02op\x18\x02\x20\x01(\tR\x02o\ - p\x12\x14\n\x05input\x18\x03\x20\x03(\tR\x05input\x12\x16\n\x06device\ - \x18\x04\x20\x01(\tR\x06device\x121\n\x04attr\x18\x05\x20\x03(\x0b2\x1d.\ - tensorflow.NodeDef.AttrEntryR\x04attr\x12a\n\x17experimental_debug_info\ - \x18\x06\x20\x01(\x0b2).tensorflow.NodeDef.ExperimentalDebugInfoR\x15exp\ - erimentalDebugInfo\x1aN\n\tAttrEntry\x12\x10\n\x03key\x18\x01\x20\x01(\t\ - R\x03key\x12+\n\x05value\x18\x02\x20\x01(\x0b2\x15.tensorflow.AttrValueR\ - \x05value:\x028\x01\x1aw\n\x15ExperimentalDebugInfo\x12.\n\x13original_n\ - ode_names\x18\x01\x20\x03(\tR\x11originalNodeNames\x12.\n\x13original_fu\ - nc_names\x18\x02\x20\x03(\tR\x11originalFuncNamesBi\n\x18org.tensorflow.\ - frameworkB\tNodeProtoP\x01Z=github.com/tensorflow/tensorflow/tensorflow/\ - go/core/framework\xf8\x01\x01b\x06proto3\ -"; - -static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2< - ::protobuf::descriptor::FileDescriptorProto, -> = ::protobuf::rt::LazyV2::INIT; - -fn parse_descriptor_proto() -> ::protobuf::descriptor::FileDescriptorProto { - ::protobuf::parse_from_bytes(file_descriptor_proto_data).unwrap() -} - -pub fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto { - file_descriptor_proto_lazy.get(|| parse_descriptor_proto()) -} diff --git a/src/protos/op_def.rs b/src/protos/op_def.rs deleted file mode 100644 index d602607237..0000000000 --- a/src/protos/op_def.rs +++ /dev/null @@ -1,2111 +0,0 @@ -// This file is generated by rust-protobuf 2.17.0. Do not edit -// @generated - -// https://github.com/rust-lang/rust-clippy/issues/702 -#![allow(unknown_lints)] -#![allow(clippy::all)] - -#![allow(unused_attributes)] -#![rustfmt::skip] - -#![allow(box_pointers)] -#![allow(dead_code)] -#![allow(missing_docs)] -#![allow(non_camel_case_types)] -#![allow(non_snake_case)] -#![allow(non_upper_case_globals)] -#![allow(trivial_casts)] -#![allow(unused_imports)] -#![allow(unused_results)] -//! Generated file from `tensorflow/core/framework/op_def.proto` - -/// Generated files are compatible only with the same version -/// of protobuf runtime. -// const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_17_0; - -#[derive(PartialEq, Clone, Default)] -pub struct OpDef { - // message fields - pub name: ::std::string::String, - pub input_arg: ::protobuf::RepeatedField, - pub output_arg: ::protobuf::RepeatedField, - pub control_output: ::protobuf::RepeatedField<::std::string::String>, - pub attr: ::protobuf::RepeatedField, - pub deprecation: ::protobuf::SingularPtrField, - pub summary: ::std::string::String, - pub description: ::std::string::String, - pub is_commutative: bool, - pub is_aggregate: bool, - pub is_stateful: bool, - pub allows_uninitialized_input: bool, - // special fields - pub unknown_fields: ::protobuf::UnknownFields, - pub cached_size: ::protobuf::CachedSize, -} - -impl<'a> ::std::default::Default for &'a OpDef { - fn default() -> &'a OpDef { - ::default_instance() - } -} - -impl OpDef { - pub fn new() -> OpDef { - ::std::default::Default::default() - } - - // string name = 1; - - pub fn get_name(&self) -> &str { - &self.name - } - pub fn clear_name(&mut self) { - self.name.clear(); - } - - // Param is passed by value, moved - pub fn set_name(&mut self, v: ::std::string::String) { - self.name = v; - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_name(&mut self) -> &mut ::std::string::String { - &mut self.name - } - - // Take field - pub fn take_name(&mut self) -> ::std::string::String { - ::std::mem::replace(&mut self.name, ::std::string::String::new()) - } - - // repeated .tensorflow.OpDef.ArgDef input_arg = 2; - - pub fn get_input_arg(&self) -> &[OpDef_ArgDef] { - &self.input_arg - } - pub fn clear_input_arg(&mut self) { - self.input_arg.clear(); - } - - // Param is passed by value, moved - pub fn set_input_arg(&mut self, v: ::protobuf::RepeatedField) { - self.input_arg = v; - } - - // Mutable pointer to the field. - pub fn mut_input_arg(&mut self) -> &mut ::protobuf::RepeatedField { - &mut self.input_arg - } - - // Take field - pub fn take_input_arg(&mut self) -> ::protobuf::RepeatedField { - ::std::mem::replace(&mut self.input_arg, ::protobuf::RepeatedField::new()) - } - - // repeated .tensorflow.OpDef.ArgDef output_arg = 3; - - pub fn get_output_arg(&self) -> &[OpDef_ArgDef] { - &self.output_arg - } - pub fn clear_output_arg(&mut self) { - self.output_arg.clear(); - } - - // Param is passed by value, moved - pub fn set_output_arg(&mut self, v: ::protobuf::RepeatedField) { - self.output_arg = v; - } - - // Mutable pointer to the field. - pub fn mut_output_arg(&mut self) -> &mut ::protobuf::RepeatedField { - &mut self.output_arg - } - - // Take field - pub fn take_output_arg(&mut self) -> ::protobuf::RepeatedField { - ::std::mem::replace(&mut self.output_arg, ::protobuf::RepeatedField::new()) - } - - // repeated string control_output = 20; - - pub fn get_control_output(&self) -> &[::std::string::String] { - &self.control_output - } - pub fn clear_control_output(&mut self) { - self.control_output.clear(); - } - - // Param is passed by value, moved - pub fn set_control_output(&mut self, v: ::protobuf::RepeatedField<::std::string::String>) { - self.control_output = v; - } - - // Mutable pointer to the field. - pub fn mut_control_output(&mut self) -> &mut ::protobuf::RepeatedField<::std::string::String> { - &mut self.control_output - } - - // Take field - pub fn take_control_output(&mut self) -> ::protobuf::RepeatedField<::std::string::String> { - ::std::mem::replace(&mut self.control_output, ::protobuf::RepeatedField::new()) - } - - // repeated .tensorflow.OpDef.AttrDef attr = 4; - - pub fn get_attr(&self) -> &[OpDef_AttrDef] { - &self.attr - } - pub fn clear_attr(&mut self) { - self.attr.clear(); - } - - // Param is passed by value, moved - pub fn set_attr(&mut self, v: ::protobuf::RepeatedField) { - self.attr = v; - } - - // Mutable pointer to the field. - pub fn mut_attr(&mut self) -> &mut ::protobuf::RepeatedField { - &mut self.attr - } - - // Take field - pub fn take_attr(&mut self) -> ::protobuf::RepeatedField { - ::std::mem::replace(&mut self.attr, ::protobuf::RepeatedField::new()) - } - - // .tensorflow.OpDeprecation deprecation = 8; - - pub fn get_deprecation(&self) -> &OpDeprecation { - self.deprecation - .as_ref() - .unwrap_or_else(|| ::default_instance()) - } - pub fn clear_deprecation(&mut self) { - self.deprecation.clear(); - } - - pub fn has_deprecation(&self) -> bool { - self.deprecation.is_some() - } - - // Param is passed by value, moved - pub fn set_deprecation(&mut self, v: OpDeprecation) { - self.deprecation = ::protobuf::SingularPtrField::some(v); - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_deprecation(&mut self) -> &mut OpDeprecation { - if self.deprecation.is_none() { - self.deprecation.set_default(); - } - self.deprecation.as_mut().unwrap() - } - - // Take field - pub fn take_deprecation(&mut self) -> OpDeprecation { - self.deprecation - .take() - .unwrap_or_else(|| OpDeprecation::new()) - } - - // string summary = 5; - - pub fn get_summary(&self) -> &str { - &self.summary - } - pub fn clear_summary(&mut self) { - self.summary.clear(); - } - - // Param is passed by value, moved - pub fn set_summary(&mut self, v: ::std::string::String) { - self.summary = v; - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_summary(&mut self) -> &mut ::std::string::String { - &mut self.summary - } - - // Take field - pub fn take_summary(&mut self) -> ::std::string::String { - ::std::mem::replace(&mut self.summary, ::std::string::String::new()) - } - - // string description = 6; - - pub fn get_description(&self) -> &str { - &self.description - } - pub fn clear_description(&mut self) { - self.description.clear(); - } - - // Param is passed by value, moved - pub fn set_description(&mut self, v: ::std::string::String) { - self.description = v; - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_description(&mut self) -> &mut ::std::string::String { - &mut self.description - } - - // Take field - pub fn take_description(&mut self) -> ::std::string::String { - ::std::mem::replace(&mut self.description, ::std::string::String::new()) - } - - // bool is_commutative = 18; - - pub fn get_is_commutative(&self) -> bool { - self.is_commutative - } - pub fn clear_is_commutative(&mut self) { - self.is_commutative = false; - } - - // Param is passed by value, moved - pub fn set_is_commutative(&mut self, v: bool) { - self.is_commutative = v; - } - - // bool is_aggregate = 16; - - pub fn get_is_aggregate(&self) -> bool { - self.is_aggregate - } - pub fn clear_is_aggregate(&mut self) { - self.is_aggregate = false; - } - - // Param is passed by value, moved - pub fn set_is_aggregate(&mut self, v: bool) { - self.is_aggregate = v; - } - - // bool is_stateful = 17; - - pub fn get_is_stateful(&self) -> bool { - self.is_stateful - } - pub fn clear_is_stateful(&mut self) { - self.is_stateful = false; - } - - // Param is passed by value, moved - pub fn set_is_stateful(&mut self, v: bool) { - self.is_stateful = v; - } - - // bool allows_uninitialized_input = 19; - - pub fn get_allows_uninitialized_input(&self) -> bool { - self.allows_uninitialized_input - } - pub fn clear_allows_uninitialized_input(&mut self) { - self.allows_uninitialized_input = false; - } - - // Param is passed by value, moved - pub fn set_allows_uninitialized_input(&mut self, v: bool) { - self.allows_uninitialized_input = v; - } -} - -impl ::protobuf::Message for OpDef { - fn is_initialized(&self) -> bool { - for v in &self.input_arg { - if !v.is_initialized() { - return false; - } - } - for v in &self.output_arg { - if !v.is_initialized() { - return false; - } - } - for v in &self.attr { - if !v.is_initialized() { - return false; - } - } - for v in &self.deprecation { - if !v.is_initialized() { - return false; - } - } - true - } - - fn merge_from( - &mut self, - is: &mut ::protobuf::CodedInputStream<'_>, - ) -> ::protobuf::ProtobufResult<()> { - while !is.eof()? { - let (field_number, wire_type) = is.read_tag_unpack()?; - match field_number { - 1 => { - ::protobuf::rt::read_singular_proto3_string_into( - wire_type, - is, - &mut self.name, - )?; - } - 2 => { - ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.input_arg)?; - } - 3 => { - ::protobuf::rt::read_repeated_message_into( - wire_type, - is, - &mut self.output_arg, - )?; - } - 20 => { - ::protobuf::rt::read_repeated_string_into( - wire_type, - is, - &mut self.control_output, - )?; - } - 4 => { - ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.attr)?; - } - 8 => { - ::protobuf::rt::read_singular_message_into( - wire_type, - is, - &mut self.deprecation, - )?; - } - 5 => { - ::protobuf::rt::read_singular_proto3_string_into( - wire_type, - is, - &mut self.summary, - )?; - } - 6 => { - ::protobuf::rt::read_singular_proto3_string_into( - wire_type, - is, - &mut self.description, - )?; - } - 18 => { - if wire_type != ::protobuf::wire_format::WireTypeVarint { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type( - wire_type, - )); - } - let tmp = is.read_bool()?; - self.is_commutative = tmp; - } - 16 => { - if wire_type != ::protobuf::wire_format::WireTypeVarint { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type( - wire_type, - )); - } - let tmp = is.read_bool()?; - self.is_aggregate = tmp; - } - 17 => { - if wire_type != ::protobuf::wire_format::WireTypeVarint { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type( - wire_type, - )); - } - let tmp = is.read_bool()?; - self.is_stateful = tmp; - } - 19 => { - if wire_type != ::protobuf::wire_format::WireTypeVarint { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type( - wire_type, - )); - } - let tmp = is.read_bool()?; - self.allows_uninitialized_input = tmp; - } - _ => { - ::protobuf::rt::read_unknown_or_skip_group( - field_number, - wire_type, - is, - self.mut_unknown_fields(), - )?; - } - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u32 { - let mut my_size = 0; - if !self.name.is_empty() { - my_size += ::protobuf::rt::string_size(1, &self.name); - } - for value in &self.input_arg { - let len = value.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - } - for value in &self.output_arg { - let len = value.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - } - for value in &self.control_output { - my_size += ::protobuf::rt::string_size(20, &value); - } - for value in &self.attr { - let len = value.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - } - if let Some(ref v) = self.deprecation.as_ref() { - let len = v.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - } - if !self.summary.is_empty() { - my_size += ::protobuf::rt::string_size(5, &self.summary); - } - if !self.description.is_empty() { - my_size += ::protobuf::rt::string_size(6, &self.description); - } - if self.is_commutative != false { - my_size += 3; - } - if self.is_aggregate != false { - my_size += 3; - } - if self.is_stateful != false { - my_size += 3; - } - if self.allows_uninitialized_input != false { - my_size += 3; - } - my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); - self.cached_size.set(my_size); - my_size - } - - fn write_to_with_cached_sizes( - &self, - os: &mut ::protobuf::CodedOutputStream<'_>, - ) -> ::protobuf::ProtobufResult<()> { - if !self.name.is_empty() { - os.write_string(1, &self.name)?; - } - for v in &self.input_arg { - os.write_tag(2, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - } - for v in &self.output_arg { - os.write_tag(3, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - } - for v in &self.control_output { - os.write_string(20, &v)?; - } - for v in &self.attr { - os.write_tag(4, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - } - if let Some(ref v) = self.deprecation.as_ref() { - os.write_tag(8, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - } - if !self.summary.is_empty() { - os.write_string(5, &self.summary)?; - } - if !self.description.is_empty() { - os.write_string(6, &self.description)?; - } - if self.is_commutative != false { - os.write_bool(18, self.is_commutative)?; - } - if self.is_aggregate != false { - os.write_bool(16, self.is_aggregate)?; - } - if self.is_stateful != false { - os.write_bool(17, self.is_stateful)?; - } - if self.allows_uninitialized_input != false { - os.write_bool(19, self.allows_uninitialized_input)?; - } - os.write_unknown_fields(self.get_unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn get_cached_size(&self) -> u32 { - self.cached_size.get() - } - - fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { - &self.unknown_fields - } - - fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { - &mut self.unknown_fields - } - - fn as_any(&self) -> &dyn (::std::any::Any) { - self as &dyn (::std::any::Any) - } - fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { - self as &mut dyn (::std::any::Any) - } - fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { - self - } - - fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - Self::descriptor_static() - } - - fn new() -> OpDef { - OpDef::new() - } - - fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = - ::protobuf::rt::LazyV2::INIT; - descriptor.get(|| { - let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::< - _, - ::protobuf::types::ProtobufTypeString, - >( - "name", |m: &OpDef| &m.name, |m: &mut OpDef| &mut m.name - )); - fields.push( - ::protobuf::reflect::accessor::make_repeated_field_accessor::< - _, - ::protobuf::types::ProtobufTypeMessage, - >( - "input_arg", - |m: &OpDef| &m.input_arg, - |m: &mut OpDef| &mut m.input_arg, - ), - ); - fields.push( - ::protobuf::reflect::accessor::make_repeated_field_accessor::< - _, - ::protobuf::types::ProtobufTypeMessage, - >( - "output_arg", - |m: &OpDef| &m.output_arg, - |m: &mut OpDef| &mut m.output_arg, - ), - ); - fields.push( - ::protobuf::reflect::accessor::make_repeated_field_accessor::< - _, - ::protobuf::types::ProtobufTypeString, - >( - "control_output", - |m: &OpDef| &m.control_output, - |m: &mut OpDef| &mut m.control_output, - ), - ); - fields.push( - ::protobuf::reflect::accessor::make_repeated_field_accessor::< - _, - ::protobuf::types::ProtobufTypeMessage, - >("attr", |m: &OpDef| &m.attr, |m: &mut OpDef| &mut m.attr), - ); - fields.push( - ::protobuf::reflect::accessor::make_singular_ptr_field_accessor::< - _, - ::protobuf::types::ProtobufTypeMessage, - >( - "deprecation", - |m: &OpDef| &m.deprecation, - |m: &mut OpDef| &mut m.deprecation, - ), - ); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::< - _, - ::protobuf::types::ProtobufTypeString, - >( - "summary", - |m: &OpDef| &m.summary, - |m: &mut OpDef| &mut m.summary, - )); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::< - _, - ::protobuf::types::ProtobufTypeString, - >( - "description", - |m: &OpDef| &m.description, - |m: &mut OpDef| &mut m.description, - )); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::< - _, - ::protobuf::types::ProtobufTypeBool, - >( - "is_commutative", - |m: &OpDef| &m.is_commutative, - |m: &mut OpDef| &mut m.is_commutative, - )); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::< - _, - ::protobuf::types::ProtobufTypeBool, - >( - "is_aggregate", - |m: &OpDef| &m.is_aggregate, - |m: &mut OpDef| &mut m.is_aggregate, - )); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::< - _, - ::protobuf::types::ProtobufTypeBool, - >( - "is_stateful", - |m: &OpDef| &m.is_stateful, - |m: &mut OpDef| &mut m.is_stateful, - )); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::< - _, - ::protobuf::types::ProtobufTypeBool, - >( - "allows_uninitialized_input", - |m: &OpDef| &m.allows_uninitialized_input, - |m: &mut OpDef| &mut m.allows_uninitialized_input, - )); - ::protobuf::reflect::MessageDescriptor::new_pb_name::( - "OpDef", - fields, - file_descriptor_proto(), - ) - }) - } - - fn default_instance() -> &'static OpDef { - static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; - instance.get(OpDef::new) - } -} - -impl ::protobuf::Clear for OpDef { - fn clear(&mut self) { - self.name.clear(); - self.input_arg.clear(); - self.output_arg.clear(); - self.control_output.clear(); - self.attr.clear(); - self.deprecation.clear(); - self.summary.clear(); - self.description.clear(); - self.is_commutative = false; - self.is_aggregate = false; - self.is_stateful = false; - self.allows_uninitialized_input = false; - self.unknown_fields.clear(); - } -} - -impl ::std::fmt::Debug for OpDef { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for OpDef { - fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { - ::protobuf::reflect::ReflectValueRef::Message(self) - } -} - -#[derive(PartialEq, Clone, Default)] -pub struct OpDef_ArgDef { - // message fields - pub name: ::std::string::String, - pub description: ::std::string::String, - pub field_type: super::types::DataType, - pub type_attr: ::std::string::String, - pub number_attr: ::std::string::String, - pub type_list_attr: ::std::string::String, - pub is_ref: bool, - // special fields - pub unknown_fields: ::protobuf::UnknownFields, - pub cached_size: ::protobuf::CachedSize, -} - -impl<'a> ::std::default::Default for &'a OpDef_ArgDef { - fn default() -> &'a OpDef_ArgDef { - ::default_instance() - } -} - -impl OpDef_ArgDef { - pub fn new() -> OpDef_ArgDef { - ::std::default::Default::default() - } - - // string name = 1; - - pub fn get_name(&self) -> &str { - &self.name - } - pub fn clear_name(&mut self) { - self.name.clear(); - } - - // Param is passed by value, moved - pub fn set_name(&mut self, v: ::std::string::String) { - self.name = v; - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_name(&mut self) -> &mut ::std::string::String { - &mut self.name - } - - // Take field - pub fn take_name(&mut self) -> ::std::string::String { - ::std::mem::replace(&mut self.name, ::std::string::String::new()) - } - - // string description = 2; - - pub fn get_description(&self) -> &str { - &self.description - } - pub fn clear_description(&mut self) { - self.description.clear(); - } - - // Param is passed by value, moved - pub fn set_description(&mut self, v: ::std::string::String) { - self.description = v; - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_description(&mut self) -> &mut ::std::string::String { - &mut self.description - } - - // Take field - pub fn take_description(&mut self) -> ::std::string::String { - ::std::mem::replace(&mut self.description, ::std::string::String::new()) - } - - // .tensorflow.DataType type = 3; - - pub fn get_field_type(&self) -> super::types::DataType { - self.field_type - } - pub fn clear_field_type(&mut self) { - self.field_type = super::types::DataType::DT_INVALID; - } - - // Param is passed by value, moved - pub fn set_field_type(&mut self, v: super::types::DataType) { - self.field_type = v; - } - - // string type_attr = 4; - - pub fn get_type_attr(&self) -> &str { - &self.type_attr - } - pub fn clear_type_attr(&mut self) { - self.type_attr.clear(); - } - - // Param is passed by value, moved - pub fn set_type_attr(&mut self, v: ::std::string::String) { - self.type_attr = v; - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_type_attr(&mut self) -> &mut ::std::string::String { - &mut self.type_attr - } - - // Take field - pub fn take_type_attr(&mut self) -> ::std::string::String { - ::std::mem::replace(&mut self.type_attr, ::std::string::String::new()) - } - - // string number_attr = 5; - - pub fn get_number_attr(&self) -> &str { - &self.number_attr - } - pub fn clear_number_attr(&mut self) { - self.number_attr.clear(); - } - - // Param is passed by value, moved - pub fn set_number_attr(&mut self, v: ::std::string::String) { - self.number_attr = v; - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_number_attr(&mut self) -> &mut ::std::string::String { - &mut self.number_attr - } - - // Take field - pub fn take_number_attr(&mut self) -> ::std::string::String { - ::std::mem::replace(&mut self.number_attr, ::std::string::String::new()) - } - - // string type_list_attr = 6; - - pub fn get_type_list_attr(&self) -> &str { - &self.type_list_attr - } - pub fn clear_type_list_attr(&mut self) { - self.type_list_attr.clear(); - } - - // Param is passed by value, moved - pub fn set_type_list_attr(&mut self, v: ::std::string::String) { - self.type_list_attr = v; - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_type_list_attr(&mut self) -> &mut ::std::string::String { - &mut self.type_list_attr - } - - // Take field - pub fn take_type_list_attr(&mut self) -> ::std::string::String { - ::std::mem::replace(&mut self.type_list_attr, ::std::string::String::new()) - } - - // bool is_ref = 16; - - pub fn get_is_ref(&self) -> bool { - self.is_ref - } - pub fn clear_is_ref(&mut self) { - self.is_ref = false; - } - - // Param is passed by value, moved - pub fn set_is_ref(&mut self, v: bool) { - self.is_ref = v; - } -} - -impl ::protobuf::Message for OpDef_ArgDef { - fn is_initialized(&self) -> bool { - true - } - - fn merge_from( - &mut self, - is: &mut ::protobuf::CodedInputStream<'_>, - ) -> ::protobuf::ProtobufResult<()> { - while !is.eof()? { - let (field_number, wire_type) = is.read_tag_unpack()?; - match field_number { - 1 => { - ::protobuf::rt::read_singular_proto3_string_into( - wire_type, - is, - &mut self.name, - )?; - } - 2 => { - ::protobuf::rt::read_singular_proto3_string_into( - wire_type, - is, - &mut self.description, - )?; - } - 3 => ::protobuf::rt::read_proto3_enum_with_unknown_fields_into( - wire_type, - is, - &mut self.field_type, - 3, - &mut self.unknown_fields, - )?, - 4 => { - ::protobuf::rt::read_singular_proto3_string_into( - wire_type, - is, - &mut self.type_attr, - )?; - } - 5 => { - ::protobuf::rt::read_singular_proto3_string_into( - wire_type, - is, - &mut self.number_attr, - )?; - } - 6 => { - ::protobuf::rt::read_singular_proto3_string_into( - wire_type, - is, - &mut self.type_list_attr, - )?; - } - 16 => { - if wire_type != ::protobuf::wire_format::WireTypeVarint { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type( - wire_type, - )); - } - let tmp = is.read_bool()?; - self.is_ref = tmp; - } - _ => { - ::protobuf::rt::read_unknown_or_skip_group( - field_number, - wire_type, - is, - self.mut_unknown_fields(), - )?; - } - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u32 { - let mut my_size = 0; - if !self.name.is_empty() { - my_size += ::protobuf::rt::string_size(1, &self.name); - } - if !self.description.is_empty() { - my_size += ::protobuf::rt::string_size(2, &self.description); - } - if self.field_type != super::types::DataType::DT_INVALID { - my_size += ::protobuf::rt::enum_size(3, self.field_type); - } - if !self.type_attr.is_empty() { - my_size += ::protobuf::rt::string_size(4, &self.type_attr); - } - if !self.number_attr.is_empty() { - my_size += ::protobuf::rt::string_size(5, &self.number_attr); - } - if !self.type_list_attr.is_empty() { - my_size += ::protobuf::rt::string_size(6, &self.type_list_attr); - } - if self.is_ref != false { - my_size += 3; - } - my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); - self.cached_size.set(my_size); - my_size - } - - fn write_to_with_cached_sizes( - &self, - os: &mut ::protobuf::CodedOutputStream<'_>, - ) -> ::protobuf::ProtobufResult<()> { - if !self.name.is_empty() { - os.write_string(1, &self.name)?; - } - if !self.description.is_empty() { - os.write_string(2, &self.description)?; - } - if self.field_type != super::types::DataType::DT_INVALID { - os.write_enum(3, ::protobuf::ProtobufEnum::value(&self.field_type))?; - } - if !self.type_attr.is_empty() { - os.write_string(4, &self.type_attr)?; - } - if !self.number_attr.is_empty() { - os.write_string(5, &self.number_attr)?; - } - if !self.type_list_attr.is_empty() { - os.write_string(6, &self.type_list_attr)?; - } - if self.is_ref != false { - os.write_bool(16, self.is_ref)?; - } - os.write_unknown_fields(self.get_unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn get_cached_size(&self) -> u32 { - self.cached_size.get() - } - - fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { - &self.unknown_fields - } - - fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { - &mut self.unknown_fields - } - - fn as_any(&self) -> &dyn (::std::any::Any) { - self as &dyn (::std::any::Any) - } - fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { - self as &mut dyn (::std::any::Any) - } - fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { - self - } - - fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - Self::descriptor_static() - } - - fn new() -> OpDef_ArgDef { - OpDef_ArgDef::new() - } - - fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = - ::protobuf::rt::LazyV2::INIT; - descriptor.get(|| { - let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::< - _, - ::protobuf::types::ProtobufTypeString, - >( - "name", - |m: &OpDef_ArgDef| &m.name, - |m: &mut OpDef_ArgDef| &mut m.name, - )); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::< - _, - ::protobuf::types::ProtobufTypeString, - >( - "description", - |m: &OpDef_ArgDef| &m.description, - |m: &mut OpDef_ArgDef| &mut m.description, - )); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::< - _, - ::protobuf::types::ProtobufTypeEnum, - >( - "type", - |m: &OpDef_ArgDef| &m.field_type, - |m: &mut OpDef_ArgDef| &mut m.field_type, - )); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::< - _, - ::protobuf::types::ProtobufTypeString, - >( - "type_attr", - |m: &OpDef_ArgDef| &m.type_attr, - |m: &mut OpDef_ArgDef| &mut m.type_attr, - )); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::< - _, - ::protobuf::types::ProtobufTypeString, - >( - "number_attr", - |m: &OpDef_ArgDef| &m.number_attr, - |m: &mut OpDef_ArgDef| &mut m.number_attr, - )); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::< - _, - ::protobuf::types::ProtobufTypeString, - >( - "type_list_attr", - |m: &OpDef_ArgDef| &m.type_list_attr, - |m: &mut OpDef_ArgDef| &mut m.type_list_attr, - )); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::< - _, - ::protobuf::types::ProtobufTypeBool, - >( - "is_ref", - |m: &OpDef_ArgDef| &m.is_ref, - |m: &mut OpDef_ArgDef| &mut m.is_ref, - )); - ::protobuf::reflect::MessageDescriptor::new_pb_name::( - "OpDef.ArgDef", - fields, - file_descriptor_proto(), - ) - }) - } - - fn default_instance() -> &'static OpDef_ArgDef { - static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; - instance.get(OpDef_ArgDef::new) - } -} - -impl ::protobuf::Clear for OpDef_ArgDef { - fn clear(&mut self) { - self.name.clear(); - self.description.clear(); - self.field_type = super::types::DataType::DT_INVALID; - self.type_attr.clear(); - self.number_attr.clear(); - self.type_list_attr.clear(); - self.is_ref = false; - self.unknown_fields.clear(); - } -} - -impl ::std::fmt::Debug for OpDef_ArgDef { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for OpDef_ArgDef { - fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { - ::protobuf::reflect::ReflectValueRef::Message(self) - } -} - -#[derive(PartialEq, Clone, Default)] -pub struct OpDef_AttrDef { - // message fields - pub name: ::std::string::String, - pub field_type: ::std::string::String, - pub default_value: ::protobuf::SingularPtrField, - pub description: ::std::string::String, - pub has_minimum: bool, - pub minimum: i64, - pub allowed_values: ::protobuf::SingularPtrField, - // special fields - pub unknown_fields: ::protobuf::UnknownFields, - pub cached_size: ::protobuf::CachedSize, -} - -impl<'a> ::std::default::Default for &'a OpDef_AttrDef { - fn default() -> &'a OpDef_AttrDef { - ::default_instance() - } -} - -impl OpDef_AttrDef { - pub fn new() -> OpDef_AttrDef { - ::std::default::Default::default() - } - - // string name = 1; - - pub fn get_name(&self) -> &str { - &self.name - } - pub fn clear_name(&mut self) { - self.name.clear(); - } - - // Param is passed by value, moved - pub fn set_name(&mut self, v: ::std::string::String) { - self.name = v; - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_name(&mut self) -> &mut ::std::string::String { - &mut self.name - } - - // Take field - pub fn take_name(&mut self) -> ::std::string::String { - ::std::mem::replace(&mut self.name, ::std::string::String::new()) - } - - // string type = 2; - - pub fn get_field_type(&self) -> &str { - &self.field_type - } - pub fn clear_field_type(&mut self) { - self.field_type.clear(); - } - - // Param is passed by value, moved - pub fn set_field_type(&mut self, v: ::std::string::String) { - self.field_type = v; - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_field_type(&mut self) -> &mut ::std::string::String { - &mut self.field_type - } - - // Take field - pub fn take_field_type(&mut self) -> ::std::string::String { - ::std::mem::replace(&mut self.field_type, ::std::string::String::new()) - } - - // .tensorflow.AttrValue default_value = 3; - - pub fn get_default_value(&self) -> &super::attr_value::AttrValue { - self.default_value.as_ref().unwrap_or_else(|| { - ::default_instance() - }) - } - pub fn clear_default_value(&mut self) { - self.default_value.clear(); - } - - pub fn has_default_value(&self) -> bool { - self.default_value.is_some() - } - - // Param is passed by value, moved - pub fn set_default_value(&mut self, v: super::attr_value::AttrValue) { - self.default_value = ::protobuf::SingularPtrField::some(v); - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_default_value(&mut self) -> &mut super::attr_value::AttrValue { - if self.default_value.is_none() { - self.default_value.set_default(); - } - self.default_value.as_mut().unwrap() - } - - // Take field - pub fn take_default_value(&mut self) -> super::attr_value::AttrValue { - self.default_value - .take() - .unwrap_or_else(|| super::attr_value::AttrValue::new()) - } - - // string description = 4; - - pub fn get_description(&self) -> &str { - &self.description - } - pub fn clear_description(&mut self) { - self.description.clear(); - } - - // Param is passed by value, moved - pub fn set_description(&mut self, v: ::std::string::String) { - self.description = v; - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_description(&mut self) -> &mut ::std::string::String { - &mut self.description - } - - // Take field - pub fn take_description(&mut self) -> ::std::string::String { - ::std::mem::replace(&mut self.description, ::std::string::String::new()) - } - - // bool has_minimum = 5; - - pub fn get_has_minimum(&self) -> bool { - self.has_minimum - } - pub fn clear_has_minimum(&mut self) { - self.has_minimum = false; - } - - // Param is passed by value, moved - pub fn set_has_minimum(&mut self, v: bool) { - self.has_minimum = v; - } - - // int64 minimum = 6; - - pub fn get_minimum(&self) -> i64 { - self.minimum - } - pub fn clear_minimum(&mut self) { - self.minimum = 0; - } - - // Param is passed by value, moved - pub fn set_minimum(&mut self, v: i64) { - self.minimum = v; - } - - // .tensorflow.AttrValue allowed_values = 7; - - pub fn get_allowed_values(&self) -> &super::attr_value::AttrValue { - self.allowed_values.as_ref().unwrap_or_else(|| { - ::default_instance() - }) - } - pub fn clear_allowed_values(&mut self) { - self.allowed_values.clear(); - } - - pub fn has_allowed_values(&self) -> bool { - self.allowed_values.is_some() - } - - // Param is passed by value, moved - pub fn set_allowed_values(&mut self, v: super::attr_value::AttrValue) { - self.allowed_values = ::protobuf::SingularPtrField::some(v); - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_allowed_values(&mut self) -> &mut super::attr_value::AttrValue { - if self.allowed_values.is_none() { - self.allowed_values.set_default(); - } - self.allowed_values.as_mut().unwrap() - } - - // Take field - pub fn take_allowed_values(&mut self) -> super::attr_value::AttrValue { - self.allowed_values - .take() - .unwrap_or_else(|| super::attr_value::AttrValue::new()) - } -} - -impl ::protobuf::Message for OpDef_AttrDef { - fn is_initialized(&self) -> bool { - for v in &self.default_value { - if !v.is_initialized() { - return false; - } - } - for v in &self.allowed_values { - if !v.is_initialized() { - return false; - } - } - true - } - - fn merge_from( - &mut self, - is: &mut ::protobuf::CodedInputStream<'_>, - ) -> ::protobuf::ProtobufResult<()> { - while !is.eof()? { - let (field_number, wire_type) = is.read_tag_unpack()?; - match field_number { - 1 => { - ::protobuf::rt::read_singular_proto3_string_into( - wire_type, - is, - &mut self.name, - )?; - } - 2 => { - ::protobuf::rt::read_singular_proto3_string_into( - wire_type, - is, - &mut self.field_type, - )?; - } - 3 => { - ::protobuf::rt::read_singular_message_into( - wire_type, - is, - &mut self.default_value, - )?; - } - 4 => { - ::protobuf::rt::read_singular_proto3_string_into( - wire_type, - is, - &mut self.description, - )?; - } - 5 => { - if wire_type != ::protobuf::wire_format::WireTypeVarint { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type( - wire_type, - )); - } - let tmp = is.read_bool()?; - self.has_minimum = tmp; - } - 6 => { - if wire_type != ::protobuf::wire_format::WireTypeVarint { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type( - wire_type, - )); - } - let tmp = is.read_int64()?; - self.minimum = tmp; - } - 7 => { - ::protobuf::rt::read_singular_message_into( - wire_type, - is, - &mut self.allowed_values, - )?; - } - _ => { - ::protobuf::rt::read_unknown_or_skip_group( - field_number, - wire_type, - is, - self.mut_unknown_fields(), - )?; - } - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u32 { - let mut my_size = 0; - if !self.name.is_empty() { - my_size += ::protobuf::rt::string_size(1, &self.name); - } - if !self.field_type.is_empty() { - my_size += ::protobuf::rt::string_size(2, &self.field_type); - } - if let Some(ref v) = self.default_value.as_ref() { - let len = v.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - } - if !self.description.is_empty() { - my_size += ::protobuf::rt::string_size(4, &self.description); - } - if self.has_minimum != false { - my_size += 2; - } - if self.minimum != 0 { - my_size += ::protobuf::rt::value_size( - 6, - self.minimum, - ::protobuf::wire_format::WireTypeVarint, - ); - } - if let Some(ref v) = self.allowed_values.as_ref() { - let len = v.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - } - my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); - self.cached_size.set(my_size); - my_size - } - - fn write_to_with_cached_sizes( - &self, - os: &mut ::protobuf::CodedOutputStream<'_>, - ) -> ::protobuf::ProtobufResult<()> { - if !self.name.is_empty() { - os.write_string(1, &self.name)?; - } - if !self.field_type.is_empty() { - os.write_string(2, &self.field_type)?; - } - if let Some(ref v) = self.default_value.as_ref() { - os.write_tag(3, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - } - if !self.description.is_empty() { - os.write_string(4, &self.description)?; - } - if self.has_minimum != false { - os.write_bool(5, self.has_minimum)?; - } - if self.minimum != 0 { - os.write_int64(6, self.minimum)?; - } - if let Some(ref v) = self.allowed_values.as_ref() { - os.write_tag(7, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - } - os.write_unknown_fields(self.get_unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn get_cached_size(&self) -> u32 { - self.cached_size.get() - } - - fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { - &self.unknown_fields - } - - fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { - &mut self.unknown_fields - } - - fn as_any(&self) -> &dyn (::std::any::Any) { - self as &dyn (::std::any::Any) - } - fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { - self as &mut dyn (::std::any::Any) - } - fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { - self - } - - fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - Self::descriptor_static() - } - - fn new() -> OpDef_AttrDef { - OpDef_AttrDef::new() - } - - fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = - ::protobuf::rt::LazyV2::INIT; - descriptor.get(|| { - let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::< - _, - ::protobuf::types::ProtobufTypeString, - >( - "name", - |m: &OpDef_AttrDef| &m.name, - |m: &mut OpDef_AttrDef| &mut m.name, - )); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::< - _, - ::protobuf::types::ProtobufTypeString, - >( - "type", - |m: &OpDef_AttrDef| &m.field_type, - |m: &mut OpDef_AttrDef| &mut m.field_type, - )); - fields.push( - ::protobuf::reflect::accessor::make_singular_ptr_field_accessor::< - _, - ::protobuf::types::ProtobufTypeMessage, - >( - "default_value", - |m: &OpDef_AttrDef| &m.default_value, - |m: &mut OpDef_AttrDef| &mut m.default_value, - ), - ); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::< - _, - ::protobuf::types::ProtobufTypeString, - >( - "description", - |m: &OpDef_AttrDef| &m.description, - |m: &mut OpDef_AttrDef| &mut m.description, - )); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::< - _, - ::protobuf::types::ProtobufTypeBool, - >( - "has_minimum", - |m: &OpDef_AttrDef| &m.has_minimum, - |m: &mut OpDef_AttrDef| &mut m.has_minimum, - )); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::< - _, - ::protobuf::types::ProtobufTypeInt64, - >( - "minimum", - |m: &OpDef_AttrDef| &m.minimum, - |m: &mut OpDef_AttrDef| &mut m.minimum, - )); - fields.push( - ::protobuf::reflect::accessor::make_singular_ptr_field_accessor::< - _, - ::protobuf::types::ProtobufTypeMessage, - >( - "allowed_values", - |m: &OpDef_AttrDef| &m.allowed_values, - |m: &mut OpDef_AttrDef| &mut m.allowed_values, - ), - ); - ::protobuf::reflect::MessageDescriptor::new_pb_name::( - "OpDef.AttrDef", - fields, - file_descriptor_proto(), - ) - }) - } - - fn default_instance() -> &'static OpDef_AttrDef { - static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; - instance.get(OpDef_AttrDef::new) - } -} - -impl ::protobuf::Clear for OpDef_AttrDef { - fn clear(&mut self) { - self.name.clear(); - self.field_type.clear(); - self.default_value.clear(); - self.description.clear(); - self.has_minimum = false; - self.minimum = 0; - self.allowed_values.clear(); - self.unknown_fields.clear(); - } -} - -impl ::std::fmt::Debug for OpDef_AttrDef { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for OpDef_AttrDef { - fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { - ::protobuf::reflect::ReflectValueRef::Message(self) - } -} - -#[derive(PartialEq, Clone, Default)] -pub struct OpDeprecation { - // message fields - pub version: i32, - pub explanation: ::std::string::String, - // special fields - pub unknown_fields: ::protobuf::UnknownFields, - pub cached_size: ::protobuf::CachedSize, -} - -impl<'a> ::std::default::Default for &'a OpDeprecation { - fn default() -> &'a OpDeprecation { - ::default_instance() - } -} - -impl OpDeprecation { - pub fn new() -> OpDeprecation { - ::std::default::Default::default() - } - - // int32 version = 1; - - pub fn get_version(&self) -> i32 { - self.version - } - pub fn clear_version(&mut self) { - self.version = 0; - } - - // Param is passed by value, moved - pub fn set_version(&mut self, v: i32) { - self.version = v; - } - - // string explanation = 2; - - pub fn get_explanation(&self) -> &str { - &self.explanation - } - pub fn clear_explanation(&mut self) { - self.explanation.clear(); - } - - // Param is passed by value, moved - pub fn set_explanation(&mut self, v: ::std::string::String) { - self.explanation = v; - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_explanation(&mut self) -> &mut ::std::string::String { - &mut self.explanation - } - - // Take field - pub fn take_explanation(&mut self) -> ::std::string::String { - ::std::mem::replace(&mut self.explanation, ::std::string::String::new()) - } -} - -impl ::protobuf::Message for OpDeprecation { - fn is_initialized(&self) -> bool { - true - } - - fn merge_from( - &mut self, - is: &mut ::protobuf::CodedInputStream<'_>, - ) -> ::protobuf::ProtobufResult<()> { - while !is.eof()? { - let (field_number, wire_type) = is.read_tag_unpack()?; - match field_number { - 1 => { - if wire_type != ::protobuf::wire_format::WireTypeVarint { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type( - wire_type, - )); - } - let tmp = is.read_int32()?; - self.version = tmp; - } - 2 => { - ::protobuf::rt::read_singular_proto3_string_into( - wire_type, - is, - &mut self.explanation, - )?; - } - _ => { - ::protobuf::rt::read_unknown_or_skip_group( - field_number, - wire_type, - is, - self.mut_unknown_fields(), - )?; - } - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u32 { - let mut my_size = 0; - if self.version != 0 { - my_size += ::protobuf::rt::value_size( - 1, - self.version, - ::protobuf::wire_format::WireTypeVarint, - ); - } - if !self.explanation.is_empty() { - my_size += ::protobuf::rt::string_size(2, &self.explanation); - } - my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); - self.cached_size.set(my_size); - my_size - } - - fn write_to_with_cached_sizes( - &self, - os: &mut ::protobuf::CodedOutputStream<'_>, - ) -> ::protobuf::ProtobufResult<()> { - if self.version != 0 { - os.write_int32(1, self.version)?; - } - if !self.explanation.is_empty() { - os.write_string(2, &self.explanation)?; - } - os.write_unknown_fields(self.get_unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn get_cached_size(&self) -> u32 { - self.cached_size.get() - } - - fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { - &self.unknown_fields - } - - fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { - &mut self.unknown_fields - } - - fn as_any(&self) -> &dyn (::std::any::Any) { - self as &dyn (::std::any::Any) - } - fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { - self as &mut dyn (::std::any::Any) - } - fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { - self - } - - fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - Self::descriptor_static() - } - - fn new() -> OpDeprecation { - OpDeprecation::new() - } - - fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = - ::protobuf::rt::LazyV2::INIT; - descriptor.get(|| { - let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::< - _, - ::protobuf::types::ProtobufTypeInt32, - >( - "version", - |m: &OpDeprecation| &m.version, - |m: &mut OpDeprecation| &mut m.version, - )); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::< - _, - ::protobuf::types::ProtobufTypeString, - >( - "explanation", - |m: &OpDeprecation| &m.explanation, - |m: &mut OpDeprecation| &mut m.explanation, - )); - ::protobuf::reflect::MessageDescriptor::new_pb_name::( - "OpDeprecation", - fields, - file_descriptor_proto(), - ) - }) - } - - fn default_instance() -> &'static OpDeprecation { - static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; - instance.get(OpDeprecation::new) - } -} - -impl ::protobuf::Clear for OpDeprecation { - fn clear(&mut self) { - self.version = 0; - self.explanation.clear(); - self.unknown_fields.clear(); - } -} - -impl ::std::fmt::Debug for OpDeprecation { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for OpDeprecation { - fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { - ::protobuf::reflect::ReflectValueRef::Message(self) - } -} - -#[derive(PartialEq, Clone, Default)] -pub struct OpList { - // message fields - pub op: ::protobuf::RepeatedField, - // special fields - pub unknown_fields: ::protobuf::UnknownFields, - pub cached_size: ::protobuf::CachedSize, -} - -impl<'a> ::std::default::Default for &'a OpList { - fn default() -> &'a OpList { - ::default_instance() - } -} - -impl OpList { - pub fn new() -> OpList { - ::std::default::Default::default() - } - - // repeated .tensorflow.OpDef op = 1; - - pub fn get_op(&self) -> &[OpDef] { - &self.op - } - pub fn clear_op(&mut self) { - self.op.clear(); - } - - // Param is passed by value, moved - pub fn set_op(&mut self, v: ::protobuf::RepeatedField) { - self.op = v; - } - - // Mutable pointer to the field. - pub fn mut_op(&mut self) -> &mut ::protobuf::RepeatedField { - &mut self.op - } - - // Take field - pub fn take_op(&mut self) -> ::protobuf::RepeatedField { - ::std::mem::replace(&mut self.op, ::protobuf::RepeatedField::new()) - } -} - -impl ::protobuf::Message for OpList { - fn is_initialized(&self) -> bool { - for v in &self.op { - if !v.is_initialized() { - return false; - } - } - true - } - - fn merge_from( - &mut self, - is: &mut ::protobuf::CodedInputStream<'_>, - ) -> ::protobuf::ProtobufResult<()> { - while !is.eof()? { - let (field_number, wire_type) = is.read_tag_unpack()?; - match field_number { - 1 => { - ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.op)?; - } - _ => { - ::protobuf::rt::read_unknown_or_skip_group( - field_number, - wire_type, - is, - self.mut_unknown_fields(), - )?; - } - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u32 { - let mut my_size = 0; - for value in &self.op { - let len = value.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - } - my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); - self.cached_size.set(my_size); - my_size - } - - fn write_to_with_cached_sizes( - &self, - os: &mut ::protobuf::CodedOutputStream<'_>, - ) -> ::protobuf::ProtobufResult<()> { - for v in &self.op { - os.write_tag(1, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - } - os.write_unknown_fields(self.get_unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn get_cached_size(&self) -> u32 { - self.cached_size.get() - } - - fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { - &self.unknown_fields - } - - fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { - &mut self.unknown_fields - } - - fn as_any(&self) -> &dyn (::std::any::Any) { - self as &dyn (::std::any::Any) - } - fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { - self as &mut dyn (::std::any::Any) - } - fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { - self - } - - fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - Self::descriptor_static() - } - - fn new() -> OpList { - OpList::new() - } - - fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = - ::protobuf::rt::LazyV2::INIT; - descriptor.get(|| { - let mut fields = ::std::vec::Vec::new(); - fields.push( - ::protobuf::reflect::accessor::make_repeated_field_accessor::< - _, - ::protobuf::types::ProtobufTypeMessage, - >("op", |m: &OpList| &m.op, |m: &mut OpList| &mut m.op), - ); - ::protobuf::reflect::MessageDescriptor::new_pb_name::( - "OpList", - fields, - file_descriptor_proto(), - ) - }) - } - - fn default_instance() -> &'static OpList { - static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; - instance.get(OpList::new) - } -} - -impl ::protobuf::Clear for OpList { - fn clear(&mut self) { - self.op.clear(); - self.unknown_fields.clear(); - } -} - -impl ::std::fmt::Debug for OpList { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for OpList { - fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { - ::protobuf::reflect::ReflectValueRef::Message(self) - } -} - -static file_descriptor_proto_data: &'static [u8] = b"\ - \n&tensorflow/core/framework/op_def.proto\x12\ntensorflow\x1a*tensorflow\ - /core/framework/attr_value.proto\x1a%tensorflow/core/framework/types.pro\ - to\"\xf4\x07\n\x05OpDef\x12\x12\n\x04name\x18\x01\x20\x01(\tR\x04name\ - \x125\n\tinput_arg\x18\x02\x20\x03(\x0b2\x18.tensorflow.OpDef.ArgDefR\ - \x08inputArg\x127\n\noutput_arg\x18\x03\x20\x03(\x0b2\x18.tensorflow.OpD\ - ef.ArgDefR\toutputArg\x12%\n\x0econtrol_output\x18\x14\x20\x03(\tR\rcont\ - rolOutput\x12-\n\x04attr\x18\x04\x20\x03(\x0b2\x19.tensorflow.OpDef.Attr\ - DefR\x04attr\x12;\n\x0bdeprecation\x18\x08\x20\x01(\x0b2\x19.tensorflow.\ - OpDeprecationR\x0bdeprecation\x12\x18\n\x07summary\x18\x05\x20\x01(\tR\ - \x07summary\x12\x20\n\x0bdescription\x18\x06\x20\x01(\tR\x0bdescription\ - \x12%\n\x0eis_commutative\x18\x12\x20\x01(\x08R\risCommutative\x12!\n\ - \x0cis_aggregate\x18\x10\x20\x01(\x08R\x0bisAggregate\x12\x1f\n\x0bis_st\ - ateful\x18\x11\x20\x01(\x08R\nisStateful\x12<\n\x1aallows_uninitialized_\ - input\x18\x13\x20\x01(\x08R\x18allowsUninitializedInput\x1a\xe3\x01\n\ - \x06ArgDef\x12\x12\n\x04name\x18\x01\x20\x01(\tR\x04name\x12\x20\n\x0bde\ - scription\x18\x02\x20\x01(\tR\x0bdescription\x12(\n\x04type\x18\x03\x20\ - \x01(\x0e2\x14.tensorflow.DataTypeR\x04type\x12\x1b\n\ttype_attr\x18\x04\ - \x20\x01(\tR\x08typeAttr\x12\x1f\n\x0bnumber_attr\x18\x05\x20\x01(\tR\nn\ - umberAttr\x12$\n\x0etype_list_attr\x18\x06\x20\x01(\tR\x0ctypeListAttr\ - \x12\x15\n\x06is_ref\x18\x10\x20\x01(\x08R\x05isRef\x1a\x88\x02\n\x07Att\ - rDef\x12\x12\n\x04name\x18\x01\x20\x01(\tR\x04name\x12\x12\n\x04type\x18\ - \x02\x20\x01(\tR\x04type\x12:\n\rdefault_value\x18\x03\x20\x01(\x0b2\x15\ - .tensorflow.AttrValueR\x0cdefaultValue\x12\x20\n\x0bdescription\x18\x04\ - \x20\x01(\tR\x0bdescription\x12\x1f\n\x0bhas_minimum\x18\x05\x20\x01(\ - \x08R\nhasMinimum\x12\x18\n\x07minimum\x18\x06\x20\x01(\x03R\x07minimum\ - \x12<\n\x0eallowed_values\x18\x07\x20\x01(\x0b2\x15.tensorflow.AttrValue\ - R\rallowedValues\"K\n\rOpDeprecation\x12\x18\n\x07version\x18\x01\x20\ - \x01(\x05R\x07version\x12\x20\n\x0bexplanation\x18\x02\x20\x01(\tR\x0bex\ - planation\"+\n\x06OpList\x12!\n\x02op\x18\x01\x20\x03(\x0b2\x11.tensorfl\ - ow.OpDefR\x02opBk\n\x18org.tensorflow.frameworkB\x0bOpDefProtosP\x01Z=gi\ - thub.com/tensorflow/tensorflow/tensorflow/go/core/framework\xf8\x01\x01b\ - \x06proto3\ -"; - -static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2< - ::protobuf::descriptor::FileDescriptorProto, -> = ::protobuf::rt::LazyV2::INIT; - -fn parse_descriptor_proto() -> ::protobuf::descriptor::FileDescriptorProto { - ::protobuf::parse_from_bytes(file_descriptor_proto_data).unwrap() -} - -pub fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto { - file_descriptor_proto_lazy.get(|| parse_descriptor_proto()) -} diff --git a/src/protos/resource_handle.rs b/src/protos/resource_handle.rs deleted file mode 100644 index d20f7d5459..0000000000 --- a/src/protos/resource_handle.rs +++ /dev/null @@ -1,707 +0,0 @@ -// This file is generated by rust-protobuf 2.17.0. Do not edit -// @generated - -// https://github.com/rust-lang/rust-clippy/issues/702 -#![allow(unknown_lints)] -#![allow(clippy::all)] - -#![allow(unused_attributes)] -#![rustfmt::skip] - -#![allow(box_pointers)] -#![allow(dead_code)] -#![allow(missing_docs)] -#![allow(non_camel_case_types)] -#![allow(non_snake_case)] -#![allow(non_upper_case_globals)] -#![allow(trivial_casts)] -#![allow(unused_imports)] -#![allow(unused_results)] -//! Generated file from `tensorflow/core/framework/resource_handle.proto` - -/// Generated files are compatible only with the same version -/// of protobuf runtime. -// const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_17_0; - -#[derive(PartialEq, Clone, Default)] -pub struct ResourceHandleProto { - // message fields - pub device: ::std::string::String, - pub container: ::std::string::String, - pub name: ::std::string::String, - pub hash_code: u64, - pub maybe_type_name: ::std::string::String, - pub dtypes_and_shapes: ::protobuf::RepeatedField, - // special fields - pub unknown_fields: ::protobuf::UnknownFields, - pub cached_size: ::protobuf::CachedSize, -} - -impl<'a> ::std::default::Default for &'a ResourceHandleProto { - fn default() -> &'a ResourceHandleProto { - ::default_instance() - } -} - -impl ResourceHandleProto { - pub fn new() -> ResourceHandleProto { - ::std::default::Default::default() - } - - // string device = 1; - - pub fn get_device(&self) -> &str { - &self.device - } - pub fn clear_device(&mut self) { - self.device.clear(); - } - - // Param is passed by value, moved - pub fn set_device(&mut self, v: ::std::string::String) { - self.device = v; - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_device(&mut self) -> &mut ::std::string::String { - &mut self.device - } - - // Take field - pub fn take_device(&mut self) -> ::std::string::String { - ::std::mem::replace(&mut self.device, ::std::string::String::new()) - } - - // string container = 2; - - pub fn get_container(&self) -> &str { - &self.container - } - pub fn clear_container(&mut self) { - self.container.clear(); - } - - // Param is passed by value, moved - pub fn set_container(&mut self, v: ::std::string::String) { - self.container = v; - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_container(&mut self) -> &mut ::std::string::String { - &mut self.container - } - - // Take field - pub fn take_container(&mut self) -> ::std::string::String { - ::std::mem::replace(&mut self.container, ::std::string::String::new()) - } - - // string name = 3; - - pub fn get_name(&self) -> &str { - &self.name - } - pub fn clear_name(&mut self) { - self.name.clear(); - } - - // Param is passed by value, moved - pub fn set_name(&mut self, v: ::std::string::String) { - self.name = v; - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_name(&mut self) -> &mut ::std::string::String { - &mut self.name - } - - // Take field - pub fn take_name(&mut self) -> ::std::string::String { - ::std::mem::replace(&mut self.name, ::std::string::String::new()) - } - - // uint64 hash_code = 4; - - pub fn get_hash_code(&self) -> u64 { - self.hash_code - } - pub fn clear_hash_code(&mut self) { - self.hash_code = 0; - } - - // Param is passed by value, moved - pub fn set_hash_code(&mut self, v: u64) { - self.hash_code = v; - } - - // string maybe_type_name = 5; - - pub fn get_maybe_type_name(&self) -> &str { - &self.maybe_type_name - } - pub fn clear_maybe_type_name(&mut self) { - self.maybe_type_name.clear(); - } - - // Param is passed by value, moved - pub fn set_maybe_type_name(&mut self, v: ::std::string::String) { - self.maybe_type_name = v; - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_maybe_type_name(&mut self) -> &mut ::std::string::String { - &mut self.maybe_type_name - } - - // Take field - pub fn take_maybe_type_name(&mut self) -> ::std::string::String { - ::std::mem::replace(&mut self.maybe_type_name, ::std::string::String::new()) - } - - // repeated .tensorflow.ResourceHandleProto.DtypeAndShape dtypes_and_shapes = 6; - - pub fn get_dtypes_and_shapes(&self) -> &[ResourceHandleProto_DtypeAndShape] { - &self.dtypes_and_shapes - } - pub fn clear_dtypes_and_shapes(&mut self) { - self.dtypes_and_shapes.clear(); - } - - // Param is passed by value, moved - pub fn set_dtypes_and_shapes( - &mut self, - v: ::protobuf::RepeatedField, - ) { - self.dtypes_and_shapes = v; - } - - // Mutable pointer to the field. - pub fn mut_dtypes_and_shapes( - &mut self, - ) -> &mut ::protobuf::RepeatedField { - &mut self.dtypes_and_shapes - } - - // Take field - pub fn take_dtypes_and_shapes( - &mut self, - ) -> ::protobuf::RepeatedField { - ::std::mem::replace( - &mut self.dtypes_and_shapes, - ::protobuf::RepeatedField::new(), - ) - } -} - -impl ::protobuf::Message for ResourceHandleProto { - fn is_initialized(&self) -> bool { - for v in &self.dtypes_and_shapes { - if !v.is_initialized() { - return false; - } - } - true - } - - fn merge_from( - &mut self, - is: &mut ::protobuf::CodedInputStream<'_>, - ) -> ::protobuf::ProtobufResult<()> { - while !is.eof()? { - let (field_number, wire_type) = is.read_tag_unpack()?; - match field_number { - 1 => { - ::protobuf::rt::read_singular_proto3_string_into( - wire_type, - is, - &mut self.device, - )?; - } - 2 => { - ::protobuf::rt::read_singular_proto3_string_into( - wire_type, - is, - &mut self.container, - )?; - } - 3 => { - ::protobuf::rt::read_singular_proto3_string_into( - wire_type, - is, - &mut self.name, - )?; - } - 4 => { - if wire_type != ::protobuf::wire_format::WireTypeVarint { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type( - wire_type, - )); - } - let tmp = is.read_uint64()?; - self.hash_code = tmp; - } - 5 => { - ::protobuf::rt::read_singular_proto3_string_into( - wire_type, - is, - &mut self.maybe_type_name, - )?; - } - 6 => { - ::protobuf::rt::read_repeated_message_into( - wire_type, - is, - &mut self.dtypes_and_shapes, - )?; - } - _ => { - ::protobuf::rt::read_unknown_or_skip_group( - field_number, - wire_type, - is, - self.mut_unknown_fields(), - )?; - } - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u32 { - let mut my_size = 0; - if !self.device.is_empty() { - my_size += ::protobuf::rt::string_size(1, &self.device); - } - if !self.container.is_empty() { - my_size += ::protobuf::rt::string_size(2, &self.container); - } - if !self.name.is_empty() { - my_size += ::protobuf::rt::string_size(3, &self.name); - } - if self.hash_code != 0 { - my_size += ::protobuf::rt::value_size( - 4, - self.hash_code, - ::protobuf::wire_format::WireTypeVarint, - ); - } - if !self.maybe_type_name.is_empty() { - my_size += ::protobuf::rt::string_size(5, &self.maybe_type_name); - } - for value in &self.dtypes_and_shapes { - let len = value.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - } - my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); - self.cached_size.set(my_size); - my_size - } - - fn write_to_with_cached_sizes( - &self, - os: &mut ::protobuf::CodedOutputStream<'_>, - ) -> ::protobuf::ProtobufResult<()> { - if !self.device.is_empty() { - os.write_string(1, &self.device)?; - } - if !self.container.is_empty() { - os.write_string(2, &self.container)?; - } - if !self.name.is_empty() { - os.write_string(3, &self.name)?; - } - if self.hash_code != 0 { - os.write_uint64(4, self.hash_code)?; - } - if !self.maybe_type_name.is_empty() { - os.write_string(5, &self.maybe_type_name)?; - } - for v in &self.dtypes_and_shapes { - os.write_tag(6, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - } - os.write_unknown_fields(self.get_unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn get_cached_size(&self) -> u32 { - self.cached_size.get() - } - - fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { - &self.unknown_fields - } - - fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { - &mut self.unknown_fields - } - - fn as_any(&self) -> &dyn (::std::any::Any) { - self as &dyn (::std::any::Any) - } - fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { - self as &mut dyn (::std::any::Any) - } - fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { - self - } - - fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - Self::descriptor_static() - } - - fn new() -> ResourceHandleProto { - ResourceHandleProto::new() - } - - fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = - ::protobuf::rt::LazyV2::INIT; - descriptor.get(|| { - let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::< - _, - ::protobuf::types::ProtobufTypeString, - >( - "device", - |m: &ResourceHandleProto| &m.device, - |m: &mut ResourceHandleProto| &mut m.device, - )); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::< - _, - ::protobuf::types::ProtobufTypeString, - >( - "container", - |m: &ResourceHandleProto| &m.container, - |m: &mut ResourceHandleProto| &mut m.container, - )); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::< - _, - ::protobuf::types::ProtobufTypeString, - >( - "name", - |m: &ResourceHandleProto| &m.name, - |m: &mut ResourceHandleProto| &mut m.name, - )); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::< - _, - ::protobuf::types::ProtobufTypeUint64, - >( - "hash_code", - |m: &ResourceHandleProto| &m.hash_code, - |m: &mut ResourceHandleProto| &mut m.hash_code, - )); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::< - _, - ::protobuf::types::ProtobufTypeString, - >( - "maybe_type_name", - |m: &ResourceHandleProto| &m.maybe_type_name, - |m: &mut ResourceHandleProto| &mut m.maybe_type_name, - )); - fields.push( - ::protobuf::reflect::accessor::make_repeated_field_accessor::< - _, - ::protobuf::types::ProtobufTypeMessage, - >( - "dtypes_and_shapes", - |m: &ResourceHandleProto| &m.dtypes_and_shapes, - |m: &mut ResourceHandleProto| &mut m.dtypes_and_shapes, - ), - ); - ::protobuf::reflect::MessageDescriptor::new_pb_name::( - "ResourceHandleProto", - fields, - file_descriptor_proto(), - ) - }) - } - - fn default_instance() -> &'static ResourceHandleProto { - static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; - instance.get(ResourceHandleProto::new) - } -} - -impl ::protobuf::Clear for ResourceHandleProto { - fn clear(&mut self) { - self.device.clear(); - self.container.clear(); - self.name.clear(); - self.hash_code = 0; - self.maybe_type_name.clear(); - self.dtypes_and_shapes.clear(); - self.unknown_fields.clear(); - } -} - -impl ::std::fmt::Debug for ResourceHandleProto { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for ResourceHandleProto { - fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { - ::protobuf::reflect::ReflectValueRef::Message(self) - } -} - -#[derive(PartialEq, Clone, Default)] -pub struct ResourceHandleProto_DtypeAndShape { - // message fields - pub dtype: super::types::DataType, - pub shape: ::protobuf::SingularPtrField, - // special fields - pub unknown_fields: ::protobuf::UnknownFields, - pub cached_size: ::protobuf::CachedSize, -} - -impl<'a> ::std::default::Default for &'a ResourceHandleProto_DtypeAndShape { - fn default() -> &'a ResourceHandleProto_DtypeAndShape { - ::default_instance() - } -} - -impl ResourceHandleProto_DtypeAndShape { - pub fn new() -> ResourceHandleProto_DtypeAndShape { - ::std::default::Default::default() - } - - // .tensorflow.DataType dtype = 1; - - pub fn get_dtype(&self) -> super::types::DataType { - self.dtype - } - pub fn clear_dtype(&mut self) { - self.dtype = super::types::DataType::DT_INVALID; - } - - // Param is passed by value, moved - pub fn set_dtype(&mut self, v: super::types::DataType) { - self.dtype = v; - } - - // .tensorflow.TensorShapeProto shape = 2; - - pub fn get_shape(&self) -> &super::tensor_shape::TensorShapeProto { - self.shape.as_ref().unwrap_or_else(|| { - ::default_instance() - }) - } - pub fn clear_shape(&mut self) { - self.shape.clear(); - } - - pub fn has_shape(&self) -> bool { - self.shape.is_some() - } - - // Param is passed by value, moved - pub fn set_shape(&mut self, v: super::tensor_shape::TensorShapeProto) { - self.shape = ::protobuf::SingularPtrField::some(v); - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_shape(&mut self) -> &mut super::tensor_shape::TensorShapeProto { - if self.shape.is_none() { - self.shape.set_default(); - } - self.shape.as_mut().unwrap() - } - - // Take field - pub fn take_shape(&mut self) -> super::tensor_shape::TensorShapeProto { - self.shape - .take() - .unwrap_or_else(|| super::tensor_shape::TensorShapeProto::new()) - } -} - -impl ::protobuf::Message for ResourceHandleProto_DtypeAndShape { - fn is_initialized(&self) -> bool { - for v in &self.shape { - if !v.is_initialized() { - return false; - } - } - true - } - - fn merge_from( - &mut self, - is: &mut ::protobuf::CodedInputStream<'_>, - ) -> ::protobuf::ProtobufResult<()> { - while !is.eof()? { - let (field_number, wire_type) = is.read_tag_unpack()?; - match field_number { - 1 => ::protobuf::rt::read_proto3_enum_with_unknown_fields_into( - wire_type, - is, - &mut self.dtype, - 1, - &mut self.unknown_fields, - )?, - 2 => { - ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.shape)?; - } - _ => { - ::protobuf::rt::read_unknown_or_skip_group( - field_number, - wire_type, - is, - self.mut_unknown_fields(), - )?; - } - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u32 { - let mut my_size = 0; - if self.dtype != super::types::DataType::DT_INVALID { - my_size += ::protobuf::rt::enum_size(1, self.dtype); - } - if let Some(ref v) = self.shape.as_ref() { - let len = v.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - } - my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); - self.cached_size.set(my_size); - my_size - } - - fn write_to_with_cached_sizes( - &self, - os: &mut ::protobuf::CodedOutputStream<'_>, - ) -> ::protobuf::ProtobufResult<()> { - if self.dtype != super::types::DataType::DT_INVALID { - os.write_enum(1, ::protobuf::ProtobufEnum::value(&self.dtype))?; - } - if let Some(ref v) = self.shape.as_ref() { - os.write_tag(2, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - } - os.write_unknown_fields(self.get_unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn get_cached_size(&self) -> u32 { - self.cached_size.get() - } - - fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { - &self.unknown_fields - } - - fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { - &mut self.unknown_fields - } - - fn as_any(&self) -> &dyn (::std::any::Any) { - self as &dyn (::std::any::Any) - } - fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { - self as &mut dyn (::std::any::Any) - } - fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { - self - } - - fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - Self::descriptor_static() - } - - fn new() -> ResourceHandleProto_DtypeAndShape { - ResourceHandleProto_DtypeAndShape::new() - } - - fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = - ::protobuf::rt::LazyV2::INIT; - descriptor.get(|| { - let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeEnum>( - "dtype", - |m: &ResourceHandleProto_DtypeAndShape| { &m.dtype }, - |m: &mut ResourceHandleProto_DtypeAndShape| { &mut m.dtype }, - )); - fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( - "shape", - |m: &ResourceHandleProto_DtypeAndShape| { &m.shape }, - |m: &mut ResourceHandleProto_DtypeAndShape| { &mut m.shape }, - )); - ::protobuf::reflect::MessageDescriptor::new_pb_name::( - "ResourceHandleProto.DtypeAndShape", - fields, - file_descriptor_proto() - ) - }) - } - - fn default_instance() -> &'static ResourceHandleProto_DtypeAndShape { - static instance: ::protobuf::rt::LazyV2 = - ::protobuf::rt::LazyV2::INIT; - instance.get(ResourceHandleProto_DtypeAndShape::new) - } -} - -impl ::protobuf::Clear for ResourceHandleProto_DtypeAndShape { - fn clear(&mut self) { - self.dtype = super::types::DataType::DT_INVALID; - self.shape.clear(); - self.unknown_fields.clear(); - } -} - -impl ::std::fmt::Debug for ResourceHandleProto_DtypeAndShape { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for ResourceHandleProto_DtypeAndShape { - fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { - ::protobuf::reflect::ReflectValueRef::Message(self) - } -} - -static file_descriptor_proto_data: &'static [u8] = b"\ - \n/tensorflow/core/framework/resource_handle.proto\x12\ntensorflow\x1a,t\ - ensorflow/core/framework/tensor_shape.proto\x1a%tensorflow/core/framewor\ - k/types.proto\"\xf0\x02\n\x13ResourceHandleProto\x12\x16\n\x06device\x18\ - \x01\x20\x01(\tR\x06device\x12\x1c\n\tcontainer\x18\x02\x20\x01(\tR\tcon\ - tainer\x12\x12\n\x04name\x18\x03\x20\x01(\tR\x04name\x12\x1b\n\thash_cod\ - e\x18\x04\x20\x01(\x04R\x08hashCode\x12&\n\x0fmaybe_type_name\x18\x05\ - \x20\x01(\tR\rmaybeTypeName\x12Y\n\x11dtypes_and_shapes\x18\x06\x20\x03(\ - \x0b2-.tensorflow.ResourceHandleProto.DtypeAndShapeR\x0fdtypesAndShapes\ - \x1ao\n\rDtypeAndShape\x12*\n\x05dtype\x18\x01\x20\x01(\x0e2\x14.tensorf\ - low.DataTypeR\x05dtype\x122\n\x05shape\x18\x02\x20\x01(\x0b2\x1c.tensorf\ - low.TensorShapeProtoR\x05shapeBn\n\x18org.tensorflow.frameworkB\x0eResou\ - rceHandleP\x01Z=github.com/tensorflow/tensorflow/tensorflow/go/core/fram\ - ework\xf8\x01\x01b\x06proto3\ -"; - -static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2< - ::protobuf::descriptor::FileDescriptorProto, -> = ::protobuf::rt::LazyV2::INIT; - -fn parse_descriptor_proto() -> ::protobuf::descriptor::FileDescriptorProto { - ::protobuf::parse_from_bytes(file_descriptor_proto_data).unwrap() -} - -pub fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto { - file_descriptor_proto_lazy.get(|| parse_descriptor_proto()) -} diff --git a/src/protos/saved_model.rs b/src/protos/saved_model.rs deleted file mode 100644 index f4cb6eb870..0000000000 --- a/src/protos/saved_model.rs +++ /dev/null @@ -1,282 +0,0 @@ -// This file is generated by rust-protobuf 2.17.0. Do not edit -// @generated - -// https://github.com/rust-lang/rust-clippy/issues/702 -#![allow(unknown_lints)] -#![allow(clippy::all)] - -#![allow(unused_attributes)] -#![rustfmt::skip] - -#![allow(box_pointers)] -#![allow(dead_code)] -#![allow(missing_docs)] -#![allow(non_camel_case_types)] -#![allow(non_snake_case)] -#![allow(non_upper_case_globals)] -#![allow(trivial_casts)] -#![allow(unused_imports)] -#![allow(unused_results)] -//! Generated file from `tensorflow/core/protobuf/saved_model.proto` - -/// Generated files are compatible only with the same version -/// of protobuf runtime. -// const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_17_0; - -#[derive(PartialEq, Clone, Default)] -pub struct SavedModel { - // message fields - pub saved_model_schema_version: i64, - pub meta_graphs: ::protobuf::RepeatedField, - // special fields - pub unknown_fields: ::protobuf::UnknownFields, - pub cached_size: ::protobuf::CachedSize, -} - -impl<'a> ::std::default::Default for &'a SavedModel { - fn default() -> &'a SavedModel { - ::default_instance() - } -} - -impl SavedModel { - pub fn new() -> SavedModel { - ::std::default::Default::default() - } - - // int64 saved_model_schema_version = 1; - - pub fn get_saved_model_schema_version(&self) -> i64 { - self.saved_model_schema_version - } - pub fn clear_saved_model_schema_version(&mut self) { - self.saved_model_schema_version = 0; - } - - // Param is passed by value, moved - pub fn set_saved_model_schema_version(&mut self, v: i64) { - self.saved_model_schema_version = v; - } - - // repeated .tensorflow.MetaGraphDef meta_graphs = 2; - - pub fn get_meta_graphs(&self) -> &[super::meta_graph::MetaGraphDef] { - &self.meta_graphs - } - pub fn clear_meta_graphs(&mut self) { - self.meta_graphs.clear(); - } - - // Param is passed by value, moved - pub fn set_meta_graphs( - &mut self, - v: ::protobuf::RepeatedField, - ) { - self.meta_graphs = v; - } - - // Mutable pointer to the field. - pub fn mut_meta_graphs( - &mut self, - ) -> &mut ::protobuf::RepeatedField { - &mut self.meta_graphs - } - - // Take field - pub fn take_meta_graphs( - &mut self, - ) -> ::protobuf::RepeatedField { - ::std::mem::replace(&mut self.meta_graphs, ::protobuf::RepeatedField::new()) - } -} - -impl ::protobuf::Message for SavedModel { - fn is_initialized(&self) -> bool { - for v in &self.meta_graphs { - if !v.is_initialized() { - return false; - } - } - true - } - - fn merge_from( - &mut self, - is: &mut ::protobuf::CodedInputStream<'_>, - ) -> ::protobuf::ProtobufResult<()> { - while !is.eof()? { - let (field_number, wire_type) = is.read_tag_unpack()?; - match field_number { - 1 => { - if wire_type != ::protobuf::wire_format::WireTypeVarint { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type( - wire_type, - )); - } - let tmp = is.read_int64()?; - self.saved_model_schema_version = tmp; - } - 2 => { - ::protobuf::rt::read_repeated_message_into( - wire_type, - is, - &mut self.meta_graphs, - )?; - } - _ => { - ::protobuf::rt::read_unknown_or_skip_group( - field_number, - wire_type, - is, - self.mut_unknown_fields(), - )?; - } - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u32 { - let mut my_size = 0; - if self.saved_model_schema_version != 0 { - my_size += ::protobuf::rt::value_size( - 1, - self.saved_model_schema_version, - ::protobuf::wire_format::WireTypeVarint, - ); - } - for value in &self.meta_graphs { - let len = value.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - } - my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); - self.cached_size.set(my_size); - my_size - } - - fn write_to_with_cached_sizes( - &self, - os: &mut ::protobuf::CodedOutputStream<'_>, - ) -> ::protobuf::ProtobufResult<()> { - if self.saved_model_schema_version != 0 { - os.write_int64(1, self.saved_model_schema_version)?; - } - for v in &self.meta_graphs { - os.write_tag(2, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - } - os.write_unknown_fields(self.get_unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn get_cached_size(&self) -> u32 { - self.cached_size.get() - } - - fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { - &self.unknown_fields - } - - fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { - &mut self.unknown_fields - } - - fn as_any(&self) -> &dyn (::std::any::Any) { - self as &dyn (::std::any::Any) - } - fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { - self as &mut dyn (::std::any::Any) - } - fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { - self - } - - fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - Self::descriptor_static() - } - - fn new() -> SavedModel { - SavedModel::new() - } - - fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = - ::protobuf::rt::LazyV2::INIT; - descriptor.get(|| { - let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::< - _, - ::protobuf::types::ProtobufTypeInt64, - >( - "saved_model_schema_version", - |m: &SavedModel| &m.saved_model_schema_version, - |m: &mut SavedModel| &mut m.saved_model_schema_version, - )); - fields.push( - ::protobuf::reflect::accessor::make_repeated_field_accessor::< - _, - ::protobuf::types::ProtobufTypeMessage, - >( - "meta_graphs", - |m: &SavedModel| &m.meta_graphs, - |m: &mut SavedModel| &mut m.meta_graphs, - ), - ); - ::protobuf::reflect::MessageDescriptor::new_pb_name::( - "SavedModel", - fields, - file_descriptor_proto(), - ) - }) - } - - fn default_instance() -> &'static SavedModel { - static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; - instance.get(SavedModel::new) - } -} - -impl ::protobuf::Clear for SavedModel { - fn clear(&mut self) { - self.saved_model_schema_version = 0; - self.meta_graphs.clear(); - self.unknown_fields.clear(); - } -} - -impl ::std::fmt::Debug for SavedModel { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for SavedModel { - fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { - ::protobuf::reflect::ReflectValueRef::Message(self) - } -} - -static file_descriptor_proto_data: &'static [u8] = b"\ - \n*tensorflow/core/protobuf/saved_model.proto\x12\ntensorflow\x1a)tensor\ - flow/core/protobuf/meta_graph.proto\"\x84\x01\n\nSavedModel\x12;\n\x1asa\ - ved_model_schema_version\x18\x01\x20\x01(\x03R\x17savedModelSchemaVersio\ - n\x129\n\x0bmeta_graphs\x18\x02\x20\x03(\x0b2\x18.tensorflow.MetaGraphDe\ - fR\nmetaGraphsBo\n\x18org.tensorflow.frameworkB\x10SavedModelProtosP\x01\ - Z = ::protobuf::rt::LazyV2::INIT; - -fn parse_descriptor_proto() -> ::protobuf::descriptor::FileDescriptorProto { - ::protobuf::parse_from_bytes(file_descriptor_proto_data).unwrap() -} - -pub fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto { - file_descriptor_proto_lazy.get(|| parse_descriptor_proto()) -} diff --git a/src/protos/saved_object_graph.rs b/src/protos/saved_object_graph.rs deleted file mode 100644 index 4335cd280c..0000000000 --- a/src/protos/saved_object_graph.rs +++ /dev/null @@ -1,3546 +0,0 @@ -// This file is generated by rust-protobuf 2.17.0. Do not edit -// @generated - -// https://github.com/rust-lang/rust-clippy/issues/702 -#![allow(unknown_lints)] -#![allow(clippy::all)] - -#![allow(unused_attributes)] -#![rustfmt::skip] - -#![allow(box_pointers)] -#![allow(dead_code)] -#![allow(missing_docs)] -#![allow(non_camel_case_types)] -#![allow(non_snake_case)] -#![allow(non_upper_case_globals)] -#![allow(trivial_casts)] -#![allow(unused_imports)] -#![allow(unused_results)] -//! Generated file from `tensorflow/core/protobuf/saved_object_graph.proto` - -/// Generated files are compatible only with the same version -/// of protobuf runtime. -// const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_17_0; - -#[derive(PartialEq, Clone, Default)] -pub struct SavedObjectGraph { - // message fields - pub nodes: ::protobuf::RepeatedField, - pub concrete_functions: - ::std::collections::HashMap<::std::string::String, SavedConcreteFunction>, - // special fields - pub unknown_fields: ::protobuf::UnknownFields, - pub cached_size: ::protobuf::CachedSize, -} - -impl<'a> ::std::default::Default for &'a SavedObjectGraph { - fn default() -> &'a SavedObjectGraph { - ::default_instance() - } -} - -impl SavedObjectGraph { - pub fn new() -> SavedObjectGraph { - ::std::default::Default::default() - } - - // repeated .tensorflow.SavedObject nodes = 1; - - pub fn get_nodes(&self) -> &[SavedObject] { - &self.nodes - } - pub fn clear_nodes(&mut self) { - self.nodes.clear(); - } - - // Param is passed by value, moved - pub fn set_nodes(&mut self, v: ::protobuf::RepeatedField) { - self.nodes = v; - } - - // Mutable pointer to the field. - pub fn mut_nodes(&mut self) -> &mut ::protobuf::RepeatedField { - &mut self.nodes - } - - // Take field - pub fn take_nodes(&mut self) -> ::protobuf::RepeatedField { - ::std::mem::replace(&mut self.nodes, ::protobuf::RepeatedField::new()) - } - - // repeated .tensorflow.SavedObjectGraph.ConcreteFunctionsEntry concrete_functions = 2; - - pub fn get_concrete_functions( - &self, - ) -> &::std::collections::HashMap<::std::string::String, SavedConcreteFunction> { - &self.concrete_functions - } - pub fn clear_concrete_functions(&mut self) { - self.concrete_functions.clear(); - } - - // Param is passed by value, moved - pub fn set_concrete_functions( - &mut self, - v: ::std::collections::HashMap<::std::string::String, SavedConcreteFunction>, - ) { - self.concrete_functions = v; - } - - // Mutable pointer to the field. - pub fn mut_concrete_functions( - &mut self, - ) -> &mut ::std::collections::HashMap<::std::string::String, SavedConcreteFunction> { - &mut self.concrete_functions - } - - // Take field - pub fn take_concrete_functions( - &mut self, - ) -> ::std::collections::HashMap<::std::string::String, SavedConcreteFunction> { - ::std::mem::replace( - &mut self.concrete_functions, - ::std::collections::HashMap::new(), - ) - } -} - -impl ::protobuf::Message for SavedObjectGraph { - fn is_initialized(&self) -> bool { - for v in &self.nodes { - if !v.is_initialized() { - return false; - } - } - true - } - - fn merge_from( - &mut self, - is: &mut ::protobuf::CodedInputStream<'_>, - ) -> ::protobuf::ProtobufResult<()> { - while !is.eof()? { - let (field_number, wire_type) = is.read_tag_unpack()?; - match field_number { - 1 => { - ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.nodes)?; - } - 2 => { - ::protobuf::rt::read_map_into::< - ::protobuf::types::ProtobufTypeString, - ::protobuf::types::ProtobufTypeMessage, - >(wire_type, is, &mut self.concrete_functions)?; - } - _ => { - ::protobuf::rt::read_unknown_or_skip_group( - field_number, - wire_type, - is, - self.mut_unknown_fields(), - )?; - } - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u32 { - let mut my_size = 0; - for value in &self.nodes { - let len = value.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - } - my_size += ::protobuf::rt::compute_map_size::< - ::protobuf::types::ProtobufTypeString, - ::protobuf::types::ProtobufTypeMessage, - >(2, &self.concrete_functions); - my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); - self.cached_size.set(my_size); - my_size - } - - fn write_to_with_cached_sizes( - &self, - os: &mut ::protobuf::CodedOutputStream<'_>, - ) -> ::protobuf::ProtobufResult<()> { - for v in &self.nodes { - os.write_tag(1, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - } - ::protobuf::rt::write_map_with_cached_sizes::< - ::protobuf::types::ProtobufTypeString, - ::protobuf::types::ProtobufTypeMessage, - >(2, &self.concrete_functions, os)?; - os.write_unknown_fields(self.get_unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn get_cached_size(&self) -> u32 { - self.cached_size.get() - } - - fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { - &self.unknown_fields - } - - fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { - &mut self.unknown_fields - } - - fn as_any(&self) -> &dyn (::std::any::Any) { - self as &dyn (::std::any::Any) - } - fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { - self as &mut dyn (::std::any::Any) - } - fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { - self - } - - fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - Self::descriptor_static() - } - - fn new() -> SavedObjectGraph { - SavedObjectGraph::new() - } - - fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = - ::protobuf::rt::LazyV2::INIT; - descriptor.get(|| { - let mut fields = ::std::vec::Vec::new(); - fields.push( - ::protobuf::reflect::accessor::make_repeated_field_accessor::< - _, - ::protobuf::types::ProtobufTypeMessage, - >( - "nodes", - |m: &SavedObjectGraph| &m.nodes, - |m: &mut SavedObjectGraph| &mut m.nodes, - ), - ); - fields.push(::protobuf::reflect::accessor::make_map_accessor::< - _, - ::protobuf::types::ProtobufTypeString, - ::protobuf::types::ProtobufTypeMessage, - >( - "concrete_functions", - |m: &SavedObjectGraph| &m.concrete_functions, - |m: &mut SavedObjectGraph| &mut m.concrete_functions, - )); - ::protobuf::reflect::MessageDescriptor::new_pb_name::( - "SavedObjectGraph", - fields, - file_descriptor_proto(), - ) - }) - } - - fn default_instance() -> &'static SavedObjectGraph { - static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; - instance.get(SavedObjectGraph::new) - } -} - -impl ::protobuf::Clear for SavedObjectGraph { - fn clear(&mut self) { - self.nodes.clear(); - self.concrete_functions.clear(); - self.unknown_fields.clear(); - } -} - -impl ::std::fmt::Debug for SavedObjectGraph { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for SavedObjectGraph { - fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { - ::protobuf::reflect::ReflectValueRef::Message(self) - } -} - -#[derive(PartialEq, Clone, Default)] -pub struct SavedObject { - // message fields - pub children: ::protobuf::RepeatedField< - super::trackable_object_graph::TrackableObjectGraph_TrackableObject_ObjectReference, - >, - pub slot_variables: ::protobuf::RepeatedField< - super::trackable_object_graph::TrackableObjectGraph_TrackableObject_SlotVariableReference, - >, - // message oneof groups - pub kind: ::std::option::Option, - // special fields - pub unknown_fields: ::protobuf::UnknownFields, - pub cached_size: ::protobuf::CachedSize, -} - -impl<'a> ::std::default::Default for &'a SavedObject { - fn default() -> &'a SavedObject { - ::default_instance() - } -} - -#[derive(Clone, PartialEq, Debug)] -pub enum SavedObject_oneof_kind { - user_object(SavedUserObject), - asset(SavedAsset), - function(SavedFunction), - variable(SavedVariable), - bare_concrete_function(SavedBareConcreteFunction), - constant(SavedConstant), - resource(SavedResource), -} - -impl SavedObject { - pub fn new() -> SavedObject { - ::std::default::Default::default() - } - - // repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference children = 1; - - pub fn get_children( - &self, - ) -> &[super::trackable_object_graph::TrackableObjectGraph_TrackableObject_ObjectReference] - { - &self.children - } - pub fn clear_children(&mut self) { - self.children.clear(); - } - - // Param is passed by value, moved - pub fn set_children( - &mut self, - v: ::protobuf::RepeatedField< - super::trackable_object_graph::TrackableObjectGraph_TrackableObject_ObjectReference, - >, - ) { - self.children = v; - } - - // Mutable pointer to the field. - pub fn mut_children( - &mut self, - ) -> &mut ::protobuf::RepeatedField< - super::trackable_object_graph::TrackableObjectGraph_TrackableObject_ObjectReference, - > { - &mut self.children - } - - // Take field - pub fn take_children( - &mut self, - ) -> ::protobuf::RepeatedField< - super::trackable_object_graph::TrackableObjectGraph_TrackableObject_ObjectReference, - > { - ::std::mem::replace(&mut self.children, ::protobuf::RepeatedField::new()) - } - - // repeated .tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference slot_variables = 3; - - -pub fn get_slot_variables(&self) -> &[super::trackable_object_graph::TrackableObjectGraph_TrackableObject_SlotVariableReference]{ - &self.slot_variables - } - pub fn clear_slot_variables(&mut self) { - self.slot_variables.clear(); - } - - // Param is passed by value, moved - pub fn set_slot_variables( - &mut self, - v: ::protobuf::RepeatedField, - ) { - self.slot_variables = v; - } - - // Mutable pointer to the field. - pub fn mut_slot_variables( - &mut self, - ) -> &mut ::protobuf::RepeatedField< - super::trackable_object_graph::TrackableObjectGraph_TrackableObject_SlotVariableReference, - > { - &mut self.slot_variables - } - - // Take field - pub fn take_slot_variables( - &mut self, - ) -> ::protobuf::RepeatedField< - super::trackable_object_graph::TrackableObjectGraph_TrackableObject_SlotVariableReference, - > { - ::std::mem::replace(&mut self.slot_variables, ::protobuf::RepeatedField::new()) - } - - // .tensorflow.SavedUserObject user_object = 4; - - pub fn get_user_object(&self) -> &SavedUserObject { - match self.kind { - ::std::option::Option::Some(SavedObject_oneof_kind::user_object(ref v)) => v, - _ => ::default_instance(), - } - } - pub fn clear_user_object(&mut self) { - self.kind = ::std::option::Option::None; - } - - pub fn has_user_object(&self) -> bool { - match self.kind { - ::std::option::Option::Some(SavedObject_oneof_kind::user_object(..)) => true, - _ => false, - } - } - - // Param is passed by value, moved - pub fn set_user_object(&mut self, v: SavedUserObject) { - self.kind = ::std::option::Option::Some(SavedObject_oneof_kind::user_object(v)) - } - - // Mutable pointer to the field. - pub fn mut_user_object(&mut self) -> &mut SavedUserObject { - if let ::std::option::Option::Some(SavedObject_oneof_kind::user_object(_)) = self.kind { - } else { - self.kind = ::std::option::Option::Some(SavedObject_oneof_kind::user_object( - SavedUserObject::new(), - )); - } - match self.kind { - ::std::option::Option::Some(SavedObject_oneof_kind::user_object(ref mut v)) => v, - _ => panic!(), - } - } - - // Take field - pub fn take_user_object(&mut self) -> SavedUserObject { - if self.has_user_object() { - match self.kind.take() { - ::std::option::Option::Some(SavedObject_oneof_kind::user_object(v)) => v, - _ => panic!(), - } - } else { - SavedUserObject::new() - } - } - - // .tensorflow.SavedAsset asset = 5; - - pub fn get_asset(&self) -> &SavedAsset { - match self.kind { - ::std::option::Option::Some(SavedObject_oneof_kind::asset(ref v)) => v, - _ => ::default_instance(), - } - } - pub fn clear_asset(&mut self) { - self.kind = ::std::option::Option::None; - } - - pub fn has_asset(&self) -> bool { - match self.kind { - ::std::option::Option::Some(SavedObject_oneof_kind::asset(..)) => true, - _ => false, - } - } - - // Param is passed by value, moved - pub fn set_asset(&mut self, v: SavedAsset) { - self.kind = ::std::option::Option::Some(SavedObject_oneof_kind::asset(v)) - } - - // Mutable pointer to the field. - pub fn mut_asset(&mut self) -> &mut SavedAsset { - if let ::std::option::Option::Some(SavedObject_oneof_kind::asset(_)) = self.kind { - } else { - self.kind = - ::std::option::Option::Some(SavedObject_oneof_kind::asset(SavedAsset::new())); - } - match self.kind { - ::std::option::Option::Some(SavedObject_oneof_kind::asset(ref mut v)) => v, - _ => panic!(), - } - } - - // Take field - pub fn take_asset(&mut self) -> SavedAsset { - if self.has_asset() { - match self.kind.take() { - ::std::option::Option::Some(SavedObject_oneof_kind::asset(v)) => v, - _ => panic!(), - } - } else { - SavedAsset::new() - } - } - - // .tensorflow.SavedFunction function = 6; - - pub fn get_function(&self) -> &SavedFunction { - match self.kind { - ::std::option::Option::Some(SavedObject_oneof_kind::function(ref v)) => v, - _ => ::default_instance(), - } - } - pub fn clear_function(&mut self) { - self.kind = ::std::option::Option::None; - } - - pub fn has_function(&self) -> bool { - match self.kind { - ::std::option::Option::Some(SavedObject_oneof_kind::function(..)) => true, - _ => false, - } - } - - // Param is passed by value, moved - pub fn set_function(&mut self, v: SavedFunction) { - self.kind = ::std::option::Option::Some(SavedObject_oneof_kind::function(v)) - } - - // Mutable pointer to the field. - pub fn mut_function(&mut self) -> &mut SavedFunction { - if let ::std::option::Option::Some(SavedObject_oneof_kind::function(_)) = self.kind { - } else { - self.kind = - ::std::option::Option::Some(SavedObject_oneof_kind::function(SavedFunction::new())); - } - match self.kind { - ::std::option::Option::Some(SavedObject_oneof_kind::function(ref mut v)) => v, - _ => panic!(), - } - } - - // Take field - pub fn take_function(&mut self) -> SavedFunction { - if self.has_function() { - match self.kind.take() { - ::std::option::Option::Some(SavedObject_oneof_kind::function(v)) => v, - _ => panic!(), - } - } else { - SavedFunction::new() - } - } - - // .tensorflow.SavedVariable variable = 7; - - pub fn get_variable(&self) -> &SavedVariable { - match self.kind { - ::std::option::Option::Some(SavedObject_oneof_kind::variable(ref v)) => v, - _ => ::default_instance(), - } - } - pub fn clear_variable(&mut self) { - self.kind = ::std::option::Option::None; - } - - pub fn has_variable(&self) -> bool { - match self.kind { - ::std::option::Option::Some(SavedObject_oneof_kind::variable(..)) => true, - _ => false, - } - } - - // Param is passed by value, moved - pub fn set_variable(&mut self, v: SavedVariable) { - self.kind = ::std::option::Option::Some(SavedObject_oneof_kind::variable(v)) - } - - // Mutable pointer to the field. - pub fn mut_variable(&mut self) -> &mut SavedVariable { - if let ::std::option::Option::Some(SavedObject_oneof_kind::variable(_)) = self.kind { - } else { - self.kind = - ::std::option::Option::Some(SavedObject_oneof_kind::variable(SavedVariable::new())); - } - match self.kind { - ::std::option::Option::Some(SavedObject_oneof_kind::variable(ref mut v)) => v, - _ => panic!(), - } - } - - // Take field - pub fn take_variable(&mut self) -> SavedVariable { - if self.has_variable() { - match self.kind.take() { - ::std::option::Option::Some(SavedObject_oneof_kind::variable(v)) => v, - _ => panic!(), - } - } else { - SavedVariable::new() - } - } - - // .tensorflow.SavedBareConcreteFunction bare_concrete_function = 8; - - pub fn get_bare_concrete_function(&self) -> &SavedBareConcreteFunction { - match self.kind { - ::std::option::Option::Some(SavedObject_oneof_kind::bare_concrete_function(ref v)) => v, - _ => ::default_instance(), - } - } - pub fn clear_bare_concrete_function(&mut self) { - self.kind = ::std::option::Option::None; - } - - pub fn has_bare_concrete_function(&self) -> bool { - match self.kind { - ::std::option::Option::Some(SavedObject_oneof_kind::bare_concrete_function(..)) => true, - _ => false, - } - } - - // Param is passed by value, moved - pub fn set_bare_concrete_function(&mut self, v: SavedBareConcreteFunction) { - self.kind = ::std::option::Option::Some(SavedObject_oneof_kind::bare_concrete_function(v)) - } - - // Mutable pointer to the field. - pub fn mut_bare_concrete_function(&mut self) -> &mut SavedBareConcreteFunction { - if let ::std::option::Option::Some(SavedObject_oneof_kind::bare_concrete_function(_)) = - self.kind - { - } else { - self.kind = ::std::option::Option::Some( - SavedObject_oneof_kind::bare_concrete_function(SavedBareConcreteFunction::new()), - ); - } - match self.kind { - ::std::option::Option::Some(SavedObject_oneof_kind::bare_concrete_function( - ref mut v, - )) => v, - _ => panic!(), - } - } - - // Take field - pub fn take_bare_concrete_function(&mut self) -> SavedBareConcreteFunction { - if self.has_bare_concrete_function() { - match self.kind.take() { - ::std::option::Option::Some(SavedObject_oneof_kind::bare_concrete_function(v)) => v, - _ => panic!(), - } - } else { - SavedBareConcreteFunction::new() - } - } - - // .tensorflow.SavedConstant constant = 9; - - pub fn get_constant(&self) -> &SavedConstant { - match self.kind { - ::std::option::Option::Some(SavedObject_oneof_kind::constant(ref v)) => v, - _ => ::default_instance(), - } - } - pub fn clear_constant(&mut self) { - self.kind = ::std::option::Option::None; - } - - pub fn has_constant(&self) -> bool { - match self.kind { - ::std::option::Option::Some(SavedObject_oneof_kind::constant(..)) => true, - _ => false, - } - } - - // Param is passed by value, moved - pub fn set_constant(&mut self, v: SavedConstant) { - self.kind = ::std::option::Option::Some(SavedObject_oneof_kind::constant(v)) - } - - // Mutable pointer to the field. - pub fn mut_constant(&mut self) -> &mut SavedConstant { - if let ::std::option::Option::Some(SavedObject_oneof_kind::constant(_)) = self.kind { - } else { - self.kind = - ::std::option::Option::Some(SavedObject_oneof_kind::constant(SavedConstant::new())); - } - match self.kind { - ::std::option::Option::Some(SavedObject_oneof_kind::constant(ref mut v)) => v, - _ => panic!(), - } - } - - // Take field - pub fn take_constant(&mut self) -> SavedConstant { - if self.has_constant() { - match self.kind.take() { - ::std::option::Option::Some(SavedObject_oneof_kind::constant(v)) => v, - _ => panic!(), - } - } else { - SavedConstant::new() - } - } - - // .tensorflow.SavedResource resource = 10; - - pub fn get_resource(&self) -> &SavedResource { - match self.kind { - ::std::option::Option::Some(SavedObject_oneof_kind::resource(ref v)) => v, - _ => ::default_instance(), - } - } - pub fn clear_resource(&mut self) { - self.kind = ::std::option::Option::None; - } - - pub fn has_resource(&self) -> bool { - match self.kind { - ::std::option::Option::Some(SavedObject_oneof_kind::resource(..)) => true, - _ => false, - } - } - - // Param is passed by value, moved - pub fn set_resource(&mut self, v: SavedResource) { - self.kind = ::std::option::Option::Some(SavedObject_oneof_kind::resource(v)) - } - - // Mutable pointer to the field. - pub fn mut_resource(&mut self) -> &mut SavedResource { - if let ::std::option::Option::Some(SavedObject_oneof_kind::resource(_)) = self.kind { - } else { - self.kind = - ::std::option::Option::Some(SavedObject_oneof_kind::resource(SavedResource::new())); - } - match self.kind { - ::std::option::Option::Some(SavedObject_oneof_kind::resource(ref mut v)) => v, - _ => panic!(), - } - } - - // Take field - pub fn take_resource(&mut self) -> SavedResource { - if self.has_resource() { - match self.kind.take() { - ::std::option::Option::Some(SavedObject_oneof_kind::resource(v)) => v, - _ => panic!(), - } - } else { - SavedResource::new() - } - } -} - -impl ::protobuf::Message for SavedObject { - fn is_initialized(&self) -> bool { - for v in &self.children { - if !v.is_initialized() { - return false; - } - } - for v in &self.slot_variables { - if !v.is_initialized() { - return false; - } - } - if let Some(SavedObject_oneof_kind::user_object(ref v)) = self.kind { - if !v.is_initialized() { - return false; - } - } - if let Some(SavedObject_oneof_kind::asset(ref v)) = self.kind { - if !v.is_initialized() { - return false; - } - } - if let Some(SavedObject_oneof_kind::function(ref v)) = self.kind { - if !v.is_initialized() { - return false; - } - } - if let Some(SavedObject_oneof_kind::variable(ref v)) = self.kind { - if !v.is_initialized() { - return false; - } - } - if let Some(SavedObject_oneof_kind::bare_concrete_function(ref v)) = self.kind { - if !v.is_initialized() { - return false; - } - } - if let Some(SavedObject_oneof_kind::constant(ref v)) = self.kind { - if !v.is_initialized() { - return false; - } - } - if let Some(SavedObject_oneof_kind::resource(ref v)) = self.kind { - if !v.is_initialized() { - return false; - } - } - true - } - - fn merge_from( - &mut self, - is: &mut ::protobuf::CodedInputStream<'_>, - ) -> ::protobuf::ProtobufResult<()> { - while !is.eof()? { - let (field_number, wire_type) = is.read_tag_unpack()?; - match field_number { - 1 => { - ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.children)?; - } - 3 => { - ::protobuf::rt::read_repeated_message_into( - wire_type, - is, - &mut self.slot_variables, - )?; - } - 4 => { - if wire_type != ::protobuf::wire_format::WireTypeLengthDelimited { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type( - wire_type, - )); - } - self.kind = ::std::option::Option::Some(SavedObject_oneof_kind::user_object( - is.read_message()?, - )); - } - 5 => { - if wire_type != ::protobuf::wire_format::WireTypeLengthDelimited { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type( - wire_type, - )); - } - self.kind = ::std::option::Option::Some(SavedObject_oneof_kind::asset( - is.read_message()?, - )); - } - 6 => { - if wire_type != ::protobuf::wire_format::WireTypeLengthDelimited { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type( - wire_type, - )); - } - self.kind = ::std::option::Option::Some(SavedObject_oneof_kind::function( - is.read_message()?, - )); - } - 7 => { - if wire_type != ::protobuf::wire_format::WireTypeLengthDelimited { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type( - wire_type, - )); - } - self.kind = ::std::option::Option::Some(SavedObject_oneof_kind::variable( - is.read_message()?, - )); - } - 8 => { - if wire_type != ::protobuf::wire_format::WireTypeLengthDelimited { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type( - wire_type, - )); - } - self.kind = ::std::option::Option::Some( - SavedObject_oneof_kind::bare_concrete_function(is.read_message()?), - ); - } - 9 => { - if wire_type != ::protobuf::wire_format::WireTypeLengthDelimited { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type( - wire_type, - )); - } - self.kind = ::std::option::Option::Some(SavedObject_oneof_kind::constant( - is.read_message()?, - )); - } - 10 => { - if wire_type != ::protobuf::wire_format::WireTypeLengthDelimited { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type( - wire_type, - )); - } - self.kind = ::std::option::Option::Some(SavedObject_oneof_kind::resource( - is.read_message()?, - )); - } - _ => { - ::protobuf::rt::read_unknown_or_skip_group( - field_number, - wire_type, - is, - self.mut_unknown_fields(), - )?; - } - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u32 { - let mut my_size = 0; - for value in &self.children { - let len = value.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - } - for value in &self.slot_variables { - let len = value.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - } - if let ::std::option::Option::Some(ref v) = self.kind { - match v { - &SavedObject_oneof_kind::user_object(ref v) => { - let len = v.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - } - &SavedObject_oneof_kind::asset(ref v) => { - let len = v.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - } - &SavedObject_oneof_kind::function(ref v) => { - let len = v.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - } - &SavedObject_oneof_kind::variable(ref v) => { - let len = v.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - } - &SavedObject_oneof_kind::bare_concrete_function(ref v) => { - let len = v.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - } - &SavedObject_oneof_kind::constant(ref v) => { - let len = v.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - } - &SavedObject_oneof_kind::resource(ref v) => { - let len = v.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - } - }; - } - my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); - self.cached_size.set(my_size); - my_size - } - - fn write_to_with_cached_sizes( - &self, - os: &mut ::protobuf::CodedOutputStream<'_>, - ) -> ::protobuf::ProtobufResult<()> { - for v in &self.children { - os.write_tag(1, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - } - for v in &self.slot_variables { - os.write_tag(3, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - } - if let ::std::option::Option::Some(ref v) = self.kind { - match v { - &SavedObject_oneof_kind::user_object(ref v) => { - os.write_tag(4, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - } - &SavedObject_oneof_kind::asset(ref v) => { - os.write_tag(5, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - } - &SavedObject_oneof_kind::function(ref v) => { - os.write_tag(6, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - } - &SavedObject_oneof_kind::variable(ref v) => { - os.write_tag(7, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - } - &SavedObject_oneof_kind::bare_concrete_function(ref v) => { - os.write_tag(8, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - } - &SavedObject_oneof_kind::constant(ref v) => { - os.write_tag(9, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - } - &SavedObject_oneof_kind::resource(ref v) => { - os.write_tag(10, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - } - }; - } - os.write_unknown_fields(self.get_unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn get_cached_size(&self) -> u32 { - self.cached_size.get() - } - - fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { - &self.unknown_fields - } - - fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { - &mut self.unknown_fields - } - - fn as_any(&self) -> &dyn (::std::any::Any) { - self as &dyn (::std::any::Any) - } - fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { - self as &mut dyn (::std::any::Any) - } - fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { - self - } - - fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - Self::descriptor_static() - } - - fn new() -> SavedObject { - SavedObject::new() - } - - fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = - ::protobuf::rt::LazyV2::INIT; - descriptor.get(|| { - let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( - "children", - |m: &SavedObject| { &m.children }, - |m: &mut SavedObject| { &mut m.children }, - )); - fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( - "slot_variables", - |m: &SavedObject| { &m.slot_variables }, - |m: &mut SavedObject| { &mut m.slot_variables }, - )); - fields.push(::protobuf::reflect::accessor::make_singular_message_accessor::<_, SavedUserObject>( - "user_object", - SavedObject::has_user_object, - SavedObject::get_user_object, - )); - fields.push(::protobuf::reflect::accessor::make_singular_message_accessor::<_, SavedAsset>( - "asset", - SavedObject::has_asset, - SavedObject::get_asset, - )); - fields.push(::protobuf::reflect::accessor::make_singular_message_accessor::<_, SavedFunction>( - "function", - SavedObject::has_function, - SavedObject::get_function, - )); - fields.push(::protobuf::reflect::accessor::make_singular_message_accessor::<_, SavedVariable>( - "variable", - SavedObject::has_variable, - SavedObject::get_variable, - )); - fields.push(::protobuf::reflect::accessor::make_singular_message_accessor::<_, SavedBareConcreteFunction>( - "bare_concrete_function", - SavedObject::has_bare_concrete_function, - SavedObject::get_bare_concrete_function, - )); - fields.push(::protobuf::reflect::accessor::make_singular_message_accessor::<_, SavedConstant>( - "constant", - SavedObject::has_constant, - SavedObject::get_constant, - )); - fields.push(::protobuf::reflect::accessor::make_singular_message_accessor::<_, SavedResource>( - "resource", - SavedObject::has_resource, - SavedObject::get_resource, - )); - ::protobuf::reflect::MessageDescriptor::new_pb_name::( - "SavedObject", - fields, - file_descriptor_proto() - ) - }) - } - - fn default_instance() -> &'static SavedObject { - static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; - instance.get(SavedObject::new) - } -} - -impl ::protobuf::Clear for SavedObject { - fn clear(&mut self) { - self.children.clear(); - self.slot_variables.clear(); - self.kind = ::std::option::Option::None; - self.kind = ::std::option::Option::None; - self.kind = ::std::option::Option::None; - self.kind = ::std::option::Option::None; - self.kind = ::std::option::Option::None; - self.kind = ::std::option::Option::None; - self.kind = ::std::option::Option::None; - self.unknown_fields.clear(); - } -} - -impl ::std::fmt::Debug for SavedObject { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for SavedObject { - fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { - ::protobuf::reflect::ReflectValueRef::Message(self) - } -} - -#[derive(PartialEq, Clone, Default)] -pub struct SavedUserObject { - // message fields - pub identifier: ::std::string::String, - pub version: ::protobuf::SingularPtrField, - pub metadata: ::std::string::String, - // special fields - pub unknown_fields: ::protobuf::UnknownFields, - pub cached_size: ::protobuf::CachedSize, -} - -impl<'a> ::std::default::Default for &'a SavedUserObject { - fn default() -> &'a SavedUserObject { - ::default_instance() - } -} - -impl SavedUserObject { - pub fn new() -> SavedUserObject { - ::std::default::Default::default() - } - - // string identifier = 1; - - pub fn get_identifier(&self) -> &str { - &self.identifier - } - pub fn clear_identifier(&mut self) { - self.identifier.clear(); - } - - // Param is passed by value, moved - pub fn set_identifier(&mut self, v: ::std::string::String) { - self.identifier = v; - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_identifier(&mut self) -> &mut ::std::string::String { - &mut self.identifier - } - - // Take field - pub fn take_identifier(&mut self) -> ::std::string::String { - ::std::mem::replace(&mut self.identifier, ::std::string::String::new()) - } - - // .tensorflow.VersionDef version = 2; - - pub fn get_version(&self) -> &super::versions::VersionDef { - self.version.as_ref().unwrap_or_else(|| { - ::default_instance() - }) - } - pub fn clear_version(&mut self) { - self.version.clear(); - } - - pub fn has_version(&self) -> bool { - self.version.is_some() - } - - // Param is passed by value, moved - pub fn set_version(&mut self, v: super::versions::VersionDef) { - self.version = ::protobuf::SingularPtrField::some(v); - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_version(&mut self) -> &mut super::versions::VersionDef { - if self.version.is_none() { - self.version.set_default(); - } - self.version.as_mut().unwrap() - } - - // Take field - pub fn take_version(&mut self) -> super::versions::VersionDef { - self.version - .take() - .unwrap_or_else(|| super::versions::VersionDef::new()) - } - - // string metadata = 3; - - pub fn get_metadata(&self) -> &str { - &self.metadata - } - pub fn clear_metadata(&mut self) { - self.metadata.clear(); - } - - // Param is passed by value, moved - pub fn set_metadata(&mut self, v: ::std::string::String) { - self.metadata = v; - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_metadata(&mut self) -> &mut ::std::string::String { - &mut self.metadata - } - - // Take field - pub fn take_metadata(&mut self) -> ::std::string::String { - ::std::mem::replace(&mut self.metadata, ::std::string::String::new()) - } -} - -impl ::protobuf::Message for SavedUserObject { - fn is_initialized(&self) -> bool { - for v in &self.version { - if !v.is_initialized() { - return false; - } - } - true - } - - fn merge_from( - &mut self, - is: &mut ::protobuf::CodedInputStream<'_>, - ) -> ::protobuf::ProtobufResult<()> { - while !is.eof()? { - let (field_number, wire_type) = is.read_tag_unpack()?; - match field_number { - 1 => { - ::protobuf::rt::read_singular_proto3_string_into( - wire_type, - is, - &mut self.identifier, - )?; - } - 2 => { - ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.version)?; - } - 3 => { - ::protobuf::rt::read_singular_proto3_string_into( - wire_type, - is, - &mut self.metadata, - )?; - } - _ => { - ::protobuf::rt::read_unknown_or_skip_group( - field_number, - wire_type, - is, - self.mut_unknown_fields(), - )?; - } - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u32 { - let mut my_size = 0; - if !self.identifier.is_empty() { - my_size += ::protobuf::rt::string_size(1, &self.identifier); - } - if let Some(ref v) = self.version.as_ref() { - let len = v.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - } - if !self.metadata.is_empty() { - my_size += ::protobuf::rt::string_size(3, &self.metadata); - } - my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); - self.cached_size.set(my_size); - my_size - } - - fn write_to_with_cached_sizes( - &self, - os: &mut ::protobuf::CodedOutputStream<'_>, - ) -> ::protobuf::ProtobufResult<()> { - if !self.identifier.is_empty() { - os.write_string(1, &self.identifier)?; - } - if let Some(ref v) = self.version.as_ref() { - os.write_tag(2, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - } - if !self.metadata.is_empty() { - os.write_string(3, &self.metadata)?; - } - os.write_unknown_fields(self.get_unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn get_cached_size(&self) -> u32 { - self.cached_size.get() - } - - fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { - &self.unknown_fields - } - - fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { - &mut self.unknown_fields - } - - fn as_any(&self) -> &dyn (::std::any::Any) { - self as &dyn (::std::any::Any) - } - fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { - self as &mut dyn (::std::any::Any) - } - fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { - self - } - - fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - Self::descriptor_static() - } - - fn new() -> SavedUserObject { - SavedUserObject::new() - } - - fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = - ::protobuf::rt::LazyV2::INIT; - descriptor.get(|| { - let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::< - _, - ::protobuf::types::ProtobufTypeString, - >( - "identifier", - |m: &SavedUserObject| &m.identifier, - |m: &mut SavedUserObject| &mut m.identifier, - )); - fields.push( - ::protobuf::reflect::accessor::make_singular_ptr_field_accessor::< - _, - ::protobuf::types::ProtobufTypeMessage, - >( - "version", - |m: &SavedUserObject| &m.version, - |m: &mut SavedUserObject| &mut m.version, - ), - ); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::< - _, - ::protobuf::types::ProtobufTypeString, - >( - "metadata", - |m: &SavedUserObject| &m.metadata, - |m: &mut SavedUserObject| &mut m.metadata, - )); - ::protobuf::reflect::MessageDescriptor::new_pb_name::( - "SavedUserObject", - fields, - file_descriptor_proto(), - ) - }) - } - - fn default_instance() -> &'static SavedUserObject { - static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; - instance.get(SavedUserObject::new) - } -} - -impl ::protobuf::Clear for SavedUserObject { - fn clear(&mut self) { - self.identifier.clear(); - self.version.clear(); - self.metadata.clear(); - self.unknown_fields.clear(); - } -} - -impl ::std::fmt::Debug for SavedUserObject { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for SavedUserObject { - fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { - ::protobuf::reflect::ReflectValueRef::Message(self) - } -} - -#[derive(PartialEq, Clone, Default)] -pub struct SavedAsset { - // message fields - pub asset_file_def_index: i32, - // special fields - pub unknown_fields: ::protobuf::UnknownFields, - pub cached_size: ::protobuf::CachedSize, -} - -impl<'a> ::std::default::Default for &'a SavedAsset { - fn default() -> &'a SavedAsset { - ::default_instance() - } -} - -impl SavedAsset { - pub fn new() -> SavedAsset { - ::std::default::Default::default() - } - - // int32 asset_file_def_index = 1; - - pub fn get_asset_file_def_index(&self) -> i32 { - self.asset_file_def_index - } - pub fn clear_asset_file_def_index(&mut self) { - self.asset_file_def_index = 0; - } - - // Param is passed by value, moved - pub fn set_asset_file_def_index(&mut self, v: i32) { - self.asset_file_def_index = v; - } -} - -impl ::protobuf::Message for SavedAsset { - fn is_initialized(&self) -> bool { - true - } - - fn merge_from( - &mut self, - is: &mut ::protobuf::CodedInputStream<'_>, - ) -> ::protobuf::ProtobufResult<()> { - while !is.eof()? { - let (field_number, wire_type) = is.read_tag_unpack()?; - match field_number { - 1 => { - if wire_type != ::protobuf::wire_format::WireTypeVarint { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type( - wire_type, - )); - } - let tmp = is.read_int32()?; - self.asset_file_def_index = tmp; - } - _ => { - ::protobuf::rt::read_unknown_or_skip_group( - field_number, - wire_type, - is, - self.mut_unknown_fields(), - )?; - } - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u32 { - let mut my_size = 0; - if self.asset_file_def_index != 0 { - my_size += ::protobuf::rt::value_size( - 1, - self.asset_file_def_index, - ::protobuf::wire_format::WireTypeVarint, - ); - } - my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); - self.cached_size.set(my_size); - my_size - } - - fn write_to_with_cached_sizes( - &self, - os: &mut ::protobuf::CodedOutputStream<'_>, - ) -> ::protobuf::ProtobufResult<()> { - if self.asset_file_def_index != 0 { - os.write_int32(1, self.asset_file_def_index)?; - } - os.write_unknown_fields(self.get_unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn get_cached_size(&self) -> u32 { - self.cached_size.get() - } - - fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { - &self.unknown_fields - } - - fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { - &mut self.unknown_fields - } - - fn as_any(&self) -> &dyn (::std::any::Any) { - self as &dyn (::std::any::Any) - } - fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { - self as &mut dyn (::std::any::Any) - } - fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { - self - } - - fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - Self::descriptor_static() - } - - fn new() -> SavedAsset { - SavedAsset::new() - } - - fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = - ::protobuf::rt::LazyV2::INIT; - descriptor.get(|| { - let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::< - _, - ::protobuf::types::ProtobufTypeInt32, - >( - "asset_file_def_index", - |m: &SavedAsset| &m.asset_file_def_index, - |m: &mut SavedAsset| &mut m.asset_file_def_index, - )); - ::protobuf::reflect::MessageDescriptor::new_pb_name::( - "SavedAsset", - fields, - file_descriptor_proto(), - ) - }) - } - - fn default_instance() -> &'static SavedAsset { - static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; - instance.get(SavedAsset::new) - } -} - -impl ::protobuf::Clear for SavedAsset { - fn clear(&mut self) { - self.asset_file_def_index = 0; - self.unknown_fields.clear(); - } -} - -impl ::std::fmt::Debug for SavedAsset { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for SavedAsset { - fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { - ::protobuf::reflect::ReflectValueRef::Message(self) - } -} - -#[derive(PartialEq, Clone, Default)] -pub struct SavedFunction { - // message fields - pub concrete_functions: ::protobuf::RepeatedField<::std::string::String>, - pub function_spec: ::protobuf::SingularPtrField, - // special fields - pub unknown_fields: ::protobuf::UnknownFields, - pub cached_size: ::protobuf::CachedSize, -} - -impl<'a> ::std::default::Default for &'a SavedFunction { - fn default() -> &'a SavedFunction { - ::default_instance() - } -} - -impl SavedFunction { - pub fn new() -> SavedFunction { - ::std::default::Default::default() - } - - // repeated string concrete_functions = 1; - - pub fn get_concrete_functions(&self) -> &[::std::string::String] { - &self.concrete_functions - } - pub fn clear_concrete_functions(&mut self) { - self.concrete_functions.clear(); - } - - // Param is passed by value, moved - pub fn set_concrete_functions(&mut self, v: ::protobuf::RepeatedField<::std::string::String>) { - self.concrete_functions = v; - } - - // Mutable pointer to the field. - pub fn mut_concrete_functions( - &mut self, - ) -> &mut ::protobuf::RepeatedField<::std::string::String> { - &mut self.concrete_functions - } - - // Take field - pub fn take_concrete_functions(&mut self) -> ::protobuf::RepeatedField<::std::string::String> { - ::std::mem::replace( - &mut self.concrete_functions, - ::protobuf::RepeatedField::new(), - ) - } - - // .tensorflow.FunctionSpec function_spec = 2; - - pub fn get_function_spec(&self) -> &FunctionSpec { - self.function_spec - .as_ref() - .unwrap_or_else(|| ::default_instance()) - } - pub fn clear_function_spec(&mut self) { - self.function_spec.clear(); - } - - pub fn has_function_spec(&self) -> bool { - self.function_spec.is_some() - } - - // Param is passed by value, moved - pub fn set_function_spec(&mut self, v: FunctionSpec) { - self.function_spec = ::protobuf::SingularPtrField::some(v); - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_function_spec(&mut self) -> &mut FunctionSpec { - if self.function_spec.is_none() { - self.function_spec.set_default(); - } - self.function_spec.as_mut().unwrap() - } - - // Take field - pub fn take_function_spec(&mut self) -> FunctionSpec { - self.function_spec - .take() - .unwrap_or_else(|| FunctionSpec::new()) - } -} - -impl ::protobuf::Message for SavedFunction { - fn is_initialized(&self) -> bool { - for v in &self.function_spec { - if !v.is_initialized() { - return false; - } - } - true - } - - fn merge_from( - &mut self, - is: &mut ::protobuf::CodedInputStream<'_>, - ) -> ::protobuf::ProtobufResult<()> { - while !is.eof()? { - let (field_number, wire_type) = is.read_tag_unpack()?; - match field_number { - 1 => { - ::protobuf::rt::read_repeated_string_into( - wire_type, - is, - &mut self.concrete_functions, - )?; - } - 2 => { - ::protobuf::rt::read_singular_message_into( - wire_type, - is, - &mut self.function_spec, - )?; - } - _ => { - ::protobuf::rt::read_unknown_or_skip_group( - field_number, - wire_type, - is, - self.mut_unknown_fields(), - )?; - } - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u32 { - let mut my_size = 0; - for value in &self.concrete_functions { - my_size += ::protobuf::rt::string_size(1, &value); - } - if let Some(ref v) = self.function_spec.as_ref() { - let len = v.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - } - my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); - self.cached_size.set(my_size); - my_size - } - - fn write_to_with_cached_sizes( - &self, - os: &mut ::protobuf::CodedOutputStream<'_>, - ) -> ::protobuf::ProtobufResult<()> { - for v in &self.concrete_functions { - os.write_string(1, &v)?; - } - if let Some(ref v) = self.function_spec.as_ref() { - os.write_tag(2, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - } - os.write_unknown_fields(self.get_unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn get_cached_size(&self) -> u32 { - self.cached_size.get() - } - - fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { - &self.unknown_fields - } - - fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { - &mut self.unknown_fields - } - - fn as_any(&self) -> &dyn (::std::any::Any) { - self as &dyn (::std::any::Any) - } - fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { - self as &mut dyn (::std::any::Any) - } - fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { - self - } - - fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - Self::descriptor_static() - } - - fn new() -> SavedFunction { - SavedFunction::new() - } - - fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = - ::protobuf::rt::LazyV2::INIT; - descriptor.get(|| { - let mut fields = ::std::vec::Vec::new(); - fields.push( - ::protobuf::reflect::accessor::make_repeated_field_accessor::< - _, - ::protobuf::types::ProtobufTypeString, - >( - "concrete_functions", - |m: &SavedFunction| &m.concrete_functions, - |m: &mut SavedFunction| &mut m.concrete_functions, - ), - ); - fields.push( - ::protobuf::reflect::accessor::make_singular_ptr_field_accessor::< - _, - ::protobuf::types::ProtobufTypeMessage, - >( - "function_spec", - |m: &SavedFunction| &m.function_spec, - |m: &mut SavedFunction| &mut m.function_spec, - ), - ); - ::protobuf::reflect::MessageDescriptor::new_pb_name::( - "SavedFunction", - fields, - file_descriptor_proto(), - ) - }) - } - - fn default_instance() -> &'static SavedFunction { - static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; - instance.get(SavedFunction::new) - } -} - -impl ::protobuf::Clear for SavedFunction { - fn clear(&mut self) { - self.concrete_functions.clear(); - self.function_spec.clear(); - self.unknown_fields.clear(); - } -} - -impl ::std::fmt::Debug for SavedFunction { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for SavedFunction { - fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { - ::protobuf::reflect::ReflectValueRef::Message(self) - } -} - -#[derive(PartialEq, Clone, Default)] -pub struct SavedConcreteFunction { - // message fields - pub bound_inputs: ::std::vec::Vec, - pub canonicalized_input_signature: - ::protobuf::SingularPtrField, - pub output_signature: ::protobuf::SingularPtrField, - // special fields - pub unknown_fields: ::protobuf::UnknownFields, - pub cached_size: ::protobuf::CachedSize, -} - -impl<'a> ::std::default::Default for &'a SavedConcreteFunction { - fn default() -> &'a SavedConcreteFunction { - ::default_instance() - } -} - -impl SavedConcreteFunction { - pub fn new() -> SavedConcreteFunction { - ::std::default::Default::default() - } - - // repeated int32 bound_inputs = 2; - - pub fn get_bound_inputs(&self) -> &[i32] { - &self.bound_inputs - } - pub fn clear_bound_inputs(&mut self) { - self.bound_inputs.clear(); - } - - // Param is passed by value, moved - pub fn set_bound_inputs(&mut self, v: ::std::vec::Vec) { - self.bound_inputs = v; - } - - // Mutable pointer to the field. - pub fn mut_bound_inputs(&mut self) -> &mut ::std::vec::Vec { - &mut self.bound_inputs - } - - // Take field - pub fn take_bound_inputs(&mut self) -> ::std::vec::Vec { - ::std::mem::replace(&mut self.bound_inputs, ::std::vec::Vec::new()) - } - - // .tensorflow.StructuredValue canonicalized_input_signature = 3; - - pub fn get_canonicalized_input_signature(&self) -> &super::struct_pb::StructuredValue { - self.canonicalized_input_signature - .as_ref() - .unwrap_or_else(|| { - ::default_instance() - }) - } - pub fn clear_canonicalized_input_signature(&mut self) { - self.canonicalized_input_signature.clear(); - } - - pub fn has_canonicalized_input_signature(&self) -> bool { - self.canonicalized_input_signature.is_some() - } - - // Param is passed by value, moved - pub fn set_canonicalized_input_signature(&mut self, v: super::struct_pb::StructuredValue) { - self.canonicalized_input_signature = ::protobuf::SingularPtrField::some(v); - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_canonicalized_input_signature(&mut self) -> &mut super::struct_pb::StructuredValue { - if self.canonicalized_input_signature.is_none() { - self.canonicalized_input_signature.set_default(); - } - self.canonicalized_input_signature.as_mut().unwrap() - } - - // Take field - pub fn take_canonicalized_input_signature(&mut self) -> super::struct_pb::StructuredValue { - self.canonicalized_input_signature - .take() - .unwrap_or_else(|| super::struct_pb::StructuredValue::new()) - } - - // .tensorflow.StructuredValue output_signature = 4; - - pub fn get_output_signature(&self) -> &super::struct_pb::StructuredValue { - self.output_signature.as_ref().unwrap_or_else(|| { - ::default_instance() - }) - } - pub fn clear_output_signature(&mut self) { - self.output_signature.clear(); - } - - pub fn has_output_signature(&self) -> bool { - self.output_signature.is_some() - } - - // Param is passed by value, moved - pub fn set_output_signature(&mut self, v: super::struct_pb::StructuredValue) { - self.output_signature = ::protobuf::SingularPtrField::some(v); - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_output_signature(&mut self) -> &mut super::struct_pb::StructuredValue { - if self.output_signature.is_none() { - self.output_signature.set_default(); - } - self.output_signature.as_mut().unwrap() - } - - // Take field - pub fn take_output_signature(&mut self) -> super::struct_pb::StructuredValue { - self.output_signature - .take() - .unwrap_or_else(|| super::struct_pb::StructuredValue::new()) - } -} - -impl ::protobuf::Message for SavedConcreteFunction { - fn is_initialized(&self) -> bool { - for v in &self.canonicalized_input_signature { - if !v.is_initialized() { - return false; - } - } - for v in &self.output_signature { - if !v.is_initialized() { - return false; - } - } - true - } - - fn merge_from( - &mut self, - is: &mut ::protobuf::CodedInputStream<'_>, - ) -> ::protobuf::ProtobufResult<()> { - while !is.eof()? { - let (field_number, wire_type) = is.read_tag_unpack()?; - match field_number { - 2 => { - ::protobuf::rt::read_repeated_int32_into( - wire_type, - is, - &mut self.bound_inputs, - )?; - } - 3 => { - ::protobuf::rt::read_singular_message_into( - wire_type, - is, - &mut self.canonicalized_input_signature, - )?; - } - 4 => { - ::protobuf::rt::read_singular_message_into( - wire_type, - is, - &mut self.output_signature, - )?; - } - _ => { - ::protobuf::rt::read_unknown_or_skip_group( - field_number, - wire_type, - is, - self.mut_unknown_fields(), - )?; - } - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u32 { - let mut my_size = 0; - for value in &self.bound_inputs { - my_size += - ::protobuf::rt::value_size(2, *value, ::protobuf::wire_format::WireTypeVarint); - } - if let Some(ref v) = self.canonicalized_input_signature.as_ref() { - let len = v.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - } - if let Some(ref v) = self.output_signature.as_ref() { - let len = v.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - } - my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); - self.cached_size.set(my_size); - my_size - } - - fn write_to_with_cached_sizes( - &self, - os: &mut ::protobuf::CodedOutputStream<'_>, - ) -> ::protobuf::ProtobufResult<()> { - for v in &self.bound_inputs { - os.write_int32(2, *v)?; - } - if let Some(ref v) = self.canonicalized_input_signature.as_ref() { - os.write_tag(3, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - } - if let Some(ref v) = self.output_signature.as_ref() { - os.write_tag(4, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - } - os.write_unknown_fields(self.get_unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn get_cached_size(&self) -> u32 { - self.cached_size.get() - } - - fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { - &self.unknown_fields - } - - fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { - &mut self.unknown_fields - } - - fn as_any(&self) -> &dyn (::std::any::Any) { - self as &dyn (::std::any::Any) - } - fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { - self as &mut dyn (::std::any::Any) - } - fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { - self - } - - fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - Self::descriptor_static() - } - - fn new() -> SavedConcreteFunction { - SavedConcreteFunction::new() - } - - fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = - ::protobuf::rt::LazyV2::INIT; - descriptor.get(|| { - let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_vec_accessor::< - _, - ::protobuf::types::ProtobufTypeInt32, - >( - "bound_inputs", - |m: &SavedConcreteFunction| &m.bound_inputs, - |m: &mut SavedConcreteFunction| &mut m.bound_inputs, - )); - fields.push( - ::protobuf::reflect::accessor::make_singular_ptr_field_accessor::< - _, - ::protobuf::types::ProtobufTypeMessage, - >( - "canonicalized_input_signature", - |m: &SavedConcreteFunction| &m.canonicalized_input_signature, - |m: &mut SavedConcreteFunction| &mut m.canonicalized_input_signature, - ), - ); - fields.push( - ::protobuf::reflect::accessor::make_singular_ptr_field_accessor::< - _, - ::protobuf::types::ProtobufTypeMessage, - >( - "output_signature", - |m: &SavedConcreteFunction| &m.output_signature, - |m: &mut SavedConcreteFunction| &mut m.output_signature, - ), - ); - ::protobuf::reflect::MessageDescriptor::new_pb_name::( - "SavedConcreteFunction", - fields, - file_descriptor_proto(), - ) - }) - } - - fn default_instance() -> &'static SavedConcreteFunction { - static instance: ::protobuf::rt::LazyV2 = - ::protobuf::rt::LazyV2::INIT; - instance.get(SavedConcreteFunction::new) - } -} - -impl ::protobuf::Clear for SavedConcreteFunction { - fn clear(&mut self) { - self.bound_inputs.clear(); - self.canonicalized_input_signature.clear(); - self.output_signature.clear(); - self.unknown_fields.clear(); - } -} - -impl ::std::fmt::Debug for SavedConcreteFunction { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for SavedConcreteFunction { - fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { - ::protobuf::reflect::ReflectValueRef::Message(self) - } -} - -#[derive(PartialEq, Clone, Default)] -pub struct SavedBareConcreteFunction { - // message fields - pub concrete_function_name: ::std::string::String, - pub argument_keywords: ::protobuf::RepeatedField<::std::string::String>, - pub allowed_positional_arguments: i64, - // special fields - pub unknown_fields: ::protobuf::UnknownFields, - pub cached_size: ::protobuf::CachedSize, -} - -impl<'a> ::std::default::Default for &'a SavedBareConcreteFunction { - fn default() -> &'a SavedBareConcreteFunction { - ::default_instance() - } -} - -impl SavedBareConcreteFunction { - pub fn new() -> SavedBareConcreteFunction { - ::std::default::Default::default() - } - - // string concrete_function_name = 1; - - pub fn get_concrete_function_name(&self) -> &str { - &self.concrete_function_name - } - pub fn clear_concrete_function_name(&mut self) { - self.concrete_function_name.clear(); - } - - // Param is passed by value, moved - pub fn set_concrete_function_name(&mut self, v: ::std::string::String) { - self.concrete_function_name = v; - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_concrete_function_name(&mut self) -> &mut ::std::string::String { - &mut self.concrete_function_name - } - - // Take field - pub fn take_concrete_function_name(&mut self) -> ::std::string::String { - ::std::mem::replace( - &mut self.concrete_function_name, - ::std::string::String::new(), - ) - } - - // repeated string argument_keywords = 2; - - pub fn get_argument_keywords(&self) -> &[::std::string::String] { - &self.argument_keywords - } - pub fn clear_argument_keywords(&mut self) { - self.argument_keywords.clear(); - } - - // Param is passed by value, moved - pub fn set_argument_keywords(&mut self, v: ::protobuf::RepeatedField<::std::string::String>) { - self.argument_keywords = v; - } - - // Mutable pointer to the field. - pub fn mut_argument_keywords( - &mut self, - ) -> &mut ::protobuf::RepeatedField<::std::string::String> { - &mut self.argument_keywords - } - - // Take field - pub fn take_argument_keywords(&mut self) -> ::protobuf::RepeatedField<::std::string::String> { - ::std::mem::replace( - &mut self.argument_keywords, - ::protobuf::RepeatedField::new(), - ) - } - - // int64 allowed_positional_arguments = 3; - - pub fn get_allowed_positional_arguments(&self) -> i64 { - self.allowed_positional_arguments - } - pub fn clear_allowed_positional_arguments(&mut self) { - self.allowed_positional_arguments = 0; - } - - // Param is passed by value, moved - pub fn set_allowed_positional_arguments(&mut self, v: i64) { - self.allowed_positional_arguments = v; - } -} - -impl ::protobuf::Message for SavedBareConcreteFunction { - fn is_initialized(&self) -> bool { - true - } - - fn merge_from( - &mut self, - is: &mut ::protobuf::CodedInputStream<'_>, - ) -> ::protobuf::ProtobufResult<()> { - while !is.eof()? { - let (field_number, wire_type) = is.read_tag_unpack()?; - match field_number { - 1 => { - ::protobuf::rt::read_singular_proto3_string_into( - wire_type, - is, - &mut self.concrete_function_name, - )?; - } - 2 => { - ::protobuf::rt::read_repeated_string_into( - wire_type, - is, - &mut self.argument_keywords, - )?; - } - 3 => { - if wire_type != ::protobuf::wire_format::WireTypeVarint { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type( - wire_type, - )); - } - let tmp = is.read_int64()?; - self.allowed_positional_arguments = tmp; - } - _ => { - ::protobuf::rt::read_unknown_or_skip_group( - field_number, - wire_type, - is, - self.mut_unknown_fields(), - )?; - } - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u32 { - let mut my_size = 0; - if !self.concrete_function_name.is_empty() { - my_size += ::protobuf::rt::string_size(1, &self.concrete_function_name); - } - for value in &self.argument_keywords { - my_size += ::protobuf::rt::string_size(2, &value); - } - if self.allowed_positional_arguments != 0 { - my_size += ::protobuf::rt::value_size( - 3, - self.allowed_positional_arguments, - ::protobuf::wire_format::WireTypeVarint, - ); - } - my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); - self.cached_size.set(my_size); - my_size - } - - fn write_to_with_cached_sizes( - &self, - os: &mut ::protobuf::CodedOutputStream<'_>, - ) -> ::protobuf::ProtobufResult<()> { - if !self.concrete_function_name.is_empty() { - os.write_string(1, &self.concrete_function_name)?; - } - for v in &self.argument_keywords { - os.write_string(2, &v)?; - } - if self.allowed_positional_arguments != 0 { - os.write_int64(3, self.allowed_positional_arguments)?; - } - os.write_unknown_fields(self.get_unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn get_cached_size(&self) -> u32 { - self.cached_size.get() - } - - fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { - &self.unknown_fields - } - - fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { - &mut self.unknown_fields - } - - fn as_any(&self) -> &dyn (::std::any::Any) { - self as &dyn (::std::any::Any) - } - fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { - self as &mut dyn (::std::any::Any) - } - fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { - self - } - - fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - Self::descriptor_static() - } - - fn new() -> SavedBareConcreteFunction { - SavedBareConcreteFunction::new() - } - - fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = - ::protobuf::rt::LazyV2::INIT; - descriptor.get(|| { - let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::< - _, - ::protobuf::types::ProtobufTypeString, - >( - "concrete_function_name", - |m: &SavedBareConcreteFunction| &m.concrete_function_name, - |m: &mut SavedBareConcreteFunction| &mut m.concrete_function_name, - )); - fields.push( - ::protobuf::reflect::accessor::make_repeated_field_accessor::< - _, - ::protobuf::types::ProtobufTypeString, - >( - "argument_keywords", - |m: &SavedBareConcreteFunction| &m.argument_keywords, - |m: &mut SavedBareConcreteFunction| &mut m.argument_keywords, - ), - ); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::< - _, - ::protobuf::types::ProtobufTypeInt64, - >( - "allowed_positional_arguments", - |m: &SavedBareConcreteFunction| &m.allowed_positional_arguments, - |m: &mut SavedBareConcreteFunction| &mut m.allowed_positional_arguments, - )); - ::protobuf::reflect::MessageDescriptor::new_pb_name::( - "SavedBareConcreteFunction", - fields, - file_descriptor_proto(), - ) - }) - } - - fn default_instance() -> &'static SavedBareConcreteFunction { - static instance: ::protobuf::rt::LazyV2 = - ::protobuf::rt::LazyV2::INIT; - instance.get(SavedBareConcreteFunction::new) - } -} - -impl ::protobuf::Clear for SavedBareConcreteFunction { - fn clear(&mut self) { - self.concrete_function_name.clear(); - self.argument_keywords.clear(); - self.allowed_positional_arguments = 0; - self.unknown_fields.clear(); - } -} - -impl ::std::fmt::Debug for SavedBareConcreteFunction { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for SavedBareConcreteFunction { - fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { - ::protobuf::reflect::ReflectValueRef::Message(self) - } -} - -#[derive(PartialEq, Clone, Default)] -pub struct SavedConstant { - // message fields - pub operation: ::std::string::String, - // special fields - pub unknown_fields: ::protobuf::UnknownFields, - pub cached_size: ::protobuf::CachedSize, -} - -impl<'a> ::std::default::Default for &'a SavedConstant { - fn default() -> &'a SavedConstant { - ::default_instance() - } -} - -impl SavedConstant { - pub fn new() -> SavedConstant { - ::std::default::Default::default() - } - - // string operation = 1; - - pub fn get_operation(&self) -> &str { - &self.operation - } - pub fn clear_operation(&mut self) { - self.operation.clear(); - } - - // Param is passed by value, moved - pub fn set_operation(&mut self, v: ::std::string::String) { - self.operation = v; - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_operation(&mut self) -> &mut ::std::string::String { - &mut self.operation - } - - // Take field - pub fn take_operation(&mut self) -> ::std::string::String { - ::std::mem::replace(&mut self.operation, ::std::string::String::new()) - } -} - -impl ::protobuf::Message for SavedConstant { - fn is_initialized(&self) -> bool { - true - } - - fn merge_from( - &mut self, - is: &mut ::protobuf::CodedInputStream<'_>, - ) -> ::protobuf::ProtobufResult<()> { - while !is.eof()? { - let (field_number, wire_type) = is.read_tag_unpack()?; - match field_number { - 1 => { - ::protobuf::rt::read_singular_proto3_string_into( - wire_type, - is, - &mut self.operation, - )?; - } - _ => { - ::protobuf::rt::read_unknown_or_skip_group( - field_number, - wire_type, - is, - self.mut_unknown_fields(), - )?; - } - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u32 { - let mut my_size = 0; - if !self.operation.is_empty() { - my_size += ::protobuf::rt::string_size(1, &self.operation); - } - my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); - self.cached_size.set(my_size); - my_size - } - - fn write_to_with_cached_sizes( - &self, - os: &mut ::protobuf::CodedOutputStream<'_>, - ) -> ::protobuf::ProtobufResult<()> { - if !self.operation.is_empty() { - os.write_string(1, &self.operation)?; - } - os.write_unknown_fields(self.get_unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn get_cached_size(&self) -> u32 { - self.cached_size.get() - } - - fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { - &self.unknown_fields - } - - fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { - &mut self.unknown_fields - } - - fn as_any(&self) -> &dyn (::std::any::Any) { - self as &dyn (::std::any::Any) - } - fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { - self as &mut dyn (::std::any::Any) - } - fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { - self - } - - fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - Self::descriptor_static() - } - - fn new() -> SavedConstant { - SavedConstant::new() - } - - fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = - ::protobuf::rt::LazyV2::INIT; - descriptor.get(|| { - let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::< - _, - ::protobuf::types::ProtobufTypeString, - >( - "operation", - |m: &SavedConstant| &m.operation, - |m: &mut SavedConstant| &mut m.operation, - )); - ::protobuf::reflect::MessageDescriptor::new_pb_name::( - "SavedConstant", - fields, - file_descriptor_proto(), - ) - }) - } - - fn default_instance() -> &'static SavedConstant { - static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; - instance.get(SavedConstant::new) - } -} - -impl ::protobuf::Clear for SavedConstant { - fn clear(&mut self) { - self.operation.clear(); - self.unknown_fields.clear(); - } -} - -impl ::std::fmt::Debug for SavedConstant { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for SavedConstant { - fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { - ::protobuf::reflect::ReflectValueRef::Message(self) - } -} - -#[derive(PartialEq, Clone, Default)] -pub struct SavedVariable { - // message fields - pub dtype: super::types::DataType, - pub shape: ::protobuf::SingularPtrField, - pub trainable: bool, - pub synchronization: super::variable::VariableSynchronization, - pub aggregation: super::variable::VariableAggregation, - pub name: ::std::string::String, - // special fields - pub unknown_fields: ::protobuf::UnknownFields, - pub cached_size: ::protobuf::CachedSize, -} - -impl<'a> ::std::default::Default for &'a SavedVariable { - fn default() -> &'a SavedVariable { - ::default_instance() - } -} - -impl SavedVariable { - pub fn new() -> SavedVariable { - ::std::default::Default::default() - } - - // .tensorflow.DataType dtype = 1; - - pub fn get_dtype(&self) -> super::types::DataType { - self.dtype - } - pub fn clear_dtype(&mut self) { - self.dtype = super::types::DataType::DT_INVALID; - } - - // Param is passed by value, moved - pub fn set_dtype(&mut self, v: super::types::DataType) { - self.dtype = v; - } - - // .tensorflow.TensorShapeProto shape = 2; - - pub fn get_shape(&self) -> &super::tensor_shape::TensorShapeProto { - self.shape.as_ref().unwrap_or_else(|| { - ::default_instance() - }) - } - pub fn clear_shape(&mut self) { - self.shape.clear(); - } - - pub fn has_shape(&self) -> bool { - self.shape.is_some() - } - - // Param is passed by value, moved - pub fn set_shape(&mut self, v: super::tensor_shape::TensorShapeProto) { - self.shape = ::protobuf::SingularPtrField::some(v); - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_shape(&mut self) -> &mut super::tensor_shape::TensorShapeProto { - if self.shape.is_none() { - self.shape.set_default(); - } - self.shape.as_mut().unwrap() - } - - // Take field - pub fn take_shape(&mut self) -> super::tensor_shape::TensorShapeProto { - self.shape - .take() - .unwrap_or_else(|| super::tensor_shape::TensorShapeProto::new()) - } - - // bool trainable = 3; - - pub fn get_trainable(&self) -> bool { - self.trainable - } - pub fn clear_trainable(&mut self) { - self.trainable = false; - } - - // Param is passed by value, moved - pub fn set_trainable(&mut self, v: bool) { - self.trainable = v; - } - - // .tensorflow.VariableSynchronization synchronization = 4; - - pub fn get_synchronization(&self) -> super::variable::VariableSynchronization { - self.synchronization - } - pub fn clear_synchronization(&mut self) { - self.synchronization = - super::variable::VariableSynchronization::VARIABLE_SYNCHRONIZATION_AUTO; - } - - // Param is passed by value, moved - pub fn set_synchronization(&mut self, v: super::variable::VariableSynchronization) { - self.synchronization = v; - } - - // .tensorflow.VariableAggregation aggregation = 5; - - pub fn get_aggregation(&self) -> super::variable::VariableAggregation { - self.aggregation - } - pub fn clear_aggregation(&mut self) { - self.aggregation = super::variable::VariableAggregation::VARIABLE_AGGREGATION_NONE; - } - - // Param is passed by value, moved - pub fn set_aggregation(&mut self, v: super::variable::VariableAggregation) { - self.aggregation = v; - } - - // string name = 6; - - pub fn get_name(&self) -> &str { - &self.name - } - pub fn clear_name(&mut self) { - self.name.clear(); - } - - // Param is passed by value, moved - pub fn set_name(&mut self, v: ::std::string::String) { - self.name = v; - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_name(&mut self) -> &mut ::std::string::String { - &mut self.name - } - - // Take field - pub fn take_name(&mut self) -> ::std::string::String { - ::std::mem::replace(&mut self.name, ::std::string::String::new()) - } -} - -impl ::protobuf::Message for SavedVariable { - fn is_initialized(&self) -> bool { - for v in &self.shape { - if !v.is_initialized() { - return false; - } - } - true - } - - fn merge_from( - &mut self, - is: &mut ::protobuf::CodedInputStream<'_>, - ) -> ::protobuf::ProtobufResult<()> { - while !is.eof()? { - let (field_number, wire_type) = is.read_tag_unpack()?; - match field_number { - 1 => ::protobuf::rt::read_proto3_enum_with_unknown_fields_into( - wire_type, - is, - &mut self.dtype, - 1, - &mut self.unknown_fields, - )?, - 2 => { - ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.shape)?; - } - 3 => { - if wire_type != ::protobuf::wire_format::WireTypeVarint { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type( - wire_type, - )); - } - let tmp = is.read_bool()?; - self.trainable = tmp; - } - 4 => ::protobuf::rt::read_proto3_enum_with_unknown_fields_into( - wire_type, - is, - &mut self.synchronization, - 4, - &mut self.unknown_fields, - )?, - 5 => ::protobuf::rt::read_proto3_enum_with_unknown_fields_into( - wire_type, - is, - &mut self.aggregation, - 5, - &mut self.unknown_fields, - )?, - 6 => { - ::protobuf::rt::read_singular_proto3_string_into( - wire_type, - is, - &mut self.name, - )?; - } - _ => { - ::protobuf::rt::read_unknown_or_skip_group( - field_number, - wire_type, - is, - self.mut_unknown_fields(), - )?; - } - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u32 { - let mut my_size = 0; - if self.dtype != super::types::DataType::DT_INVALID { - my_size += ::protobuf::rt::enum_size(1, self.dtype); - } - if let Some(ref v) = self.shape.as_ref() { - let len = v.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - } - if self.trainable != false { - my_size += 2; - } - if self.synchronization - != super::variable::VariableSynchronization::VARIABLE_SYNCHRONIZATION_AUTO - { - my_size += ::protobuf::rt::enum_size(4, self.synchronization); - } - if self.aggregation != super::variable::VariableAggregation::VARIABLE_AGGREGATION_NONE { - my_size += ::protobuf::rt::enum_size(5, self.aggregation); - } - if !self.name.is_empty() { - my_size += ::protobuf::rt::string_size(6, &self.name); - } - my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); - self.cached_size.set(my_size); - my_size - } - - fn write_to_with_cached_sizes( - &self, - os: &mut ::protobuf::CodedOutputStream<'_>, - ) -> ::protobuf::ProtobufResult<()> { - if self.dtype != super::types::DataType::DT_INVALID { - os.write_enum(1, ::protobuf::ProtobufEnum::value(&self.dtype))?; - } - if let Some(ref v) = self.shape.as_ref() { - os.write_tag(2, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - } - if self.trainable != false { - os.write_bool(3, self.trainable)?; - } - if self.synchronization - != super::variable::VariableSynchronization::VARIABLE_SYNCHRONIZATION_AUTO - { - os.write_enum(4, ::protobuf::ProtobufEnum::value(&self.synchronization))?; - } - if self.aggregation != super::variable::VariableAggregation::VARIABLE_AGGREGATION_NONE { - os.write_enum(5, ::protobuf::ProtobufEnum::value(&self.aggregation))?; - } - if !self.name.is_empty() { - os.write_string(6, &self.name)?; - } - os.write_unknown_fields(self.get_unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn get_cached_size(&self) -> u32 { - self.cached_size.get() - } - - fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { - &self.unknown_fields - } - - fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { - &mut self.unknown_fields - } - - fn as_any(&self) -> &dyn (::std::any::Any) { - self as &dyn (::std::any::Any) - } - fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { - self as &mut dyn (::std::any::Any) - } - fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { - self - } - - fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - Self::descriptor_static() - } - - fn new() -> SavedVariable { - SavedVariable::new() - } - - fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = - ::protobuf::rt::LazyV2::INIT; - descriptor.get(|| { - let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::< - _, - ::protobuf::types::ProtobufTypeEnum, - >( - "dtype", - |m: &SavedVariable| &m.dtype, - |m: &mut SavedVariable| &mut m.dtype, - )); - fields.push( - ::protobuf::reflect::accessor::make_singular_ptr_field_accessor::< - _, - ::protobuf::types::ProtobufTypeMessage, - >( - "shape", - |m: &SavedVariable| &m.shape, - |m: &mut SavedVariable| &mut m.shape, - ), - ); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::< - _, - ::protobuf::types::ProtobufTypeBool, - >( - "trainable", - |m: &SavedVariable| &m.trainable, - |m: &mut SavedVariable| &mut m.trainable, - )); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::< - _, - ::protobuf::types::ProtobufTypeEnum, - >( - "synchronization", - |m: &SavedVariable| &m.synchronization, - |m: &mut SavedVariable| &mut m.synchronization, - )); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::< - _, - ::protobuf::types::ProtobufTypeEnum, - >( - "aggregation", - |m: &SavedVariable| &m.aggregation, - |m: &mut SavedVariable| &mut m.aggregation, - )); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::< - _, - ::protobuf::types::ProtobufTypeString, - >( - "name", - |m: &SavedVariable| &m.name, - |m: &mut SavedVariable| &mut m.name, - )); - ::protobuf::reflect::MessageDescriptor::new_pb_name::( - "SavedVariable", - fields, - file_descriptor_proto(), - ) - }) - } - - fn default_instance() -> &'static SavedVariable { - static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; - instance.get(SavedVariable::new) - } -} - -impl ::protobuf::Clear for SavedVariable { - fn clear(&mut self) { - self.dtype = super::types::DataType::DT_INVALID; - self.shape.clear(); - self.trainable = false; - self.synchronization = - super::variable::VariableSynchronization::VARIABLE_SYNCHRONIZATION_AUTO; - self.aggregation = super::variable::VariableAggregation::VARIABLE_AGGREGATION_NONE; - self.name.clear(); - self.unknown_fields.clear(); - } -} - -impl ::std::fmt::Debug for SavedVariable { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for SavedVariable { - fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { - ::protobuf::reflect::ReflectValueRef::Message(self) - } -} - -#[derive(PartialEq, Clone, Default)] -pub struct FunctionSpec { - // message fields - pub fullargspec: ::protobuf::SingularPtrField, - pub is_method: bool, - pub input_signature: ::protobuf::SingularPtrField, - // special fields - pub unknown_fields: ::protobuf::UnknownFields, - pub cached_size: ::protobuf::CachedSize, -} - -impl<'a> ::std::default::Default for &'a FunctionSpec { - fn default() -> &'a FunctionSpec { - ::default_instance() - } -} - -impl FunctionSpec { - pub fn new() -> FunctionSpec { - ::std::default::Default::default() - } - - // .tensorflow.StructuredValue fullargspec = 1; - - pub fn get_fullargspec(&self) -> &super::struct_pb::StructuredValue { - self.fullargspec.as_ref().unwrap_or_else(|| { - ::default_instance() - }) - } - pub fn clear_fullargspec(&mut self) { - self.fullargspec.clear(); - } - - pub fn has_fullargspec(&self) -> bool { - self.fullargspec.is_some() - } - - // Param is passed by value, moved - pub fn set_fullargspec(&mut self, v: super::struct_pb::StructuredValue) { - self.fullargspec = ::protobuf::SingularPtrField::some(v); - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_fullargspec(&mut self) -> &mut super::struct_pb::StructuredValue { - if self.fullargspec.is_none() { - self.fullargspec.set_default(); - } - self.fullargspec.as_mut().unwrap() - } - - // Take field - pub fn take_fullargspec(&mut self) -> super::struct_pb::StructuredValue { - self.fullargspec - .take() - .unwrap_or_else(|| super::struct_pb::StructuredValue::new()) - } - - // bool is_method = 2; - - pub fn get_is_method(&self) -> bool { - self.is_method - } - pub fn clear_is_method(&mut self) { - self.is_method = false; - } - - // Param is passed by value, moved - pub fn set_is_method(&mut self, v: bool) { - self.is_method = v; - } - - // .tensorflow.StructuredValue input_signature = 5; - - pub fn get_input_signature(&self) -> &super::struct_pb::StructuredValue { - self.input_signature.as_ref().unwrap_or_else(|| { - ::default_instance() - }) - } - pub fn clear_input_signature(&mut self) { - self.input_signature.clear(); - } - - pub fn has_input_signature(&self) -> bool { - self.input_signature.is_some() - } - - // Param is passed by value, moved - pub fn set_input_signature(&mut self, v: super::struct_pb::StructuredValue) { - self.input_signature = ::protobuf::SingularPtrField::some(v); - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_input_signature(&mut self) -> &mut super::struct_pb::StructuredValue { - if self.input_signature.is_none() { - self.input_signature.set_default(); - } - self.input_signature.as_mut().unwrap() - } - - // Take field - pub fn take_input_signature(&mut self) -> super::struct_pb::StructuredValue { - self.input_signature - .take() - .unwrap_or_else(|| super::struct_pb::StructuredValue::new()) - } -} - -impl ::protobuf::Message for FunctionSpec { - fn is_initialized(&self) -> bool { - for v in &self.fullargspec { - if !v.is_initialized() { - return false; - } - } - for v in &self.input_signature { - if !v.is_initialized() { - return false; - } - } - true - } - - fn merge_from( - &mut self, - is: &mut ::protobuf::CodedInputStream<'_>, - ) -> ::protobuf::ProtobufResult<()> { - while !is.eof()? { - let (field_number, wire_type) = is.read_tag_unpack()?; - match field_number { - 1 => { - ::protobuf::rt::read_singular_message_into( - wire_type, - is, - &mut self.fullargspec, - )?; - } - 2 => { - if wire_type != ::protobuf::wire_format::WireTypeVarint { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type( - wire_type, - )); - } - let tmp = is.read_bool()?; - self.is_method = tmp; - } - 5 => { - ::protobuf::rt::read_singular_message_into( - wire_type, - is, - &mut self.input_signature, - )?; - } - _ => { - ::protobuf::rt::read_unknown_or_skip_group( - field_number, - wire_type, - is, - self.mut_unknown_fields(), - )?; - } - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u32 { - let mut my_size = 0; - if let Some(ref v) = self.fullargspec.as_ref() { - let len = v.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - } - if self.is_method != false { - my_size += 2; - } - if let Some(ref v) = self.input_signature.as_ref() { - let len = v.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - } - my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); - self.cached_size.set(my_size); - my_size - } - - fn write_to_with_cached_sizes( - &self, - os: &mut ::protobuf::CodedOutputStream<'_>, - ) -> ::protobuf::ProtobufResult<()> { - if let Some(ref v) = self.fullargspec.as_ref() { - os.write_tag(1, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - } - if self.is_method != false { - os.write_bool(2, self.is_method)?; - } - if let Some(ref v) = self.input_signature.as_ref() { - os.write_tag(5, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - } - os.write_unknown_fields(self.get_unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn get_cached_size(&self) -> u32 { - self.cached_size.get() - } - - fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { - &self.unknown_fields - } - - fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { - &mut self.unknown_fields - } - - fn as_any(&self) -> &dyn (::std::any::Any) { - self as &dyn (::std::any::Any) - } - fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { - self as &mut dyn (::std::any::Any) - } - fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { - self - } - - fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - Self::descriptor_static() - } - - fn new() -> FunctionSpec { - FunctionSpec::new() - } - - fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = - ::protobuf::rt::LazyV2::INIT; - descriptor.get(|| { - let mut fields = ::std::vec::Vec::new(); - fields.push( - ::protobuf::reflect::accessor::make_singular_ptr_field_accessor::< - _, - ::protobuf::types::ProtobufTypeMessage, - >( - "fullargspec", - |m: &FunctionSpec| &m.fullargspec, - |m: &mut FunctionSpec| &mut m.fullargspec, - ), - ); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::< - _, - ::protobuf::types::ProtobufTypeBool, - >( - "is_method", - |m: &FunctionSpec| &m.is_method, - |m: &mut FunctionSpec| &mut m.is_method, - )); - fields.push( - ::protobuf::reflect::accessor::make_singular_ptr_field_accessor::< - _, - ::protobuf::types::ProtobufTypeMessage, - >( - "input_signature", - |m: &FunctionSpec| &m.input_signature, - |m: &mut FunctionSpec| &mut m.input_signature, - ), - ); - ::protobuf::reflect::MessageDescriptor::new_pb_name::( - "FunctionSpec", - fields, - file_descriptor_proto(), - ) - }) - } - - fn default_instance() -> &'static FunctionSpec { - static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; - instance.get(FunctionSpec::new) - } -} - -impl ::protobuf::Clear for FunctionSpec { - fn clear(&mut self) { - self.fullargspec.clear(); - self.is_method = false; - self.input_signature.clear(); - self.unknown_fields.clear(); - } -} - -impl ::std::fmt::Debug for FunctionSpec { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for FunctionSpec { - fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { - ::protobuf::reflect::ReflectValueRef::Message(self) - } -} - -#[derive(PartialEq, Clone, Default)] -pub struct SavedResource { - // message fields - pub device: ::std::string::String, - // special fields - pub unknown_fields: ::protobuf::UnknownFields, - pub cached_size: ::protobuf::CachedSize, -} - -impl<'a> ::std::default::Default for &'a SavedResource { - fn default() -> &'a SavedResource { - ::default_instance() - } -} - -impl SavedResource { - pub fn new() -> SavedResource { - ::std::default::Default::default() - } - - // string device = 1; - - pub fn get_device(&self) -> &str { - &self.device - } - pub fn clear_device(&mut self) { - self.device.clear(); - } - - // Param is passed by value, moved - pub fn set_device(&mut self, v: ::std::string::String) { - self.device = v; - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_device(&mut self) -> &mut ::std::string::String { - &mut self.device - } - - // Take field - pub fn take_device(&mut self) -> ::std::string::String { - ::std::mem::replace(&mut self.device, ::std::string::String::new()) - } -} - -impl ::protobuf::Message for SavedResource { - fn is_initialized(&self) -> bool { - true - } - - fn merge_from( - &mut self, - is: &mut ::protobuf::CodedInputStream<'_>, - ) -> ::protobuf::ProtobufResult<()> { - while !is.eof()? { - let (field_number, wire_type) = is.read_tag_unpack()?; - match field_number { - 1 => { - ::protobuf::rt::read_singular_proto3_string_into( - wire_type, - is, - &mut self.device, - )?; - } - _ => { - ::protobuf::rt::read_unknown_or_skip_group( - field_number, - wire_type, - is, - self.mut_unknown_fields(), - )?; - } - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u32 { - let mut my_size = 0; - if !self.device.is_empty() { - my_size += ::protobuf::rt::string_size(1, &self.device); - } - my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); - self.cached_size.set(my_size); - my_size - } - - fn write_to_with_cached_sizes( - &self, - os: &mut ::protobuf::CodedOutputStream<'_>, - ) -> ::protobuf::ProtobufResult<()> { - if !self.device.is_empty() { - os.write_string(1, &self.device)?; - } - os.write_unknown_fields(self.get_unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn get_cached_size(&self) -> u32 { - self.cached_size.get() - } - - fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { - &self.unknown_fields - } - - fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { - &mut self.unknown_fields - } - - fn as_any(&self) -> &dyn (::std::any::Any) { - self as &dyn (::std::any::Any) - } - fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { - self as &mut dyn (::std::any::Any) - } - fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { - self - } - - fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - Self::descriptor_static() - } - - fn new() -> SavedResource { - SavedResource::new() - } - - fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = - ::protobuf::rt::LazyV2::INIT; - descriptor.get(|| { - let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::< - _, - ::protobuf::types::ProtobufTypeString, - >( - "device", - |m: &SavedResource| &m.device, - |m: &mut SavedResource| &mut m.device, - )); - ::protobuf::reflect::MessageDescriptor::new_pb_name::( - "SavedResource", - fields, - file_descriptor_proto(), - ) - }) - } - - fn default_instance() -> &'static SavedResource { - static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; - instance.get(SavedResource::new) - } -} - -impl ::protobuf::Clear for SavedResource { - fn clear(&mut self) { - self.device.clear(); - self.unknown_fields.clear(); - } -} - -impl ::std::fmt::Debug for SavedResource { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for SavedResource { - fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { - ::protobuf::reflect::ReflectValueRef::Message(self) - } -} - -static file_descriptor_proto_data: &'static [u8] = b"\ - \n1tensorflow/core/protobuf/saved_object_graph.proto\x12\ntensorflow\x1a\ - 5tensorflow/core/protobuf/trackable_object_graph.proto\x1a%tensorflow/co\ - re/protobuf/struct.proto\x1a,tensorflow/core/framework/tensor_shape.prot\ - o\x1a%tensorflow/core/framework/types.proto\x1a(tensorflow/core/framewor\ - k/versions.proto\x1a(tensorflow/core/framework/variable.proto\"\x8e\x02\ - \n\x10SavedObjectGraph\x12-\n\x05nodes\x18\x01\x20\x03(\x0b2\x17.tensorf\ - low.SavedObjectR\x05nodes\x12b\n\x12concrete_functions\x18\x02\x20\x03(\ - \x0b23.tensorflow.SavedObjectGraph.ConcreteFunctionsEntryR\x11concreteFu\ - nctions\x1ag\n\x16ConcreteFunctionsEntry\x12\x10\n\x03key\x18\x01\x20\ - \x01(\tR\x03key\x127\n\x05value\x18\x02\x20\x01(\x0b2!.tensorflow.SavedC\ - oncreteFunctionR\x05value:\x028\x01\"\xa7\x05\n\x0bSavedObject\x12\\\n\ - \x08children\x18\x01\x20\x03(\x0b2@.tensorflow.TrackableObjectGraph.Trac\ - kableObject.ObjectReferenceR\x08children\x12m\n\x0eslot_variables\x18\ - \x03\x20\x03(\x0b2F.tensorflow.TrackableObjectGraph.TrackableObject.Slot\ - VariableReferenceR\rslotVariables\x12>\n\x0buser_object\x18\x04\x20\x01(\ - \x0b2\x1b.tensorflow.SavedUserObjectH\0R\nuserObject\x12.\n\x05asset\x18\ - \x05\x20\x01(\x0b2\x16.tensorflow.SavedAssetH\0R\x05asset\x127\n\x08func\ - tion\x18\x06\x20\x01(\x0b2\x19.tensorflow.SavedFunctionH\0R\x08function\ - \x127\n\x08variable\x18\x07\x20\x01(\x0b2\x19.tensorflow.SavedVariableH\ - \0R\x08variable\x12]\n\x16bare_concrete_function\x18\x08\x20\x01(\x0b2%.\ - tensorflow.SavedBareConcreteFunctionH\0R\x14bareConcreteFunction\x127\n\ - \x08constant\x18\t\x20\x01(\x0b2\x19.tensorflow.SavedConstantH\0R\x08con\ - stant\x127\n\x08resource\x18\n\x20\x01(\x0b2\x19.tensorflow.SavedResourc\ - eH\0R\x08resourceB\x06\n\x04kindJ\x04\x08\x02\x10\x03R\nattributes\"\x7f\ - \n\x0fSavedUserObject\x12\x1e\n\nidentifier\x18\x01\x20\x01(\tR\nidentif\ - ier\x120\n\x07version\x18\x02\x20\x01(\x0b2\x16.tensorflow.VersionDefR\ - \x07version\x12\x1a\n\x08metadata\x18\x03\x20\x01(\tR\x08metadata\"=\n\n\ - SavedAsset\x12/\n\x14asset_file_def_index\x18\x01\x20\x01(\x05R\x11asset\ - FileDefIndex\"}\n\rSavedFunction\x12-\n\x12concrete_functions\x18\x01\ - \x20\x03(\tR\x11concreteFunctions\x12=\n\rfunction_spec\x18\x02\x20\x01(\ - \x0b2\x18.tensorflow.FunctionSpecR\x0cfunctionSpec\"\xe3\x01\n\x15SavedC\ - oncreteFunction\x12!\n\x0cbound_inputs\x18\x02\x20\x03(\x05R\x0bboundInp\ - uts\x12_\n\x1dcanonicalized_input_signature\x18\x03\x20\x01(\x0b2\x1b.te\ - nsorflow.StructuredValueR\x1bcanonicalizedInputSignature\x12F\n\x10outpu\ - t_signature\x18\x04\x20\x01(\x0b2\x1b.tensorflow.StructuredValueR\x0fout\ - putSignature\"\xc0\x01\n\x19SavedBareConcreteFunction\x124\n\x16concrete\ - _function_name\x18\x01\x20\x01(\tR\x14concreteFunctionName\x12+\n\x11arg\ - ument_keywords\x18\x02\x20\x03(\tR\x10argumentKeywords\x12@\n\x1callowed\ - _positional_arguments\x18\x03\x20\x01(\x03R\x1aallowedPositionalArgument\ - s\"-\n\rSavedConstant\x12\x1c\n\toperation\x18\x01\x20\x01(\tR\toperatio\ - n\"\xb3\x02\n\rSavedVariable\x12*\n\x05dtype\x18\x01\x20\x01(\x0e2\x14.t\ - ensorflow.DataTypeR\x05dtype\x122\n\x05shape\x18\x02\x20\x01(\x0b2\x1c.t\ - ensorflow.TensorShapeProtoR\x05shape\x12\x1c\n\ttrainable\x18\x03\x20\ - \x01(\x08R\ttrainable\x12M\n\x0fsynchronization\x18\x04\x20\x01(\x0e2#.t\ - ensorflow.VariableSynchronizationR\x0fsynchronization\x12A\n\x0baggregat\ - ion\x18\x05\x20\x01(\x0e2\x1f.tensorflow.VariableAggregationR\x0baggrega\ - tion\x12\x12\n\x04name\x18\x06\x20\x01(\tR\x04name\"\xbc\x01\n\x0cFuncti\ - onSpec\x12=\n\x0bfullargspec\x18\x01\x20\x01(\x0b2\x1b.tensorflow.Struct\ - uredValueR\x0bfullargspec\x12\x1b\n\tis_method\x18\x02\x20\x01(\x08R\x08\ - isMethod\x12D\n\x0finput_signature\x18\x05\x20\x01(\x0b2\x1b.tensorflow.\ - StructuredValueR\x0einputSignatureJ\x04\x08\x03\x10\x04J\x04\x08\x04\x10\ - \x05\"'\n\rSavedResource\x12\x16\n\x06device\x18\x01\x20\x01(\tR\x06devi\ - ceB\x03\xf8\x01\x01b\x06proto3\ -"; - -static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2< - ::protobuf::descriptor::FileDescriptorProto, -> = ::protobuf::rt::LazyV2::INIT; - -fn parse_descriptor_proto() -> ::protobuf::descriptor::FileDescriptorProto { - ::protobuf::parse_from_bytes(file_descriptor_proto_data).unwrap() -} - -pub fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto { - file_descriptor_proto_lazy.get(|| parse_descriptor_proto()) -} diff --git a/src/protos/saver.rs b/src/protos/saver.rs deleted file mode 100644 index 1fe6c73ff4..0000000000 --- a/src/protos/saver.rs +++ /dev/null @@ -1,538 +0,0 @@ -// This file is generated by rust-protobuf 2.17.0. Do not edit -// @generated - -// https://github.com/rust-lang/rust-clippy/issues/702 -#![allow(unknown_lints)] -#![allow(clippy::all)] - -#![allow(unused_attributes)] -#![rustfmt::skip] - -#![allow(box_pointers)] -#![allow(dead_code)] -#![allow(missing_docs)] -#![allow(non_camel_case_types)] -#![allow(non_snake_case)] -#![allow(non_upper_case_globals)] -#![allow(trivial_casts)] -#![allow(unused_imports)] -#![allow(unused_results)] -//! Generated file from `tensorflow/core/protobuf/saver.proto` - -/// Generated files are compatible only with the same version -/// of protobuf runtime. -// const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_17_0; - -#[derive(PartialEq, Clone, Default)] -pub struct SaverDef { - // message fields - pub filename_tensor_name: ::std::string::String, - pub save_tensor_name: ::std::string::String, - pub restore_op_name: ::std::string::String, - pub max_to_keep: i32, - pub sharded: bool, - pub keep_checkpoint_every_n_hours: f32, - pub version: SaverDef_CheckpointFormatVersion, - // special fields - pub unknown_fields: ::protobuf::UnknownFields, - pub cached_size: ::protobuf::CachedSize, -} - -impl<'a> ::std::default::Default for &'a SaverDef { - fn default() -> &'a SaverDef { - ::default_instance() - } -} - -impl SaverDef { - pub fn new() -> SaverDef { - ::std::default::Default::default() - } - - // string filename_tensor_name = 1; - - pub fn get_filename_tensor_name(&self) -> &str { - &self.filename_tensor_name - } - pub fn clear_filename_tensor_name(&mut self) { - self.filename_tensor_name.clear(); - } - - // Param is passed by value, moved - pub fn set_filename_tensor_name(&mut self, v: ::std::string::String) { - self.filename_tensor_name = v; - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_filename_tensor_name(&mut self) -> &mut ::std::string::String { - &mut self.filename_tensor_name - } - - // Take field - pub fn take_filename_tensor_name(&mut self) -> ::std::string::String { - ::std::mem::replace(&mut self.filename_tensor_name, ::std::string::String::new()) - } - - // string save_tensor_name = 2; - - pub fn get_save_tensor_name(&self) -> &str { - &self.save_tensor_name - } - pub fn clear_save_tensor_name(&mut self) { - self.save_tensor_name.clear(); - } - - // Param is passed by value, moved - pub fn set_save_tensor_name(&mut self, v: ::std::string::String) { - self.save_tensor_name = v; - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_save_tensor_name(&mut self) -> &mut ::std::string::String { - &mut self.save_tensor_name - } - - // Take field - pub fn take_save_tensor_name(&mut self) -> ::std::string::String { - ::std::mem::replace(&mut self.save_tensor_name, ::std::string::String::new()) - } - - // string restore_op_name = 3; - - pub fn get_restore_op_name(&self) -> &str { - &self.restore_op_name - } - pub fn clear_restore_op_name(&mut self) { - self.restore_op_name.clear(); - } - - // Param is passed by value, moved - pub fn set_restore_op_name(&mut self, v: ::std::string::String) { - self.restore_op_name = v; - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_restore_op_name(&mut self) -> &mut ::std::string::String { - &mut self.restore_op_name - } - - // Take field - pub fn take_restore_op_name(&mut self) -> ::std::string::String { - ::std::mem::replace(&mut self.restore_op_name, ::std::string::String::new()) - } - - // int32 max_to_keep = 4; - - pub fn get_max_to_keep(&self) -> i32 { - self.max_to_keep - } - pub fn clear_max_to_keep(&mut self) { - self.max_to_keep = 0; - } - - // Param is passed by value, moved - pub fn set_max_to_keep(&mut self, v: i32) { - self.max_to_keep = v; - } - - // bool sharded = 5; - - pub fn get_sharded(&self) -> bool { - self.sharded - } - pub fn clear_sharded(&mut self) { - self.sharded = false; - } - - // Param is passed by value, moved - pub fn set_sharded(&mut self, v: bool) { - self.sharded = v; - } - - // float keep_checkpoint_every_n_hours = 6; - - pub fn get_keep_checkpoint_every_n_hours(&self) -> f32 { - self.keep_checkpoint_every_n_hours - } - pub fn clear_keep_checkpoint_every_n_hours(&mut self) { - self.keep_checkpoint_every_n_hours = 0.; - } - - // Param is passed by value, moved - pub fn set_keep_checkpoint_every_n_hours(&mut self, v: f32) { - self.keep_checkpoint_every_n_hours = v; - } - - // .tensorflow.SaverDef.CheckpointFormatVersion version = 7; - - pub fn get_version(&self) -> SaverDef_CheckpointFormatVersion { - self.version - } - pub fn clear_version(&mut self) { - self.version = SaverDef_CheckpointFormatVersion::LEGACY; - } - - // Param is passed by value, moved - pub fn set_version(&mut self, v: SaverDef_CheckpointFormatVersion) { - self.version = v; - } -} - -impl ::protobuf::Message for SaverDef { - fn is_initialized(&self) -> bool { - true - } - - fn merge_from( - &mut self, - is: &mut ::protobuf::CodedInputStream<'_>, - ) -> ::protobuf::ProtobufResult<()> { - while !is.eof()? { - let (field_number, wire_type) = is.read_tag_unpack()?; - match field_number { - 1 => { - ::protobuf::rt::read_singular_proto3_string_into( - wire_type, - is, - &mut self.filename_tensor_name, - )?; - } - 2 => { - ::protobuf::rt::read_singular_proto3_string_into( - wire_type, - is, - &mut self.save_tensor_name, - )?; - } - 3 => { - ::protobuf::rt::read_singular_proto3_string_into( - wire_type, - is, - &mut self.restore_op_name, - )?; - } - 4 => { - if wire_type != ::protobuf::wire_format::WireTypeVarint { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type( - wire_type, - )); - } - let tmp = is.read_int32()?; - self.max_to_keep = tmp; - } - 5 => { - if wire_type != ::protobuf::wire_format::WireTypeVarint { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type( - wire_type, - )); - } - let tmp = is.read_bool()?; - self.sharded = tmp; - } - 6 => { - if wire_type != ::protobuf::wire_format::WireTypeFixed32 { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type( - wire_type, - )); - } - let tmp = is.read_float()?; - self.keep_checkpoint_every_n_hours = tmp; - } - 7 => ::protobuf::rt::read_proto3_enum_with_unknown_fields_into( - wire_type, - is, - &mut self.version, - 7, - &mut self.unknown_fields, - )?, - _ => { - ::protobuf::rt::read_unknown_or_skip_group( - field_number, - wire_type, - is, - self.mut_unknown_fields(), - )?; - } - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u32 { - let mut my_size = 0; - if !self.filename_tensor_name.is_empty() { - my_size += ::protobuf::rt::string_size(1, &self.filename_tensor_name); - } - if !self.save_tensor_name.is_empty() { - my_size += ::protobuf::rt::string_size(2, &self.save_tensor_name); - } - if !self.restore_op_name.is_empty() { - my_size += ::protobuf::rt::string_size(3, &self.restore_op_name); - } - if self.max_to_keep != 0 { - my_size += ::protobuf::rt::value_size( - 4, - self.max_to_keep, - ::protobuf::wire_format::WireTypeVarint, - ); - } - if self.sharded != false { - my_size += 2; - } - if self.keep_checkpoint_every_n_hours != 0. { - my_size += 5; - } - if self.version != SaverDef_CheckpointFormatVersion::LEGACY { - my_size += ::protobuf::rt::enum_size(7, self.version); - } - my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); - self.cached_size.set(my_size); - my_size - } - - fn write_to_with_cached_sizes( - &self, - os: &mut ::protobuf::CodedOutputStream<'_>, - ) -> ::protobuf::ProtobufResult<()> { - if !self.filename_tensor_name.is_empty() { - os.write_string(1, &self.filename_tensor_name)?; - } - if !self.save_tensor_name.is_empty() { - os.write_string(2, &self.save_tensor_name)?; - } - if !self.restore_op_name.is_empty() { - os.write_string(3, &self.restore_op_name)?; - } - if self.max_to_keep != 0 { - os.write_int32(4, self.max_to_keep)?; - } - if self.sharded != false { - os.write_bool(5, self.sharded)?; - } - if self.keep_checkpoint_every_n_hours != 0. { - os.write_float(6, self.keep_checkpoint_every_n_hours)?; - } - if self.version != SaverDef_CheckpointFormatVersion::LEGACY { - os.write_enum(7, ::protobuf::ProtobufEnum::value(&self.version))?; - } - os.write_unknown_fields(self.get_unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn get_cached_size(&self) -> u32 { - self.cached_size.get() - } - - fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { - &self.unknown_fields - } - - fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { - &mut self.unknown_fields - } - - fn as_any(&self) -> &dyn (::std::any::Any) { - self as &dyn (::std::any::Any) - } - fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { - self as &mut dyn (::std::any::Any) - } - fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { - self - } - - fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - Self::descriptor_static() - } - - fn new() -> SaverDef { - SaverDef::new() - } - - fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = - ::protobuf::rt::LazyV2::INIT; - descriptor.get(|| { - let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::< - _, - ::protobuf::types::ProtobufTypeString, - >( - "filename_tensor_name", - |m: &SaverDef| &m.filename_tensor_name, - |m: &mut SaverDef| &mut m.filename_tensor_name, - )); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::< - _, - ::protobuf::types::ProtobufTypeString, - >( - "save_tensor_name", - |m: &SaverDef| &m.save_tensor_name, - |m: &mut SaverDef| &mut m.save_tensor_name, - )); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::< - _, - ::protobuf::types::ProtobufTypeString, - >( - "restore_op_name", - |m: &SaverDef| &m.restore_op_name, - |m: &mut SaverDef| &mut m.restore_op_name, - )); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::< - _, - ::protobuf::types::ProtobufTypeInt32, - >( - "max_to_keep", - |m: &SaverDef| &m.max_to_keep, - |m: &mut SaverDef| &mut m.max_to_keep, - )); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::< - _, - ::protobuf::types::ProtobufTypeBool, - >( - "sharded", - |m: &SaverDef| &m.sharded, - |m: &mut SaverDef| &mut m.sharded, - )); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::< - _, - ::protobuf::types::ProtobufTypeFloat, - >( - "keep_checkpoint_every_n_hours", - |m: &SaverDef| &m.keep_checkpoint_every_n_hours, - |m: &mut SaverDef| &mut m.keep_checkpoint_every_n_hours, - )); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::< - _, - ::protobuf::types::ProtobufTypeEnum, - >( - "version", - |m: &SaverDef| &m.version, - |m: &mut SaverDef| &mut m.version, - )); - ::protobuf::reflect::MessageDescriptor::new_pb_name::( - "SaverDef", - fields, - file_descriptor_proto(), - ) - }) - } - - fn default_instance() -> &'static SaverDef { - static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; - instance.get(SaverDef::new) - } -} - -impl ::protobuf::Clear for SaverDef { - fn clear(&mut self) { - self.filename_tensor_name.clear(); - self.save_tensor_name.clear(); - self.restore_op_name.clear(); - self.max_to_keep = 0; - self.sharded = false; - self.keep_checkpoint_every_n_hours = 0.; - self.version = SaverDef_CheckpointFormatVersion::LEGACY; - self.unknown_fields.clear(); - } -} - -impl ::std::fmt::Debug for SaverDef { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for SaverDef { - fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { - ::protobuf::reflect::ReflectValueRef::Message(self) - } -} - -#[derive(Clone, PartialEq, Eq, Debug, Hash)] -pub enum SaverDef_CheckpointFormatVersion { - LEGACY = 0, - V1 = 1, - V2 = 2, -} - -impl ::protobuf::ProtobufEnum for SaverDef_CheckpointFormatVersion { - fn value(&self) -> i32 { - *self as i32 - } - - fn from_i32(value: i32) -> ::std::option::Option { - match value { - 0 => ::std::option::Option::Some(SaverDef_CheckpointFormatVersion::LEGACY), - 1 => ::std::option::Option::Some(SaverDef_CheckpointFormatVersion::V1), - 2 => ::std::option::Option::Some(SaverDef_CheckpointFormatVersion::V2), - _ => ::std::option::Option::None, - } - } - - fn values() -> &'static [Self] { - static values: &'static [SaverDef_CheckpointFormatVersion] = &[ - SaverDef_CheckpointFormatVersion::LEGACY, - SaverDef_CheckpointFormatVersion::V1, - SaverDef_CheckpointFormatVersion::V2, - ]; - values - } - - fn enum_descriptor_static() -> &'static ::protobuf::reflect::EnumDescriptor { - static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::EnumDescriptor> = - ::protobuf::rt::LazyV2::INIT; - descriptor.get(|| { - ::protobuf::reflect::EnumDescriptor::new_pb_name::( - "SaverDef.CheckpointFormatVersion", - file_descriptor_proto(), - ) - }) - } -} - -impl ::std::marker::Copy for SaverDef_CheckpointFormatVersion {} - -impl ::std::default::Default for SaverDef_CheckpointFormatVersion { - fn default() -> Self { - SaverDef_CheckpointFormatVersion::LEGACY - } -} - -impl ::protobuf::reflect::ProtobufValue for SaverDef_CheckpointFormatVersion { - fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { - ::protobuf::reflect::ReflectValueRef::Enum(::protobuf::ProtobufEnum::descriptor(self)) - } -} - -static file_descriptor_proto_data: &'static [u8] = b"\ - \n$tensorflow/core/protobuf/saver.proto\x12\ntensorflow\"\x89\x03\n\x08S\ - averDef\x120\n\x14filename_tensor_name\x18\x01\x20\x01(\tR\x12filenameTe\ - nsorName\x12(\n\x10save_tensor_name\x18\x02\x20\x01(\tR\x0esaveTensorNam\ - e\x12&\n\x0frestore_op_name\x18\x03\x20\x01(\tR\rrestoreOpName\x12\x1e\n\ - \x0bmax_to_keep\x18\x04\x20\x01(\x05R\tmaxToKeep\x12\x18\n\x07sharded\ - \x18\x05\x20\x01(\x08R\x07sharded\x12@\n\x1dkeep_checkpoint_every_n_hour\ - s\x18\x06\x20\x01(\x02R\x19keepCheckpointEveryNHours\x12F\n\x07version\ - \x18\x07\x20\x01(\x0e2,.tensorflow.SaverDef.CheckpointFormatVersionR\x07\ - version\"5\n\x17CheckpointFormatVersion\x12\n\n\x06LEGACY\x10\0\x12\x06\ - \n\x02V1\x10\x01\x12\x06\n\x02V2\x10\x02Be\n\x13org.tensorflow.utilB\x0b\ - SaverProtosP\x01Z = ::protobuf::rt::LazyV2::INIT; - -fn parse_descriptor_proto() -> ::protobuf::descriptor::FileDescriptorProto { - ::protobuf::parse_from_bytes(file_descriptor_proto_data).unwrap() -} - -pub fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto { - file_descriptor_proto_lazy.get(|| parse_descriptor_proto()) -} diff --git a/src/protos/struct_pb.rs b/src/protos/struct_pb.rs deleted file mode 100644 index 5f8aba2087..0000000000 --- a/src/protos/struct_pb.rs +++ /dev/null @@ -1,2962 +0,0 @@ -// This file is generated by rust-protobuf 2.17.0. Do not edit -// @generated - -// https://github.com/rust-lang/rust-clippy/issues/702 -#![allow(unknown_lints)] -#![allow(clippy::all)] - -#![allow(unused_attributes)] -#![rustfmt::skip] - -#![allow(box_pointers)] -#![allow(dead_code)] -#![allow(missing_docs)] -#![allow(non_camel_case_types)] -#![allow(non_snake_case)] -#![allow(non_upper_case_globals)] -#![allow(trivial_casts)] -#![allow(unused_imports)] -#![allow(unused_results)] -//! Generated file from `tensorflow/core/protobuf/struct.proto` - -/// Generated files are compatible only with the same version -/// of protobuf runtime. -// const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_17_0; - -#[derive(PartialEq, Clone, Default)] -pub struct StructuredValue { - // message oneof groups - pub kind: ::std::option::Option, - // special fields - pub unknown_fields: ::protobuf::UnknownFields, - pub cached_size: ::protobuf::CachedSize, -} - -impl<'a> ::std::default::Default for &'a StructuredValue { - fn default() -> &'a StructuredValue { - ::default_instance() - } -} - -#[derive(Clone, PartialEq, Debug)] -pub enum StructuredValue_oneof_kind { - none_value(NoneValue), - float64_value(f64), - int64_value(i64), - string_value(::std::string::String), - bool_value(bool), - tensor_shape_value(super::tensor_shape::TensorShapeProto), - tensor_dtype_value(super::types::DataType), - tensor_spec_value(TensorSpecProto), - type_spec_value(TypeSpecProto), - list_value(ListValue), - tuple_value(TupleValue), - dict_value(DictValue), - named_tuple_value(NamedTupleValue), -} - -impl StructuredValue { - pub fn new() -> StructuredValue { - ::std::default::Default::default() - } - - // .tensorflow.NoneValue none_value = 1; - - pub fn get_none_value(&self) -> &NoneValue { - match self.kind { - ::std::option::Option::Some(StructuredValue_oneof_kind::none_value(ref v)) => v, - _ => ::default_instance(), - } - } - pub fn clear_none_value(&mut self) { - self.kind = ::std::option::Option::None; - } - - pub fn has_none_value(&self) -> bool { - match self.kind { - ::std::option::Option::Some(StructuredValue_oneof_kind::none_value(..)) => true, - _ => false, - } - } - - // Param is passed by value, moved - pub fn set_none_value(&mut self, v: NoneValue) { - self.kind = ::std::option::Option::Some(StructuredValue_oneof_kind::none_value(v)) - } - - // Mutable pointer to the field. - pub fn mut_none_value(&mut self) -> &mut NoneValue { - if let ::std::option::Option::Some(StructuredValue_oneof_kind::none_value(_)) = self.kind { - } else { - self.kind = ::std::option::Option::Some(StructuredValue_oneof_kind::none_value( - NoneValue::new(), - )); - } - match self.kind { - ::std::option::Option::Some(StructuredValue_oneof_kind::none_value(ref mut v)) => v, - _ => panic!(), - } - } - - // Take field - pub fn take_none_value(&mut self) -> NoneValue { - if self.has_none_value() { - match self.kind.take() { - ::std::option::Option::Some(StructuredValue_oneof_kind::none_value(v)) => v, - _ => panic!(), - } - } else { - NoneValue::new() - } - } - - // double float64_value = 11; - - pub fn get_float64_value(&self) -> f64 { - match self.kind { - ::std::option::Option::Some(StructuredValue_oneof_kind::float64_value(v)) => v, - _ => 0., - } - } - pub fn clear_float64_value(&mut self) { - self.kind = ::std::option::Option::None; - } - - pub fn has_float64_value(&self) -> bool { - match self.kind { - ::std::option::Option::Some(StructuredValue_oneof_kind::float64_value(..)) => true, - _ => false, - } - } - - // Param is passed by value, moved - pub fn set_float64_value(&mut self, v: f64) { - self.kind = ::std::option::Option::Some(StructuredValue_oneof_kind::float64_value(v)) - } - - // sint64 int64_value = 12; - - pub fn get_int64_value(&self) -> i64 { - match self.kind { - ::std::option::Option::Some(StructuredValue_oneof_kind::int64_value(v)) => v, - _ => 0, - } - } - pub fn clear_int64_value(&mut self) { - self.kind = ::std::option::Option::None; - } - - pub fn has_int64_value(&self) -> bool { - match self.kind { - ::std::option::Option::Some(StructuredValue_oneof_kind::int64_value(..)) => true, - _ => false, - } - } - - // Param is passed by value, moved - pub fn set_int64_value(&mut self, v: i64) { - self.kind = ::std::option::Option::Some(StructuredValue_oneof_kind::int64_value(v)) - } - - // string string_value = 13; - - pub fn get_string_value(&self) -> &str { - match self.kind { - ::std::option::Option::Some(StructuredValue_oneof_kind::string_value(ref v)) => v, - _ => "", - } - } - pub fn clear_string_value(&mut self) { - self.kind = ::std::option::Option::None; - } - - pub fn has_string_value(&self) -> bool { - match self.kind { - ::std::option::Option::Some(StructuredValue_oneof_kind::string_value(..)) => true, - _ => false, - } - } - - // Param is passed by value, moved - pub fn set_string_value(&mut self, v: ::std::string::String) { - self.kind = ::std::option::Option::Some(StructuredValue_oneof_kind::string_value(v)) - } - - // Mutable pointer to the field. - pub fn mut_string_value(&mut self) -> &mut ::std::string::String { - if let ::std::option::Option::Some(StructuredValue_oneof_kind::string_value(_)) = self.kind - { - } else { - self.kind = ::std::option::Option::Some(StructuredValue_oneof_kind::string_value( - ::std::string::String::new(), - )); - } - match self.kind { - ::std::option::Option::Some(StructuredValue_oneof_kind::string_value(ref mut v)) => v, - _ => panic!(), - } - } - - // Take field - pub fn take_string_value(&mut self) -> ::std::string::String { - if self.has_string_value() { - match self.kind.take() { - ::std::option::Option::Some(StructuredValue_oneof_kind::string_value(v)) => v, - _ => panic!(), - } - } else { - ::std::string::String::new() - } - } - - // bool bool_value = 14; - - pub fn get_bool_value(&self) -> bool { - match self.kind { - ::std::option::Option::Some(StructuredValue_oneof_kind::bool_value(v)) => v, - _ => false, - } - } - pub fn clear_bool_value(&mut self) { - self.kind = ::std::option::Option::None; - } - - pub fn has_bool_value(&self) -> bool { - match self.kind { - ::std::option::Option::Some(StructuredValue_oneof_kind::bool_value(..)) => true, - _ => false, - } - } - - // Param is passed by value, moved - pub fn set_bool_value(&mut self, v: bool) { - self.kind = ::std::option::Option::Some(StructuredValue_oneof_kind::bool_value(v)) - } - - // .tensorflow.TensorShapeProto tensor_shape_value = 31; - - pub fn get_tensor_shape_value(&self) -> &super::tensor_shape::TensorShapeProto { - match self.kind { - ::std::option::Option::Some(StructuredValue_oneof_kind::tensor_shape_value(ref v)) => v, - _ => ::default_instance(), - } - } - pub fn clear_tensor_shape_value(&mut self) { - self.kind = ::std::option::Option::None; - } - - pub fn has_tensor_shape_value(&self) -> bool { - match self.kind { - ::std::option::Option::Some(StructuredValue_oneof_kind::tensor_shape_value(..)) => true, - _ => false, - } - } - - // Param is passed by value, moved - pub fn set_tensor_shape_value(&mut self, v: super::tensor_shape::TensorShapeProto) { - self.kind = ::std::option::Option::Some(StructuredValue_oneof_kind::tensor_shape_value(v)) - } - - // Mutable pointer to the field. - pub fn mut_tensor_shape_value(&mut self) -> &mut super::tensor_shape::TensorShapeProto { - if let ::std::option::Option::Some(StructuredValue_oneof_kind::tensor_shape_value(_)) = - self.kind - { - } else { - self.kind = - ::std::option::Option::Some(StructuredValue_oneof_kind::tensor_shape_value( - super::tensor_shape::TensorShapeProto::new(), - )); - } - match self.kind { - ::std::option::Option::Some(StructuredValue_oneof_kind::tensor_shape_value( - ref mut v, - )) => v, - _ => panic!(), - } - } - - // Take field - pub fn take_tensor_shape_value(&mut self) -> super::tensor_shape::TensorShapeProto { - if self.has_tensor_shape_value() { - match self.kind.take() { - ::std::option::Option::Some(StructuredValue_oneof_kind::tensor_shape_value(v)) => v, - _ => panic!(), - } - } else { - super::tensor_shape::TensorShapeProto::new() - } - } - - // .tensorflow.DataType tensor_dtype_value = 32; - - pub fn get_tensor_dtype_value(&self) -> super::types::DataType { - match self.kind { - ::std::option::Option::Some(StructuredValue_oneof_kind::tensor_dtype_value(v)) => v, - _ => super::types::DataType::DT_INVALID, - } - } - pub fn clear_tensor_dtype_value(&mut self) { - self.kind = ::std::option::Option::None; - } - - pub fn has_tensor_dtype_value(&self) -> bool { - match self.kind { - ::std::option::Option::Some(StructuredValue_oneof_kind::tensor_dtype_value(..)) => true, - _ => false, - } - } - - // Param is passed by value, moved - pub fn set_tensor_dtype_value(&mut self, v: super::types::DataType) { - self.kind = ::std::option::Option::Some(StructuredValue_oneof_kind::tensor_dtype_value(v)) - } - - // .tensorflow.TensorSpecProto tensor_spec_value = 33; - - pub fn get_tensor_spec_value(&self) -> &TensorSpecProto { - match self.kind { - ::std::option::Option::Some(StructuredValue_oneof_kind::tensor_spec_value(ref v)) => v, - _ => ::default_instance(), - } - } - pub fn clear_tensor_spec_value(&mut self) { - self.kind = ::std::option::Option::None; - } - - pub fn has_tensor_spec_value(&self) -> bool { - match self.kind { - ::std::option::Option::Some(StructuredValue_oneof_kind::tensor_spec_value(..)) => true, - _ => false, - } - } - - // Param is passed by value, moved - pub fn set_tensor_spec_value(&mut self, v: TensorSpecProto) { - self.kind = ::std::option::Option::Some(StructuredValue_oneof_kind::tensor_spec_value(v)) - } - - // Mutable pointer to the field. - pub fn mut_tensor_spec_value(&mut self) -> &mut TensorSpecProto { - if let ::std::option::Option::Some(StructuredValue_oneof_kind::tensor_spec_value(_)) = - self.kind - { - } else { - self.kind = ::std::option::Option::Some(StructuredValue_oneof_kind::tensor_spec_value( - TensorSpecProto::new(), - )); - } - match self.kind { - ::std::option::Option::Some(StructuredValue_oneof_kind::tensor_spec_value( - ref mut v, - )) => v, - _ => panic!(), - } - } - - // Take field - pub fn take_tensor_spec_value(&mut self) -> TensorSpecProto { - if self.has_tensor_spec_value() { - match self.kind.take() { - ::std::option::Option::Some(StructuredValue_oneof_kind::tensor_spec_value(v)) => v, - _ => panic!(), - } - } else { - TensorSpecProto::new() - } - } - - // .tensorflow.TypeSpecProto type_spec_value = 34; - - pub fn get_type_spec_value(&self) -> &TypeSpecProto { - match self.kind { - ::std::option::Option::Some(StructuredValue_oneof_kind::type_spec_value(ref v)) => v, - _ => ::default_instance(), - } - } - pub fn clear_type_spec_value(&mut self) { - self.kind = ::std::option::Option::None; - } - - pub fn has_type_spec_value(&self) -> bool { - match self.kind { - ::std::option::Option::Some(StructuredValue_oneof_kind::type_spec_value(..)) => true, - _ => false, - } - } - - // Param is passed by value, moved - pub fn set_type_spec_value(&mut self, v: TypeSpecProto) { - self.kind = ::std::option::Option::Some(StructuredValue_oneof_kind::type_spec_value(v)) - } - - // Mutable pointer to the field. - pub fn mut_type_spec_value(&mut self) -> &mut TypeSpecProto { - if let ::std::option::Option::Some(StructuredValue_oneof_kind::type_spec_value(_)) = - self.kind - { - } else { - self.kind = ::std::option::Option::Some(StructuredValue_oneof_kind::type_spec_value( - TypeSpecProto::new(), - )); - } - match self.kind { - ::std::option::Option::Some(StructuredValue_oneof_kind::type_spec_value(ref mut v)) => { - v - } - _ => panic!(), - } - } - - // Take field - pub fn take_type_spec_value(&mut self) -> TypeSpecProto { - if self.has_type_spec_value() { - match self.kind.take() { - ::std::option::Option::Some(StructuredValue_oneof_kind::type_spec_value(v)) => v, - _ => panic!(), - } - } else { - TypeSpecProto::new() - } - } - - // .tensorflow.ListValue list_value = 51; - - pub fn get_list_value(&self) -> &ListValue { - match self.kind { - ::std::option::Option::Some(StructuredValue_oneof_kind::list_value(ref v)) => v, - _ => ::default_instance(), - } - } - pub fn clear_list_value(&mut self) { - self.kind = ::std::option::Option::None; - } - - pub fn has_list_value(&self) -> bool { - match self.kind { - ::std::option::Option::Some(StructuredValue_oneof_kind::list_value(..)) => true, - _ => false, - } - } - - // Param is passed by value, moved - pub fn set_list_value(&mut self, v: ListValue) { - self.kind = ::std::option::Option::Some(StructuredValue_oneof_kind::list_value(v)) - } - - // Mutable pointer to the field. - pub fn mut_list_value(&mut self) -> &mut ListValue { - if let ::std::option::Option::Some(StructuredValue_oneof_kind::list_value(_)) = self.kind { - } else { - self.kind = ::std::option::Option::Some(StructuredValue_oneof_kind::list_value( - ListValue::new(), - )); - } - match self.kind { - ::std::option::Option::Some(StructuredValue_oneof_kind::list_value(ref mut v)) => v, - _ => panic!(), - } - } - - // Take field - pub fn take_list_value(&mut self) -> ListValue { - if self.has_list_value() { - match self.kind.take() { - ::std::option::Option::Some(StructuredValue_oneof_kind::list_value(v)) => v, - _ => panic!(), - } - } else { - ListValue::new() - } - } - - // .tensorflow.TupleValue tuple_value = 52; - - pub fn get_tuple_value(&self) -> &TupleValue { - match self.kind { - ::std::option::Option::Some(StructuredValue_oneof_kind::tuple_value(ref v)) => v, - _ => ::default_instance(), - } - } - pub fn clear_tuple_value(&mut self) { - self.kind = ::std::option::Option::None; - } - - pub fn has_tuple_value(&self) -> bool { - match self.kind { - ::std::option::Option::Some(StructuredValue_oneof_kind::tuple_value(..)) => true, - _ => false, - } - } - - // Param is passed by value, moved - pub fn set_tuple_value(&mut self, v: TupleValue) { - self.kind = ::std::option::Option::Some(StructuredValue_oneof_kind::tuple_value(v)) - } - - // Mutable pointer to the field. - pub fn mut_tuple_value(&mut self) -> &mut TupleValue { - if let ::std::option::Option::Some(StructuredValue_oneof_kind::tuple_value(_)) = self.kind { - } else { - self.kind = ::std::option::Option::Some(StructuredValue_oneof_kind::tuple_value( - TupleValue::new(), - )); - } - match self.kind { - ::std::option::Option::Some(StructuredValue_oneof_kind::tuple_value(ref mut v)) => v, - _ => panic!(), - } - } - - // Take field - pub fn take_tuple_value(&mut self) -> TupleValue { - if self.has_tuple_value() { - match self.kind.take() { - ::std::option::Option::Some(StructuredValue_oneof_kind::tuple_value(v)) => v, - _ => panic!(), - } - } else { - TupleValue::new() - } - } - - // .tensorflow.DictValue dict_value = 53; - - pub fn get_dict_value(&self) -> &DictValue { - match self.kind { - ::std::option::Option::Some(StructuredValue_oneof_kind::dict_value(ref v)) => v, - _ => ::default_instance(), - } - } - pub fn clear_dict_value(&mut self) { - self.kind = ::std::option::Option::None; - } - - pub fn has_dict_value(&self) -> bool { - match self.kind { - ::std::option::Option::Some(StructuredValue_oneof_kind::dict_value(..)) => true, - _ => false, - } - } - - // Param is passed by value, moved - pub fn set_dict_value(&mut self, v: DictValue) { - self.kind = ::std::option::Option::Some(StructuredValue_oneof_kind::dict_value(v)) - } - - // Mutable pointer to the field. - pub fn mut_dict_value(&mut self) -> &mut DictValue { - if let ::std::option::Option::Some(StructuredValue_oneof_kind::dict_value(_)) = self.kind { - } else { - self.kind = ::std::option::Option::Some(StructuredValue_oneof_kind::dict_value( - DictValue::new(), - )); - } - match self.kind { - ::std::option::Option::Some(StructuredValue_oneof_kind::dict_value(ref mut v)) => v, - _ => panic!(), - } - } - - // Take field - pub fn take_dict_value(&mut self) -> DictValue { - if self.has_dict_value() { - match self.kind.take() { - ::std::option::Option::Some(StructuredValue_oneof_kind::dict_value(v)) => v, - _ => panic!(), - } - } else { - DictValue::new() - } - } - - // .tensorflow.NamedTupleValue named_tuple_value = 54; - - pub fn get_named_tuple_value(&self) -> &NamedTupleValue { - match self.kind { - ::std::option::Option::Some(StructuredValue_oneof_kind::named_tuple_value(ref v)) => v, - _ => ::default_instance(), - } - } - pub fn clear_named_tuple_value(&mut self) { - self.kind = ::std::option::Option::None; - } - - pub fn has_named_tuple_value(&self) -> bool { - match self.kind { - ::std::option::Option::Some(StructuredValue_oneof_kind::named_tuple_value(..)) => true, - _ => false, - } - } - - // Param is passed by value, moved - pub fn set_named_tuple_value(&mut self, v: NamedTupleValue) { - self.kind = ::std::option::Option::Some(StructuredValue_oneof_kind::named_tuple_value(v)) - } - - // Mutable pointer to the field. - pub fn mut_named_tuple_value(&mut self) -> &mut NamedTupleValue { - if let ::std::option::Option::Some(StructuredValue_oneof_kind::named_tuple_value(_)) = - self.kind - { - } else { - self.kind = ::std::option::Option::Some(StructuredValue_oneof_kind::named_tuple_value( - NamedTupleValue::new(), - )); - } - match self.kind { - ::std::option::Option::Some(StructuredValue_oneof_kind::named_tuple_value( - ref mut v, - )) => v, - _ => panic!(), - } - } - - // Take field - pub fn take_named_tuple_value(&mut self) -> NamedTupleValue { - if self.has_named_tuple_value() { - match self.kind.take() { - ::std::option::Option::Some(StructuredValue_oneof_kind::named_tuple_value(v)) => v, - _ => panic!(), - } - } else { - NamedTupleValue::new() - } - } -} - -impl ::protobuf::Message for StructuredValue { - fn is_initialized(&self) -> bool { - if let Some(StructuredValue_oneof_kind::none_value(ref v)) = self.kind { - if !v.is_initialized() { - return false; - } - } - if let Some(StructuredValue_oneof_kind::tensor_shape_value(ref v)) = self.kind { - if !v.is_initialized() { - return false; - } - } - if let Some(StructuredValue_oneof_kind::tensor_spec_value(ref v)) = self.kind { - if !v.is_initialized() { - return false; - } - } - if let Some(StructuredValue_oneof_kind::type_spec_value(ref v)) = self.kind { - if !v.is_initialized() { - return false; - } - } - if let Some(StructuredValue_oneof_kind::list_value(ref v)) = self.kind { - if !v.is_initialized() { - return false; - } - } - if let Some(StructuredValue_oneof_kind::tuple_value(ref v)) = self.kind { - if !v.is_initialized() { - return false; - } - } - if let Some(StructuredValue_oneof_kind::dict_value(ref v)) = self.kind { - if !v.is_initialized() { - return false; - } - } - if let Some(StructuredValue_oneof_kind::named_tuple_value(ref v)) = self.kind { - if !v.is_initialized() { - return false; - } - } - true - } - - fn merge_from( - &mut self, - is: &mut ::protobuf::CodedInputStream<'_>, - ) -> ::protobuf::ProtobufResult<()> { - while !is.eof()? { - let (field_number, wire_type) = is.read_tag_unpack()?; - match field_number { - 1 => { - if wire_type != ::protobuf::wire_format::WireTypeLengthDelimited { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type( - wire_type, - )); - } - self.kind = ::std::option::Option::Some( - StructuredValue_oneof_kind::none_value(is.read_message()?), - ); - } - 11 => { - if wire_type != ::protobuf::wire_format::WireTypeFixed64 { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type( - wire_type, - )); - } - self.kind = ::std::option::Option::Some( - StructuredValue_oneof_kind::float64_value(is.read_double()?), - ); - } - 12 => { - if wire_type != ::protobuf::wire_format::WireTypeVarint { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type( - wire_type, - )); - } - self.kind = ::std::option::Option::Some( - StructuredValue_oneof_kind::int64_value(is.read_sint64()?), - ); - } - 13 => { - if wire_type != ::protobuf::wire_format::WireTypeLengthDelimited { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type( - wire_type, - )); - } - self.kind = ::std::option::Option::Some( - StructuredValue_oneof_kind::string_value(is.read_string()?), - ); - } - 14 => { - if wire_type != ::protobuf::wire_format::WireTypeVarint { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type( - wire_type, - )); - } - self.kind = ::std::option::Option::Some( - StructuredValue_oneof_kind::bool_value(is.read_bool()?), - ); - } - 31 => { - if wire_type != ::protobuf::wire_format::WireTypeLengthDelimited { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type( - wire_type, - )); - } - self.kind = ::std::option::Option::Some( - StructuredValue_oneof_kind::tensor_shape_value(is.read_message()?), - ); - } - 32 => { - if wire_type != ::protobuf::wire_format::WireTypeVarint { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type( - wire_type, - )); - } - self.kind = ::std::option::Option::Some( - StructuredValue_oneof_kind::tensor_dtype_value(is.read_enum()?), - ); - } - 33 => { - if wire_type != ::protobuf::wire_format::WireTypeLengthDelimited { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type( - wire_type, - )); - } - self.kind = ::std::option::Option::Some( - StructuredValue_oneof_kind::tensor_spec_value(is.read_message()?), - ); - } - 34 => { - if wire_type != ::protobuf::wire_format::WireTypeLengthDelimited { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type( - wire_type, - )); - } - self.kind = ::std::option::Option::Some( - StructuredValue_oneof_kind::type_spec_value(is.read_message()?), - ); - } - 51 => { - if wire_type != ::protobuf::wire_format::WireTypeLengthDelimited { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type( - wire_type, - )); - } - self.kind = ::std::option::Option::Some( - StructuredValue_oneof_kind::list_value(is.read_message()?), - ); - } - 52 => { - if wire_type != ::protobuf::wire_format::WireTypeLengthDelimited { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type( - wire_type, - )); - } - self.kind = ::std::option::Option::Some( - StructuredValue_oneof_kind::tuple_value(is.read_message()?), - ); - } - 53 => { - if wire_type != ::protobuf::wire_format::WireTypeLengthDelimited { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type( - wire_type, - )); - } - self.kind = ::std::option::Option::Some( - StructuredValue_oneof_kind::dict_value(is.read_message()?), - ); - } - 54 => { - if wire_type != ::protobuf::wire_format::WireTypeLengthDelimited { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type( - wire_type, - )); - } - self.kind = ::std::option::Option::Some( - StructuredValue_oneof_kind::named_tuple_value(is.read_message()?), - ); - } - _ => { - ::protobuf::rt::read_unknown_or_skip_group( - field_number, - wire_type, - is, - self.mut_unknown_fields(), - )?; - } - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u32 { - let mut my_size = 0; - if let ::std::option::Option::Some(ref v) = self.kind { - match v { - &StructuredValue_oneof_kind::none_value(ref v) => { - let len = v.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - } - &StructuredValue_oneof_kind::float64_value(v) => { - my_size += 9; - } - &StructuredValue_oneof_kind::int64_value(v) => { - my_size += ::protobuf::rt::value_varint_zigzag_size(12, v); - } - &StructuredValue_oneof_kind::string_value(ref v) => { - my_size += ::protobuf::rt::string_size(13, &v); - } - &StructuredValue_oneof_kind::bool_value(v) => { - my_size += 2; - } - &StructuredValue_oneof_kind::tensor_shape_value(ref v) => { - let len = v.compute_size(); - my_size += 2 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - } - &StructuredValue_oneof_kind::tensor_dtype_value(v) => { - my_size += ::protobuf::rt::enum_size(32, v); - } - &StructuredValue_oneof_kind::tensor_spec_value(ref v) => { - let len = v.compute_size(); - my_size += 2 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - } - &StructuredValue_oneof_kind::type_spec_value(ref v) => { - let len = v.compute_size(); - my_size += 2 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - } - &StructuredValue_oneof_kind::list_value(ref v) => { - let len = v.compute_size(); - my_size += 2 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - } - &StructuredValue_oneof_kind::tuple_value(ref v) => { - let len = v.compute_size(); - my_size += 2 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - } - &StructuredValue_oneof_kind::dict_value(ref v) => { - let len = v.compute_size(); - my_size += 2 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - } - &StructuredValue_oneof_kind::named_tuple_value(ref v) => { - let len = v.compute_size(); - my_size += 2 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - } - }; - } - my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); - self.cached_size.set(my_size); - my_size - } - - fn write_to_with_cached_sizes( - &self, - os: &mut ::protobuf::CodedOutputStream<'_>, - ) -> ::protobuf::ProtobufResult<()> { - if let ::std::option::Option::Some(ref v) = self.kind { - match v { - &StructuredValue_oneof_kind::none_value(ref v) => { - os.write_tag(1, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - } - &StructuredValue_oneof_kind::float64_value(v) => { - os.write_double(11, v)?; - } - &StructuredValue_oneof_kind::int64_value(v) => { - os.write_sint64(12, v)?; - } - &StructuredValue_oneof_kind::string_value(ref v) => { - os.write_string(13, v)?; - } - &StructuredValue_oneof_kind::bool_value(v) => { - os.write_bool(14, v)?; - } - &StructuredValue_oneof_kind::tensor_shape_value(ref v) => { - os.write_tag(31, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - } - &StructuredValue_oneof_kind::tensor_dtype_value(v) => { - os.write_enum(32, ::protobuf::ProtobufEnum::value(&v))?; - } - &StructuredValue_oneof_kind::tensor_spec_value(ref v) => { - os.write_tag(33, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - } - &StructuredValue_oneof_kind::type_spec_value(ref v) => { - os.write_tag(34, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - } - &StructuredValue_oneof_kind::list_value(ref v) => { - os.write_tag(51, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - } - &StructuredValue_oneof_kind::tuple_value(ref v) => { - os.write_tag(52, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - } - &StructuredValue_oneof_kind::dict_value(ref v) => { - os.write_tag(53, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - } - &StructuredValue_oneof_kind::named_tuple_value(ref v) => { - os.write_tag(54, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - } - }; - } - os.write_unknown_fields(self.get_unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn get_cached_size(&self) -> u32 { - self.cached_size.get() - } - - fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { - &self.unknown_fields - } - - fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { - &mut self.unknown_fields - } - - fn as_any(&self) -> &dyn (::std::any::Any) { - self as &dyn (::std::any::Any) - } - fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { - self as &mut dyn (::std::any::Any) - } - fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { - self - } - - fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - Self::descriptor_static() - } - - fn new() -> StructuredValue { - StructuredValue::new() - } - - fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = - ::protobuf::rt::LazyV2::INIT; - descriptor.get(|| { - let mut fields = ::std::vec::Vec::new(); - fields.push( - ::protobuf::reflect::accessor::make_singular_message_accessor::<_, NoneValue>( - "none_value", - StructuredValue::has_none_value, - StructuredValue::get_none_value, - ), - ); - fields.push( - ::protobuf::reflect::accessor::make_singular_f64_accessor::<_>( - "float64_value", - StructuredValue::has_float64_value, - StructuredValue::get_float64_value, - ), - ); - fields.push( - ::protobuf::reflect::accessor::make_singular_i64_accessor::<_>( - "int64_value", - StructuredValue::has_int64_value, - StructuredValue::get_int64_value, - ), - ); - fields.push( - ::protobuf::reflect::accessor::make_singular_string_accessor::<_>( - "string_value", - StructuredValue::has_string_value, - StructuredValue::get_string_value, - ), - ); - fields.push( - ::protobuf::reflect::accessor::make_singular_bool_accessor::<_>( - "bool_value", - StructuredValue::has_bool_value, - StructuredValue::get_bool_value, - ), - ); - fields.push( - ::protobuf::reflect::accessor::make_singular_message_accessor::< - _, - super::tensor_shape::TensorShapeProto, - >( - "tensor_shape_value", - StructuredValue::has_tensor_shape_value, - StructuredValue::get_tensor_shape_value, - ), - ); - fields.push( - ::protobuf::reflect::accessor::make_singular_enum_accessor::< - _, - super::types::DataType, - >( - "tensor_dtype_value", - StructuredValue::has_tensor_dtype_value, - StructuredValue::get_tensor_dtype_value, - ), - ); - fields.push( - ::protobuf::reflect::accessor::make_singular_message_accessor::<_, TensorSpecProto>( - "tensor_spec_value", - StructuredValue::has_tensor_spec_value, - StructuredValue::get_tensor_spec_value, - ), - ); - fields.push( - ::protobuf::reflect::accessor::make_singular_message_accessor::<_, TypeSpecProto>( - "type_spec_value", - StructuredValue::has_type_spec_value, - StructuredValue::get_type_spec_value, - ), - ); - fields.push( - ::protobuf::reflect::accessor::make_singular_message_accessor::<_, ListValue>( - "list_value", - StructuredValue::has_list_value, - StructuredValue::get_list_value, - ), - ); - fields.push( - ::protobuf::reflect::accessor::make_singular_message_accessor::<_, TupleValue>( - "tuple_value", - StructuredValue::has_tuple_value, - StructuredValue::get_tuple_value, - ), - ); - fields.push( - ::protobuf::reflect::accessor::make_singular_message_accessor::<_, DictValue>( - "dict_value", - StructuredValue::has_dict_value, - StructuredValue::get_dict_value, - ), - ); - fields.push( - ::protobuf::reflect::accessor::make_singular_message_accessor::<_, NamedTupleValue>( - "named_tuple_value", - StructuredValue::has_named_tuple_value, - StructuredValue::get_named_tuple_value, - ), - ); - ::protobuf::reflect::MessageDescriptor::new_pb_name::( - "StructuredValue", - fields, - file_descriptor_proto(), - ) - }) - } - - fn default_instance() -> &'static StructuredValue { - static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; - instance.get(StructuredValue::new) - } -} - -impl ::protobuf::Clear for StructuredValue { - fn clear(&mut self) { - self.kind = ::std::option::Option::None; - self.kind = ::std::option::Option::None; - self.kind = ::std::option::Option::None; - self.kind = ::std::option::Option::None; - self.kind = ::std::option::Option::None; - self.kind = ::std::option::Option::None; - self.kind = ::std::option::Option::None; - self.kind = ::std::option::Option::None; - self.kind = ::std::option::Option::None; - self.kind = ::std::option::Option::None; - self.kind = ::std::option::Option::None; - self.kind = ::std::option::Option::None; - self.kind = ::std::option::Option::None; - self.unknown_fields.clear(); - } -} - -impl ::std::fmt::Debug for StructuredValue { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for StructuredValue { - fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { - ::protobuf::reflect::ReflectValueRef::Message(self) - } -} - -#[derive(PartialEq, Clone, Default)] -pub struct NoneValue { - // special fields - pub unknown_fields: ::protobuf::UnknownFields, - pub cached_size: ::protobuf::CachedSize, -} - -impl<'a> ::std::default::Default for &'a NoneValue { - fn default() -> &'a NoneValue { - ::default_instance() - } -} - -impl NoneValue { - pub fn new() -> NoneValue { - ::std::default::Default::default() - } -} - -impl ::protobuf::Message for NoneValue { - fn is_initialized(&self) -> bool { - true - } - - fn merge_from( - &mut self, - is: &mut ::protobuf::CodedInputStream<'_>, - ) -> ::protobuf::ProtobufResult<()> { - while !is.eof()? { - let (field_number, wire_type) = is.read_tag_unpack()?; - match field_number { - _ => { - ::protobuf::rt::read_unknown_or_skip_group( - field_number, - wire_type, - is, - self.mut_unknown_fields(), - )?; - } - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u32 { - let mut my_size = 0; - my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); - self.cached_size.set(my_size); - my_size - } - - fn write_to_with_cached_sizes( - &self, - os: &mut ::protobuf::CodedOutputStream<'_>, - ) -> ::protobuf::ProtobufResult<()> { - os.write_unknown_fields(self.get_unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn get_cached_size(&self) -> u32 { - self.cached_size.get() - } - - fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { - &self.unknown_fields - } - - fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { - &mut self.unknown_fields - } - - fn as_any(&self) -> &dyn (::std::any::Any) { - self as &dyn (::std::any::Any) - } - fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { - self as &mut dyn (::std::any::Any) - } - fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { - self - } - - fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - Self::descriptor_static() - } - - fn new() -> NoneValue { - NoneValue::new() - } - - fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = - ::protobuf::rt::LazyV2::INIT; - descriptor.get(|| { - let fields = ::std::vec::Vec::new(); - ::protobuf::reflect::MessageDescriptor::new_pb_name::( - "NoneValue", - fields, - file_descriptor_proto(), - ) - }) - } - - fn default_instance() -> &'static NoneValue { - static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; - instance.get(NoneValue::new) - } -} - -impl ::protobuf::Clear for NoneValue { - fn clear(&mut self) { - self.unknown_fields.clear(); - } -} - -impl ::std::fmt::Debug for NoneValue { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for NoneValue { - fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { - ::protobuf::reflect::ReflectValueRef::Message(self) - } -} - -#[derive(PartialEq, Clone, Default)] -pub struct ListValue { - // message fields - pub values: ::protobuf::RepeatedField, - // special fields - pub unknown_fields: ::protobuf::UnknownFields, - pub cached_size: ::protobuf::CachedSize, -} - -impl<'a> ::std::default::Default for &'a ListValue { - fn default() -> &'a ListValue { - ::default_instance() - } -} - -impl ListValue { - pub fn new() -> ListValue { - ::std::default::Default::default() - } - - // repeated .tensorflow.StructuredValue values = 1; - - pub fn get_values(&self) -> &[StructuredValue] { - &self.values - } - pub fn clear_values(&mut self) { - self.values.clear(); - } - - // Param is passed by value, moved - pub fn set_values(&mut self, v: ::protobuf::RepeatedField) { - self.values = v; - } - - // Mutable pointer to the field. - pub fn mut_values(&mut self) -> &mut ::protobuf::RepeatedField { - &mut self.values - } - - // Take field - pub fn take_values(&mut self) -> ::protobuf::RepeatedField { - ::std::mem::replace(&mut self.values, ::protobuf::RepeatedField::new()) - } -} - -impl ::protobuf::Message for ListValue { - fn is_initialized(&self) -> bool { - for v in &self.values { - if !v.is_initialized() { - return false; - } - } - true - } - - fn merge_from( - &mut self, - is: &mut ::protobuf::CodedInputStream<'_>, - ) -> ::protobuf::ProtobufResult<()> { - while !is.eof()? { - let (field_number, wire_type) = is.read_tag_unpack()?; - match field_number { - 1 => { - ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.values)?; - } - _ => { - ::protobuf::rt::read_unknown_or_skip_group( - field_number, - wire_type, - is, - self.mut_unknown_fields(), - )?; - } - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u32 { - let mut my_size = 0; - for value in &self.values { - let len = value.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - } - my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); - self.cached_size.set(my_size); - my_size - } - - fn write_to_with_cached_sizes( - &self, - os: &mut ::protobuf::CodedOutputStream<'_>, - ) -> ::protobuf::ProtobufResult<()> { - for v in &self.values { - os.write_tag(1, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - } - os.write_unknown_fields(self.get_unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn get_cached_size(&self) -> u32 { - self.cached_size.get() - } - - fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { - &self.unknown_fields - } - - fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { - &mut self.unknown_fields - } - - fn as_any(&self) -> &dyn (::std::any::Any) { - self as &dyn (::std::any::Any) - } - fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { - self as &mut dyn (::std::any::Any) - } - fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { - self - } - - fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - Self::descriptor_static() - } - - fn new() -> ListValue { - ListValue::new() - } - - fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = - ::protobuf::rt::LazyV2::INIT; - descriptor.get(|| { - let mut fields = ::std::vec::Vec::new(); - fields.push( - ::protobuf::reflect::accessor::make_repeated_field_accessor::< - _, - ::protobuf::types::ProtobufTypeMessage, - >( - "values", - |m: &ListValue| &m.values, - |m: &mut ListValue| &mut m.values, - ), - ); - ::protobuf::reflect::MessageDescriptor::new_pb_name::( - "ListValue", - fields, - file_descriptor_proto(), - ) - }) - } - - fn default_instance() -> &'static ListValue { - static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; - instance.get(ListValue::new) - } -} - -impl ::protobuf::Clear for ListValue { - fn clear(&mut self) { - self.values.clear(); - self.unknown_fields.clear(); - } -} - -impl ::std::fmt::Debug for ListValue { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for ListValue { - fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { - ::protobuf::reflect::ReflectValueRef::Message(self) - } -} - -#[derive(PartialEq, Clone, Default)] -pub struct TupleValue { - // message fields - pub values: ::protobuf::RepeatedField, - // special fields - pub unknown_fields: ::protobuf::UnknownFields, - pub cached_size: ::protobuf::CachedSize, -} - -impl<'a> ::std::default::Default for &'a TupleValue { - fn default() -> &'a TupleValue { - ::default_instance() - } -} - -impl TupleValue { - pub fn new() -> TupleValue { - ::std::default::Default::default() - } - - // repeated .tensorflow.StructuredValue values = 1; - - pub fn get_values(&self) -> &[StructuredValue] { - &self.values - } - pub fn clear_values(&mut self) { - self.values.clear(); - } - - // Param is passed by value, moved - pub fn set_values(&mut self, v: ::protobuf::RepeatedField) { - self.values = v; - } - - // Mutable pointer to the field. - pub fn mut_values(&mut self) -> &mut ::protobuf::RepeatedField { - &mut self.values - } - - // Take field - pub fn take_values(&mut self) -> ::protobuf::RepeatedField { - ::std::mem::replace(&mut self.values, ::protobuf::RepeatedField::new()) - } -} - -impl ::protobuf::Message for TupleValue { - fn is_initialized(&self) -> bool { - for v in &self.values { - if !v.is_initialized() { - return false; - } - } - true - } - - fn merge_from( - &mut self, - is: &mut ::protobuf::CodedInputStream<'_>, - ) -> ::protobuf::ProtobufResult<()> { - while !is.eof()? { - let (field_number, wire_type) = is.read_tag_unpack()?; - match field_number { - 1 => { - ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.values)?; - } - _ => { - ::protobuf::rt::read_unknown_or_skip_group( - field_number, - wire_type, - is, - self.mut_unknown_fields(), - )?; - } - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u32 { - let mut my_size = 0; - for value in &self.values { - let len = value.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - } - my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); - self.cached_size.set(my_size); - my_size - } - - fn write_to_with_cached_sizes( - &self, - os: &mut ::protobuf::CodedOutputStream<'_>, - ) -> ::protobuf::ProtobufResult<()> { - for v in &self.values { - os.write_tag(1, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - } - os.write_unknown_fields(self.get_unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn get_cached_size(&self) -> u32 { - self.cached_size.get() - } - - fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { - &self.unknown_fields - } - - fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { - &mut self.unknown_fields - } - - fn as_any(&self) -> &dyn (::std::any::Any) { - self as &dyn (::std::any::Any) - } - fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { - self as &mut dyn (::std::any::Any) - } - fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { - self - } - - fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - Self::descriptor_static() - } - - fn new() -> TupleValue { - TupleValue::new() - } - - fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = - ::protobuf::rt::LazyV2::INIT; - descriptor.get(|| { - let mut fields = ::std::vec::Vec::new(); - fields.push( - ::protobuf::reflect::accessor::make_repeated_field_accessor::< - _, - ::protobuf::types::ProtobufTypeMessage, - >( - "values", - |m: &TupleValue| &m.values, - |m: &mut TupleValue| &mut m.values, - ), - ); - ::protobuf::reflect::MessageDescriptor::new_pb_name::( - "TupleValue", - fields, - file_descriptor_proto(), - ) - }) - } - - fn default_instance() -> &'static TupleValue { - static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; - instance.get(TupleValue::new) - } -} - -impl ::protobuf::Clear for TupleValue { - fn clear(&mut self) { - self.values.clear(); - self.unknown_fields.clear(); - } -} - -impl ::std::fmt::Debug for TupleValue { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for TupleValue { - fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { - ::protobuf::reflect::ReflectValueRef::Message(self) - } -} - -#[derive(PartialEq, Clone, Default)] -pub struct DictValue { - // message fields - pub fields: ::std::collections::HashMap<::std::string::String, StructuredValue>, - // special fields - pub unknown_fields: ::protobuf::UnknownFields, - pub cached_size: ::protobuf::CachedSize, -} - -impl<'a> ::std::default::Default for &'a DictValue { - fn default() -> &'a DictValue { - ::default_instance() - } -} - -impl DictValue { - pub fn new() -> DictValue { - ::std::default::Default::default() - } - - // repeated .tensorflow.DictValue.FieldsEntry fields = 1; - - pub fn get_fields( - &self, - ) -> &::std::collections::HashMap<::std::string::String, StructuredValue> { - &self.fields - } - pub fn clear_fields(&mut self) { - self.fields.clear(); - } - - // Param is passed by value, moved - pub fn set_fields( - &mut self, - v: ::std::collections::HashMap<::std::string::String, StructuredValue>, - ) { - self.fields = v; - } - - // Mutable pointer to the field. - pub fn mut_fields( - &mut self, - ) -> &mut ::std::collections::HashMap<::std::string::String, StructuredValue> { - &mut self.fields - } - - // Take field - pub fn take_fields( - &mut self, - ) -> ::std::collections::HashMap<::std::string::String, StructuredValue> { - ::std::mem::replace(&mut self.fields, ::std::collections::HashMap::new()) - } -} - -impl ::protobuf::Message for DictValue { - fn is_initialized(&self) -> bool { - true - } - - fn merge_from( - &mut self, - is: &mut ::protobuf::CodedInputStream<'_>, - ) -> ::protobuf::ProtobufResult<()> { - while !is.eof()? { - let (field_number, wire_type) = is.read_tag_unpack()?; - match field_number { - 1 => { - ::protobuf::rt::read_map_into::< - ::protobuf::types::ProtobufTypeString, - ::protobuf::types::ProtobufTypeMessage, - >(wire_type, is, &mut self.fields)?; - } - _ => { - ::protobuf::rt::read_unknown_or_skip_group( - field_number, - wire_type, - is, - self.mut_unknown_fields(), - )?; - } - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u32 { - let mut my_size = 0; - my_size += ::protobuf::rt::compute_map_size::< - ::protobuf::types::ProtobufTypeString, - ::protobuf::types::ProtobufTypeMessage, - >(1, &self.fields); - my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); - self.cached_size.set(my_size); - my_size - } - - fn write_to_with_cached_sizes( - &self, - os: &mut ::protobuf::CodedOutputStream<'_>, - ) -> ::protobuf::ProtobufResult<()> { - ::protobuf::rt::write_map_with_cached_sizes::< - ::protobuf::types::ProtobufTypeString, - ::protobuf::types::ProtobufTypeMessage, - >(1, &self.fields, os)?; - os.write_unknown_fields(self.get_unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn get_cached_size(&self) -> u32 { - self.cached_size.get() - } - - fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { - &self.unknown_fields - } - - fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { - &mut self.unknown_fields - } - - fn as_any(&self) -> &dyn (::std::any::Any) { - self as &dyn (::std::any::Any) - } - fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { - self as &mut dyn (::std::any::Any) - } - fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { - self - } - - fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - Self::descriptor_static() - } - - fn new() -> DictValue { - DictValue::new() - } - - fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = - ::protobuf::rt::LazyV2::INIT; - descriptor.get(|| { - let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_map_accessor::< - _, - ::protobuf::types::ProtobufTypeString, - ::protobuf::types::ProtobufTypeMessage, - >( - "fields", - |m: &DictValue| &m.fields, - |m: &mut DictValue| &mut m.fields, - )); - ::protobuf::reflect::MessageDescriptor::new_pb_name::( - "DictValue", - fields, - file_descriptor_proto(), - ) - }) - } - - fn default_instance() -> &'static DictValue { - static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; - instance.get(DictValue::new) - } -} - -impl ::protobuf::Clear for DictValue { - fn clear(&mut self) { - self.fields.clear(); - self.unknown_fields.clear(); - } -} - -impl ::std::fmt::Debug for DictValue { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for DictValue { - fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { - ::protobuf::reflect::ReflectValueRef::Message(self) - } -} - -#[derive(PartialEq, Clone, Default)] -pub struct PairValue { - // message fields - pub key: ::std::string::String, - pub value: ::protobuf::SingularPtrField, - // special fields - pub unknown_fields: ::protobuf::UnknownFields, - pub cached_size: ::protobuf::CachedSize, -} - -impl<'a> ::std::default::Default for &'a PairValue { - fn default() -> &'a PairValue { - ::default_instance() - } -} - -impl PairValue { - pub fn new() -> PairValue { - ::std::default::Default::default() - } - - // string key = 1; - - pub fn get_key(&self) -> &str { - &self.key - } - pub fn clear_key(&mut self) { - self.key.clear(); - } - - // Param is passed by value, moved - pub fn set_key(&mut self, v: ::std::string::String) { - self.key = v; - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_key(&mut self) -> &mut ::std::string::String { - &mut self.key - } - - // Take field - pub fn take_key(&mut self) -> ::std::string::String { - ::std::mem::replace(&mut self.key, ::std::string::String::new()) - } - - // .tensorflow.StructuredValue value = 2; - - pub fn get_value(&self) -> &StructuredValue { - self.value - .as_ref() - .unwrap_or_else(|| ::default_instance()) - } - pub fn clear_value(&mut self) { - self.value.clear(); - } - - pub fn has_value(&self) -> bool { - self.value.is_some() - } - - // Param is passed by value, moved - pub fn set_value(&mut self, v: StructuredValue) { - self.value = ::protobuf::SingularPtrField::some(v); - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_value(&mut self) -> &mut StructuredValue { - if self.value.is_none() { - self.value.set_default(); - } - self.value.as_mut().unwrap() - } - - // Take field - pub fn take_value(&mut self) -> StructuredValue { - self.value.take().unwrap_or_else(|| StructuredValue::new()) - } -} - -impl ::protobuf::Message for PairValue { - fn is_initialized(&self) -> bool { - for v in &self.value { - if !v.is_initialized() { - return false; - } - } - true - } - - fn merge_from( - &mut self, - is: &mut ::protobuf::CodedInputStream<'_>, - ) -> ::protobuf::ProtobufResult<()> { - while !is.eof()? { - let (field_number, wire_type) = is.read_tag_unpack()?; - match field_number { - 1 => { - ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.key)?; - } - 2 => { - ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.value)?; - } - _ => { - ::protobuf::rt::read_unknown_or_skip_group( - field_number, - wire_type, - is, - self.mut_unknown_fields(), - )?; - } - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u32 { - let mut my_size = 0; - if !self.key.is_empty() { - my_size += ::protobuf::rt::string_size(1, &self.key); - } - if let Some(ref v) = self.value.as_ref() { - let len = v.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - } - my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); - self.cached_size.set(my_size); - my_size - } - - fn write_to_with_cached_sizes( - &self, - os: &mut ::protobuf::CodedOutputStream<'_>, - ) -> ::protobuf::ProtobufResult<()> { - if !self.key.is_empty() { - os.write_string(1, &self.key)?; - } - if let Some(ref v) = self.value.as_ref() { - os.write_tag(2, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - } - os.write_unknown_fields(self.get_unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn get_cached_size(&self) -> u32 { - self.cached_size.get() - } - - fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { - &self.unknown_fields - } - - fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { - &mut self.unknown_fields - } - - fn as_any(&self) -> &dyn (::std::any::Any) { - self as &dyn (::std::any::Any) - } - fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { - self as &mut dyn (::std::any::Any) - } - fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { - self - } - - fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - Self::descriptor_static() - } - - fn new() -> PairValue { - PairValue::new() - } - - fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = - ::protobuf::rt::LazyV2::INIT; - descriptor.get(|| { - let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::< - _, - ::protobuf::types::ProtobufTypeString, - >( - "key", - |m: &PairValue| &m.key, - |m: &mut PairValue| &mut m.key, - )); - fields.push( - ::protobuf::reflect::accessor::make_singular_ptr_field_accessor::< - _, - ::protobuf::types::ProtobufTypeMessage, - >( - "value", - |m: &PairValue| &m.value, - |m: &mut PairValue| &mut m.value, - ), - ); - ::protobuf::reflect::MessageDescriptor::new_pb_name::( - "PairValue", - fields, - file_descriptor_proto(), - ) - }) - } - - fn default_instance() -> &'static PairValue { - static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; - instance.get(PairValue::new) - } -} - -impl ::protobuf::Clear for PairValue { - fn clear(&mut self) { - self.key.clear(); - self.value.clear(); - self.unknown_fields.clear(); - } -} - -impl ::std::fmt::Debug for PairValue { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for PairValue { - fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { - ::protobuf::reflect::ReflectValueRef::Message(self) - } -} - -#[derive(PartialEq, Clone, Default)] -pub struct NamedTupleValue { - // message fields - pub name: ::std::string::String, - pub values: ::protobuf::RepeatedField, - // special fields - pub unknown_fields: ::protobuf::UnknownFields, - pub cached_size: ::protobuf::CachedSize, -} - -impl<'a> ::std::default::Default for &'a NamedTupleValue { - fn default() -> &'a NamedTupleValue { - ::default_instance() - } -} - -impl NamedTupleValue { - pub fn new() -> NamedTupleValue { - ::std::default::Default::default() - } - - // string name = 1; - - pub fn get_name(&self) -> &str { - &self.name - } - pub fn clear_name(&mut self) { - self.name.clear(); - } - - // Param is passed by value, moved - pub fn set_name(&mut self, v: ::std::string::String) { - self.name = v; - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_name(&mut self) -> &mut ::std::string::String { - &mut self.name - } - - // Take field - pub fn take_name(&mut self) -> ::std::string::String { - ::std::mem::replace(&mut self.name, ::std::string::String::new()) - } - - // repeated .tensorflow.PairValue values = 2; - - pub fn get_values(&self) -> &[PairValue] { - &self.values - } - pub fn clear_values(&mut self) { - self.values.clear(); - } - - // Param is passed by value, moved - pub fn set_values(&mut self, v: ::protobuf::RepeatedField) { - self.values = v; - } - - // Mutable pointer to the field. - pub fn mut_values(&mut self) -> &mut ::protobuf::RepeatedField { - &mut self.values - } - - // Take field - pub fn take_values(&mut self) -> ::protobuf::RepeatedField { - ::std::mem::replace(&mut self.values, ::protobuf::RepeatedField::new()) - } -} - -impl ::protobuf::Message for NamedTupleValue { - fn is_initialized(&self) -> bool { - for v in &self.values { - if !v.is_initialized() { - return false; - } - } - true - } - - fn merge_from( - &mut self, - is: &mut ::protobuf::CodedInputStream<'_>, - ) -> ::protobuf::ProtobufResult<()> { - while !is.eof()? { - let (field_number, wire_type) = is.read_tag_unpack()?; - match field_number { - 1 => { - ::protobuf::rt::read_singular_proto3_string_into( - wire_type, - is, - &mut self.name, - )?; - } - 2 => { - ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.values)?; - } - _ => { - ::protobuf::rt::read_unknown_or_skip_group( - field_number, - wire_type, - is, - self.mut_unknown_fields(), - )?; - } - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u32 { - let mut my_size = 0; - if !self.name.is_empty() { - my_size += ::protobuf::rt::string_size(1, &self.name); - } - for value in &self.values { - let len = value.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - } - my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); - self.cached_size.set(my_size); - my_size - } - - fn write_to_with_cached_sizes( - &self, - os: &mut ::protobuf::CodedOutputStream<'_>, - ) -> ::protobuf::ProtobufResult<()> { - if !self.name.is_empty() { - os.write_string(1, &self.name)?; - } - for v in &self.values { - os.write_tag(2, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - } - os.write_unknown_fields(self.get_unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn get_cached_size(&self) -> u32 { - self.cached_size.get() - } - - fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { - &self.unknown_fields - } - - fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { - &mut self.unknown_fields - } - - fn as_any(&self) -> &dyn (::std::any::Any) { - self as &dyn (::std::any::Any) - } - fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { - self as &mut dyn (::std::any::Any) - } - fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { - self - } - - fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - Self::descriptor_static() - } - - fn new() -> NamedTupleValue { - NamedTupleValue::new() - } - - fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = - ::protobuf::rt::LazyV2::INIT; - descriptor.get(|| { - let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::< - _, - ::protobuf::types::ProtobufTypeString, - >( - "name", - |m: &NamedTupleValue| &m.name, - |m: &mut NamedTupleValue| &mut m.name, - )); - fields.push( - ::protobuf::reflect::accessor::make_repeated_field_accessor::< - _, - ::protobuf::types::ProtobufTypeMessage, - >( - "values", - |m: &NamedTupleValue| &m.values, - |m: &mut NamedTupleValue| &mut m.values, - ), - ); - ::protobuf::reflect::MessageDescriptor::new_pb_name::( - "NamedTupleValue", - fields, - file_descriptor_proto(), - ) - }) - } - - fn default_instance() -> &'static NamedTupleValue { - static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; - instance.get(NamedTupleValue::new) - } -} - -impl ::protobuf::Clear for NamedTupleValue { - fn clear(&mut self) { - self.name.clear(); - self.values.clear(); - self.unknown_fields.clear(); - } -} - -impl ::std::fmt::Debug for NamedTupleValue { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for NamedTupleValue { - fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { - ::protobuf::reflect::ReflectValueRef::Message(self) - } -} - -#[derive(PartialEq, Clone, Default)] -pub struct TensorSpecProto { - // message fields - pub name: ::std::string::String, - pub shape: ::protobuf::SingularPtrField, - pub dtype: super::types::DataType, - // special fields - pub unknown_fields: ::protobuf::UnknownFields, - pub cached_size: ::protobuf::CachedSize, -} - -impl<'a> ::std::default::Default for &'a TensorSpecProto { - fn default() -> &'a TensorSpecProto { - ::default_instance() - } -} - -impl TensorSpecProto { - pub fn new() -> TensorSpecProto { - ::std::default::Default::default() - } - - // string name = 1; - - pub fn get_name(&self) -> &str { - &self.name - } - pub fn clear_name(&mut self) { - self.name.clear(); - } - - // Param is passed by value, moved - pub fn set_name(&mut self, v: ::std::string::String) { - self.name = v; - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_name(&mut self) -> &mut ::std::string::String { - &mut self.name - } - - // Take field - pub fn take_name(&mut self) -> ::std::string::String { - ::std::mem::replace(&mut self.name, ::std::string::String::new()) - } - - // .tensorflow.TensorShapeProto shape = 2; - - pub fn get_shape(&self) -> &super::tensor_shape::TensorShapeProto { - self.shape.as_ref().unwrap_or_else(|| { - ::default_instance() - }) - } - pub fn clear_shape(&mut self) { - self.shape.clear(); - } - - pub fn has_shape(&self) -> bool { - self.shape.is_some() - } - - // Param is passed by value, moved - pub fn set_shape(&mut self, v: super::tensor_shape::TensorShapeProto) { - self.shape = ::protobuf::SingularPtrField::some(v); - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_shape(&mut self) -> &mut super::tensor_shape::TensorShapeProto { - if self.shape.is_none() { - self.shape.set_default(); - } - self.shape.as_mut().unwrap() - } - - // Take field - pub fn take_shape(&mut self) -> super::tensor_shape::TensorShapeProto { - self.shape - .take() - .unwrap_or_else(|| super::tensor_shape::TensorShapeProto::new()) - } - - // .tensorflow.DataType dtype = 3; - - pub fn get_dtype(&self) -> super::types::DataType { - self.dtype - } - pub fn clear_dtype(&mut self) { - self.dtype = super::types::DataType::DT_INVALID; - } - - // Param is passed by value, moved - pub fn set_dtype(&mut self, v: super::types::DataType) { - self.dtype = v; - } -} - -impl ::protobuf::Message for TensorSpecProto { - fn is_initialized(&self) -> bool { - for v in &self.shape { - if !v.is_initialized() { - return false; - } - } - true - } - - fn merge_from( - &mut self, - is: &mut ::protobuf::CodedInputStream<'_>, - ) -> ::protobuf::ProtobufResult<()> { - while !is.eof()? { - let (field_number, wire_type) = is.read_tag_unpack()?; - match field_number { - 1 => { - ::protobuf::rt::read_singular_proto3_string_into( - wire_type, - is, - &mut self.name, - )?; - } - 2 => { - ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.shape)?; - } - 3 => ::protobuf::rt::read_proto3_enum_with_unknown_fields_into( - wire_type, - is, - &mut self.dtype, - 3, - &mut self.unknown_fields, - )?, - _ => { - ::protobuf::rt::read_unknown_or_skip_group( - field_number, - wire_type, - is, - self.mut_unknown_fields(), - )?; - } - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u32 { - let mut my_size = 0; - if !self.name.is_empty() { - my_size += ::protobuf::rt::string_size(1, &self.name); - } - if let Some(ref v) = self.shape.as_ref() { - let len = v.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - } - if self.dtype != super::types::DataType::DT_INVALID { - my_size += ::protobuf::rt::enum_size(3, self.dtype); - } - my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); - self.cached_size.set(my_size); - my_size - } - - fn write_to_with_cached_sizes( - &self, - os: &mut ::protobuf::CodedOutputStream<'_>, - ) -> ::protobuf::ProtobufResult<()> { - if !self.name.is_empty() { - os.write_string(1, &self.name)?; - } - if let Some(ref v) = self.shape.as_ref() { - os.write_tag(2, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - } - if self.dtype != super::types::DataType::DT_INVALID { - os.write_enum(3, ::protobuf::ProtobufEnum::value(&self.dtype))?; - } - os.write_unknown_fields(self.get_unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn get_cached_size(&self) -> u32 { - self.cached_size.get() - } - - fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { - &self.unknown_fields - } - - fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { - &mut self.unknown_fields - } - - fn as_any(&self) -> &dyn (::std::any::Any) { - self as &dyn (::std::any::Any) - } - fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { - self as &mut dyn (::std::any::Any) - } - fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { - self - } - - fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - Self::descriptor_static() - } - - fn new() -> TensorSpecProto { - TensorSpecProto::new() - } - - fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = - ::protobuf::rt::LazyV2::INIT; - descriptor.get(|| { - let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::< - _, - ::protobuf::types::ProtobufTypeString, - >( - "name", - |m: &TensorSpecProto| &m.name, - |m: &mut TensorSpecProto| &mut m.name, - )); - fields.push( - ::protobuf::reflect::accessor::make_singular_ptr_field_accessor::< - _, - ::protobuf::types::ProtobufTypeMessage, - >( - "shape", - |m: &TensorSpecProto| &m.shape, - |m: &mut TensorSpecProto| &mut m.shape, - ), - ); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::< - _, - ::protobuf::types::ProtobufTypeEnum, - >( - "dtype", - |m: &TensorSpecProto| &m.dtype, - |m: &mut TensorSpecProto| &mut m.dtype, - )); - ::protobuf::reflect::MessageDescriptor::new_pb_name::( - "TensorSpecProto", - fields, - file_descriptor_proto(), - ) - }) - } - - fn default_instance() -> &'static TensorSpecProto { - static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; - instance.get(TensorSpecProto::new) - } -} - -impl ::protobuf::Clear for TensorSpecProto { - fn clear(&mut self) { - self.name.clear(); - self.shape.clear(); - self.dtype = super::types::DataType::DT_INVALID; - self.unknown_fields.clear(); - } -} - -impl ::std::fmt::Debug for TensorSpecProto { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for TensorSpecProto { - fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { - ::protobuf::reflect::ReflectValueRef::Message(self) - } -} - -#[derive(PartialEq, Clone, Default)] -pub struct TypeSpecProto { - // message fields - pub type_spec_class: TypeSpecProto_TypeSpecClass, - pub type_state: ::protobuf::SingularPtrField, - pub type_spec_class_name: ::std::string::String, - // special fields - pub unknown_fields: ::protobuf::UnknownFields, - pub cached_size: ::protobuf::CachedSize, -} - -impl<'a> ::std::default::Default for &'a TypeSpecProto { - fn default() -> &'a TypeSpecProto { - ::default_instance() - } -} - -impl TypeSpecProto { - pub fn new() -> TypeSpecProto { - ::std::default::Default::default() - } - - // .tensorflow.TypeSpecProto.TypeSpecClass type_spec_class = 1; - - pub fn get_type_spec_class(&self) -> TypeSpecProto_TypeSpecClass { - self.type_spec_class - } - pub fn clear_type_spec_class(&mut self) { - self.type_spec_class = TypeSpecProto_TypeSpecClass::UNKNOWN; - } - - // Param is passed by value, moved - pub fn set_type_spec_class(&mut self, v: TypeSpecProto_TypeSpecClass) { - self.type_spec_class = v; - } - - // .tensorflow.StructuredValue type_state = 2; - - pub fn get_type_state(&self) -> &StructuredValue { - self.type_state - .as_ref() - .unwrap_or_else(|| ::default_instance()) - } - pub fn clear_type_state(&mut self) { - self.type_state.clear(); - } - - pub fn has_type_state(&self) -> bool { - self.type_state.is_some() - } - - // Param is passed by value, moved - pub fn set_type_state(&mut self, v: StructuredValue) { - self.type_state = ::protobuf::SingularPtrField::some(v); - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_type_state(&mut self) -> &mut StructuredValue { - if self.type_state.is_none() { - self.type_state.set_default(); - } - self.type_state.as_mut().unwrap() - } - - // Take field - pub fn take_type_state(&mut self) -> StructuredValue { - self.type_state - .take() - .unwrap_or_else(|| StructuredValue::new()) - } - - // string type_spec_class_name = 3; - - pub fn get_type_spec_class_name(&self) -> &str { - &self.type_spec_class_name - } - pub fn clear_type_spec_class_name(&mut self) { - self.type_spec_class_name.clear(); - } - - // Param is passed by value, moved - pub fn set_type_spec_class_name(&mut self, v: ::std::string::String) { - self.type_spec_class_name = v; - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_type_spec_class_name(&mut self) -> &mut ::std::string::String { - &mut self.type_spec_class_name - } - - // Take field - pub fn take_type_spec_class_name(&mut self) -> ::std::string::String { - ::std::mem::replace(&mut self.type_spec_class_name, ::std::string::String::new()) - } -} - -impl ::protobuf::Message for TypeSpecProto { - fn is_initialized(&self) -> bool { - for v in &self.type_state { - if !v.is_initialized() { - return false; - } - } - true - } - - fn merge_from( - &mut self, - is: &mut ::protobuf::CodedInputStream<'_>, - ) -> ::protobuf::ProtobufResult<()> { - while !is.eof()? { - let (field_number, wire_type) = is.read_tag_unpack()?; - match field_number { - 1 => ::protobuf::rt::read_proto3_enum_with_unknown_fields_into( - wire_type, - is, - &mut self.type_spec_class, - 1, - &mut self.unknown_fields, - )?, - 2 => { - ::protobuf::rt::read_singular_message_into( - wire_type, - is, - &mut self.type_state, - )?; - } - 3 => { - ::protobuf::rt::read_singular_proto3_string_into( - wire_type, - is, - &mut self.type_spec_class_name, - )?; - } - _ => { - ::protobuf::rt::read_unknown_or_skip_group( - field_number, - wire_type, - is, - self.mut_unknown_fields(), - )?; - } - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u32 { - let mut my_size = 0; - if self.type_spec_class != TypeSpecProto_TypeSpecClass::UNKNOWN { - my_size += ::protobuf::rt::enum_size(1, self.type_spec_class); - } - if let Some(ref v) = self.type_state.as_ref() { - let len = v.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - } - if !self.type_spec_class_name.is_empty() { - my_size += ::protobuf::rt::string_size(3, &self.type_spec_class_name); - } - my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); - self.cached_size.set(my_size); - my_size - } - - fn write_to_with_cached_sizes( - &self, - os: &mut ::protobuf::CodedOutputStream<'_>, - ) -> ::protobuf::ProtobufResult<()> { - if self.type_spec_class != TypeSpecProto_TypeSpecClass::UNKNOWN { - os.write_enum(1, ::protobuf::ProtobufEnum::value(&self.type_spec_class))?; - } - if let Some(ref v) = self.type_state.as_ref() { - os.write_tag(2, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - } - if !self.type_spec_class_name.is_empty() { - os.write_string(3, &self.type_spec_class_name)?; - } - os.write_unknown_fields(self.get_unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn get_cached_size(&self) -> u32 { - self.cached_size.get() - } - - fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { - &self.unknown_fields - } - - fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { - &mut self.unknown_fields - } - - fn as_any(&self) -> &dyn (::std::any::Any) { - self as &dyn (::std::any::Any) - } - fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { - self as &mut dyn (::std::any::Any) - } - fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { - self - } - - fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - Self::descriptor_static() - } - - fn new() -> TypeSpecProto { - TypeSpecProto::new() - } - - fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = - ::protobuf::rt::LazyV2::INIT; - descriptor.get(|| { - let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::< - _, - ::protobuf::types::ProtobufTypeEnum, - >( - "type_spec_class", - |m: &TypeSpecProto| &m.type_spec_class, - |m: &mut TypeSpecProto| &mut m.type_spec_class, - )); - fields.push( - ::protobuf::reflect::accessor::make_singular_ptr_field_accessor::< - _, - ::protobuf::types::ProtobufTypeMessage, - >( - "type_state", - |m: &TypeSpecProto| &m.type_state, - |m: &mut TypeSpecProto| &mut m.type_state, - ), - ); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::< - _, - ::protobuf::types::ProtobufTypeString, - >( - "type_spec_class_name", - |m: &TypeSpecProto| &m.type_spec_class_name, - |m: &mut TypeSpecProto| &mut m.type_spec_class_name, - )); - ::protobuf::reflect::MessageDescriptor::new_pb_name::( - "TypeSpecProto", - fields, - file_descriptor_proto(), - ) - }) - } - - fn default_instance() -> &'static TypeSpecProto { - static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; - instance.get(TypeSpecProto::new) - } -} - -impl ::protobuf::Clear for TypeSpecProto { - fn clear(&mut self) { - self.type_spec_class = TypeSpecProto_TypeSpecClass::UNKNOWN; - self.type_state.clear(); - self.type_spec_class_name.clear(); - self.unknown_fields.clear(); - } -} - -impl ::std::fmt::Debug for TypeSpecProto { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for TypeSpecProto { - fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { - ::protobuf::reflect::ReflectValueRef::Message(self) - } -} - -#[derive(Clone, PartialEq, Eq, Debug, Hash)] -pub enum TypeSpecProto_TypeSpecClass { - UNKNOWN = 0, - SPARSE_TENSOR_SPEC = 1, - INDEXED_SLICES_SPEC = 2, - RAGGED_TENSOR_SPEC = 3, - TENSOR_ARRAY_SPEC = 4, - DATA_DATASET_SPEC = 5, - DATA_ITERATOR_SPEC = 6, - OPTIONAL_SPEC = 7, - PER_REPLICA_SPEC = 8, -} - -impl ::protobuf::ProtobufEnum for TypeSpecProto_TypeSpecClass { - fn value(&self) -> i32 { - *self as i32 - } - - fn from_i32(value: i32) -> ::std::option::Option { - match value { - 0 => ::std::option::Option::Some(TypeSpecProto_TypeSpecClass::UNKNOWN), - 1 => ::std::option::Option::Some(TypeSpecProto_TypeSpecClass::SPARSE_TENSOR_SPEC), - 2 => ::std::option::Option::Some(TypeSpecProto_TypeSpecClass::INDEXED_SLICES_SPEC), - 3 => ::std::option::Option::Some(TypeSpecProto_TypeSpecClass::RAGGED_TENSOR_SPEC), - 4 => ::std::option::Option::Some(TypeSpecProto_TypeSpecClass::TENSOR_ARRAY_SPEC), - 5 => ::std::option::Option::Some(TypeSpecProto_TypeSpecClass::DATA_DATASET_SPEC), - 6 => ::std::option::Option::Some(TypeSpecProto_TypeSpecClass::DATA_ITERATOR_SPEC), - 7 => ::std::option::Option::Some(TypeSpecProto_TypeSpecClass::OPTIONAL_SPEC), - 8 => ::std::option::Option::Some(TypeSpecProto_TypeSpecClass::PER_REPLICA_SPEC), - _ => ::std::option::Option::None, - } - } - - fn values() -> &'static [Self] { - static values: &'static [TypeSpecProto_TypeSpecClass] = &[ - TypeSpecProto_TypeSpecClass::UNKNOWN, - TypeSpecProto_TypeSpecClass::SPARSE_TENSOR_SPEC, - TypeSpecProto_TypeSpecClass::INDEXED_SLICES_SPEC, - TypeSpecProto_TypeSpecClass::RAGGED_TENSOR_SPEC, - TypeSpecProto_TypeSpecClass::TENSOR_ARRAY_SPEC, - TypeSpecProto_TypeSpecClass::DATA_DATASET_SPEC, - TypeSpecProto_TypeSpecClass::DATA_ITERATOR_SPEC, - TypeSpecProto_TypeSpecClass::OPTIONAL_SPEC, - TypeSpecProto_TypeSpecClass::PER_REPLICA_SPEC, - ]; - values - } - - fn enum_descriptor_static() -> &'static ::protobuf::reflect::EnumDescriptor { - static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::EnumDescriptor> = - ::protobuf::rt::LazyV2::INIT; - descriptor.get(|| { - ::protobuf::reflect::EnumDescriptor::new_pb_name::( - "TypeSpecProto.TypeSpecClass", - file_descriptor_proto(), - ) - }) - } -} - -impl ::std::marker::Copy for TypeSpecProto_TypeSpecClass {} - -impl ::std::default::Default for TypeSpecProto_TypeSpecClass { - fn default() -> Self { - TypeSpecProto_TypeSpecClass::UNKNOWN - } -} - -impl ::protobuf::reflect::ProtobufValue for TypeSpecProto_TypeSpecClass { - fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { - ::protobuf::reflect::ReflectValueRef::Enum(::protobuf::ProtobufEnum::descriptor(self)) - } -} - -static file_descriptor_proto_data: &'static [u8] = b"\ - \n%tensorflow/core/protobuf/struct.proto\x12\ntensorflow\x1a,tensorflow/\ - core/framework/tensor_shape.proto\x1a%tensorflow/core/framework/types.pr\ - oto\"\xfb\x05\n\x0fStructuredValue\x126\n\nnone_value\x18\x01\x20\x01(\ - \x0b2\x15.tensorflow.NoneValueH\0R\tnoneValue\x12%\n\rfloat64_value\x18\ - \x0b\x20\x01(\x01H\0R\x0cfloat64Value\x12!\n\x0bint64_value\x18\x0c\x20\ - \x01(\x12H\0R\nint64Value\x12#\n\x0cstring_value\x18\r\x20\x01(\tH\0R\ - \x0bstringValue\x12\x1f\n\nbool_value\x18\x0e\x20\x01(\x08H\0R\tboolValu\ - e\x12L\n\x12tensor_shape_value\x18\x1f\x20\x01(\x0b2\x1c.tensorflow.Tens\ - orShapeProtoH\0R\x10tensorShapeValue\x12D\n\x12tensor_dtype_value\x18\ - \x20\x20\x01(\x0e2\x14.tensorflow.DataTypeH\0R\x10tensorDtypeValue\x12I\ - \n\x11tensor_spec_value\x18!\x20\x01(\x0b2\x1b.tensorflow.TensorSpecProt\ - oH\0R\x0ftensorSpecValue\x12C\n\x0ftype_spec_value\x18\"\x20\x01(\x0b2\ - \x19.tensorflow.TypeSpecProtoH\0R\rtypeSpecValue\x126\n\nlist_value\x183\ - \x20\x01(\x0b2\x15.tensorflow.ListValueH\0R\tlistValue\x129\n\x0btuple_v\ - alue\x184\x20\x01(\x0b2\x16.tensorflow.TupleValueH\0R\ntupleValue\x126\n\ - \ndict_value\x185\x20\x01(\x0b2\x15.tensorflow.DictValueH\0R\tdictValue\ - \x12I\n\x11named_tuple_value\x186\x20\x01(\x0b2\x1b.tensorflow.NamedTupl\ - eValueH\0R\x0fnamedTupleValueB\x06\n\x04kind\"\x0b\n\tNoneValue\"@\n\tLi\ - stValue\x123\n\x06values\x18\x01\x20\x03(\x0b2\x1b.tensorflow.Structured\ - ValueR\x06values\"A\n\nTupleValue\x123\n\x06values\x18\x01\x20\x03(\x0b2\ - \x1b.tensorflow.StructuredValueR\x06values\"\x9e\x01\n\tDictValue\x129\n\ - \x06fields\x18\x01\x20\x03(\x0b2!.tensorflow.DictValue.FieldsEntryR\x06f\ - ields\x1aV\n\x0bFieldsEntry\x12\x10\n\x03key\x18\x01\x20\x01(\tR\x03key\ - \x121\n\x05value\x18\x02\x20\x01(\x0b2\x1b.tensorflow.StructuredValueR\ - \x05value:\x028\x01\"P\n\tPairValue\x12\x10\n\x03key\x18\x01\x20\x01(\tR\ - \x03key\x121\n\x05value\x18\x02\x20\x01(\x0b2\x1b.tensorflow.StructuredV\ - alueR\x05value\"T\n\x0fNamedTupleValue\x12\x12\n\x04name\x18\x01\x20\x01\ - (\tR\x04name\x12-\n\x06values\x18\x02\x20\x03(\x0b2\x15.tensorflow.PairV\ - alueR\x06values\"\x85\x01\n\x0fTensorSpecProto\x12\x12\n\x04name\x18\x01\ - \x20\x01(\tR\x04name\x122\n\x05shape\x18\x02\x20\x01(\x0b2\x1c.tensorflo\ - w.TensorShapeProtoR\x05shape\x12*\n\x05dtype\x18\x03\x20\x01(\x0e2\x14.t\ - ensorflow.DataTypeR\x05dtype\"\xa4\x03\n\rTypeSpecProto\x12O\n\x0ftype_s\ - pec_class\x18\x01\x20\x01(\x0e2'.tensorflow.TypeSpecProto.TypeSpecClassR\ - \rtypeSpecClass\x12:\n\ntype_state\x18\x02\x20\x01(\x0b2\x1b.tensorflow.\ - StructuredValueR\ttypeState\x12/\n\x14type_spec_class_name\x18\x03\x20\ - \x01(\tR\x11typeSpecClassName\"\xd4\x01\n\rTypeSpecClass\x12\x0b\n\x07UN\ - KNOWN\x10\0\x12\x16\n\x12SPARSE_TENSOR_SPEC\x10\x01\x12\x17\n\x13INDEXED\ - _SLICES_SPEC\x10\x02\x12\x16\n\x12RAGGED_TENSOR_SPEC\x10\x03\x12\x15\n\ - \x11TENSOR_ARRAY_SPEC\x10\x04\x12\x15\n\x11DATA_DATASET_SPEC\x10\x05\x12\ - \x16\n\x12DATA_ITERATOR_SPEC\x10\x06\x12\x11\n\rOPTIONAL_SPEC\x10\x07\ - \x12\x14\n\x10PER_REPLICA_SPEC\x10\x08b\x06proto3\ -"; - -static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2< - ::protobuf::descriptor::FileDescriptorProto, -> = ::protobuf::rt::LazyV2::INIT; - -fn parse_descriptor_proto() -> ::protobuf::descriptor::FileDescriptorProto { - ::protobuf::parse_from_bytes(file_descriptor_proto_data).unwrap() -} - -pub fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto { - file_descriptor_proto_lazy.get(|| parse_descriptor_proto()) -} diff --git a/src/protos/tensor.rs b/src/protos/tensor.rs deleted file mode 100644 index 13f0de43dc..0000000000 --- a/src/protos/tensor.rs +++ /dev/null @@ -1,1343 +0,0 @@ -// This file is generated by rust-protobuf 2.17.0. Do not edit -// @generated - -// https://github.com/rust-lang/rust-clippy/issues/702 -#![allow(unknown_lints)] -#![allow(clippy::all)] - -#![allow(unused_attributes)] -#![rustfmt::skip] - -#![allow(box_pointers)] -#![allow(dead_code)] -#![allow(missing_docs)] -#![allow(non_camel_case_types)] -#![allow(non_snake_case)] -#![allow(non_upper_case_globals)] -#![allow(trivial_casts)] -#![allow(unused_imports)] -#![allow(unused_results)] -//! Generated file from `tensorflow/core/framework/tensor.proto` - -/// Generated files are compatible only with the same version -/// of protobuf runtime. -// const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_17_0; - -#[derive(PartialEq, Clone, Default)] -pub struct TensorProto { - // message fields - pub dtype: super::types::DataType, - pub tensor_shape: ::protobuf::SingularPtrField, - pub version_number: i32, - pub tensor_content: ::std::vec::Vec, - pub half_val: ::std::vec::Vec, - pub float_val: ::std::vec::Vec, - pub double_val: ::std::vec::Vec, - pub int_val: ::std::vec::Vec, - pub string_val: ::protobuf::RepeatedField<::std::vec::Vec>, - pub scomplex_val: ::std::vec::Vec, - pub int64_val: ::std::vec::Vec, - pub bool_val: ::std::vec::Vec, - pub dcomplex_val: ::std::vec::Vec, - pub resource_handle_val: ::protobuf::RepeatedField, - pub variant_val: ::protobuf::RepeatedField, - pub uint32_val: ::std::vec::Vec, - pub uint64_val: ::std::vec::Vec, - // special fields - pub unknown_fields: ::protobuf::UnknownFields, - pub cached_size: ::protobuf::CachedSize, -} - -impl<'a> ::std::default::Default for &'a TensorProto { - fn default() -> &'a TensorProto { - ::default_instance() - } -} - -impl TensorProto { - pub fn new() -> TensorProto { - ::std::default::Default::default() - } - - // .tensorflow.DataType dtype = 1; - - pub fn get_dtype(&self) -> super::types::DataType { - self.dtype - } - pub fn clear_dtype(&mut self) { - self.dtype = super::types::DataType::DT_INVALID; - } - - // Param is passed by value, moved - pub fn set_dtype(&mut self, v: super::types::DataType) { - self.dtype = v; - } - - // .tensorflow.TensorShapeProto tensor_shape = 2; - - pub fn get_tensor_shape(&self) -> &super::tensor_shape::TensorShapeProto { - self.tensor_shape.as_ref().unwrap_or_else(|| { - ::default_instance() - }) - } - pub fn clear_tensor_shape(&mut self) { - self.tensor_shape.clear(); - } - - pub fn has_tensor_shape(&self) -> bool { - self.tensor_shape.is_some() - } - - // Param is passed by value, moved - pub fn set_tensor_shape(&mut self, v: super::tensor_shape::TensorShapeProto) { - self.tensor_shape = ::protobuf::SingularPtrField::some(v); - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_tensor_shape(&mut self) -> &mut super::tensor_shape::TensorShapeProto { - if self.tensor_shape.is_none() { - self.tensor_shape.set_default(); - } - self.tensor_shape.as_mut().unwrap() - } - - // Take field - pub fn take_tensor_shape(&mut self) -> super::tensor_shape::TensorShapeProto { - self.tensor_shape - .take() - .unwrap_or_else(|| super::tensor_shape::TensorShapeProto::new()) - } - - // int32 version_number = 3; - - pub fn get_version_number(&self) -> i32 { - self.version_number - } - pub fn clear_version_number(&mut self) { - self.version_number = 0; - } - - // Param is passed by value, moved - pub fn set_version_number(&mut self, v: i32) { - self.version_number = v; - } - - // bytes tensor_content = 4; - - pub fn get_tensor_content(&self) -> &[u8] { - &self.tensor_content - } - pub fn clear_tensor_content(&mut self) { - self.tensor_content.clear(); - } - - // Param is passed by value, moved - pub fn set_tensor_content(&mut self, v: ::std::vec::Vec) { - self.tensor_content = v; - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_tensor_content(&mut self) -> &mut ::std::vec::Vec { - &mut self.tensor_content - } - - // Take field - pub fn take_tensor_content(&mut self) -> ::std::vec::Vec { - ::std::mem::replace(&mut self.tensor_content, ::std::vec::Vec::new()) - } - - // repeated int32 half_val = 13; - - pub fn get_half_val(&self) -> &[i32] { - &self.half_val - } - pub fn clear_half_val(&mut self) { - self.half_val.clear(); - } - - // Param is passed by value, moved - pub fn set_half_val(&mut self, v: ::std::vec::Vec) { - self.half_val = v; - } - - // Mutable pointer to the field. - pub fn mut_half_val(&mut self) -> &mut ::std::vec::Vec { - &mut self.half_val - } - - // Take field - pub fn take_half_val(&mut self) -> ::std::vec::Vec { - ::std::mem::replace(&mut self.half_val, ::std::vec::Vec::new()) - } - - // repeated float float_val = 5; - - pub fn get_float_val(&self) -> &[f32] { - &self.float_val - } - pub fn clear_float_val(&mut self) { - self.float_val.clear(); - } - - // Param is passed by value, moved - pub fn set_float_val(&mut self, v: ::std::vec::Vec) { - self.float_val = v; - } - - // Mutable pointer to the field. - pub fn mut_float_val(&mut self) -> &mut ::std::vec::Vec { - &mut self.float_val - } - - // Take field - pub fn take_float_val(&mut self) -> ::std::vec::Vec { - ::std::mem::replace(&mut self.float_val, ::std::vec::Vec::new()) - } - - // repeated double double_val = 6; - - pub fn get_double_val(&self) -> &[f64] { - &self.double_val - } - pub fn clear_double_val(&mut self) { - self.double_val.clear(); - } - - // Param is passed by value, moved - pub fn set_double_val(&mut self, v: ::std::vec::Vec) { - self.double_val = v; - } - - // Mutable pointer to the field. - pub fn mut_double_val(&mut self) -> &mut ::std::vec::Vec { - &mut self.double_val - } - - // Take field - pub fn take_double_val(&mut self) -> ::std::vec::Vec { - ::std::mem::replace(&mut self.double_val, ::std::vec::Vec::new()) - } - - // repeated int32 int_val = 7; - - pub fn get_int_val(&self) -> &[i32] { - &self.int_val - } - pub fn clear_int_val(&mut self) { - self.int_val.clear(); - } - - // Param is passed by value, moved - pub fn set_int_val(&mut self, v: ::std::vec::Vec) { - self.int_val = v; - } - - // Mutable pointer to the field. - pub fn mut_int_val(&mut self) -> &mut ::std::vec::Vec { - &mut self.int_val - } - - // Take field - pub fn take_int_val(&mut self) -> ::std::vec::Vec { - ::std::mem::replace(&mut self.int_val, ::std::vec::Vec::new()) - } - - // repeated bytes string_val = 8; - - pub fn get_string_val(&self) -> &[::std::vec::Vec] { - &self.string_val - } - pub fn clear_string_val(&mut self) { - self.string_val.clear(); - } - - // Param is passed by value, moved - pub fn set_string_val(&mut self, v: ::protobuf::RepeatedField<::std::vec::Vec>) { - self.string_val = v; - } - - // Mutable pointer to the field. - pub fn mut_string_val(&mut self) -> &mut ::protobuf::RepeatedField<::std::vec::Vec> { - &mut self.string_val - } - - // Take field - pub fn take_string_val(&mut self) -> ::protobuf::RepeatedField<::std::vec::Vec> { - ::std::mem::replace(&mut self.string_val, ::protobuf::RepeatedField::new()) - } - - // repeated float scomplex_val = 9; - - pub fn get_scomplex_val(&self) -> &[f32] { - &self.scomplex_val - } - pub fn clear_scomplex_val(&mut self) { - self.scomplex_val.clear(); - } - - // Param is passed by value, moved - pub fn set_scomplex_val(&mut self, v: ::std::vec::Vec) { - self.scomplex_val = v; - } - - // Mutable pointer to the field. - pub fn mut_scomplex_val(&mut self) -> &mut ::std::vec::Vec { - &mut self.scomplex_val - } - - // Take field - pub fn take_scomplex_val(&mut self) -> ::std::vec::Vec { - ::std::mem::replace(&mut self.scomplex_val, ::std::vec::Vec::new()) - } - - // repeated int64 int64_val = 10; - - pub fn get_int64_val(&self) -> &[i64] { - &self.int64_val - } - pub fn clear_int64_val(&mut self) { - self.int64_val.clear(); - } - - // Param is passed by value, moved - pub fn set_int64_val(&mut self, v: ::std::vec::Vec) { - self.int64_val = v; - } - - // Mutable pointer to the field. - pub fn mut_int64_val(&mut self) -> &mut ::std::vec::Vec { - &mut self.int64_val - } - - // Take field - pub fn take_int64_val(&mut self) -> ::std::vec::Vec { - ::std::mem::replace(&mut self.int64_val, ::std::vec::Vec::new()) - } - - // repeated bool bool_val = 11; - - pub fn get_bool_val(&self) -> &[bool] { - &self.bool_val - } - pub fn clear_bool_val(&mut self) { - self.bool_val.clear(); - } - - // Param is passed by value, moved - pub fn set_bool_val(&mut self, v: ::std::vec::Vec) { - self.bool_val = v; - } - - // Mutable pointer to the field. - pub fn mut_bool_val(&mut self) -> &mut ::std::vec::Vec { - &mut self.bool_val - } - - // Take field - pub fn take_bool_val(&mut self) -> ::std::vec::Vec { - ::std::mem::replace(&mut self.bool_val, ::std::vec::Vec::new()) - } - - // repeated double dcomplex_val = 12; - - pub fn get_dcomplex_val(&self) -> &[f64] { - &self.dcomplex_val - } - pub fn clear_dcomplex_val(&mut self) { - self.dcomplex_val.clear(); - } - - // Param is passed by value, moved - pub fn set_dcomplex_val(&mut self, v: ::std::vec::Vec) { - self.dcomplex_val = v; - } - - // Mutable pointer to the field. - pub fn mut_dcomplex_val(&mut self) -> &mut ::std::vec::Vec { - &mut self.dcomplex_val - } - - // Take field - pub fn take_dcomplex_val(&mut self) -> ::std::vec::Vec { - ::std::mem::replace(&mut self.dcomplex_val, ::std::vec::Vec::new()) - } - - // repeated .tensorflow.ResourceHandleProto resource_handle_val = 14; - - pub fn get_resource_handle_val(&self) -> &[super::resource_handle::ResourceHandleProto] { - &self.resource_handle_val - } - pub fn clear_resource_handle_val(&mut self) { - self.resource_handle_val.clear(); - } - - // Param is passed by value, moved - pub fn set_resource_handle_val( - &mut self, - v: ::protobuf::RepeatedField, - ) { - self.resource_handle_val = v; - } - - // Mutable pointer to the field. - pub fn mut_resource_handle_val( - &mut self, - ) -> &mut ::protobuf::RepeatedField { - &mut self.resource_handle_val - } - - // Take field - pub fn take_resource_handle_val( - &mut self, - ) -> ::protobuf::RepeatedField { - ::std::mem::replace( - &mut self.resource_handle_val, - ::protobuf::RepeatedField::new(), - ) - } - - // repeated .tensorflow.VariantTensorDataProto variant_val = 15; - - pub fn get_variant_val(&self) -> &[VariantTensorDataProto] { - &self.variant_val - } - pub fn clear_variant_val(&mut self) { - self.variant_val.clear(); - } - - // Param is passed by value, moved - pub fn set_variant_val(&mut self, v: ::protobuf::RepeatedField) { - self.variant_val = v; - } - - // Mutable pointer to the field. - pub fn mut_variant_val(&mut self) -> &mut ::protobuf::RepeatedField { - &mut self.variant_val - } - - // Take field - pub fn take_variant_val(&mut self) -> ::protobuf::RepeatedField { - ::std::mem::replace(&mut self.variant_val, ::protobuf::RepeatedField::new()) - } - - // repeated uint32 uint32_val = 16; - - pub fn get_uint32_val(&self) -> &[u32] { - &self.uint32_val - } - pub fn clear_uint32_val(&mut self) { - self.uint32_val.clear(); - } - - // Param is passed by value, moved - pub fn set_uint32_val(&mut self, v: ::std::vec::Vec) { - self.uint32_val = v; - } - - // Mutable pointer to the field. - pub fn mut_uint32_val(&mut self) -> &mut ::std::vec::Vec { - &mut self.uint32_val - } - - // Take field - pub fn take_uint32_val(&mut self) -> ::std::vec::Vec { - ::std::mem::replace(&mut self.uint32_val, ::std::vec::Vec::new()) - } - - // repeated uint64 uint64_val = 17; - - pub fn get_uint64_val(&self) -> &[u64] { - &self.uint64_val - } - pub fn clear_uint64_val(&mut self) { - self.uint64_val.clear(); - } - - // Param is passed by value, moved - pub fn set_uint64_val(&mut self, v: ::std::vec::Vec) { - self.uint64_val = v; - } - - // Mutable pointer to the field. - pub fn mut_uint64_val(&mut self) -> &mut ::std::vec::Vec { - &mut self.uint64_val - } - - // Take field - pub fn take_uint64_val(&mut self) -> ::std::vec::Vec { - ::std::mem::replace(&mut self.uint64_val, ::std::vec::Vec::new()) - } -} - -impl ::protobuf::Message for TensorProto { - fn is_initialized(&self) -> bool { - for v in &self.tensor_shape { - if !v.is_initialized() { - return false; - } - } - for v in &self.resource_handle_val { - if !v.is_initialized() { - return false; - } - } - for v in &self.variant_val { - if !v.is_initialized() { - return false; - } - } - true - } - - fn merge_from( - &mut self, - is: &mut ::protobuf::CodedInputStream<'_>, - ) -> ::protobuf::ProtobufResult<()> { - while !is.eof()? { - let (field_number, wire_type) = is.read_tag_unpack()?; - match field_number { - 1 => ::protobuf::rt::read_proto3_enum_with_unknown_fields_into( - wire_type, - is, - &mut self.dtype, - 1, - &mut self.unknown_fields, - )?, - 2 => { - ::protobuf::rt::read_singular_message_into( - wire_type, - is, - &mut self.tensor_shape, - )?; - } - 3 => { - if wire_type != ::protobuf::wire_format::WireTypeVarint { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type( - wire_type, - )); - } - let tmp = is.read_int32()?; - self.version_number = tmp; - } - 4 => { - ::protobuf::rt::read_singular_proto3_bytes_into( - wire_type, - is, - &mut self.tensor_content, - )?; - } - 13 => { - ::protobuf::rt::read_repeated_int32_into(wire_type, is, &mut self.half_val)?; - } - 5 => { - ::protobuf::rt::read_repeated_float_into(wire_type, is, &mut self.float_val)?; - } - 6 => { - ::protobuf::rt::read_repeated_double_into(wire_type, is, &mut self.double_val)?; - } - 7 => { - ::protobuf::rt::read_repeated_int32_into(wire_type, is, &mut self.int_val)?; - } - 8 => { - ::protobuf::rt::read_repeated_bytes_into(wire_type, is, &mut self.string_val)?; - } - 9 => { - ::protobuf::rt::read_repeated_float_into( - wire_type, - is, - &mut self.scomplex_val, - )?; - } - 10 => { - ::protobuf::rt::read_repeated_int64_into(wire_type, is, &mut self.int64_val)?; - } - 11 => { - ::protobuf::rt::read_repeated_bool_into(wire_type, is, &mut self.bool_val)?; - } - 12 => { - ::protobuf::rt::read_repeated_double_into( - wire_type, - is, - &mut self.dcomplex_val, - )?; - } - 14 => { - ::protobuf::rt::read_repeated_message_into( - wire_type, - is, - &mut self.resource_handle_val, - )?; - } - 15 => { - ::protobuf::rt::read_repeated_message_into( - wire_type, - is, - &mut self.variant_val, - )?; - } - 16 => { - ::protobuf::rt::read_repeated_uint32_into(wire_type, is, &mut self.uint32_val)?; - } - 17 => { - ::protobuf::rt::read_repeated_uint64_into(wire_type, is, &mut self.uint64_val)?; - } - _ => { - ::protobuf::rt::read_unknown_or_skip_group( - field_number, - wire_type, - is, - self.mut_unknown_fields(), - )?; - } - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u32 { - let mut my_size = 0; - if self.dtype != super::types::DataType::DT_INVALID { - my_size += ::protobuf::rt::enum_size(1, self.dtype); - } - if let Some(ref v) = self.tensor_shape.as_ref() { - let len = v.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - } - if self.version_number != 0 { - my_size += ::protobuf::rt::value_size( - 3, - self.version_number, - ::protobuf::wire_format::WireTypeVarint, - ); - } - if !self.tensor_content.is_empty() { - my_size += ::protobuf::rt::bytes_size(4, &self.tensor_content); - } - if !self.half_val.is_empty() { - my_size += ::protobuf::rt::vec_packed_varint_size(13, &self.half_val); - } - if !self.float_val.is_empty() { - my_size += 1 - + ::protobuf::rt::compute_raw_varint32_size((self.float_val.len() * 4) as u32) - + (self.float_val.len() * 4) as u32; - } - if !self.double_val.is_empty() { - my_size += 1 - + ::protobuf::rt::compute_raw_varint32_size((self.double_val.len() * 8) as u32) - + (self.double_val.len() * 8) as u32; - } - if !self.int_val.is_empty() { - my_size += ::protobuf::rt::vec_packed_varint_size(7, &self.int_val); - } - for value in &self.string_val { - my_size += ::protobuf::rt::bytes_size(8, &value); - } - if !self.scomplex_val.is_empty() { - my_size += 1 - + ::protobuf::rt::compute_raw_varint32_size((self.scomplex_val.len() * 4) as u32) - + (self.scomplex_val.len() * 4) as u32; - } - if !self.int64_val.is_empty() { - my_size += ::protobuf::rt::vec_packed_varint_size(10, &self.int64_val); - } - if !self.bool_val.is_empty() { - my_size += 1 - + ::protobuf::rt::compute_raw_varint32_size((self.bool_val.len() * 1) as u32) - + (self.bool_val.len() * 1) as u32; - } - if !self.dcomplex_val.is_empty() { - my_size += 1 - + ::protobuf::rt::compute_raw_varint32_size((self.dcomplex_val.len() * 8) as u32) - + (self.dcomplex_val.len() * 8) as u32; - } - for value in &self.resource_handle_val { - let len = value.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - } - for value in &self.variant_val { - let len = value.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - } - if !self.uint32_val.is_empty() { - my_size += ::protobuf::rt::vec_packed_varint_size(16, &self.uint32_val); - } - if !self.uint64_val.is_empty() { - my_size += ::protobuf::rt::vec_packed_varint_size(17, &self.uint64_val); - } - my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); - self.cached_size.set(my_size); - my_size - } - - fn write_to_with_cached_sizes( - &self, - os: &mut ::protobuf::CodedOutputStream<'_>, - ) -> ::protobuf::ProtobufResult<()> { - if self.dtype != super::types::DataType::DT_INVALID { - os.write_enum(1, ::protobuf::ProtobufEnum::value(&self.dtype))?; - } - if let Some(ref v) = self.tensor_shape.as_ref() { - os.write_tag(2, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - } - if self.version_number != 0 { - os.write_int32(3, self.version_number)?; - } - if !self.tensor_content.is_empty() { - os.write_bytes(4, &self.tensor_content)?; - } - if !self.half_val.is_empty() { - os.write_tag(13, ::protobuf::wire_format::WireTypeLengthDelimited)?; - // TODO: Data size is computed again, it should be cached - os.write_raw_varint32(::protobuf::rt::vec_packed_varint_data_size(&self.half_val))?; - for v in &self.half_val { - os.write_int32_no_tag(*v)?; - } - } - if !self.float_val.is_empty() { - os.write_tag(5, ::protobuf::wire_format::WireTypeLengthDelimited)?; - // TODO: Data size is computed again, it should be cached - os.write_raw_varint32((self.float_val.len() * 4) as u32)?; - for v in &self.float_val { - os.write_float_no_tag(*v)?; - } - } - if !self.double_val.is_empty() { - os.write_tag(6, ::protobuf::wire_format::WireTypeLengthDelimited)?; - // TODO: Data size is computed again, it should be cached - os.write_raw_varint32((self.double_val.len() * 8) as u32)?; - for v in &self.double_val { - os.write_double_no_tag(*v)?; - } - } - if !self.int_val.is_empty() { - os.write_tag(7, ::protobuf::wire_format::WireTypeLengthDelimited)?; - // TODO: Data size is computed again, it should be cached - os.write_raw_varint32(::protobuf::rt::vec_packed_varint_data_size(&self.int_val))?; - for v in &self.int_val { - os.write_int32_no_tag(*v)?; - } - } - for v in &self.string_val { - os.write_bytes(8, &v)?; - } - if !self.scomplex_val.is_empty() { - os.write_tag(9, ::protobuf::wire_format::WireTypeLengthDelimited)?; - // TODO: Data size is computed again, it should be cached - os.write_raw_varint32((self.scomplex_val.len() * 4) as u32)?; - for v in &self.scomplex_val { - os.write_float_no_tag(*v)?; - } - } - if !self.int64_val.is_empty() { - os.write_tag(10, ::protobuf::wire_format::WireTypeLengthDelimited)?; - // TODO: Data size is computed again, it should be cached - os.write_raw_varint32(::protobuf::rt::vec_packed_varint_data_size(&self.int64_val))?; - for v in &self.int64_val { - os.write_int64_no_tag(*v)?; - } - } - if !self.bool_val.is_empty() { - os.write_tag(11, ::protobuf::wire_format::WireTypeLengthDelimited)?; - // TODO: Data size is computed again, it should be cached - os.write_raw_varint32((self.bool_val.len() * 1) as u32)?; - for v in &self.bool_val { - os.write_bool_no_tag(*v)?; - } - } - if !self.dcomplex_val.is_empty() { - os.write_tag(12, ::protobuf::wire_format::WireTypeLengthDelimited)?; - // TODO: Data size is computed again, it should be cached - os.write_raw_varint32((self.dcomplex_val.len() * 8) as u32)?; - for v in &self.dcomplex_val { - os.write_double_no_tag(*v)?; - } - } - for v in &self.resource_handle_val { - os.write_tag(14, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - } - for v in &self.variant_val { - os.write_tag(15, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - } - if !self.uint32_val.is_empty() { - os.write_tag(16, ::protobuf::wire_format::WireTypeLengthDelimited)?; - // TODO: Data size is computed again, it should be cached - os.write_raw_varint32(::protobuf::rt::vec_packed_varint_data_size( - &self.uint32_val, - ))?; - for v in &self.uint32_val { - os.write_uint32_no_tag(*v)?; - } - } - if !self.uint64_val.is_empty() { - os.write_tag(17, ::protobuf::wire_format::WireTypeLengthDelimited)?; - // TODO: Data size is computed again, it should be cached - os.write_raw_varint32(::protobuf::rt::vec_packed_varint_data_size( - &self.uint64_val, - ))?; - for v in &self.uint64_val { - os.write_uint64_no_tag(*v)?; - } - } - os.write_unknown_fields(self.get_unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn get_cached_size(&self) -> u32 { - self.cached_size.get() - } - - fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { - &self.unknown_fields - } - - fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { - &mut self.unknown_fields - } - - fn as_any(&self) -> &dyn (::std::any::Any) { - self as &dyn (::std::any::Any) - } - fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { - self as &mut dyn (::std::any::Any) - } - fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { - self - } - - fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - Self::descriptor_static() - } - - fn new() -> TensorProto { - TensorProto::new() - } - - fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = - ::protobuf::rt::LazyV2::INIT; - descriptor.get(|| { - let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::< - _, - ::protobuf::types::ProtobufTypeEnum, - >( - "dtype", - |m: &TensorProto| &m.dtype, - |m: &mut TensorProto| &mut m.dtype, - )); - fields.push( - ::protobuf::reflect::accessor::make_singular_ptr_field_accessor::< - _, - ::protobuf::types::ProtobufTypeMessage, - >( - "tensor_shape", - |m: &TensorProto| &m.tensor_shape, - |m: &mut TensorProto| &mut m.tensor_shape, - ), - ); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::< - _, - ::protobuf::types::ProtobufTypeInt32, - >( - "version_number", - |m: &TensorProto| &m.version_number, - |m: &mut TensorProto| &mut m.version_number, - )); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::< - _, - ::protobuf::types::ProtobufTypeBytes, - >( - "tensor_content", - |m: &TensorProto| &m.tensor_content, - |m: &mut TensorProto| &mut m.tensor_content, - )); - fields.push(::protobuf::reflect::accessor::make_vec_accessor::< - _, - ::protobuf::types::ProtobufTypeInt32, - >( - "half_val", - |m: &TensorProto| &m.half_val, - |m: &mut TensorProto| &mut m.half_val, - )); - fields.push(::protobuf::reflect::accessor::make_vec_accessor::< - _, - ::protobuf::types::ProtobufTypeFloat, - >( - "float_val", - |m: &TensorProto| &m.float_val, - |m: &mut TensorProto| &mut m.float_val, - )); - fields.push(::protobuf::reflect::accessor::make_vec_accessor::< - _, - ::protobuf::types::ProtobufTypeDouble, - >( - "double_val", - |m: &TensorProto| &m.double_val, - |m: &mut TensorProto| &mut m.double_val, - )); - fields.push(::protobuf::reflect::accessor::make_vec_accessor::< - _, - ::protobuf::types::ProtobufTypeInt32, - >( - "int_val", - |m: &TensorProto| &m.int_val, - |m: &mut TensorProto| &mut m.int_val, - )); - fields.push( - ::protobuf::reflect::accessor::make_repeated_field_accessor::< - _, - ::protobuf::types::ProtobufTypeBytes, - >( - "string_val", - |m: &TensorProto| &m.string_val, - |m: &mut TensorProto| &mut m.string_val, - ), - ); - fields.push(::protobuf::reflect::accessor::make_vec_accessor::< - _, - ::protobuf::types::ProtobufTypeFloat, - >( - "scomplex_val", - |m: &TensorProto| &m.scomplex_val, - |m: &mut TensorProto| &mut m.scomplex_val, - )); - fields.push(::protobuf::reflect::accessor::make_vec_accessor::< - _, - ::protobuf::types::ProtobufTypeInt64, - >( - "int64_val", - |m: &TensorProto| &m.int64_val, - |m: &mut TensorProto| &mut m.int64_val, - )); - fields.push(::protobuf::reflect::accessor::make_vec_accessor::< - _, - ::protobuf::types::ProtobufTypeBool, - >( - "bool_val", - |m: &TensorProto| &m.bool_val, - |m: &mut TensorProto| &mut m.bool_val, - )); - fields.push(::protobuf::reflect::accessor::make_vec_accessor::< - _, - ::protobuf::types::ProtobufTypeDouble, - >( - "dcomplex_val", - |m: &TensorProto| &m.dcomplex_val, - |m: &mut TensorProto| &mut m.dcomplex_val, - )); - fields.push( - ::protobuf::reflect::accessor::make_repeated_field_accessor::< - _, - ::protobuf::types::ProtobufTypeMessage< - super::resource_handle::ResourceHandleProto, - >, - >( - "resource_handle_val", - |m: &TensorProto| &m.resource_handle_val, - |m: &mut TensorProto| &mut m.resource_handle_val, - ), - ); - fields.push( - ::protobuf::reflect::accessor::make_repeated_field_accessor::< - _, - ::protobuf::types::ProtobufTypeMessage, - >( - "variant_val", - |m: &TensorProto| &m.variant_val, - |m: &mut TensorProto| &mut m.variant_val, - ), - ); - fields.push(::protobuf::reflect::accessor::make_vec_accessor::< - _, - ::protobuf::types::ProtobufTypeUint32, - >( - "uint32_val", - |m: &TensorProto| &m.uint32_val, - |m: &mut TensorProto| &mut m.uint32_val, - )); - fields.push(::protobuf::reflect::accessor::make_vec_accessor::< - _, - ::protobuf::types::ProtobufTypeUint64, - >( - "uint64_val", - |m: &TensorProto| &m.uint64_val, - |m: &mut TensorProto| &mut m.uint64_val, - )); - ::protobuf::reflect::MessageDescriptor::new_pb_name::( - "TensorProto", - fields, - file_descriptor_proto(), - ) - }) - } - - fn default_instance() -> &'static TensorProto { - static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; - instance.get(TensorProto::new) - } -} - -impl ::protobuf::Clear for TensorProto { - fn clear(&mut self) { - self.dtype = super::types::DataType::DT_INVALID; - self.tensor_shape.clear(); - self.version_number = 0; - self.tensor_content.clear(); - self.half_val.clear(); - self.float_val.clear(); - self.double_val.clear(); - self.int_val.clear(); - self.string_val.clear(); - self.scomplex_val.clear(); - self.int64_val.clear(); - self.bool_val.clear(); - self.dcomplex_val.clear(); - self.resource_handle_val.clear(); - self.variant_val.clear(); - self.uint32_val.clear(); - self.uint64_val.clear(); - self.unknown_fields.clear(); - } -} - -impl ::std::fmt::Debug for TensorProto { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for TensorProto { - fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { - ::protobuf::reflect::ReflectValueRef::Message(self) - } -} - -#[derive(PartialEq, Clone, Default)] -pub struct VariantTensorDataProto { - // message fields - pub type_name: ::std::string::String, - pub metadata: ::std::vec::Vec, - pub tensors: ::protobuf::RepeatedField, - // special fields - pub unknown_fields: ::protobuf::UnknownFields, - pub cached_size: ::protobuf::CachedSize, -} - -impl<'a> ::std::default::Default for &'a VariantTensorDataProto { - fn default() -> &'a VariantTensorDataProto { - ::default_instance() - } -} - -impl VariantTensorDataProto { - pub fn new() -> VariantTensorDataProto { - ::std::default::Default::default() - } - - // string type_name = 1; - - pub fn get_type_name(&self) -> &str { - &self.type_name - } - pub fn clear_type_name(&mut self) { - self.type_name.clear(); - } - - // Param is passed by value, moved - pub fn set_type_name(&mut self, v: ::std::string::String) { - self.type_name = v; - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_type_name(&mut self) -> &mut ::std::string::String { - &mut self.type_name - } - - // Take field - pub fn take_type_name(&mut self) -> ::std::string::String { - ::std::mem::replace(&mut self.type_name, ::std::string::String::new()) - } - - // bytes metadata = 2; - - pub fn get_metadata(&self) -> &[u8] { - &self.metadata - } - pub fn clear_metadata(&mut self) { - self.metadata.clear(); - } - - // Param is passed by value, moved - pub fn set_metadata(&mut self, v: ::std::vec::Vec) { - self.metadata = v; - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_metadata(&mut self) -> &mut ::std::vec::Vec { - &mut self.metadata - } - - // Take field - pub fn take_metadata(&mut self) -> ::std::vec::Vec { - ::std::mem::replace(&mut self.metadata, ::std::vec::Vec::new()) - } - - // repeated .tensorflow.TensorProto tensors = 3; - - pub fn get_tensors(&self) -> &[TensorProto] { - &self.tensors - } - pub fn clear_tensors(&mut self) { - self.tensors.clear(); - } - - // Param is passed by value, moved - pub fn set_tensors(&mut self, v: ::protobuf::RepeatedField) { - self.tensors = v; - } - - // Mutable pointer to the field. - pub fn mut_tensors(&mut self) -> &mut ::protobuf::RepeatedField { - &mut self.tensors - } - - // Take field - pub fn take_tensors(&mut self) -> ::protobuf::RepeatedField { - ::std::mem::replace(&mut self.tensors, ::protobuf::RepeatedField::new()) - } -} - -impl ::protobuf::Message for VariantTensorDataProto { - fn is_initialized(&self) -> bool { - for v in &self.tensors { - if !v.is_initialized() { - return false; - } - } - true - } - - fn merge_from( - &mut self, - is: &mut ::protobuf::CodedInputStream<'_>, - ) -> ::protobuf::ProtobufResult<()> { - while !is.eof()? { - let (field_number, wire_type) = is.read_tag_unpack()?; - match field_number { - 1 => { - ::protobuf::rt::read_singular_proto3_string_into( - wire_type, - is, - &mut self.type_name, - )?; - } - 2 => { - ::protobuf::rt::read_singular_proto3_bytes_into( - wire_type, - is, - &mut self.metadata, - )?; - } - 3 => { - ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.tensors)?; - } - _ => { - ::protobuf::rt::read_unknown_or_skip_group( - field_number, - wire_type, - is, - self.mut_unknown_fields(), - )?; - } - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u32 { - let mut my_size = 0; - if !self.type_name.is_empty() { - my_size += ::protobuf::rt::string_size(1, &self.type_name); - } - if !self.metadata.is_empty() { - my_size += ::protobuf::rt::bytes_size(2, &self.metadata); - } - for value in &self.tensors { - let len = value.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - } - my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); - self.cached_size.set(my_size); - my_size - } - - fn write_to_with_cached_sizes( - &self, - os: &mut ::protobuf::CodedOutputStream<'_>, - ) -> ::protobuf::ProtobufResult<()> { - if !self.type_name.is_empty() { - os.write_string(1, &self.type_name)?; - } - if !self.metadata.is_empty() { - os.write_bytes(2, &self.metadata)?; - } - for v in &self.tensors { - os.write_tag(3, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - } - os.write_unknown_fields(self.get_unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn get_cached_size(&self) -> u32 { - self.cached_size.get() - } - - fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { - &self.unknown_fields - } - - fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { - &mut self.unknown_fields - } - - fn as_any(&self) -> &dyn (::std::any::Any) { - self as &dyn (::std::any::Any) - } - fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { - self as &mut dyn (::std::any::Any) - } - fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { - self - } - - fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - Self::descriptor_static() - } - - fn new() -> VariantTensorDataProto { - VariantTensorDataProto::new() - } - - fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = - ::protobuf::rt::LazyV2::INIT; - descriptor.get(|| { - let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::< - _, - ::protobuf::types::ProtobufTypeString, - >( - "type_name", - |m: &VariantTensorDataProto| &m.type_name, - |m: &mut VariantTensorDataProto| &mut m.type_name, - )); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::< - _, - ::protobuf::types::ProtobufTypeBytes, - >( - "metadata", - |m: &VariantTensorDataProto| &m.metadata, - |m: &mut VariantTensorDataProto| &mut m.metadata, - )); - fields.push( - ::protobuf::reflect::accessor::make_repeated_field_accessor::< - _, - ::protobuf::types::ProtobufTypeMessage, - >( - "tensors", - |m: &VariantTensorDataProto| &m.tensors, - |m: &mut VariantTensorDataProto| &mut m.tensors, - ), - ); - ::protobuf::reflect::MessageDescriptor::new_pb_name::( - "VariantTensorDataProto", - fields, - file_descriptor_proto(), - ) - }) - } - - fn default_instance() -> &'static VariantTensorDataProto { - static instance: ::protobuf::rt::LazyV2 = - ::protobuf::rt::LazyV2::INIT; - instance.get(VariantTensorDataProto::new) - } -} - -impl ::protobuf::Clear for VariantTensorDataProto { - fn clear(&mut self) { - self.type_name.clear(); - self.metadata.clear(); - self.tensors.clear(); - self.unknown_fields.clear(); - } -} - -impl ::std::fmt::Debug for VariantTensorDataProto { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for VariantTensorDataProto { - fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { - ::protobuf::reflect::ReflectValueRef::Message(self) - } -} - -static file_descriptor_proto_data: &'static [u8] = b"\ - \n&tensorflow/core/framework/tensor.proto\x12\ntensorflow\x1a/tensorflow\ - /core/framework/resource_handle.proto\x1a,tensorflow/core/framework/tens\ - or_shape.proto\x1a%tensorflow/core/framework/types.proto\"\xd1\x05\n\x0b\ - TensorProto\x12*\n\x05dtype\x18\x01\x20\x01(\x0e2\x14.tensorflow.DataTyp\ - eR\x05dtype\x12?\n\x0ctensor_shape\x18\x02\x20\x01(\x0b2\x1c.tensorflow.\ - TensorShapeProtoR\x0btensorShape\x12%\n\x0eversion_number\x18\x03\x20\ - \x01(\x05R\rversionNumber\x12%\n\x0etensor_content\x18\x04\x20\x01(\x0cR\ - \rtensorContent\x12\x1d\n\x08half_val\x18\r\x20\x03(\x05R\x07halfValB\ - \x02\x10\x01\x12\x1f\n\tfloat_val\x18\x05\x20\x03(\x02R\x08floatValB\x02\ - \x10\x01\x12!\n\ndouble_val\x18\x06\x20\x03(\x01R\tdoubleValB\x02\x10\ - \x01\x12\x1b\n\x07int_val\x18\x07\x20\x03(\x05R\x06intValB\x02\x10\x01\ - \x12\x1d\n\nstring_val\x18\x08\x20\x03(\x0cR\tstringVal\x12%\n\x0cscompl\ - ex_val\x18\t\x20\x03(\x02R\x0bscomplexValB\x02\x10\x01\x12\x1f\n\tint64_\ - val\x18\n\x20\x03(\x03R\x08int64ValB\x02\x10\x01\x12\x1d\n\x08bool_val\ - \x18\x0b\x20\x03(\x08R\x07boolValB\x02\x10\x01\x12%\n\x0cdcomplex_val\ - \x18\x0c\x20\x03(\x01R\x0bdcomplexValB\x02\x10\x01\x12O\n\x13resource_ha\ - ndle_val\x18\x0e\x20\x03(\x0b2\x1f.tensorflow.ResourceHandleProtoR\x11re\ - sourceHandleVal\x12C\n\x0bvariant_val\x18\x0f\x20\x03(\x0b2\".tensorflow\ - .VariantTensorDataProtoR\nvariantVal\x12!\n\nuint32_val\x18\x10\x20\x03(\ - \rR\tuint32ValB\x02\x10\x01\x12!\n\nuint64_val\x18\x11\x20\x03(\x04R\tui\ - nt64ValB\x02\x10\x01\"\x84\x01\n\x16VariantTensorDataProto\x12\x1b\n\tty\ - pe_name\x18\x01\x20\x01(\tR\x08typeName\x12\x1a\n\x08metadata\x18\x02\ - \x20\x01(\x0cR\x08metadata\x121\n\x07tensors\x18\x03\x20\x03(\x0b2\x17.t\ - ensorflow.TensorProtoR\x07tensorsBl\n\x18org.tensorflow.frameworkB\x0cTe\ - nsorProtosP\x01Z=github.com/tensorflow/tensorflow/tensorflow/go/core/fra\ - mework\xf8\x01\x01b\x06proto3\ -"; - -static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2< - ::protobuf::descriptor::FileDescriptorProto, -> = ::protobuf::rt::LazyV2::INIT; - -fn parse_descriptor_proto() -> ::protobuf::descriptor::FileDescriptorProto { - ::protobuf::parse_from_bytes(file_descriptor_proto_data).unwrap() -} - -pub fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto { - file_descriptor_proto_lazy.get(|| parse_descriptor_proto()) -} diff --git a/src/protos/tensor_shape.rs b/src/protos/tensor_shape.rs deleted file mode 100644 index 07503178f9..0000000000 --- a/src/protos/tensor_shape.rs +++ /dev/null @@ -1,485 +0,0 @@ -// This file is generated by rust-protobuf 2.17.0. Do not edit -// @generated - -// https://github.com/rust-lang/rust-clippy/issues/702 -#![allow(unknown_lints)] -#![allow(clippy::all)] - -#![allow(unused_attributes)] -#![rustfmt::skip] - -#![allow(box_pointers)] -#![allow(dead_code)] -#![allow(missing_docs)] -#![allow(non_camel_case_types)] -#![allow(non_snake_case)] -#![allow(non_upper_case_globals)] -#![allow(trivial_casts)] -#![allow(unused_imports)] -#![allow(unused_results)] -//! Generated file from `tensorflow/core/framework/tensor_shape.proto` - -/// Generated files are compatible only with the same version -/// of protobuf runtime. -// const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_17_0; - -#[derive(PartialEq, Clone, Default)] -pub struct TensorShapeProto { - // message fields - pub dim: ::protobuf::RepeatedField, - pub unknown_rank: bool, - // special fields - pub unknown_fields: ::protobuf::UnknownFields, - pub cached_size: ::protobuf::CachedSize, -} - -impl<'a> ::std::default::Default for &'a TensorShapeProto { - fn default() -> &'a TensorShapeProto { - ::default_instance() - } -} - -impl TensorShapeProto { - pub fn new() -> TensorShapeProto { - ::std::default::Default::default() - } - - // repeated .tensorflow.TensorShapeProto.Dim dim = 2; - - pub fn get_dim(&self) -> &[TensorShapeProto_Dim] { - &self.dim - } - pub fn clear_dim(&mut self) { - self.dim.clear(); - } - - // Param is passed by value, moved - pub fn set_dim(&mut self, v: ::protobuf::RepeatedField) { - self.dim = v; - } - - // Mutable pointer to the field. - pub fn mut_dim(&mut self) -> &mut ::protobuf::RepeatedField { - &mut self.dim - } - - // Take field - pub fn take_dim(&mut self) -> ::protobuf::RepeatedField { - ::std::mem::replace(&mut self.dim, ::protobuf::RepeatedField::new()) - } - - // bool unknown_rank = 3; - - pub fn get_unknown_rank(&self) -> bool { - self.unknown_rank - } - pub fn clear_unknown_rank(&mut self) { - self.unknown_rank = false; - } - - // Param is passed by value, moved - pub fn set_unknown_rank(&mut self, v: bool) { - self.unknown_rank = v; - } -} - -impl ::protobuf::Message for TensorShapeProto { - fn is_initialized(&self) -> bool { - for v in &self.dim { - if !v.is_initialized() { - return false; - } - } - true - } - - fn merge_from( - &mut self, - is: &mut ::protobuf::CodedInputStream<'_>, - ) -> ::protobuf::ProtobufResult<()> { - while !is.eof()? { - let (field_number, wire_type) = is.read_tag_unpack()?; - match field_number { - 2 => { - ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.dim)?; - } - 3 => { - if wire_type != ::protobuf::wire_format::WireTypeVarint { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type( - wire_type, - )); - } - let tmp = is.read_bool()?; - self.unknown_rank = tmp; - } - _ => { - ::protobuf::rt::read_unknown_or_skip_group( - field_number, - wire_type, - is, - self.mut_unknown_fields(), - )?; - } - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u32 { - let mut my_size = 0; - for value in &self.dim { - let len = value.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - } - if self.unknown_rank != false { - my_size += 2; - } - my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); - self.cached_size.set(my_size); - my_size - } - - fn write_to_with_cached_sizes( - &self, - os: &mut ::protobuf::CodedOutputStream<'_>, - ) -> ::protobuf::ProtobufResult<()> { - for v in &self.dim { - os.write_tag(2, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - } - if self.unknown_rank != false { - os.write_bool(3, self.unknown_rank)?; - } - os.write_unknown_fields(self.get_unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn get_cached_size(&self) -> u32 { - self.cached_size.get() - } - - fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { - &self.unknown_fields - } - - fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { - &mut self.unknown_fields - } - - fn as_any(&self) -> &dyn (::std::any::Any) { - self as &dyn (::std::any::Any) - } - fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { - self as &mut dyn (::std::any::Any) - } - fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { - self - } - - fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - Self::descriptor_static() - } - - fn new() -> TensorShapeProto { - TensorShapeProto::new() - } - - fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = - ::protobuf::rt::LazyV2::INIT; - descriptor.get(|| { - let mut fields = ::std::vec::Vec::new(); - fields.push( - ::protobuf::reflect::accessor::make_repeated_field_accessor::< - _, - ::protobuf::types::ProtobufTypeMessage, - >( - "dim", - |m: &TensorShapeProto| &m.dim, - |m: &mut TensorShapeProto| &mut m.dim, - ), - ); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::< - _, - ::protobuf::types::ProtobufTypeBool, - >( - "unknown_rank", - |m: &TensorShapeProto| &m.unknown_rank, - |m: &mut TensorShapeProto| &mut m.unknown_rank, - )); - ::protobuf::reflect::MessageDescriptor::new_pb_name::( - "TensorShapeProto", - fields, - file_descriptor_proto(), - ) - }) - } - - fn default_instance() -> &'static TensorShapeProto { - static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; - instance.get(TensorShapeProto::new) - } -} - -impl ::protobuf::Clear for TensorShapeProto { - fn clear(&mut self) { - self.dim.clear(); - self.unknown_rank = false; - self.unknown_fields.clear(); - } -} - -impl ::std::fmt::Debug for TensorShapeProto { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for TensorShapeProto { - fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { - ::protobuf::reflect::ReflectValueRef::Message(self) - } -} - -#[derive(PartialEq, Clone, Default)] -pub struct TensorShapeProto_Dim { - // message fields - pub size: i64, - pub name: ::std::string::String, - // special fields - pub unknown_fields: ::protobuf::UnknownFields, - pub cached_size: ::protobuf::CachedSize, -} - -impl<'a> ::std::default::Default for &'a TensorShapeProto_Dim { - fn default() -> &'a TensorShapeProto_Dim { - ::default_instance() - } -} - -impl TensorShapeProto_Dim { - pub fn new() -> TensorShapeProto_Dim { - ::std::default::Default::default() - } - - // int64 size = 1; - - pub fn get_size(&self) -> i64 { - self.size - } - pub fn clear_size(&mut self) { - self.size = 0; - } - - // Param is passed by value, moved - pub fn set_size(&mut self, v: i64) { - self.size = v; - } - - // string name = 2; - - pub fn get_name(&self) -> &str { - &self.name - } - pub fn clear_name(&mut self) { - self.name.clear(); - } - - // Param is passed by value, moved - pub fn set_name(&mut self, v: ::std::string::String) { - self.name = v; - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_name(&mut self) -> &mut ::std::string::String { - &mut self.name - } - - // Take field - pub fn take_name(&mut self) -> ::std::string::String { - ::std::mem::replace(&mut self.name, ::std::string::String::new()) - } -} - -impl ::protobuf::Message for TensorShapeProto_Dim { - fn is_initialized(&self) -> bool { - true - } - - fn merge_from( - &mut self, - is: &mut ::protobuf::CodedInputStream<'_>, - ) -> ::protobuf::ProtobufResult<()> { - while !is.eof()? { - let (field_number, wire_type) = is.read_tag_unpack()?; - match field_number { - 1 => { - if wire_type != ::protobuf::wire_format::WireTypeVarint { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type( - wire_type, - )); - } - let tmp = is.read_int64()?; - self.size = tmp; - } - 2 => { - ::protobuf::rt::read_singular_proto3_string_into( - wire_type, - is, - &mut self.name, - )?; - } - _ => { - ::protobuf::rt::read_unknown_or_skip_group( - field_number, - wire_type, - is, - self.mut_unknown_fields(), - )?; - } - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u32 { - let mut my_size = 0; - if self.size != 0 { - my_size += - ::protobuf::rt::value_size(1, self.size, ::protobuf::wire_format::WireTypeVarint); - } - if !self.name.is_empty() { - my_size += ::protobuf::rt::string_size(2, &self.name); - } - my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); - self.cached_size.set(my_size); - my_size - } - - fn write_to_with_cached_sizes( - &self, - os: &mut ::protobuf::CodedOutputStream<'_>, - ) -> ::protobuf::ProtobufResult<()> { - if self.size != 0 { - os.write_int64(1, self.size)?; - } - if !self.name.is_empty() { - os.write_string(2, &self.name)?; - } - os.write_unknown_fields(self.get_unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn get_cached_size(&self) -> u32 { - self.cached_size.get() - } - - fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { - &self.unknown_fields - } - - fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { - &mut self.unknown_fields - } - - fn as_any(&self) -> &dyn (::std::any::Any) { - self as &dyn (::std::any::Any) - } - fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { - self as &mut dyn (::std::any::Any) - } - fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { - self - } - - fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - Self::descriptor_static() - } - - fn new() -> TensorShapeProto_Dim { - TensorShapeProto_Dim::new() - } - - fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = - ::protobuf::rt::LazyV2::INIT; - descriptor.get(|| { - let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::< - _, - ::protobuf::types::ProtobufTypeInt64, - >( - "size", - |m: &TensorShapeProto_Dim| &m.size, - |m: &mut TensorShapeProto_Dim| &mut m.size, - )); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::< - _, - ::protobuf::types::ProtobufTypeString, - >( - "name", - |m: &TensorShapeProto_Dim| &m.name, - |m: &mut TensorShapeProto_Dim| &mut m.name, - )); - ::protobuf::reflect::MessageDescriptor::new_pb_name::( - "TensorShapeProto.Dim", - fields, - file_descriptor_proto(), - ) - }) - } - - fn default_instance() -> &'static TensorShapeProto_Dim { - static instance: ::protobuf::rt::LazyV2 = - ::protobuf::rt::LazyV2::INIT; - instance.get(TensorShapeProto_Dim::new) - } -} - -impl ::protobuf::Clear for TensorShapeProto_Dim { - fn clear(&mut self) { - self.size = 0; - self.name.clear(); - self.unknown_fields.clear(); - } -} - -impl ::std::fmt::Debug for TensorShapeProto_Dim { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for TensorShapeProto_Dim { - fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { - ::protobuf::reflect::ReflectValueRef::Message(self) - } -} - -static file_descriptor_proto_data: &'static [u8] = b"\ - \n,tensorflow/core/framework/tensor_shape.proto\x12\ntensorflow\"\x98\ - \x01\n\x10TensorShapeProto\x122\n\x03dim\x18\x02\x20\x03(\x0b2\x20.tenso\ - rflow.TensorShapeProto.DimR\x03dim\x12!\n\x0cunknown_rank\x18\x03\x20\ - \x01(\x08R\x0bunknownRank\x1a-\n\x03Dim\x12\x12\n\x04size\x18\x01\x20\ - \x01(\x03R\x04size\x12\x12\n\x04name\x18\x02\x20\x01(\tR\x04nameBq\n\x18\ - org.tensorflow.frameworkB\x11TensorShapeProtosP\x01Z=github.com/tensorfl\ - ow/tensorflow/tensorflow/go/core/framework\xf8\x01\x01b\x06proto3\ -"; - -static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2< - ::protobuf::descriptor::FileDescriptorProto, -> = ::protobuf::rt::LazyV2::INIT; - -fn parse_descriptor_proto() -> ::protobuf::descriptor::FileDescriptorProto { - ::protobuf::parse_from_bytes(file_descriptor_proto_data).unwrap() -} - -pub fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto { - file_descriptor_proto_lazy.get(|| parse_descriptor_proto()) -} diff --git a/src/protos/trackable_object_graph.rs b/src/protos/trackable_object_graph.rs deleted file mode 100644 index 10c77dfad8..0000000000 --- a/src/protos/trackable_object_graph.rs +++ /dev/null @@ -1,1403 +0,0 @@ -// This file is generated by rust-protobuf 2.17.0. Do not edit -// @generated - -// https://github.com/rust-lang/rust-clippy/issues/702 -#![allow(unknown_lints)] -#![allow(clippy::all)] - -#![allow(unused_attributes)] -#![rustfmt::skip] - -#![allow(box_pointers)] -#![allow(dead_code)] -#![allow(missing_docs)] -#![allow(non_camel_case_types)] -#![allow(non_snake_case)] -#![allow(non_upper_case_globals)] -#![allow(trivial_casts)] -#![allow(unused_imports)] -#![allow(unused_results)] -//! Generated file from `tensorflow/core/protobuf/trackable_object_graph.proto` - -/// Generated files are compatible only with the same version -/// of protobuf runtime. -// const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_17_0; - -#[derive(PartialEq, Clone, Default)] -pub struct TrackableObjectGraph { - // message fields - pub nodes: ::protobuf::RepeatedField, - // special fields - pub unknown_fields: ::protobuf::UnknownFields, - pub cached_size: ::protobuf::CachedSize, -} - -impl<'a> ::std::default::Default for &'a TrackableObjectGraph { - fn default() -> &'a TrackableObjectGraph { - ::default_instance() - } -} - -impl TrackableObjectGraph { - pub fn new() -> TrackableObjectGraph { - ::std::default::Default::default() - } - - // repeated .tensorflow.TrackableObjectGraph.TrackableObject nodes = 1; - - pub fn get_nodes(&self) -> &[TrackableObjectGraph_TrackableObject] { - &self.nodes - } - pub fn clear_nodes(&mut self) { - self.nodes.clear(); - } - - // Param is passed by value, moved - pub fn set_nodes( - &mut self, - v: ::protobuf::RepeatedField, - ) { - self.nodes = v; - } - - // Mutable pointer to the field. - pub fn mut_nodes( - &mut self, - ) -> &mut ::protobuf::RepeatedField { - &mut self.nodes - } - - // Take field - pub fn take_nodes( - &mut self, - ) -> ::protobuf::RepeatedField { - ::std::mem::replace(&mut self.nodes, ::protobuf::RepeatedField::new()) - } -} - -impl ::protobuf::Message for TrackableObjectGraph { - fn is_initialized(&self) -> bool { - for v in &self.nodes { - if !v.is_initialized() { - return false; - } - } - true - } - - fn merge_from( - &mut self, - is: &mut ::protobuf::CodedInputStream<'_>, - ) -> ::protobuf::ProtobufResult<()> { - while !is.eof()? { - let (field_number, wire_type) = is.read_tag_unpack()?; - match field_number { - 1 => { - ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.nodes)?; - } - _ => { - ::protobuf::rt::read_unknown_or_skip_group( - field_number, - wire_type, - is, - self.mut_unknown_fields(), - )?; - } - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u32 { - let mut my_size = 0; - for value in &self.nodes { - let len = value.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - } - my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); - self.cached_size.set(my_size); - my_size - } - - fn write_to_with_cached_sizes( - &self, - os: &mut ::protobuf::CodedOutputStream<'_>, - ) -> ::protobuf::ProtobufResult<()> { - for v in &self.nodes { - os.write_tag(1, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - } - os.write_unknown_fields(self.get_unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn get_cached_size(&self) -> u32 { - self.cached_size.get() - } - - fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { - &self.unknown_fields - } - - fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { - &mut self.unknown_fields - } - - fn as_any(&self) -> &dyn (::std::any::Any) { - self as &dyn (::std::any::Any) - } - fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { - self as &mut dyn (::std::any::Any) - } - fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { - self - } - - fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - Self::descriptor_static() - } - - fn new() -> TrackableObjectGraph { - TrackableObjectGraph::new() - } - - fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = - ::protobuf::rt::LazyV2::INIT; - descriptor.get(|| { - let mut fields = ::std::vec::Vec::new(); - fields.push( - ::protobuf::reflect::accessor::make_repeated_field_accessor::< - _, - ::protobuf::types::ProtobufTypeMessage, - >( - "nodes", - |m: &TrackableObjectGraph| &m.nodes, - |m: &mut TrackableObjectGraph| &mut m.nodes, - ), - ); - ::protobuf::reflect::MessageDescriptor::new_pb_name::( - "TrackableObjectGraph", - fields, - file_descriptor_proto(), - ) - }) - } - - fn default_instance() -> &'static TrackableObjectGraph { - static instance: ::protobuf::rt::LazyV2 = - ::protobuf::rt::LazyV2::INIT; - instance.get(TrackableObjectGraph::new) - } -} - -impl ::protobuf::Clear for TrackableObjectGraph { - fn clear(&mut self) { - self.nodes.clear(); - self.unknown_fields.clear(); - } -} - -impl ::std::fmt::Debug for TrackableObjectGraph { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for TrackableObjectGraph { - fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { - ::protobuf::reflect::ReflectValueRef::Message(self) - } -} - -#[derive(PartialEq, Clone, Default)] -pub struct TrackableObjectGraph_TrackableObject { - // message fields - pub children: ::protobuf::RepeatedField, - pub attributes: - ::protobuf::RepeatedField, - pub slot_variables: - ::protobuf::RepeatedField, - // special fields - pub unknown_fields: ::protobuf::UnknownFields, - pub cached_size: ::protobuf::CachedSize, -} - -impl<'a> ::std::default::Default for &'a TrackableObjectGraph_TrackableObject { - fn default() -> &'a TrackableObjectGraph_TrackableObject { - ::default_instance() - } -} - -impl TrackableObjectGraph_TrackableObject { - pub fn new() -> TrackableObjectGraph_TrackableObject { - ::std::default::Default::default() - } - - // repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference children = 1; - - pub fn get_children(&self) -> &[TrackableObjectGraph_TrackableObject_ObjectReference] { - &self.children - } - pub fn clear_children(&mut self) { - self.children.clear(); - } - - // Param is passed by value, moved - pub fn set_children( - &mut self, - v: ::protobuf::RepeatedField, - ) { - self.children = v; - } - - // Mutable pointer to the field. - pub fn mut_children( - &mut self, - ) -> &mut ::protobuf::RepeatedField { - &mut self.children - } - - // Take field - pub fn take_children( - &mut self, - ) -> ::protobuf::RepeatedField { - ::std::mem::replace(&mut self.children, ::protobuf::RepeatedField::new()) - } - - // repeated .tensorflow.TrackableObjectGraph.TrackableObject.SerializedTensor attributes = 2; - - pub fn get_attributes(&self) -> &[TrackableObjectGraph_TrackableObject_SerializedTensor] { - &self.attributes - } - pub fn clear_attributes(&mut self) { - self.attributes.clear(); - } - - // Param is passed by value, moved - pub fn set_attributes( - &mut self, - v: ::protobuf::RepeatedField, - ) { - self.attributes = v; - } - - // Mutable pointer to the field. - pub fn mut_attributes( - &mut self, - ) -> &mut ::protobuf::RepeatedField { - &mut self.attributes - } - - // Take field - pub fn take_attributes( - &mut self, - ) -> ::protobuf::RepeatedField { - ::std::mem::replace(&mut self.attributes, ::protobuf::RepeatedField::new()) - } - - // repeated .tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference slot_variables = 3; - - pub fn get_slot_variables( - &self, - ) -> &[TrackableObjectGraph_TrackableObject_SlotVariableReference] { - &self.slot_variables - } - pub fn clear_slot_variables(&mut self) { - self.slot_variables.clear(); - } - - // Param is passed by value, moved - pub fn set_slot_variables( - &mut self, - v: ::protobuf::RepeatedField, - ) { - self.slot_variables = v; - } - - // Mutable pointer to the field. - pub fn mut_slot_variables( - &mut self, - ) -> &mut ::protobuf::RepeatedField - { - &mut self.slot_variables - } - - // Take field - pub fn take_slot_variables( - &mut self, - ) -> ::protobuf::RepeatedField { - ::std::mem::replace(&mut self.slot_variables, ::protobuf::RepeatedField::new()) - } -} - -impl ::protobuf::Message for TrackableObjectGraph_TrackableObject { - fn is_initialized(&self) -> bool { - for v in &self.children { - if !v.is_initialized() { - return false; - } - } - for v in &self.attributes { - if !v.is_initialized() { - return false; - } - } - for v in &self.slot_variables { - if !v.is_initialized() { - return false; - } - } - true - } - - fn merge_from( - &mut self, - is: &mut ::protobuf::CodedInputStream<'_>, - ) -> ::protobuf::ProtobufResult<()> { - while !is.eof()? { - let (field_number, wire_type) = is.read_tag_unpack()?; - match field_number { - 1 => { - ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.children)?; - } - 2 => { - ::protobuf::rt::read_repeated_message_into( - wire_type, - is, - &mut self.attributes, - )?; - } - 3 => { - ::protobuf::rt::read_repeated_message_into( - wire_type, - is, - &mut self.slot_variables, - )?; - } - _ => { - ::protobuf::rt::read_unknown_or_skip_group( - field_number, - wire_type, - is, - self.mut_unknown_fields(), - )?; - } - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u32 { - let mut my_size = 0; - for value in &self.children { - let len = value.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - } - for value in &self.attributes { - let len = value.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - } - for value in &self.slot_variables { - let len = value.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - } - my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); - self.cached_size.set(my_size); - my_size - } - - fn write_to_with_cached_sizes( - &self, - os: &mut ::protobuf::CodedOutputStream<'_>, - ) -> ::protobuf::ProtobufResult<()> { - for v in &self.children { - os.write_tag(1, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - } - for v in &self.attributes { - os.write_tag(2, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - } - for v in &self.slot_variables { - os.write_tag(3, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - } - os.write_unknown_fields(self.get_unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn get_cached_size(&self) -> u32 { - self.cached_size.get() - } - - fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { - &self.unknown_fields - } - - fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { - &mut self.unknown_fields - } - - fn as_any(&self) -> &dyn (::std::any::Any) { - self as &dyn (::std::any::Any) - } - fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { - self as &mut dyn (::std::any::Any) - } - fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { - self - } - - fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - Self::descriptor_static() - } - - fn new() -> TrackableObjectGraph_TrackableObject { - TrackableObjectGraph_TrackableObject::new() - } - - fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = - ::protobuf::rt::LazyV2::INIT; - descriptor.get(|| { - let mut fields = ::std::vec::Vec::new(); - fields.push( - ::protobuf::reflect::accessor::make_repeated_field_accessor::< - _, - ::protobuf::types::ProtobufTypeMessage< - TrackableObjectGraph_TrackableObject_ObjectReference, - >, - >( - "children", - |m: &TrackableObjectGraph_TrackableObject| &m.children, - |m: &mut TrackableObjectGraph_TrackableObject| &mut m.children, - ), - ); - fields.push( - ::protobuf::reflect::accessor::make_repeated_field_accessor::< - _, - ::protobuf::types::ProtobufTypeMessage< - TrackableObjectGraph_TrackableObject_SerializedTensor, - >, - >( - "attributes", - |m: &TrackableObjectGraph_TrackableObject| &m.attributes, - |m: &mut TrackableObjectGraph_TrackableObject| &mut m.attributes, - ), - ); - fields.push( - ::protobuf::reflect::accessor::make_repeated_field_accessor::< - _, - ::protobuf::types::ProtobufTypeMessage< - TrackableObjectGraph_TrackableObject_SlotVariableReference, - >, - >( - "slot_variables", - |m: &TrackableObjectGraph_TrackableObject| &m.slot_variables, - |m: &mut TrackableObjectGraph_TrackableObject| &mut m.slot_variables, - ), - ); - ::protobuf::reflect::MessageDescriptor::new_pb_name::< - TrackableObjectGraph_TrackableObject, - >( - "TrackableObjectGraph.TrackableObject", - fields, - file_descriptor_proto(), - ) - }) - } - - fn default_instance() -> &'static TrackableObjectGraph_TrackableObject { - static instance: ::protobuf::rt::LazyV2 = - ::protobuf::rt::LazyV2::INIT; - instance.get(TrackableObjectGraph_TrackableObject::new) - } -} - -impl ::protobuf::Clear for TrackableObjectGraph_TrackableObject { - fn clear(&mut self) { - self.children.clear(); - self.attributes.clear(); - self.slot_variables.clear(); - self.unknown_fields.clear(); - } -} - -impl ::std::fmt::Debug for TrackableObjectGraph_TrackableObject { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for TrackableObjectGraph_TrackableObject { - fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { - ::protobuf::reflect::ReflectValueRef::Message(self) - } -} - -#[derive(PartialEq, Clone, Default)] -pub struct TrackableObjectGraph_TrackableObject_ObjectReference { - // message fields - pub node_id: i32, - pub local_name: ::std::string::String, - // special fields - pub unknown_fields: ::protobuf::UnknownFields, - pub cached_size: ::protobuf::CachedSize, -} - -impl<'a> ::std::default::Default for &'a TrackableObjectGraph_TrackableObject_ObjectReference { - fn default() -> &'a TrackableObjectGraph_TrackableObject_ObjectReference { - ::default_instance() - } -} - -impl TrackableObjectGraph_TrackableObject_ObjectReference { - pub fn new() -> TrackableObjectGraph_TrackableObject_ObjectReference { - ::std::default::Default::default() - } - - // int32 node_id = 1; - - pub fn get_node_id(&self) -> i32 { - self.node_id - } - pub fn clear_node_id(&mut self) { - self.node_id = 0; - } - - // Param is passed by value, moved - pub fn set_node_id(&mut self, v: i32) { - self.node_id = v; - } - - // string local_name = 2; - - pub fn get_local_name(&self) -> &str { - &self.local_name - } - pub fn clear_local_name(&mut self) { - self.local_name.clear(); - } - - // Param is passed by value, moved - pub fn set_local_name(&mut self, v: ::std::string::String) { - self.local_name = v; - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_local_name(&mut self) -> &mut ::std::string::String { - &mut self.local_name - } - - // Take field - pub fn take_local_name(&mut self) -> ::std::string::String { - ::std::mem::replace(&mut self.local_name, ::std::string::String::new()) - } -} - -impl ::protobuf::Message for TrackableObjectGraph_TrackableObject_ObjectReference { - fn is_initialized(&self) -> bool { - true - } - - fn merge_from( - &mut self, - is: &mut ::protobuf::CodedInputStream<'_>, - ) -> ::protobuf::ProtobufResult<()> { - while !is.eof()? { - let (field_number, wire_type) = is.read_tag_unpack()?; - match field_number { - 1 => { - if wire_type != ::protobuf::wire_format::WireTypeVarint { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type( - wire_type, - )); - } - let tmp = is.read_int32()?; - self.node_id = tmp; - } - 2 => { - ::protobuf::rt::read_singular_proto3_string_into( - wire_type, - is, - &mut self.local_name, - )?; - } - _ => { - ::protobuf::rt::read_unknown_or_skip_group( - field_number, - wire_type, - is, - self.mut_unknown_fields(), - )?; - } - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u32 { - let mut my_size = 0; - if self.node_id != 0 { - my_size += ::protobuf::rt::value_size( - 1, - self.node_id, - ::protobuf::wire_format::WireTypeVarint, - ); - } - if !self.local_name.is_empty() { - my_size += ::protobuf::rt::string_size(2, &self.local_name); - } - my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); - self.cached_size.set(my_size); - my_size - } - - fn write_to_with_cached_sizes( - &self, - os: &mut ::protobuf::CodedOutputStream<'_>, - ) -> ::protobuf::ProtobufResult<()> { - if self.node_id != 0 { - os.write_int32(1, self.node_id)?; - } - if !self.local_name.is_empty() { - os.write_string(2, &self.local_name)?; - } - os.write_unknown_fields(self.get_unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn get_cached_size(&self) -> u32 { - self.cached_size.get() - } - - fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { - &self.unknown_fields - } - - fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { - &mut self.unknown_fields - } - - fn as_any(&self) -> &dyn (::std::any::Any) { - self as &dyn (::std::any::Any) - } - fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { - self as &mut dyn (::std::any::Any) - } - fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { - self - } - - fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - Self::descriptor_static() - } - - fn new() -> TrackableObjectGraph_TrackableObject_ObjectReference { - TrackableObjectGraph_TrackableObject_ObjectReference::new() - } - - fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = - ::protobuf::rt::LazyV2::INIT; - descriptor.get(|| { - let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::< - _, - ::protobuf::types::ProtobufTypeInt32, - >( - "node_id", - |m: &TrackableObjectGraph_TrackableObject_ObjectReference| &m.node_id, - |m: &mut TrackableObjectGraph_TrackableObject_ObjectReference| &mut m.node_id, - )); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::< - _, - ::protobuf::types::ProtobufTypeString, - >( - "local_name", - |m: &TrackableObjectGraph_TrackableObject_ObjectReference| &m.local_name, - |m: &mut TrackableObjectGraph_TrackableObject_ObjectReference| &mut m.local_name, - )); - ::protobuf::reflect::MessageDescriptor::new_pb_name::< - TrackableObjectGraph_TrackableObject_ObjectReference, - >( - "TrackableObjectGraph.TrackableObject.ObjectReference", - fields, - file_descriptor_proto(), - ) - }) - } - - fn default_instance() -> &'static TrackableObjectGraph_TrackableObject_ObjectReference { - static instance: ::protobuf::rt::LazyV2< - TrackableObjectGraph_TrackableObject_ObjectReference, - > = ::protobuf::rt::LazyV2::INIT; - instance.get(TrackableObjectGraph_TrackableObject_ObjectReference::new) - } -} - -impl ::protobuf::Clear for TrackableObjectGraph_TrackableObject_ObjectReference { - fn clear(&mut self) { - self.node_id = 0; - self.local_name.clear(); - self.unknown_fields.clear(); - } -} - -impl ::std::fmt::Debug for TrackableObjectGraph_TrackableObject_ObjectReference { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for TrackableObjectGraph_TrackableObject_ObjectReference { - fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { - ::protobuf::reflect::ReflectValueRef::Message(self) - } -} - -#[derive(PartialEq, Clone, Default)] -pub struct TrackableObjectGraph_TrackableObject_SerializedTensor { - // message fields - pub name: ::std::string::String, - pub full_name: ::std::string::String, - pub checkpoint_key: ::std::string::String, - pub optional_restore: bool, - // special fields - pub unknown_fields: ::protobuf::UnknownFields, - pub cached_size: ::protobuf::CachedSize, -} - -impl<'a> ::std::default::Default for &'a TrackableObjectGraph_TrackableObject_SerializedTensor { - fn default() -> &'a TrackableObjectGraph_TrackableObject_SerializedTensor { - ::default_instance() - } -} - -impl TrackableObjectGraph_TrackableObject_SerializedTensor { - pub fn new() -> TrackableObjectGraph_TrackableObject_SerializedTensor { - ::std::default::Default::default() - } - - // string name = 1; - - pub fn get_name(&self) -> &str { - &self.name - } - pub fn clear_name(&mut self) { - self.name.clear(); - } - - // Param is passed by value, moved - pub fn set_name(&mut self, v: ::std::string::String) { - self.name = v; - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_name(&mut self) -> &mut ::std::string::String { - &mut self.name - } - - // Take field - pub fn take_name(&mut self) -> ::std::string::String { - ::std::mem::replace(&mut self.name, ::std::string::String::new()) - } - - // string full_name = 2; - - pub fn get_full_name(&self) -> &str { - &self.full_name - } - pub fn clear_full_name(&mut self) { - self.full_name.clear(); - } - - // Param is passed by value, moved - pub fn set_full_name(&mut self, v: ::std::string::String) { - self.full_name = v; - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_full_name(&mut self) -> &mut ::std::string::String { - &mut self.full_name - } - - // Take field - pub fn take_full_name(&mut self) -> ::std::string::String { - ::std::mem::replace(&mut self.full_name, ::std::string::String::new()) - } - - // string checkpoint_key = 3; - - pub fn get_checkpoint_key(&self) -> &str { - &self.checkpoint_key - } - pub fn clear_checkpoint_key(&mut self) { - self.checkpoint_key.clear(); - } - - // Param is passed by value, moved - pub fn set_checkpoint_key(&mut self, v: ::std::string::String) { - self.checkpoint_key = v; - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_checkpoint_key(&mut self) -> &mut ::std::string::String { - &mut self.checkpoint_key - } - - // Take field - pub fn take_checkpoint_key(&mut self) -> ::std::string::String { - ::std::mem::replace(&mut self.checkpoint_key, ::std::string::String::new()) - } - - // bool optional_restore = 4; - - pub fn get_optional_restore(&self) -> bool { - self.optional_restore - } - pub fn clear_optional_restore(&mut self) { - self.optional_restore = false; - } - - // Param is passed by value, moved - pub fn set_optional_restore(&mut self, v: bool) { - self.optional_restore = v; - } -} - -impl ::protobuf::Message for TrackableObjectGraph_TrackableObject_SerializedTensor { - fn is_initialized(&self) -> bool { - true - } - - fn merge_from( - &mut self, - is: &mut ::protobuf::CodedInputStream<'_>, - ) -> ::protobuf::ProtobufResult<()> { - while !is.eof()? { - let (field_number, wire_type) = is.read_tag_unpack()?; - match field_number { - 1 => { - ::protobuf::rt::read_singular_proto3_string_into( - wire_type, - is, - &mut self.name, - )?; - } - 2 => { - ::protobuf::rt::read_singular_proto3_string_into( - wire_type, - is, - &mut self.full_name, - )?; - } - 3 => { - ::protobuf::rt::read_singular_proto3_string_into( - wire_type, - is, - &mut self.checkpoint_key, - )?; - } - 4 => { - if wire_type != ::protobuf::wire_format::WireTypeVarint { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type( - wire_type, - )); - } - let tmp = is.read_bool()?; - self.optional_restore = tmp; - } - _ => { - ::protobuf::rt::read_unknown_or_skip_group( - field_number, - wire_type, - is, - self.mut_unknown_fields(), - )?; - } - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u32 { - let mut my_size = 0; - if !self.name.is_empty() { - my_size += ::protobuf::rt::string_size(1, &self.name); - } - if !self.full_name.is_empty() { - my_size += ::protobuf::rt::string_size(2, &self.full_name); - } - if !self.checkpoint_key.is_empty() { - my_size += ::protobuf::rt::string_size(3, &self.checkpoint_key); - } - if self.optional_restore != false { - my_size += 2; - } - my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); - self.cached_size.set(my_size); - my_size - } - - fn write_to_with_cached_sizes( - &self, - os: &mut ::protobuf::CodedOutputStream<'_>, - ) -> ::protobuf::ProtobufResult<()> { - if !self.name.is_empty() { - os.write_string(1, &self.name)?; - } - if !self.full_name.is_empty() { - os.write_string(2, &self.full_name)?; - } - if !self.checkpoint_key.is_empty() { - os.write_string(3, &self.checkpoint_key)?; - } - if self.optional_restore != false { - os.write_bool(4, self.optional_restore)?; - } - os.write_unknown_fields(self.get_unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn get_cached_size(&self) -> u32 { - self.cached_size.get() - } - - fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { - &self.unknown_fields - } - - fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { - &mut self.unknown_fields - } - - fn as_any(&self) -> &dyn (::std::any::Any) { - self as &dyn (::std::any::Any) - } - fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { - self as &mut dyn (::std::any::Any) - } - fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { - self - } - - fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - Self::descriptor_static() - } - - fn new() -> TrackableObjectGraph_TrackableObject_SerializedTensor { - TrackableObjectGraph_TrackableObject_SerializedTensor::new() - } - - fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = - ::protobuf::rt::LazyV2::INIT; - descriptor.get(|| { - let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::< - _, - ::protobuf::types::ProtobufTypeString, - >( - "name", - |m: &TrackableObjectGraph_TrackableObject_SerializedTensor| &m.name, - |m: &mut TrackableObjectGraph_TrackableObject_SerializedTensor| &mut m.name, - )); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::< - _, - ::protobuf::types::ProtobufTypeString, - >( - "full_name", - |m: &TrackableObjectGraph_TrackableObject_SerializedTensor| &m.full_name, - |m: &mut TrackableObjectGraph_TrackableObject_SerializedTensor| &mut m.full_name, - )); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::< - _, - ::protobuf::types::ProtobufTypeString, - >( - "checkpoint_key", - |m: &TrackableObjectGraph_TrackableObject_SerializedTensor| &m.checkpoint_key, - |m: &mut TrackableObjectGraph_TrackableObject_SerializedTensor| { - &mut m.checkpoint_key - }, - )); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::< - _, - ::protobuf::types::ProtobufTypeBool, - >( - "optional_restore", - |m: &TrackableObjectGraph_TrackableObject_SerializedTensor| &m.optional_restore, - |m: &mut TrackableObjectGraph_TrackableObject_SerializedTensor| { - &mut m.optional_restore - }, - )); - ::protobuf::reflect::MessageDescriptor::new_pb_name::< - TrackableObjectGraph_TrackableObject_SerializedTensor, - >( - "TrackableObjectGraph.TrackableObject.SerializedTensor", - fields, - file_descriptor_proto(), - ) - }) - } - - fn default_instance() -> &'static TrackableObjectGraph_TrackableObject_SerializedTensor { - static instance: ::protobuf::rt::LazyV2< - TrackableObjectGraph_TrackableObject_SerializedTensor, - > = ::protobuf::rt::LazyV2::INIT; - instance.get(TrackableObjectGraph_TrackableObject_SerializedTensor::new) - } -} - -impl ::protobuf::Clear for TrackableObjectGraph_TrackableObject_SerializedTensor { - fn clear(&mut self) { - self.name.clear(); - self.full_name.clear(); - self.checkpoint_key.clear(); - self.optional_restore = false; - self.unknown_fields.clear(); - } -} - -impl ::std::fmt::Debug for TrackableObjectGraph_TrackableObject_SerializedTensor { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for TrackableObjectGraph_TrackableObject_SerializedTensor { - fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { - ::protobuf::reflect::ReflectValueRef::Message(self) - } -} - -#[derive(PartialEq, Clone, Default)] -pub struct TrackableObjectGraph_TrackableObject_SlotVariableReference { - // message fields - pub original_variable_node_id: i32, - pub slot_name: ::std::string::String, - pub slot_variable_node_id: i32, - // special fields - pub unknown_fields: ::protobuf::UnknownFields, - pub cached_size: ::protobuf::CachedSize, -} - -impl<'a> ::std::default::Default - for &'a TrackableObjectGraph_TrackableObject_SlotVariableReference -{ - fn default() -> &'a TrackableObjectGraph_TrackableObject_SlotVariableReference { - ::default_instance() - } -} - -impl TrackableObjectGraph_TrackableObject_SlotVariableReference { - pub fn new() -> TrackableObjectGraph_TrackableObject_SlotVariableReference { - ::std::default::Default::default() - } - - // int32 original_variable_node_id = 1; - - pub fn get_original_variable_node_id(&self) -> i32 { - self.original_variable_node_id - } - pub fn clear_original_variable_node_id(&mut self) { - self.original_variable_node_id = 0; - } - - // Param is passed by value, moved - pub fn set_original_variable_node_id(&mut self, v: i32) { - self.original_variable_node_id = v; - } - - // string slot_name = 2; - - pub fn get_slot_name(&self) -> &str { - &self.slot_name - } - pub fn clear_slot_name(&mut self) { - self.slot_name.clear(); - } - - // Param is passed by value, moved - pub fn set_slot_name(&mut self, v: ::std::string::String) { - self.slot_name = v; - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_slot_name(&mut self) -> &mut ::std::string::String { - &mut self.slot_name - } - - // Take field - pub fn take_slot_name(&mut self) -> ::std::string::String { - ::std::mem::replace(&mut self.slot_name, ::std::string::String::new()) - } - - // int32 slot_variable_node_id = 3; - - pub fn get_slot_variable_node_id(&self) -> i32 { - self.slot_variable_node_id - } - pub fn clear_slot_variable_node_id(&mut self) { - self.slot_variable_node_id = 0; - } - - // Param is passed by value, moved - pub fn set_slot_variable_node_id(&mut self, v: i32) { - self.slot_variable_node_id = v; - } -} - -impl ::protobuf::Message for TrackableObjectGraph_TrackableObject_SlotVariableReference { - fn is_initialized(&self) -> bool { - true - } - - fn merge_from( - &mut self, - is: &mut ::protobuf::CodedInputStream<'_>, - ) -> ::protobuf::ProtobufResult<()> { - while !is.eof()? { - let (field_number, wire_type) = is.read_tag_unpack()?; - match field_number { - 1 => { - if wire_type != ::protobuf::wire_format::WireTypeVarint { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type( - wire_type, - )); - } - let tmp = is.read_int32()?; - self.original_variable_node_id = tmp; - } - 2 => { - ::protobuf::rt::read_singular_proto3_string_into( - wire_type, - is, - &mut self.slot_name, - )?; - } - 3 => { - if wire_type != ::protobuf::wire_format::WireTypeVarint { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type( - wire_type, - )); - } - let tmp = is.read_int32()?; - self.slot_variable_node_id = tmp; - } - _ => { - ::protobuf::rt::read_unknown_or_skip_group( - field_number, - wire_type, - is, - self.mut_unknown_fields(), - )?; - } - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u32 { - let mut my_size = 0; - if self.original_variable_node_id != 0 { - my_size += ::protobuf::rt::value_size( - 1, - self.original_variable_node_id, - ::protobuf::wire_format::WireTypeVarint, - ); - } - if !self.slot_name.is_empty() { - my_size += ::protobuf::rt::string_size(2, &self.slot_name); - } - if self.slot_variable_node_id != 0 { - my_size += ::protobuf::rt::value_size( - 3, - self.slot_variable_node_id, - ::protobuf::wire_format::WireTypeVarint, - ); - } - my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); - self.cached_size.set(my_size); - my_size - } - - fn write_to_with_cached_sizes( - &self, - os: &mut ::protobuf::CodedOutputStream<'_>, - ) -> ::protobuf::ProtobufResult<()> { - if self.original_variable_node_id != 0 { - os.write_int32(1, self.original_variable_node_id)?; - } - if !self.slot_name.is_empty() { - os.write_string(2, &self.slot_name)?; - } - if self.slot_variable_node_id != 0 { - os.write_int32(3, self.slot_variable_node_id)?; - } - os.write_unknown_fields(self.get_unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn get_cached_size(&self) -> u32 { - self.cached_size.get() - } - - fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { - &self.unknown_fields - } - - fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { - &mut self.unknown_fields - } - - fn as_any(&self) -> &dyn (::std::any::Any) { - self as &dyn (::std::any::Any) - } - fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { - self as &mut dyn (::std::any::Any) - } - fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { - self - } - - fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - Self::descriptor_static() - } - - fn new() -> TrackableObjectGraph_TrackableObject_SlotVariableReference { - TrackableObjectGraph_TrackableObject_SlotVariableReference::new() - } - - fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = - ::protobuf::rt::LazyV2::INIT; - descriptor.get(|| { - let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::< - _, - ::protobuf::types::ProtobufTypeInt32, - >( - "original_variable_node_id", - |m: &TrackableObjectGraph_TrackableObject_SlotVariableReference| { - &m.original_variable_node_id - }, - |m: &mut TrackableObjectGraph_TrackableObject_SlotVariableReference| { - &mut m.original_variable_node_id - }, - )); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::< - _, - ::protobuf::types::ProtobufTypeString, - >( - "slot_name", - |m: &TrackableObjectGraph_TrackableObject_SlotVariableReference| &m.slot_name, - |m: &mut TrackableObjectGraph_TrackableObject_SlotVariableReference| { - &mut m.slot_name - }, - )); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::< - _, - ::protobuf::types::ProtobufTypeInt32, - >( - "slot_variable_node_id", - |m: &TrackableObjectGraph_TrackableObject_SlotVariableReference| { - &m.slot_variable_node_id - }, - |m: &mut TrackableObjectGraph_TrackableObject_SlotVariableReference| { - &mut m.slot_variable_node_id - }, - )); - ::protobuf::reflect::MessageDescriptor::new_pb_name::< - TrackableObjectGraph_TrackableObject_SlotVariableReference, - >( - "TrackableObjectGraph.TrackableObject.SlotVariableReference", - fields, - file_descriptor_proto(), - ) - }) - } - - fn default_instance() -> &'static TrackableObjectGraph_TrackableObject_SlotVariableReference { - static instance: ::protobuf::rt::LazyV2< - TrackableObjectGraph_TrackableObject_SlotVariableReference, - > = ::protobuf::rt::LazyV2::INIT; - instance.get(TrackableObjectGraph_TrackableObject_SlotVariableReference::new) - } -} - -impl ::protobuf::Clear for TrackableObjectGraph_TrackableObject_SlotVariableReference { - fn clear(&mut self) { - self.original_variable_node_id = 0; - self.slot_name.clear(); - self.slot_variable_node_id = 0; - self.unknown_fields.clear(); - } -} - -impl ::std::fmt::Debug for TrackableObjectGraph_TrackableObject_SlotVariableReference { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue - for TrackableObjectGraph_TrackableObject_SlotVariableReference -{ - fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { - ::protobuf::reflect::ReflectValueRef::Message(self) - } -} - -static file_descriptor_proto_data: &'static [u8] = b"\ - \n5tensorflow/core/protobuf/trackable_object_graph.proto\x12\ntensorflow\ - \"\xaa\x06\n\x14TrackableObjectGraph\x12F\n\x05nodes\x18\x01\x20\x03(\ - \x0b20.tensorflow.TrackableObjectGraph.TrackableObjectR\x05nodes\x1a\xc9\ - \x05\n\x0fTrackableObject\x12\\\n\x08children\x18\x01\x20\x03(\x0b2@.ten\ - sorflow.TrackableObjectGraph.TrackableObject.ObjectReferenceR\x08childre\ - n\x12a\n\nattributes\x18\x02\x20\x03(\x0b2A.tensorflow.TrackableObjectGr\ - aph.TrackableObject.SerializedTensorR\nattributes\x12m\n\x0eslot_variabl\ - es\x18\x03\x20\x03(\x0b2F.tensorflow.TrackableObjectGraph.TrackableObjec\ - t.SlotVariableReferenceR\rslotVariables\x1aI\n\x0fObjectReference\x12\ - \x17\n\x07node_id\x18\x01\x20\x01(\x05R\x06nodeId\x12\x1d\n\nlocal_name\ - \x18\x02\x20\x01(\tR\tlocalName\x1a\x95\x01\n\x10SerializedTensor\x12\ - \x12\n\x04name\x18\x01\x20\x01(\tR\x04name\x12\x1b\n\tfull_name\x18\x02\ - \x20\x01(\tR\x08fullName\x12%\n\x0echeckpoint_key\x18\x03\x20\x01(\tR\rc\ - heckpointKey\x12)\n\x10optional_restore\x18\x04\x20\x01(\x08R\x0foptiona\ - lRestore\x1a\xa2\x01\n\x15SlotVariableReference\x129\n\x19original_varia\ - ble_node_id\x18\x01\x20\x01(\x05R\x16originalVariableNodeId\x12\x1b\n\ts\ - lot_name\x18\x02\x20\x01(\tR\x08slotName\x121\n\x15slot_variable_node_id\ - \x18\x03\x20\x01(\x05R\x12slotVariableNodeIdB\x03\xf8\x01\x01b\x06proto3\ -"; - -static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2< - ::protobuf::descriptor::FileDescriptorProto, -> = ::protobuf::rt::LazyV2::INIT; - -fn parse_descriptor_proto() -> ::protobuf::descriptor::FileDescriptorProto { - ::protobuf::parse_from_bytes(file_descriptor_proto_data).unwrap() -} - -pub fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto { - file_descriptor_proto_lazy.get(|| parse_descriptor_proto()) -} diff --git a/src/protos/types.rs b/src/protos/types.rs deleted file mode 100644 index fb8ad7b2e8..0000000000 --- a/src/protos/types.rs +++ /dev/null @@ -1,250 +0,0 @@ -// This file is generated by rust-protobuf 2.17.0. Do not edit -// @generated - -// https://github.com/rust-lang/rust-clippy/issues/702 -#![allow(unknown_lints)] -#![allow(clippy::all)] - -#![allow(unused_attributes)] -#![rustfmt::skip] - -#![allow(box_pointers)] -#![allow(dead_code)] -#![allow(missing_docs)] -#![allow(non_camel_case_types)] -#![allow(non_snake_case)] -#![allow(non_upper_case_globals)] -#![allow(trivial_casts)] -#![allow(unused_imports)] -#![allow(unused_results)] -//! Generated file from `tensorflow/core/framework/types.proto` - -/// Generated files are compatible only with the same version -/// of protobuf runtime. -// const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_17_0; - -#[derive(Clone, PartialEq, Eq, Debug, Hash)] -pub enum DataType { - DT_INVALID = 0, - DT_FLOAT = 1, - DT_DOUBLE = 2, - DT_INT32 = 3, - DT_UINT8 = 4, - DT_INT16 = 5, - DT_INT8 = 6, - DT_STRING = 7, - DT_COMPLEX64 = 8, - DT_INT64 = 9, - DT_BOOL = 10, - DT_QINT8 = 11, - DT_QUINT8 = 12, - DT_QINT32 = 13, - DT_BFLOAT16 = 14, - DT_QINT16 = 15, - DT_QUINT16 = 16, - DT_UINT16 = 17, - DT_COMPLEX128 = 18, - DT_HALF = 19, - DT_RESOURCE = 20, - DT_VARIANT = 21, - DT_UINT32 = 22, - DT_UINT64 = 23, - DT_FLOAT_REF = 101, - DT_DOUBLE_REF = 102, - DT_INT32_REF = 103, - DT_UINT8_REF = 104, - DT_INT16_REF = 105, - DT_INT8_REF = 106, - DT_STRING_REF = 107, - DT_COMPLEX64_REF = 108, - DT_INT64_REF = 109, - DT_BOOL_REF = 110, - DT_QINT8_REF = 111, - DT_QUINT8_REF = 112, - DT_QINT32_REF = 113, - DT_BFLOAT16_REF = 114, - DT_QINT16_REF = 115, - DT_QUINT16_REF = 116, - DT_UINT16_REF = 117, - DT_COMPLEX128_REF = 118, - DT_HALF_REF = 119, - DT_RESOURCE_REF = 120, - DT_VARIANT_REF = 121, - DT_UINT32_REF = 122, - DT_UINT64_REF = 123, -} - -impl ::protobuf::ProtobufEnum for DataType { - fn value(&self) -> i32 { - *self as i32 - } - - fn from_i32(value: i32) -> ::std::option::Option { - match value { - 0 => ::std::option::Option::Some(DataType::DT_INVALID), - 1 => ::std::option::Option::Some(DataType::DT_FLOAT), - 2 => ::std::option::Option::Some(DataType::DT_DOUBLE), - 3 => ::std::option::Option::Some(DataType::DT_INT32), - 4 => ::std::option::Option::Some(DataType::DT_UINT8), - 5 => ::std::option::Option::Some(DataType::DT_INT16), - 6 => ::std::option::Option::Some(DataType::DT_INT8), - 7 => ::std::option::Option::Some(DataType::DT_STRING), - 8 => ::std::option::Option::Some(DataType::DT_COMPLEX64), - 9 => ::std::option::Option::Some(DataType::DT_INT64), - 10 => ::std::option::Option::Some(DataType::DT_BOOL), - 11 => ::std::option::Option::Some(DataType::DT_QINT8), - 12 => ::std::option::Option::Some(DataType::DT_QUINT8), - 13 => ::std::option::Option::Some(DataType::DT_QINT32), - 14 => ::std::option::Option::Some(DataType::DT_BFLOAT16), - 15 => ::std::option::Option::Some(DataType::DT_QINT16), - 16 => ::std::option::Option::Some(DataType::DT_QUINT16), - 17 => ::std::option::Option::Some(DataType::DT_UINT16), - 18 => ::std::option::Option::Some(DataType::DT_COMPLEX128), - 19 => ::std::option::Option::Some(DataType::DT_HALF), - 20 => ::std::option::Option::Some(DataType::DT_RESOURCE), - 21 => ::std::option::Option::Some(DataType::DT_VARIANT), - 22 => ::std::option::Option::Some(DataType::DT_UINT32), - 23 => ::std::option::Option::Some(DataType::DT_UINT64), - 101 => ::std::option::Option::Some(DataType::DT_FLOAT_REF), - 102 => ::std::option::Option::Some(DataType::DT_DOUBLE_REF), - 103 => ::std::option::Option::Some(DataType::DT_INT32_REF), - 104 => ::std::option::Option::Some(DataType::DT_UINT8_REF), - 105 => ::std::option::Option::Some(DataType::DT_INT16_REF), - 106 => ::std::option::Option::Some(DataType::DT_INT8_REF), - 107 => ::std::option::Option::Some(DataType::DT_STRING_REF), - 108 => ::std::option::Option::Some(DataType::DT_COMPLEX64_REF), - 109 => ::std::option::Option::Some(DataType::DT_INT64_REF), - 110 => ::std::option::Option::Some(DataType::DT_BOOL_REF), - 111 => ::std::option::Option::Some(DataType::DT_QINT8_REF), - 112 => ::std::option::Option::Some(DataType::DT_QUINT8_REF), - 113 => ::std::option::Option::Some(DataType::DT_QINT32_REF), - 114 => ::std::option::Option::Some(DataType::DT_BFLOAT16_REF), - 115 => ::std::option::Option::Some(DataType::DT_QINT16_REF), - 116 => ::std::option::Option::Some(DataType::DT_QUINT16_REF), - 117 => ::std::option::Option::Some(DataType::DT_UINT16_REF), - 118 => ::std::option::Option::Some(DataType::DT_COMPLEX128_REF), - 119 => ::std::option::Option::Some(DataType::DT_HALF_REF), - 120 => ::std::option::Option::Some(DataType::DT_RESOURCE_REF), - 121 => ::std::option::Option::Some(DataType::DT_VARIANT_REF), - 122 => ::std::option::Option::Some(DataType::DT_UINT32_REF), - 123 => ::std::option::Option::Some(DataType::DT_UINT64_REF), - _ => ::std::option::Option::None, - } - } - - fn values() -> &'static [Self] { - static values: &'static [DataType] = &[ - DataType::DT_INVALID, - DataType::DT_FLOAT, - DataType::DT_DOUBLE, - DataType::DT_INT32, - DataType::DT_UINT8, - DataType::DT_INT16, - DataType::DT_INT8, - DataType::DT_STRING, - DataType::DT_COMPLEX64, - DataType::DT_INT64, - DataType::DT_BOOL, - DataType::DT_QINT8, - DataType::DT_QUINT8, - DataType::DT_QINT32, - DataType::DT_BFLOAT16, - DataType::DT_QINT16, - DataType::DT_QUINT16, - DataType::DT_UINT16, - DataType::DT_COMPLEX128, - DataType::DT_HALF, - DataType::DT_RESOURCE, - DataType::DT_VARIANT, - DataType::DT_UINT32, - DataType::DT_UINT64, - DataType::DT_FLOAT_REF, - DataType::DT_DOUBLE_REF, - DataType::DT_INT32_REF, - DataType::DT_UINT8_REF, - DataType::DT_INT16_REF, - DataType::DT_INT8_REF, - DataType::DT_STRING_REF, - DataType::DT_COMPLEX64_REF, - DataType::DT_INT64_REF, - DataType::DT_BOOL_REF, - DataType::DT_QINT8_REF, - DataType::DT_QUINT8_REF, - DataType::DT_QINT32_REF, - DataType::DT_BFLOAT16_REF, - DataType::DT_QINT16_REF, - DataType::DT_QUINT16_REF, - DataType::DT_UINT16_REF, - DataType::DT_COMPLEX128_REF, - DataType::DT_HALF_REF, - DataType::DT_RESOURCE_REF, - DataType::DT_VARIANT_REF, - DataType::DT_UINT32_REF, - DataType::DT_UINT64_REF, - ]; - values - } - - fn enum_descriptor_static() -> &'static ::protobuf::reflect::EnumDescriptor { - static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::EnumDescriptor> = - ::protobuf::rt::LazyV2::INIT; - descriptor.get(|| { - ::protobuf::reflect::EnumDescriptor::new_pb_name::( - "DataType", - file_descriptor_proto(), - ) - }) - } -} - -impl ::std::marker::Copy for DataType {} - -impl ::std::default::Default for DataType { - fn default() -> Self { - DataType::DT_INVALID - } -} - -impl ::protobuf::reflect::ProtobufValue for DataType { - fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { - ::protobuf::reflect::ReflectValueRef::Enum(::protobuf::ProtobufEnum::descriptor(self)) - } -} - -static file_descriptor_proto_data: &'static [u8] = b"\ - \n%tensorflow/core/framework/types.proto\x12\ntensorflow*\xaa\x06\n\x08D\ - ataType\x12\x0e\n\nDT_INVALID\x10\0\x12\x0c\n\x08DT_FLOAT\x10\x01\x12\r\ - \n\tDT_DOUBLE\x10\x02\x12\x0c\n\x08DT_INT32\x10\x03\x12\x0c\n\x08DT_UINT\ - 8\x10\x04\x12\x0c\n\x08DT_INT16\x10\x05\x12\x0b\n\x07DT_INT8\x10\x06\x12\ - \r\n\tDT_STRING\x10\x07\x12\x10\n\x0cDT_COMPLEX64\x10\x08\x12\x0c\n\x08D\ - T_INT64\x10\t\x12\x0b\n\x07DT_BOOL\x10\n\x12\x0c\n\x08DT_QINT8\x10\x0b\ - \x12\r\n\tDT_QUINT8\x10\x0c\x12\r\n\tDT_QINT32\x10\r\x12\x0f\n\x0bDT_BFL\ - OAT16\x10\x0e\x12\r\n\tDT_QINT16\x10\x0f\x12\x0e\n\nDT_QUINT16\x10\x10\ - \x12\r\n\tDT_UINT16\x10\x11\x12\x11\n\rDT_COMPLEX128\x10\x12\x12\x0b\n\ - \x07DT_HALF\x10\x13\x12\x0f\n\x0bDT_RESOURCE\x10\x14\x12\x0e\n\nDT_VARIA\ - NT\x10\x15\x12\r\n\tDT_UINT32\x10\x16\x12\r\n\tDT_UINT64\x10\x17\x12\x10\ - \n\x0cDT_FLOAT_REF\x10e\x12\x11\n\rDT_DOUBLE_REF\x10f\x12\x10\n\x0cDT_IN\ - T32_REF\x10g\x12\x10\n\x0cDT_UINT8_REF\x10h\x12\x10\n\x0cDT_INT16_REF\ - \x10i\x12\x0f\n\x0bDT_INT8_REF\x10j\x12\x11\n\rDT_STRING_REF\x10k\x12\ - \x14\n\x10DT_COMPLEX64_REF\x10l\x12\x10\n\x0cDT_INT64_REF\x10m\x12\x0f\n\ - \x0bDT_BOOL_REF\x10n\x12\x10\n\x0cDT_QINT8_REF\x10o\x12\x11\n\rDT_QUINT8\ - _REF\x10p\x12\x11\n\rDT_QINT32_REF\x10q\x12\x13\n\x0fDT_BFLOAT16_REF\x10\ - r\x12\x11\n\rDT_QINT16_REF\x10s\x12\x12\n\x0eDT_QUINT16_REF\x10t\x12\x11\ - \n\rDT_UINT16_REF\x10u\x12\x15\n\x11DT_COMPLEX128_REF\x10v\x12\x0f\n\x0b\ - DT_HALF_REF\x10w\x12\x13\n\x0fDT_RESOURCE_REF\x10x\x12\x12\n\x0eDT_VARIA\ - NT_REF\x10y\x12\x11\n\rDT_UINT32_REF\x10z\x12\x11\n\rDT_UINT64_REF\x10{B\ - k\n\x18org.tensorflow.frameworkB\x0bTypesProtosP\x01Z=github.com/tensorf\ - low/tensorflow/tensorflow/go/core/framework\xf8\x01\x01b\x06proto3\ -"; - -static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2< - ::protobuf::descriptor::FileDescriptorProto, -> = ::protobuf::rt::LazyV2::INIT; - -fn parse_descriptor_proto() -> ::protobuf::descriptor::FileDescriptorProto { - ::protobuf::parse_from_bytes(file_descriptor_proto_data).unwrap() -} - -pub fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto { - file_descriptor_proto_lazy.get(|| parse_descriptor_proto()) -} diff --git a/src/protos/variable.rs b/src/protos/variable.rs deleted file mode 100644 index 67110204cf..0000000000 --- a/src/protos/variable.rs +++ /dev/null @@ -1,1041 +0,0 @@ -// This file is generated by rust-protobuf 2.17.0. Do not edit -// @generated - -// https://github.com/rust-lang/rust-clippy/issues/702 -#![allow(unknown_lints)] -#![allow(clippy::all)] - -#![allow(unused_attributes)] -#![rustfmt::skip] - -#![allow(box_pointers)] -#![allow(dead_code)] -#![allow(missing_docs)] -#![allow(non_camel_case_types)] -#![allow(non_snake_case)] -#![allow(non_upper_case_globals)] -#![allow(trivial_casts)] -#![allow(unused_imports)] -#![allow(unused_results)] -//! Generated file from `tensorflow/core/framework/variable.proto` - -/// Generated files are compatible only with the same version -/// of protobuf runtime. -// const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_17_0; - -#[derive(PartialEq, Clone, Default)] -pub struct VariableDef { - // message fields - pub variable_name: ::std::string::String, - pub initial_value_name: ::std::string::String, - pub initializer_name: ::std::string::String, - pub snapshot_name: ::std::string::String, - pub save_slice_info_def: ::protobuf::SingularPtrField, - pub is_resource: bool, - pub trainable: bool, - pub synchronization: VariableSynchronization, - pub aggregation: VariableAggregation, - // special fields - pub unknown_fields: ::protobuf::UnknownFields, - pub cached_size: ::protobuf::CachedSize, -} - -impl<'a> ::std::default::Default for &'a VariableDef { - fn default() -> &'a VariableDef { - ::default_instance() - } -} - -impl VariableDef { - pub fn new() -> VariableDef { - ::std::default::Default::default() - } - - // string variable_name = 1; - - pub fn get_variable_name(&self) -> &str { - &self.variable_name - } - pub fn clear_variable_name(&mut self) { - self.variable_name.clear(); - } - - // Param is passed by value, moved - pub fn set_variable_name(&mut self, v: ::std::string::String) { - self.variable_name = v; - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_variable_name(&mut self) -> &mut ::std::string::String { - &mut self.variable_name - } - - // Take field - pub fn take_variable_name(&mut self) -> ::std::string::String { - ::std::mem::replace(&mut self.variable_name, ::std::string::String::new()) - } - - // string initial_value_name = 6; - - pub fn get_initial_value_name(&self) -> &str { - &self.initial_value_name - } - pub fn clear_initial_value_name(&mut self) { - self.initial_value_name.clear(); - } - - // Param is passed by value, moved - pub fn set_initial_value_name(&mut self, v: ::std::string::String) { - self.initial_value_name = v; - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_initial_value_name(&mut self) -> &mut ::std::string::String { - &mut self.initial_value_name - } - - // Take field - pub fn take_initial_value_name(&mut self) -> ::std::string::String { - ::std::mem::replace(&mut self.initial_value_name, ::std::string::String::new()) - } - - // string initializer_name = 2; - - pub fn get_initializer_name(&self) -> &str { - &self.initializer_name - } - pub fn clear_initializer_name(&mut self) { - self.initializer_name.clear(); - } - - // Param is passed by value, moved - pub fn set_initializer_name(&mut self, v: ::std::string::String) { - self.initializer_name = v; - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_initializer_name(&mut self) -> &mut ::std::string::String { - &mut self.initializer_name - } - - // Take field - pub fn take_initializer_name(&mut self) -> ::std::string::String { - ::std::mem::replace(&mut self.initializer_name, ::std::string::String::new()) - } - - // string snapshot_name = 3; - - pub fn get_snapshot_name(&self) -> &str { - &self.snapshot_name - } - pub fn clear_snapshot_name(&mut self) { - self.snapshot_name.clear(); - } - - // Param is passed by value, moved - pub fn set_snapshot_name(&mut self, v: ::std::string::String) { - self.snapshot_name = v; - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_snapshot_name(&mut self) -> &mut ::std::string::String { - &mut self.snapshot_name - } - - // Take field - pub fn take_snapshot_name(&mut self) -> ::std::string::String { - ::std::mem::replace(&mut self.snapshot_name, ::std::string::String::new()) - } - - // .tensorflow.SaveSliceInfoDef save_slice_info_def = 4; - - pub fn get_save_slice_info_def(&self) -> &SaveSliceInfoDef { - self.save_slice_info_def - .as_ref() - .unwrap_or_else(|| ::default_instance()) - } - pub fn clear_save_slice_info_def(&mut self) { - self.save_slice_info_def.clear(); - } - - pub fn has_save_slice_info_def(&self) -> bool { - self.save_slice_info_def.is_some() - } - - // Param is passed by value, moved - pub fn set_save_slice_info_def(&mut self, v: SaveSliceInfoDef) { - self.save_slice_info_def = ::protobuf::SingularPtrField::some(v); - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_save_slice_info_def(&mut self) -> &mut SaveSliceInfoDef { - if self.save_slice_info_def.is_none() { - self.save_slice_info_def.set_default(); - } - self.save_slice_info_def.as_mut().unwrap() - } - - // Take field - pub fn take_save_slice_info_def(&mut self) -> SaveSliceInfoDef { - self.save_slice_info_def - .take() - .unwrap_or_else(|| SaveSliceInfoDef::new()) - } - - // bool is_resource = 5; - - pub fn get_is_resource(&self) -> bool { - self.is_resource - } - pub fn clear_is_resource(&mut self) { - self.is_resource = false; - } - - // Param is passed by value, moved - pub fn set_is_resource(&mut self, v: bool) { - self.is_resource = v; - } - - // bool trainable = 7; - - pub fn get_trainable(&self) -> bool { - self.trainable - } - pub fn clear_trainable(&mut self) { - self.trainable = false; - } - - // Param is passed by value, moved - pub fn set_trainable(&mut self, v: bool) { - self.trainable = v; - } - - // .tensorflow.VariableSynchronization synchronization = 8; - - pub fn get_synchronization(&self) -> VariableSynchronization { - self.synchronization - } - pub fn clear_synchronization(&mut self) { - self.synchronization = VariableSynchronization::VARIABLE_SYNCHRONIZATION_AUTO; - } - - // Param is passed by value, moved - pub fn set_synchronization(&mut self, v: VariableSynchronization) { - self.synchronization = v; - } - - // .tensorflow.VariableAggregation aggregation = 9; - - pub fn get_aggregation(&self) -> VariableAggregation { - self.aggregation - } - pub fn clear_aggregation(&mut self) { - self.aggregation = VariableAggregation::VARIABLE_AGGREGATION_NONE; - } - - // Param is passed by value, moved - pub fn set_aggregation(&mut self, v: VariableAggregation) { - self.aggregation = v; - } -} - -impl ::protobuf::Message for VariableDef { - fn is_initialized(&self) -> bool { - for v in &self.save_slice_info_def { - if !v.is_initialized() { - return false; - } - } - true - } - - fn merge_from( - &mut self, - is: &mut ::protobuf::CodedInputStream<'_>, - ) -> ::protobuf::ProtobufResult<()> { - while !is.eof()? { - let (field_number, wire_type) = is.read_tag_unpack()?; - match field_number { - 1 => { - ::protobuf::rt::read_singular_proto3_string_into( - wire_type, - is, - &mut self.variable_name, - )?; - } - 6 => { - ::protobuf::rt::read_singular_proto3_string_into( - wire_type, - is, - &mut self.initial_value_name, - )?; - } - 2 => { - ::protobuf::rt::read_singular_proto3_string_into( - wire_type, - is, - &mut self.initializer_name, - )?; - } - 3 => { - ::protobuf::rt::read_singular_proto3_string_into( - wire_type, - is, - &mut self.snapshot_name, - )?; - } - 4 => { - ::protobuf::rt::read_singular_message_into( - wire_type, - is, - &mut self.save_slice_info_def, - )?; - } - 5 => { - if wire_type != ::protobuf::wire_format::WireTypeVarint { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type( - wire_type, - )); - } - let tmp = is.read_bool()?; - self.is_resource = tmp; - } - 7 => { - if wire_type != ::protobuf::wire_format::WireTypeVarint { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type( - wire_type, - )); - } - let tmp = is.read_bool()?; - self.trainable = tmp; - } - 8 => ::protobuf::rt::read_proto3_enum_with_unknown_fields_into( - wire_type, - is, - &mut self.synchronization, - 8, - &mut self.unknown_fields, - )?, - 9 => ::protobuf::rt::read_proto3_enum_with_unknown_fields_into( - wire_type, - is, - &mut self.aggregation, - 9, - &mut self.unknown_fields, - )?, - _ => { - ::protobuf::rt::read_unknown_or_skip_group( - field_number, - wire_type, - is, - self.mut_unknown_fields(), - )?; - } - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u32 { - let mut my_size = 0; - if !self.variable_name.is_empty() { - my_size += ::protobuf::rt::string_size(1, &self.variable_name); - } - if !self.initial_value_name.is_empty() { - my_size += ::protobuf::rt::string_size(6, &self.initial_value_name); - } - if !self.initializer_name.is_empty() { - my_size += ::protobuf::rt::string_size(2, &self.initializer_name); - } - if !self.snapshot_name.is_empty() { - my_size += ::protobuf::rt::string_size(3, &self.snapshot_name); - } - if let Some(ref v) = self.save_slice_info_def.as_ref() { - let len = v.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - } - if self.is_resource != false { - my_size += 2; - } - if self.trainable != false { - my_size += 2; - } - if self.synchronization != VariableSynchronization::VARIABLE_SYNCHRONIZATION_AUTO { - my_size += ::protobuf::rt::enum_size(8, self.synchronization); - } - if self.aggregation != VariableAggregation::VARIABLE_AGGREGATION_NONE { - my_size += ::protobuf::rt::enum_size(9, self.aggregation); - } - my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); - self.cached_size.set(my_size); - my_size - } - - fn write_to_with_cached_sizes( - &self, - os: &mut ::protobuf::CodedOutputStream<'_>, - ) -> ::protobuf::ProtobufResult<()> { - if !self.variable_name.is_empty() { - os.write_string(1, &self.variable_name)?; - } - if !self.initial_value_name.is_empty() { - os.write_string(6, &self.initial_value_name)?; - } - if !self.initializer_name.is_empty() { - os.write_string(2, &self.initializer_name)?; - } - if !self.snapshot_name.is_empty() { - os.write_string(3, &self.snapshot_name)?; - } - if let Some(ref v) = self.save_slice_info_def.as_ref() { - os.write_tag(4, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - } - if self.is_resource != false { - os.write_bool(5, self.is_resource)?; - } - if self.trainable != false { - os.write_bool(7, self.trainable)?; - } - if self.synchronization != VariableSynchronization::VARIABLE_SYNCHRONIZATION_AUTO { - os.write_enum(8, ::protobuf::ProtobufEnum::value(&self.synchronization))?; - } - if self.aggregation != VariableAggregation::VARIABLE_AGGREGATION_NONE { - os.write_enum(9, ::protobuf::ProtobufEnum::value(&self.aggregation))?; - } - os.write_unknown_fields(self.get_unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn get_cached_size(&self) -> u32 { - self.cached_size.get() - } - - fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { - &self.unknown_fields - } - - fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { - &mut self.unknown_fields - } - - fn as_any(&self) -> &dyn (::std::any::Any) { - self as &dyn (::std::any::Any) - } - fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { - self as &mut dyn (::std::any::Any) - } - fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { - self - } - - fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - Self::descriptor_static() - } - - fn new() -> VariableDef { - VariableDef::new() - } - - fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = - ::protobuf::rt::LazyV2::INIT; - descriptor.get(|| { - let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::< - _, - ::protobuf::types::ProtobufTypeString, - >( - "variable_name", - |m: &VariableDef| &m.variable_name, - |m: &mut VariableDef| &mut m.variable_name, - )); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::< - _, - ::protobuf::types::ProtobufTypeString, - >( - "initial_value_name", - |m: &VariableDef| &m.initial_value_name, - |m: &mut VariableDef| &mut m.initial_value_name, - )); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::< - _, - ::protobuf::types::ProtobufTypeString, - >( - "initializer_name", - |m: &VariableDef| &m.initializer_name, - |m: &mut VariableDef| &mut m.initializer_name, - )); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::< - _, - ::protobuf::types::ProtobufTypeString, - >( - "snapshot_name", - |m: &VariableDef| &m.snapshot_name, - |m: &mut VariableDef| &mut m.snapshot_name, - )); - fields.push( - ::protobuf::reflect::accessor::make_singular_ptr_field_accessor::< - _, - ::protobuf::types::ProtobufTypeMessage, - >( - "save_slice_info_def", - |m: &VariableDef| &m.save_slice_info_def, - |m: &mut VariableDef| &mut m.save_slice_info_def, - ), - ); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::< - _, - ::protobuf::types::ProtobufTypeBool, - >( - "is_resource", - |m: &VariableDef| &m.is_resource, - |m: &mut VariableDef| &mut m.is_resource, - )); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::< - _, - ::protobuf::types::ProtobufTypeBool, - >( - "trainable", - |m: &VariableDef| &m.trainable, - |m: &mut VariableDef| &mut m.trainable, - )); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::< - _, - ::protobuf::types::ProtobufTypeEnum, - >( - "synchronization", - |m: &VariableDef| &m.synchronization, - |m: &mut VariableDef| &mut m.synchronization, - )); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::< - _, - ::protobuf::types::ProtobufTypeEnum, - >( - "aggregation", - |m: &VariableDef| &m.aggregation, - |m: &mut VariableDef| &mut m.aggregation, - )); - ::protobuf::reflect::MessageDescriptor::new_pb_name::( - "VariableDef", - fields, - file_descriptor_proto(), - ) - }) - } - - fn default_instance() -> &'static VariableDef { - static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; - instance.get(VariableDef::new) - } -} - -impl ::protobuf::Clear for VariableDef { - fn clear(&mut self) { - self.variable_name.clear(); - self.initial_value_name.clear(); - self.initializer_name.clear(); - self.snapshot_name.clear(); - self.save_slice_info_def.clear(); - self.is_resource = false; - self.trainable = false; - self.synchronization = VariableSynchronization::VARIABLE_SYNCHRONIZATION_AUTO; - self.aggregation = VariableAggregation::VARIABLE_AGGREGATION_NONE; - self.unknown_fields.clear(); - } -} - -impl ::std::fmt::Debug for VariableDef { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for VariableDef { - fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { - ::protobuf::reflect::ReflectValueRef::Message(self) - } -} - -#[derive(PartialEq, Clone, Default)] -pub struct SaveSliceInfoDef { - // message fields - pub full_name: ::std::string::String, - pub full_shape: ::std::vec::Vec, - pub var_offset: ::std::vec::Vec, - pub var_shape: ::std::vec::Vec, - // special fields - pub unknown_fields: ::protobuf::UnknownFields, - pub cached_size: ::protobuf::CachedSize, -} - -impl<'a> ::std::default::Default for &'a SaveSliceInfoDef { - fn default() -> &'a SaveSliceInfoDef { - ::default_instance() - } -} - -impl SaveSliceInfoDef { - pub fn new() -> SaveSliceInfoDef { - ::std::default::Default::default() - } - - // string full_name = 1; - - pub fn get_full_name(&self) -> &str { - &self.full_name - } - pub fn clear_full_name(&mut self) { - self.full_name.clear(); - } - - // Param is passed by value, moved - pub fn set_full_name(&mut self, v: ::std::string::String) { - self.full_name = v; - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_full_name(&mut self) -> &mut ::std::string::String { - &mut self.full_name - } - - // Take field - pub fn take_full_name(&mut self) -> ::std::string::String { - ::std::mem::replace(&mut self.full_name, ::std::string::String::new()) - } - - // repeated int64 full_shape = 2; - - pub fn get_full_shape(&self) -> &[i64] { - &self.full_shape - } - pub fn clear_full_shape(&mut self) { - self.full_shape.clear(); - } - - // Param is passed by value, moved - pub fn set_full_shape(&mut self, v: ::std::vec::Vec) { - self.full_shape = v; - } - - // Mutable pointer to the field. - pub fn mut_full_shape(&mut self) -> &mut ::std::vec::Vec { - &mut self.full_shape - } - - // Take field - pub fn take_full_shape(&mut self) -> ::std::vec::Vec { - ::std::mem::replace(&mut self.full_shape, ::std::vec::Vec::new()) - } - - // repeated int64 var_offset = 3; - - pub fn get_var_offset(&self) -> &[i64] { - &self.var_offset - } - pub fn clear_var_offset(&mut self) { - self.var_offset.clear(); - } - - // Param is passed by value, moved - pub fn set_var_offset(&mut self, v: ::std::vec::Vec) { - self.var_offset = v; - } - - // Mutable pointer to the field. - pub fn mut_var_offset(&mut self) -> &mut ::std::vec::Vec { - &mut self.var_offset - } - - // Take field - pub fn take_var_offset(&mut self) -> ::std::vec::Vec { - ::std::mem::replace(&mut self.var_offset, ::std::vec::Vec::new()) - } - - // repeated int64 var_shape = 4; - - pub fn get_var_shape(&self) -> &[i64] { - &self.var_shape - } - pub fn clear_var_shape(&mut self) { - self.var_shape.clear(); - } - - // Param is passed by value, moved - pub fn set_var_shape(&mut self, v: ::std::vec::Vec) { - self.var_shape = v; - } - - // Mutable pointer to the field. - pub fn mut_var_shape(&mut self) -> &mut ::std::vec::Vec { - &mut self.var_shape - } - - // Take field - pub fn take_var_shape(&mut self) -> ::std::vec::Vec { - ::std::mem::replace(&mut self.var_shape, ::std::vec::Vec::new()) - } -} - -impl ::protobuf::Message for SaveSliceInfoDef { - fn is_initialized(&self) -> bool { - true - } - - fn merge_from( - &mut self, - is: &mut ::protobuf::CodedInputStream<'_>, - ) -> ::protobuf::ProtobufResult<()> { - while !is.eof()? { - let (field_number, wire_type) = is.read_tag_unpack()?; - match field_number { - 1 => { - ::protobuf::rt::read_singular_proto3_string_into( - wire_type, - is, - &mut self.full_name, - )?; - } - 2 => { - ::protobuf::rt::read_repeated_int64_into(wire_type, is, &mut self.full_shape)?; - } - 3 => { - ::protobuf::rt::read_repeated_int64_into(wire_type, is, &mut self.var_offset)?; - } - 4 => { - ::protobuf::rt::read_repeated_int64_into(wire_type, is, &mut self.var_shape)?; - } - _ => { - ::protobuf::rt::read_unknown_or_skip_group( - field_number, - wire_type, - is, - self.mut_unknown_fields(), - )?; - } - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u32 { - let mut my_size = 0; - if !self.full_name.is_empty() { - my_size += ::protobuf::rt::string_size(1, &self.full_name); - } - for value in &self.full_shape { - my_size += - ::protobuf::rt::value_size(2, *value, ::protobuf::wire_format::WireTypeVarint); - } - for value in &self.var_offset { - my_size += - ::protobuf::rt::value_size(3, *value, ::protobuf::wire_format::WireTypeVarint); - } - for value in &self.var_shape { - my_size += - ::protobuf::rt::value_size(4, *value, ::protobuf::wire_format::WireTypeVarint); - } - my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); - self.cached_size.set(my_size); - my_size - } - - fn write_to_with_cached_sizes( - &self, - os: &mut ::protobuf::CodedOutputStream<'_>, - ) -> ::protobuf::ProtobufResult<()> { - if !self.full_name.is_empty() { - os.write_string(1, &self.full_name)?; - } - for v in &self.full_shape { - os.write_int64(2, *v)?; - } - for v in &self.var_offset { - os.write_int64(3, *v)?; - } - for v in &self.var_shape { - os.write_int64(4, *v)?; - } - os.write_unknown_fields(self.get_unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn get_cached_size(&self) -> u32 { - self.cached_size.get() - } - - fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { - &self.unknown_fields - } - - fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { - &mut self.unknown_fields - } - - fn as_any(&self) -> &dyn (::std::any::Any) { - self as &dyn (::std::any::Any) - } - fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { - self as &mut dyn (::std::any::Any) - } - fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { - self - } - - fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - Self::descriptor_static() - } - - fn new() -> SaveSliceInfoDef { - SaveSliceInfoDef::new() - } - - fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = - ::protobuf::rt::LazyV2::INIT; - descriptor.get(|| { - let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::< - _, - ::protobuf::types::ProtobufTypeString, - >( - "full_name", - |m: &SaveSliceInfoDef| &m.full_name, - |m: &mut SaveSliceInfoDef| &mut m.full_name, - )); - fields.push(::protobuf::reflect::accessor::make_vec_accessor::< - _, - ::protobuf::types::ProtobufTypeInt64, - >( - "full_shape", - |m: &SaveSliceInfoDef| &m.full_shape, - |m: &mut SaveSliceInfoDef| &mut m.full_shape, - )); - fields.push(::protobuf::reflect::accessor::make_vec_accessor::< - _, - ::protobuf::types::ProtobufTypeInt64, - >( - "var_offset", - |m: &SaveSliceInfoDef| &m.var_offset, - |m: &mut SaveSliceInfoDef| &mut m.var_offset, - )); - fields.push(::protobuf::reflect::accessor::make_vec_accessor::< - _, - ::protobuf::types::ProtobufTypeInt64, - >( - "var_shape", - |m: &SaveSliceInfoDef| &m.var_shape, - |m: &mut SaveSliceInfoDef| &mut m.var_shape, - )); - ::protobuf::reflect::MessageDescriptor::new_pb_name::( - "SaveSliceInfoDef", - fields, - file_descriptor_proto(), - ) - }) - } - - fn default_instance() -> &'static SaveSliceInfoDef { - static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; - instance.get(SaveSliceInfoDef::new) - } -} - -impl ::protobuf::Clear for SaveSliceInfoDef { - fn clear(&mut self) { - self.full_name.clear(); - self.full_shape.clear(); - self.var_offset.clear(); - self.var_shape.clear(); - self.unknown_fields.clear(); - } -} - -impl ::std::fmt::Debug for SaveSliceInfoDef { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for SaveSliceInfoDef { - fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { - ::protobuf::reflect::ReflectValueRef::Message(self) - } -} - -#[derive(Clone, PartialEq, Eq, Debug, Hash)] -pub enum VariableSynchronization { - VARIABLE_SYNCHRONIZATION_AUTO = 0, - VARIABLE_SYNCHRONIZATION_NONE = 1, - VARIABLE_SYNCHRONIZATION_ON_WRITE = 2, - VARIABLE_SYNCHRONIZATION_ON_READ = 3, -} - -impl ::protobuf::ProtobufEnum for VariableSynchronization { - fn value(&self) -> i32 { - *self as i32 - } - - fn from_i32(value: i32) -> ::std::option::Option { - match value { - 0 => { - ::std::option::Option::Some(VariableSynchronization::VARIABLE_SYNCHRONIZATION_AUTO) - } - 1 => { - ::std::option::Option::Some(VariableSynchronization::VARIABLE_SYNCHRONIZATION_NONE) - } - 2 => ::std::option::Option::Some( - VariableSynchronization::VARIABLE_SYNCHRONIZATION_ON_WRITE, - ), - 3 => ::std::option::Option::Some( - VariableSynchronization::VARIABLE_SYNCHRONIZATION_ON_READ, - ), - _ => ::std::option::Option::None, - } - } - - fn values() -> &'static [Self] { - static values: &'static [VariableSynchronization] = &[ - VariableSynchronization::VARIABLE_SYNCHRONIZATION_AUTO, - VariableSynchronization::VARIABLE_SYNCHRONIZATION_NONE, - VariableSynchronization::VARIABLE_SYNCHRONIZATION_ON_WRITE, - VariableSynchronization::VARIABLE_SYNCHRONIZATION_ON_READ, - ]; - values - } - - fn enum_descriptor_static() -> &'static ::protobuf::reflect::EnumDescriptor { - static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::EnumDescriptor> = - ::protobuf::rt::LazyV2::INIT; - descriptor.get(|| { - ::protobuf::reflect::EnumDescriptor::new_pb_name::( - "VariableSynchronization", - file_descriptor_proto(), - ) - }) - } -} - -impl ::std::marker::Copy for VariableSynchronization {} - -impl ::std::default::Default for VariableSynchronization { - fn default() -> Self { - VariableSynchronization::VARIABLE_SYNCHRONIZATION_AUTO - } -} - -impl ::protobuf::reflect::ProtobufValue for VariableSynchronization { - fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { - ::protobuf::reflect::ReflectValueRef::Enum(::protobuf::ProtobufEnum::descriptor(self)) - } -} - -#[derive(Clone, PartialEq, Eq, Debug, Hash)] -pub enum VariableAggregation { - VARIABLE_AGGREGATION_NONE = 0, - VARIABLE_AGGREGATION_SUM = 1, - VARIABLE_AGGREGATION_MEAN = 2, - VARIABLE_AGGREGATION_ONLY_FIRST_REPLICA = 3, -} - -impl ::protobuf::ProtobufEnum for VariableAggregation { - fn value(&self) -> i32 { - *self as i32 - } - - fn from_i32(value: i32) -> ::std::option::Option { - match value { - 0 => ::std::option::Option::Some(VariableAggregation::VARIABLE_AGGREGATION_NONE), - 1 => ::std::option::Option::Some(VariableAggregation::VARIABLE_AGGREGATION_SUM), - 2 => ::std::option::Option::Some(VariableAggregation::VARIABLE_AGGREGATION_MEAN), - 3 => ::std::option::Option::Some( - VariableAggregation::VARIABLE_AGGREGATION_ONLY_FIRST_REPLICA, - ), - _ => ::std::option::Option::None, - } - } - - fn values() -> &'static [Self] { - static values: &'static [VariableAggregation] = &[ - VariableAggregation::VARIABLE_AGGREGATION_NONE, - VariableAggregation::VARIABLE_AGGREGATION_SUM, - VariableAggregation::VARIABLE_AGGREGATION_MEAN, - VariableAggregation::VARIABLE_AGGREGATION_ONLY_FIRST_REPLICA, - ]; - values - } - - fn enum_descriptor_static() -> &'static ::protobuf::reflect::EnumDescriptor { - static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::EnumDescriptor> = - ::protobuf::rt::LazyV2::INIT; - descriptor.get(|| { - ::protobuf::reflect::EnumDescriptor::new_pb_name::( - "VariableAggregation", - file_descriptor_proto(), - ) - }) - } -} - -impl ::std::marker::Copy for VariableAggregation {} - -impl ::std::default::Default for VariableAggregation { - fn default() -> Self { - VariableAggregation::VARIABLE_AGGREGATION_NONE - } -} - -impl ::protobuf::reflect::ProtobufValue for VariableAggregation { - fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { - ::protobuf::reflect::ReflectValueRef::Enum(::protobuf::ProtobufEnum::descriptor(self)) - } -} - -static file_descriptor_proto_data: &'static [u8] = b"\ - \n(tensorflow/core/framework/variable.proto\x12\ntensorflow\"\xce\x03\n\ - \x0bVariableDef\x12#\n\rvariable_name\x18\x01\x20\x01(\tR\x0cvariableNam\ - e\x12,\n\x12initial_value_name\x18\x06\x20\x01(\tR\x10initialValueName\ - \x12)\n\x10initializer_name\x18\x02\x20\x01(\tR\x0finitializerName\x12#\ - \n\rsnapshot_name\x18\x03\x20\x01(\tR\x0csnapshotName\x12K\n\x13save_sli\ - ce_info_def\x18\x04\x20\x01(\x0b2\x1c.tensorflow.SaveSliceInfoDefR\x10sa\ - veSliceInfoDef\x12\x1f\n\x0bis_resource\x18\x05\x20\x01(\x08R\nisResourc\ - e\x12\x1c\n\ttrainable\x18\x07\x20\x01(\x08R\ttrainable\x12M\n\x0fsynchr\ - onization\x18\x08\x20\x01(\x0e2#.tensorflow.VariableSynchronizationR\x0f\ - synchronization\x12A\n\x0baggregation\x18\t\x20\x01(\x0e2\x1f.tensorflow\ - .VariableAggregationR\x0baggregation\"\x8a\x01\n\x10SaveSliceInfoDef\x12\ - \x1b\n\tfull_name\x18\x01\x20\x01(\tR\x08fullName\x12\x1d\n\nfull_shape\ - \x18\x02\x20\x03(\x03R\tfullShape\x12\x1d\n\nvar_offset\x18\x03\x20\x03(\ - \x03R\tvarOffset\x12\x1b\n\tvar_shape\x18\x04\x20\x03(\x03R\x08varShape*\ - \xac\x01\n\x17VariableSynchronization\x12!\n\x1dVARIABLE_SYNCHRONIZATION\ - _AUTO\x10\0\x12!\n\x1dVARIABLE_SYNCHRONIZATION_NONE\x10\x01\x12%\n!VARIA\ - BLE_SYNCHRONIZATION_ON_WRITE\x10\x02\x12$\n\x20VARIABLE_SYNCHRONIZATION_\ - ON_READ\x10\x03*\x9e\x01\n\x13VariableAggregation\x12\x1d\n\x19VARIABLE_\ - AGGREGATION_NONE\x10\0\x12\x1c\n\x18VARIABLE_AGGREGATION_SUM\x10\x01\x12\ - \x1d\n\x19VARIABLE_AGGREGATION_MEAN\x10\x02\x12+\n'VARIABLE_AGGREGATION_\ - ONLY_FIRST_REPLICA\x10\x03Bn\n\x18org.tensorflow.frameworkB\x0eVariableP\ - rotosP\x01Z=github.com/tensorflow/tensorflow/tensorflow/go/core/framewor\ - k\xf8\x01\x01b\x06proto3\ -"; - -static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2< - ::protobuf::descriptor::FileDescriptorProto, -> = ::protobuf::rt::LazyV2::INIT; - -fn parse_descriptor_proto() -> ::protobuf::descriptor::FileDescriptorProto { - ::protobuf::parse_from_bytes(file_descriptor_proto_data).unwrap() -} - -pub fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto { - file_descriptor_proto_lazy.get(|| parse_descriptor_proto()) -} diff --git a/src/protos/versions.rs b/src/protos/versions.rs deleted file mode 100644 index f077118a88..0000000000 --- a/src/protos/versions.rs +++ /dev/null @@ -1,308 +0,0 @@ -// This file is generated by rust-protobuf 2.17.0. Do not edit -// @generated - -// https://github.com/rust-lang/rust-clippy/issues/702 -#![allow(unknown_lints)] -#![allow(clippy::all)] - -#![allow(unused_attributes)] -#![rustfmt::skip] - -#![allow(box_pointers)] -#![allow(dead_code)] -#![allow(missing_docs)] -#![allow(non_camel_case_types)] -#![allow(non_snake_case)] -#![allow(non_upper_case_globals)] -#![allow(trivial_casts)] -#![allow(unused_imports)] -#![allow(unused_results)] -//! Generated file from `tensorflow/core/framework/versions.proto` - -/// Generated files are compatible only with the same version -/// of protobuf runtime. -// const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_17_0; - -#[derive(PartialEq, Clone, Default)] -pub struct VersionDef { - // message fields - pub producer: i32, - pub min_consumer: i32, - pub bad_consumers: ::std::vec::Vec, - // special fields - pub unknown_fields: ::protobuf::UnknownFields, - pub cached_size: ::protobuf::CachedSize, -} - -impl<'a> ::std::default::Default for &'a VersionDef { - fn default() -> &'a VersionDef { - ::default_instance() - } -} - -impl VersionDef { - pub fn new() -> VersionDef { - ::std::default::Default::default() - } - - // int32 producer = 1; - - pub fn get_producer(&self) -> i32 { - self.producer - } - pub fn clear_producer(&mut self) { - self.producer = 0; - } - - // Param is passed by value, moved - pub fn set_producer(&mut self, v: i32) { - self.producer = v; - } - - // int32 min_consumer = 2; - - pub fn get_min_consumer(&self) -> i32 { - self.min_consumer - } - pub fn clear_min_consumer(&mut self) { - self.min_consumer = 0; - } - - // Param is passed by value, moved - pub fn set_min_consumer(&mut self, v: i32) { - self.min_consumer = v; - } - - // repeated int32 bad_consumers = 3; - - pub fn get_bad_consumers(&self) -> &[i32] { - &self.bad_consumers - } - pub fn clear_bad_consumers(&mut self) { - self.bad_consumers.clear(); - } - - // Param is passed by value, moved - pub fn set_bad_consumers(&mut self, v: ::std::vec::Vec) { - self.bad_consumers = v; - } - - // Mutable pointer to the field. - pub fn mut_bad_consumers(&mut self) -> &mut ::std::vec::Vec { - &mut self.bad_consumers - } - - // Take field - pub fn take_bad_consumers(&mut self) -> ::std::vec::Vec { - ::std::mem::replace(&mut self.bad_consumers, ::std::vec::Vec::new()) - } -} - -impl ::protobuf::Message for VersionDef { - fn is_initialized(&self) -> bool { - true - } - - fn merge_from( - &mut self, - is: &mut ::protobuf::CodedInputStream<'_>, - ) -> ::protobuf::ProtobufResult<()> { - while !is.eof()? { - let (field_number, wire_type) = is.read_tag_unpack()?; - match field_number { - 1 => { - if wire_type != ::protobuf::wire_format::WireTypeVarint { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type( - wire_type, - )); - } - let tmp = is.read_int32()?; - self.producer = tmp; - } - 2 => { - if wire_type != ::protobuf::wire_format::WireTypeVarint { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type( - wire_type, - )); - } - let tmp = is.read_int32()?; - self.min_consumer = tmp; - } - 3 => { - ::protobuf::rt::read_repeated_int32_into( - wire_type, - is, - &mut self.bad_consumers, - )?; - } - _ => { - ::protobuf::rt::read_unknown_or_skip_group( - field_number, - wire_type, - is, - self.mut_unknown_fields(), - )?; - } - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u32 { - let mut my_size = 0; - if self.producer != 0 { - my_size += ::protobuf::rt::value_size( - 1, - self.producer, - ::protobuf::wire_format::WireTypeVarint, - ); - } - if self.min_consumer != 0 { - my_size += ::protobuf::rt::value_size( - 2, - self.min_consumer, - ::protobuf::wire_format::WireTypeVarint, - ); - } - for value in &self.bad_consumers { - my_size += - ::protobuf::rt::value_size(3, *value, ::protobuf::wire_format::WireTypeVarint); - } - my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); - self.cached_size.set(my_size); - my_size - } - - fn write_to_with_cached_sizes( - &self, - os: &mut ::protobuf::CodedOutputStream<'_>, - ) -> ::protobuf::ProtobufResult<()> { - if self.producer != 0 { - os.write_int32(1, self.producer)?; - } - if self.min_consumer != 0 { - os.write_int32(2, self.min_consumer)?; - } - for v in &self.bad_consumers { - os.write_int32(3, *v)?; - } - os.write_unknown_fields(self.get_unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn get_cached_size(&self) -> u32 { - self.cached_size.get() - } - - fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { - &self.unknown_fields - } - - fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { - &mut self.unknown_fields - } - - fn as_any(&self) -> &dyn (::std::any::Any) { - self as &dyn (::std::any::Any) - } - fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { - self as &mut dyn (::std::any::Any) - } - fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { - self - } - - fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - Self::descriptor_static() - } - - fn new() -> VersionDef { - VersionDef::new() - } - - fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = - ::protobuf::rt::LazyV2::INIT; - descriptor.get(|| { - let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::< - _, - ::protobuf::types::ProtobufTypeInt32, - >( - "producer", - |m: &VersionDef| &m.producer, - |m: &mut VersionDef| &mut m.producer, - )); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::< - _, - ::protobuf::types::ProtobufTypeInt32, - >( - "min_consumer", - |m: &VersionDef| &m.min_consumer, - |m: &mut VersionDef| &mut m.min_consumer, - )); - fields.push(::protobuf::reflect::accessor::make_vec_accessor::< - _, - ::protobuf::types::ProtobufTypeInt32, - >( - "bad_consumers", - |m: &VersionDef| &m.bad_consumers, - |m: &mut VersionDef| &mut m.bad_consumers, - )); - ::protobuf::reflect::MessageDescriptor::new_pb_name::( - "VersionDef", - fields, - file_descriptor_proto(), - ) - }) - } - - fn default_instance() -> &'static VersionDef { - static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; - instance.get(VersionDef::new) - } -} - -impl ::protobuf::Clear for VersionDef { - fn clear(&mut self) { - self.producer = 0; - self.min_consumer = 0; - self.bad_consumers.clear(); - self.unknown_fields.clear(); - } -} - -impl ::std::fmt::Debug for VersionDef { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for VersionDef { - fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { - ::protobuf::reflect::ReflectValueRef::Message(self) - } -} - -static file_descriptor_proto_data: &'static [u8] = b"\ - \n(tensorflow/core/framework/versions.proto\x12\ntensorflow\"p\n\nVersio\ - nDef\x12\x1a\n\x08producer\x18\x01\x20\x01(\x05R\x08producer\x12!\n\x0cm\ - in_consumer\x18\x02\x20\x01(\x05R\x0bminConsumer\x12#\n\rbad_consumers\ - \x18\x03\x20\x03(\x05R\x0cbadConsumersBn\n\x18org.tensorflow.frameworkB\ - \x0eVersionsProtosP\x01Z=github.com/tensorflow/tensorflow/tensorflow/go/\ - core/framework\xf8\x01\x01b\x06proto3\ -"; - -static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2< - ::protobuf::descriptor::FileDescriptorProto, -> = ::protobuf::rt::LazyV2::INIT; - -fn parse_descriptor_proto() -> ::protobuf::descriptor::FileDescriptorProto { - ::protobuf::parse_from_bytes(file_descriptor_proto_data).unwrap() -} - -pub fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto { - file_descriptor_proto_lazy.get(|| parse_descriptor_proto()) -} diff --git a/src/session.rs b/src/session.rs index 1f5a4e89be..323559e61b 100644 --- a/src/session.rs +++ b/src/session.rs @@ -12,11 +12,13 @@ use super::Tensor; use super::TensorType; use crate::tf; use libc::{c_char, c_int}; +use protobuf::{parse_from_bytes, Message, ProtobufResult}; use std::ffi::CStr; use std::ffi::CString; use std::marker; use std::path::Path; use std::ptr; +use tensorflow_protos_rs::config::*; /// Aggregation type for a saved model bundle. #[derive(Debug)] @@ -462,12 +464,26 @@ impl<'l> SessionRunArgs<'l> { self.run_options = Some(Buffer::from(run_options)) } + pub fn set_run_options_protobuf(&mut self, config: &RunOptions) -> ProtobufResult<()> { + let bytes = config.write_to_bytes()?; + self.run_options = Some(Buffer::from(&bytes)); + Ok(()) + } + /// Returns the serialized [`RunOptions` proto](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/core/protobuf/config.proto) /// Returns none if `RunOption` are not set. pub fn get_run_options(&self) -> Option<&[u8]> { self.run_options.as_ref().map(std::convert::AsRef::as_ref) } + pub fn get_options(&self) -> Option { + if let Some(opt) = &self.run_options { + parse_from_bytes::(&opt).ok() + } else { + None + } + } + /// Returns the serialized [`RunMetadata` proto](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/core/protobuf/config.proto) /// Returns none if `self::set_request_metadata` is not set to true. pub fn get_metadata(&mut self) -> Option<&[u8]> { diff --git a/tensorflow-proto-codegen/Cargo.toml b/tensorflow-proto-codegen/Cargo.toml deleted file mode 100644 index 5ae7dd0ee0..0000000000 --- a/tensorflow-proto-codegen/Cargo.toml +++ /dev/null @@ -1,10 +0,0 @@ -[package] -name = "tensorflow-proto-codegen" -version = "0.1.0" -authors = ["Adam Crume "] -edition = "2018" - -[dependencies] -protoc-rust = "2.7.0" - -[workspace] diff --git a/tensorflow-proto-codegen/src/main.rs b/tensorflow-proto-codegen/src/main.rs deleted file mode 100644 index 1f3af56de7..0000000000 --- a/tensorflow-proto-codegen/src/main.rs +++ /dev/null @@ -1,126 +0,0 @@ -extern crate protoc_rust; - -use std::env; -use std::error::Error; -use std::path::Path; -use std::result::Result; - -fn main() -> Result<(), Box> { - let args: Vec = env::args().collect(); - let tensorflow_folder = &args[1]; - let output_folder = Path::new(&args[2]); - protoc_rust::run(protoc_rust::Args { - out_dir: output_folder - .join("src/protos") - .to_str() - .ok_or("Unable to format output path for main crate")?, - input: &[ - &format!( - "{}/tensorflow/core/framework/attr_value.proto", - tensorflow_folder - ), - &format!( - "{}/tensorflow/core/framework/function.proto", - tensorflow_folder - ), - &format!( - "{}/tensorflow/core/framework/graph.proto", - tensorflow_folder - ), - &format!( - "{}/tensorflow/core/framework/node_def.proto", - tensorflow_folder - ), - &format!( - "{}/tensorflow/core/framework/op_def.proto", - tensorflow_folder - ), - &format!( - "{}/tensorflow/core/framework/resource_handle.proto", - tensorflow_folder - ), - &format!( - "{}/tensorflow/core/protobuf/saved_model.proto", - tensorflow_folder - ), - &format!( - "{}/tensorflow/core/protobuf/saved_object_graph.proto", - tensorflow_folder - ), - &format!( - "{}/tensorflow/core/protobuf/struct.proto", - tensorflow_folder - ), - &format!( - "{}/tensorflow/core/framework/tensor.proto", - tensorflow_folder - ), - &format!( - "{}/tensorflow/core/framework/tensor_shape.proto", - tensorflow_folder - ), - &format!( - "{}/tensorflow/core/protobuf/trackable_object_graph.proto", - tensorflow_folder - ), - &format!( - "{}/tensorflow/core/framework/types.proto", - tensorflow_folder - ), - &format!( - "{}/tensorflow/core/framework/variable.proto", - tensorflow_folder - ), - &format!( - "{}/tensorflow/core/framework/versions.proto", - tensorflow_folder - ), - &format!( - "{}/tensorflow/core/protobuf/meta_graph.proto", - tensorflow_folder - ), - &format!("{}/tensorflow/core/protobuf/saver.proto", tensorflow_folder), - ], - includes: &[tensorflow_folder], - customize: protoc_rust::Customize { - ..Default::default() - }, - })?; - protoc_rust::run(protoc_rust::Args { - out_dir: output_folder - .join("tensorflow-op-codegen/src/protos") - .to_str() - .ok_or("Unable to format output path for ops crate")?, - input: &[ - &format!( - "{}/tensorflow/core/framework/attr_value.proto", - tensorflow_folder - ), - &format!( - "{}/tensorflow/core/framework/op_def.proto", - tensorflow_folder - ), - &format!( - "{}/tensorflow/core/framework/resource_handle.proto", - tensorflow_folder - ), - &format!( - "{}/tensorflow/core/framework/tensor.proto", - tensorflow_folder - ), - &format!( - "{}/tensorflow/core/framework/tensor_shape.proto", - tensorflow_folder - ), - &format!( - "{}/tensorflow/core/framework/types.proto", - tensorflow_folder - ), - ], - includes: &[tensorflow_folder], - customize: protoc_rust::Customize { - ..Default::default() - }, - })?; - Ok(()) -}