diff --git a/.gitignore b/.gitignore index ad63fbe..8857f63 100644 --- a/.gitignore +++ b/.gitignore @@ -3,7 +3,6 @@ *~ target/ -sticker-tf-proto/src/*.rs .eggs __pycache__ diff --git a/.travis.yml b/.travis.yml index 1f70cc7..ea60ed2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,4 @@ -dist: bionic +dist: xenial env: global: - PROJECT_NAME: sticker @@ -6,10 +6,6 @@ addons: apt: packages: - patchelf - - protobuf-compiler - homebrew: - packages: - - protobuf matrix: fast_finish: true include: diff --git a/Cargo.lock b/Cargo.lock index f3db5c3..92fd29f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -642,20 +642,20 @@ dependencies = [ [[package]] name = "protobuf" -version = "2.8.1" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "protobuf-codegen" -version = "2.8.1" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "protobuf 2.8.1 (registry+https://github.com/rust-lang/crates.io-index)", + "protobuf 2.8.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "protoc" -version = "2.8.1" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", @@ -663,12 +663,12 @@ dependencies = [ [[package]] name = "protoc-rust" -version = "2.8.1" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "protobuf 2.8.1 (registry+https://github.com/rust-lang/crates.io-index)", - "protobuf-codegen 2.8.1 (registry+https://github.com/rust-lang/crates.io-index)", - "protoc 2.8.1 (registry+https://github.com/rust-lang/crates.io-index)", + "protobuf 2.8.0 (registry+https://github.com/rust-lang/crates.io-index)", + "protobuf-codegen 2.8.0 (registry+https://github.com/rust-lang/crates.io-index)", + "protoc 2.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "tempfile 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -919,7 +919,7 @@ dependencies = [ "ndarray-tensorflow 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "ordered-float 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "petgraph 0.4.13 (registry+https://github.com/rust-lang/crates.io-index)", - "protobuf 2.8.1 (registry+https://github.com/rust-lang/crates.io-index)", + "protobuf 2.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.101 (registry+https://github.com/rust-lang/crates.io-index)", "serde_cbor 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.101 (registry+https://github.com/rust-lang/crates.io-index)", @@ -932,8 +932,8 @@ dependencies = [ name = "sticker-tf-proto" version = "0.10.0" dependencies = [ - "protobuf 2.8.1 (registry+https://github.com/rust-lang/crates.io-index)", - "protoc-rust 2.8.1 (registry+https://github.com/rust-lang/crates.io-index)", + "protobuf 2.8.0 (registry+https://github.com/rust-lang/crates.io-index)", + "protoc-rust 2.8.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1225,10 +1225,10 @@ dependencies = [ "checksum ppv-lite86 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "e3cbf9f658cdb5000fcf6f362b8ea2ba154b9f146a61c7a20d647034c6b6561b" "checksum proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)" = "cf3d2011ab5c909338f7887f4fc896d35932e29146c12c8d01da6b22a80ba759" "checksum proc-macro2 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "afdc77cc74ec70ed262262942ebb7dac3d479e9e5cfa2da1841c0806f6cdabcc" -"checksum protobuf 2.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "40361836defdd5871ff7e84096c6f6444af7fc157f8ef1789f54f147687caa20" -"checksum protobuf-codegen 2.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "12c6abd78435445fc86898ebbd0521a68438063d4a73e23527b7134e6bf58b4a" -"checksum protoc 2.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3998c4bc0af8ccbd3cc68245ee9f72663c5ae2fb78bc48ff7719aef11562edea" -"checksum protoc-rust 2.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "234c97039c32bb58a883d0deafa57db37e59428ce536f3bdfe1c46cffec04113" +"checksum protobuf 2.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8aefcec9f142b524d98fc81d07827743be89dd6586a1ba6ab21fa66a500b3fa5" +"checksum protobuf-codegen 2.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "31539be8028d6b9e8e1b3b7c74e2fa3555302e27b2cc20dbaee6ffba648f75e2" +"checksum protoc 2.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d60e39b07eb4039379829c55c11eba3fd8bd72b265b9ece8cc623b106908c08d" +"checksum protoc-rust 2.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2d48a8543845706a2cf6336b9540d4a27efba0f666189690c1a8f50ae182ee1b" "checksum quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)" = "6ce23b6b870e8f94f81fb0a363d65d86675884b34a09043c81e5562f11c1f8e1" "checksum quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "053a8c8bcc71fcce321828dc897a98ab9760bef03a4fc36693c231e5b3216cfe" "checksum rand 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "3ae1b169243eaf61759b8475a998f0a385e42042370f3a7dbaf35246eacc8412" diff --git a/sticker-tf-proto/Cargo.toml b/sticker-tf-proto/Cargo.toml index 2cd92bd..ab6a85f 100644 --- a/sticker-tf-proto/Cargo.toml +++ b/sticker-tf-proto/Cargo.toml @@ -10,7 +10,13 @@ repository = "https://github.com/danieldk/sticker.git" license = "Apache-2.0" [dependencies] -protobuf = "2" +# This is annoying, but the generated protobuf contains +# the version number in symbols and compilation fails when +# this dependency is updated +protobuf = "= 2.8.0" [build-dependencies] -protoc-rust = "2" +protoc-rust = { version = "2", optional = true } + +[features] +proto-compile = [ "protoc-rust" ] diff --git a/sticker-tf-proto/build.rs b/sticker-tf-proto/build.rs index bab633c..4c9a03e 100644 --- a/sticker-tf-proto/build.rs +++ b/sticker-tf-proto/build.rs @@ -1,4 +1,5 @@ fn main() { + #[cfg(feature = "proto-compile")] protoc_rust::run(protoc_rust::Args { out_dir: "src", input: &[ diff --git a/sticker-tf-proto/src/allocation_description.rs b/sticker-tf-proto/src/allocation_description.rs new file mode 100644 index 0000000..b9fb75b --- /dev/null +++ b/sticker-tf-proto/src/allocation_description.rs @@ -0,0 +1,400 @@ +// This file is generated by rust-protobuf 2.8.0. Do not edit +// @generated + +// https://github.com/Manishearth/rust-clippy/issues/702 +#![allow(unknown_lints)] +#![allow(clippy::all)] + +#![cfg_attr(rustfmt, 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(unsafe_code)] +#![allow(unused_imports)] +#![allow(unused_results)] +//! Generated file from `tensorflow/core/framework/allocation_description.proto` + +use protobuf::Message as Message_imported_for_functions; +use protobuf::ProtobufEnum as ProtobufEnum_imported_for_functions; + +/// Generated files are compatible only with the same version +/// of protobuf runtime. +const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_8_0; + +#[derive(PartialEq,Clone,Default)] +pub struct AllocationDescription { + // message fields + pub requested_bytes: i64, + pub allocated_bytes: i64, + pub allocator_name: ::std::string::String, + pub allocation_id: i64, + pub has_single_reference: bool, + pub ptr: u64, + // special fields + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, +} + +impl<'a> ::std::default::Default for &'a AllocationDescription { + fn default() -> &'a AllocationDescription { + ::default_instance() + } +} + +impl AllocationDescription { + pub fn new() -> AllocationDescription { + ::std::default::Default::default() + } + + // int64 requested_bytes = 1; + + + pub fn get_requested_bytes(&self) -> i64 { + self.requested_bytes + } + pub fn clear_requested_bytes(&mut self) { + self.requested_bytes = 0; + } + + // Param is passed by value, moved + pub fn set_requested_bytes(&mut self, v: i64) { + self.requested_bytes = v; + } + + // int64 allocated_bytes = 2; + + + pub fn get_allocated_bytes(&self) -> i64 { + self.allocated_bytes + } + pub fn clear_allocated_bytes(&mut self) { + self.allocated_bytes = 0; + } + + // Param is passed by value, moved + pub fn set_allocated_bytes(&mut self, v: i64) { + self.allocated_bytes = v; + } + + // string allocator_name = 3; + + + pub fn get_allocator_name(&self) -> &str { + &self.allocator_name + } + pub fn clear_allocator_name(&mut self) { + self.allocator_name.clear(); + } + + // Param is passed by value, moved + pub fn set_allocator_name(&mut self, v: ::std::string::String) { + self.allocator_name = v; + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_allocator_name(&mut self) -> &mut ::std::string::String { + &mut self.allocator_name + } + + // Take field + pub fn take_allocator_name(&mut self) -> ::std::string::String { + ::std::mem::replace(&mut self.allocator_name, ::std::string::String::new()) + } + + // int64 allocation_id = 4; + + + pub fn get_allocation_id(&self) -> i64 { + self.allocation_id + } + pub fn clear_allocation_id(&mut self) { + self.allocation_id = 0; + } + + // Param is passed by value, moved + pub fn set_allocation_id(&mut self, v: i64) { + self.allocation_id = v; + } + + // bool has_single_reference = 5; + + + pub fn get_has_single_reference(&self) -> bool { + self.has_single_reference + } + pub fn clear_has_single_reference(&mut self) { + self.has_single_reference = false; + } + + // Param is passed by value, moved + pub fn set_has_single_reference(&mut self, v: bool) { + self.has_single_reference = v; + } + + // uint64 ptr = 6; + + + pub fn get_ptr(&self) -> u64 { + self.ptr + } + pub fn clear_ptr(&mut self) { + self.ptr = 0; + } + + // Param is passed by value, moved + pub fn set_ptr(&mut self, v: u64) { + self.ptr = v; + } +} + +impl ::protobuf::Message for AllocationDescription { + 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.requested_bytes = 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_int64()?; + self.allocated_bytes = tmp; + }, + 3 => { + ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.allocator_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_int64()?; + self.allocation_id = 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.has_single_reference = 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_uint64()?; + self.ptr = 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.requested_bytes != 0 { + my_size += ::protobuf::rt::value_size(1, self.requested_bytes, ::protobuf::wire_format::WireTypeVarint); + } + if self.allocated_bytes != 0 { + my_size += ::protobuf::rt::value_size(2, self.allocated_bytes, ::protobuf::wire_format::WireTypeVarint); + } + if !self.allocator_name.is_empty() { + my_size += ::protobuf::rt::string_size(3, &self.allocator_name); + } + if self.allocation_id != 0 { + my_size += ::protobuf::rt::value_size(4, self.allocation_id, ::protobuf::wire_format::WireTypeVarint); + } + if self.has_single_reference != false { + my_size += 2; + } + if self.ptr != 0 { + my_size += ::protobuf::rt::value_size(6, self.ptr, ::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.requested_bytes != 0 { + os.write_int64(1, self.requested_bytes)?; + } + if self.allocated_bytes != 0 { + os.write_int64(2, self.allocated_bytes)?; + } + if !self.allocator_name.is_empty() { + os.write_string(3, &self.allocator_name)?; + } + if self.allocation_id != 0 { + os.write_int64(4, self.allocation_id)?; + } + if self.has_single_reference != false { + os.write_bool(5, self.has_single_reference)?; + } + if self.ptr != 0 { + os.write_uint64(6, self.ptr)?; + } + 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: Box) -> ::std::boxed::Box { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> AllocationDescription { + AllocationDescription::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, + }; + unsafe { + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt64>( + "requested_bytes", + |m: &AllocationDescription| { &m.requested_bytes }, + |m: &mut AllocationDescription| { &mut m.requested_bytes }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt64>( + "allocated_bytes", + |m: &AllocationDescription| { &m.allocated_bytes }, + |m: &mut AllocationDescription| { &mut m.allocated_bytes }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "allocator_name", + |m: &AllocationDescription| { &m.allocator_name }, + |m: &mut AllocationDescription| { &mut m.allocator_name }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt64>( + "allocation_id", + |m: &AllocationDescription| { &m.allocation_id }, + |m: &mut AllocationDescription| { &mut m.allocation_id }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBool>( + "has_single_reference", + |m: &AllocationDescription| { &m.has_single_reference }, + |m: &mut AllocationDescription| { &mut m.has_single_reference }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeUint64>( + "ptr", + |m: &AllocationDescription| { &m.ptr }, + |m: &mut AllocationDescription| { &mut m.ptr }, + )); + ::protobuf::reflect::MessageDescriptor::new::( + "AllocationDescription", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static AllocationDescription { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const AllocationDescription, + }; + unsafe { + instance.get(AllocationDescription::new) + } + } +} + +impl ::protobuf::Clear for AllocationDescription { + fn clear(&mut self) { + self.requested_bytes = 0; + self.allocated_bytes = 0; + self.allocator_name.clear(); + self.allocation_id = 0; + self.has_single_reference = false; + self.ptr = 0; + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for AllocationDescription { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for AllocationDescription { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +static file_descriptor_proto_data: &'static [u8] = b"\ + \n6tensorflow/core/framework/allocation_description.proto\x12\ntensorflo\ + w\"\xf9\x01\n\x15AllocationDescription\x12'\n\x0frequested_bytes\x18\x01\ + \x20\x01(\x03R\x0erequestedBytes\x12'\n\x0fallocated_bytes\x18\x02\x20\ + \x01(\x03R\x0eallocatedBytes\x12%\n\x0eallocator_name\x18\x03\x20\x01(\t\ + R\rallocatorName\x12#\n\rallocation_id\x18\x04\x20\x01(\x03R\x0callocati\ + onId\x120\n\x14has_single_reference\x18\x05\x20\x01(\x08R\x12hasSingleRe\ + ference\x12\x10\n\x03ptr\x18\x06\x20\x01(\x04R\x03ptrB{\n\x18org.tensorf\ + low.frameworkB\x1bAllocationDescriptionProtosP\x01Z=github.com/tensorflo\ + w/tensorflow/tensorflow/go/core/framework\xf8\x01\x01b\x06proto3\ +"; + +static mut file_descriptor_proto_lazy: ::protobuf::lazy::Lazy<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::descriptor::FileDescriptorProto, +}; + +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 { + unsafe { + file_descriptor_proto_lazy.get(|| { + parse_descriptor_proto() + }) + } +} diff --git a/sticker-tf-proto/src/attr_value.rs b/sticker-tf-proto/src/attr_value.rs new file mode 100644 index 0000000..b1ef621 --- /dev/null +++ b/sticker-tf-proto/src/attr_value.rs @@ -0,0 +1,1535 @@ +// This file is generated by rust-protobuf 2.8.0. Do not edit +// @generated + +// https://github.com/Manishearth/rust-clippy/issues/702 +#![allow(unknown_lints)] +#![allow(clippy::all)] + +#![cfg_attr(rustfmt, 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(unsafe_code)] +#![allow(unused_imports)] +#![allow(unused_results)] +//! Generated file from `tensorflow/core/framework/attr_value.proto` + +use protobuf::Message as Message_imported_for_functions; +use protobuf::ProtobufEnum as ProtobufEnum_imported_for_functions; + +/// Generated files are compatible only with the same version +/// of protobuf runtime. +const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_8_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, + _ => super::tensor_shape::TensorShapeProto::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, + _ => super::tensor::TensorProto::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, + _ => AttrValue_ListValue::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, + _ => NameAttrList::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, v.value())?; + }, + &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: 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 mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, + }; + unsafe { + 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::( + "AttrValue", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static AttrValue { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const AttrValue, + }; + unsafe { + 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::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::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(v.value())?; + }; + } + 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: 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 mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, + }; + unsafe { + 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::( + "AttrValue_ListValue", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static AttrValue_ListValue { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const AttrValue_ListValue, + }; + unsafe { + 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::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::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: 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 mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, + }; + unsafe { + 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::( + "NameAttrList", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static NameAttrList { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const NameAttrList, + }; + unsafe { + 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::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::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 mut file_descriptor_proto_lazy: ::protobuf::lazy::Lazy<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::descriptor::FileDescriptorProto, +}; + +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 { + unsafe { + file_descriptor_proto_lazy.get(|| { + parse_descriptor_proto() + }) + } +} diff --git a/sticker-tf-proto/src/cluster.rs b/sticker-tf-proto/src/cluster.rs new file mode 100644 index 0000000..5ac8892 --- /dev/null +++ b/sticker-tf-proto/src/cluster.rs @@ -0,0 +1,437 @@ +// This file is generated by rust-protobuf 2.8.0. Do not edit +// @generated + +// https://github.com/Manishearth/rust-clippy/issues/702 +#![allow(unknown_lints)] +#![allow(clippy::all)] + +#![cfg_attr(rustfmt, 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(unsafe_code)] +#![allow(unused_imports)] +#![allow(unused_results)] +//! Generated file from `tensorflow/core/protobuf/cluster.proto` + +use protobuf::Message as Message_imported_for_functions; +use protobuf::ProtobufEnum as ProtobufEnum_imported_for_functions; + +/// Generated files are compatible only with the same version +/// of protobuf runtime. +const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_8_0; + +#[derive(PartialEq,Clone,Default)] +pub struct JobDef { + // message fields + pub name: ::std::string::String, + pub tasks: ::std::collections::HashMap, + // special fields + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, +} + +impl<'a> ::std::default::Default for &'a JobDef { + fn default() -> &'a JobDef { + ::default_instance() + } +} + +impl JobDef { + pub fn new() -> JobDef { + ::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.JobDef.TasksEntry tasks = 2; + + + pub fn get_tasks(&self) -> &::std::collections::HashMap { + &self.tasks + } + pub fn clear_tasks(&mut self) { + self.tasks.clear(); + } + + // Param is passed by value, moved + pub fn set_tasks(&mut self, v: ::std::collections::HashMap) { + self.tasks = v; + } + + // Mutable pointer to the field. + pub fn mut_tasks(&mut self) -> &mut ::std::collections::HashMap { + &mut self.tasks + } + + // Take field + pub fn take_tasks(&mut self) -> ::std::collections::HashMap { + ::std::mem::replace(&mut self.tasks, ::std::collections::HashMap::new()) + } +} + +impl ::protobuf::Message for JobDef { + 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::ProtobufTypeInt32, ::protobuf::types::ProtobufTypeString>(wire_type, is, &mut self.tasks)?; + }, + _ => { + ::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::ProtobufTypeInt32, ::protobuf::types::ProtobufTypeString>(2, &self.tasks); + 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::ProtobufTypeInt32, ::protobuf::types::ProtobufTypeString>(2, &self.tasks, 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: Box) -> ::std::boxed::Box { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> JobDef { + JobDef::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, + }; + unsafe { + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "name", + |m: &JobDef| { &m.name }, + |m: &mut JobDef| { &mut m.name }, + )); + fields.push(::protobuf::reflect::accessor::make_map_accessor::<_, ::protobuf::types::ProtobufTypeInt32, ::protobuf::types::ProtobufTypeString>( + "tasks", + |m: &JobDef| { &m.tasks }, + |m: &mut JobDef| { &mut m.tasks }, + )); + ::protobuf::reflect::MessageDescriptor::new::( + "JobDef", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static JobDef { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const JobDef, + }; + unsafe { + instance.get(JobDef::new) + } + } +} + +impl ::protobuf::Clear for JobDef { + fn clear(&mut self) { + self.name.clear(); + self.tasks.clear(); + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for JobDef { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for JobDef { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct ClusterDef { + // message fields + pub job: ::protobuf::RepeatedField, + // special fields + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, +} + +impl<'a> ::std::default::Default for &'a ClusterDef { + fn default() -> &'a ClusterDef { + ::default_instance() + } +} + +impl ClusterDef { + pub fn new() -> ClusterDef { + ::std::default::Default::default() + } + + // repeated .tensorflow.JobDef job = 1; + + + pub fn get_job(&self) -> &[JobDef] { + &self.job + } + pub fn clear_job(&mut self) { + self.job.clear(); + } + + // Param is passed by value, moved + pub fn set_job(&mut self, v: ::protobuf::RepeatedField) { + self.job = v; + } + + // Mutable pointer to the field. + pub fn mut_job(&mut self) -> &mut ::protobuf::RepeatedField { + &mut self.job + } + + // Take field + pub fn take_job(&mut self) -> ::protobuf::RepeatedField { + ::std::mem::replace(&mut self.job, ::protobuf::RepeatedField::new()) + } +} + +impl ::protobuf::Message for ClusterDef { + fn is_initialized(&self) -> bool { + for v in &self.job { + 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.job)?; + }, + _ => { + ::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.job { + 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.job { + 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: Box) -> ::std::boxed::Box { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> ClusterDef { + ClusterDef::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, + }; + unsafe { + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( + "job", + |m: &ClusterDef| { &m.job }, + |m: &mut ClusterDef| { &mut m.job }, + )); + ::protobuf::reflect::MessageDescriptor::new::( + "ClusterDef", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static ClusterDef { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ClusterDef, + }; + unsafe { + instance.get(ClusterDef::new) + } + } +} + +impl ::protobuf::Clear for ClusterDef { + fn clear(&mut self) { + self.job.clear(); + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for ClusterDef { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for ClusterDef { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +static file_descriptor_proto_data: &'static [u8] = b"\ + \n&tensorflow/core/protobuf/cluster.proto\x12\ntensorflow\"\x8b\x01\n\ + \x06JobDef\x12\x12\n\x04name\x18\x01\x20\x01(\tR\x04name\x123\n\x05tasks\ + \x18\x02\x20\x03(\x0b2\x1d.tensorflow.JobDef.TasksEntryR\x05tasks\x1a8\n\ + \nTasksEntry\x12\x10\n\x03key\x18\x01\x20\x01(\x05R\x03key\x12\x14\n\x05\ + value\x18\x02\x20\x01(\tR\x05value:\x028\x01\"2\n\nClusterDef\x12$\n\x03\ + job\x18\x01\x20\x03(\x0b2\x12.tensorflow.JobDefR\x03jobBn\n\x1aorg.tenso\ + rflow.distruntimeB\rClusterProtosP\x01Z = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::descriptor::FileDescriptorProto, +}; + +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 { + unsafe { + file_descriptor_proto_lazy.get(|| { + parse_descriptor_proto() + }) + } +} diff --git a/sticker-tf-proto/src/config.rs b/sticker-tf-proto/src/config.rs new file mode 100644 index 0000000..9640548 --- /dev/null +++ b/sticker-tf-proto/src/config.rs @@ -0,0 +1,5198 @@ +// This file is generated by rust-protobuf 2.8.0. Do not edit +// @generated + +// https://github.com/Manishearth/rust-clippy/issues/702 +#![allow(unknown_lints)] +#![allow(clippy::all)] + +#![cfg_attr(rustfmt, 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(unsafe_code)] +#![allow(unused_imports)] +#![allow(unused_results)] +//! Generated file from `tensorflow/core/protobuf/config.proto` + +use protobuf::Message as Message_imported_for_functions; +use protobuf::ProtobufEnum as ProtobufEnum_imported_for_functions; + +/// Generated files are compatible only with the same version +/// of protobuf runtime. +const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_8_0; + +#[derive(PartialEq,Clone,Default)] +pub struct GPUOptions { + // message fields + pub per_process_gpu_memory_fraction: f64, + pub allow_growth: bool, + pub allocator_type: ::std::string::String, + pub deferred_deletion_bytes: i64, + pub visible_device_list: ::std::string::String, + pub polling_active_delay_usecs: i32, + pub polling_inactive_delay_msecs: i32, + pub force_gpu_compatible: bool, + pub experimental: ::protobuf::SingularPtrField, + // special fields + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, +} + +impl<'a> ::std::default::Default for &'a GPUOptions { + fn default() -> &'a GPUOptions { + ::default_instance() + } +} + +impl GPUOptions { + pub fn new() -> GPUOptions { + ::std::default::Default::default() + } + + // double per_process_gpu_memory_fraction = 1; + + + pub fn get_per_process_gpu_memory_fraction(&self) -> f64 { + self.per_process_gpu_memory_fraction + } + pub fn clear_per_process_gpu_memory_fraction(&mut self) { + self.per_process_gpu_memory_fraction = 0.; + } + + // Param is passed by value, moved + pub fn set_per_process_gpu_memory_fraction(&mut self, v: f64) { + self.per_process_gpu_memory_fraction = v; + } + + // bool allow_growth = 4; + + + pub fn get_allow_growth(&self) -> bool { + self.allow_growth + } + pub fn clear_allow_growth(&mut self) { + self.allow_growth = false; + } + + // Param is passed by value, moved + pub fn set_allow_growth(&mut self, v: bool) { + self.allow_growth = v; + } + + // string allocator_type = 2; + + + pub fn get_allocator_type(&self) -> &str { + &self.allocator_type + } + pub fn clear_allocator_type(&mut self) { + self.allocator_type.clear(); + } + + // Param is passed by value, moved + pub fn set_allocator_type(&mut self, v: ::std::string::String) { + self.allocator_type = v; + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_allocator_type(&mut self) -> &mut ::std::string::String { + &mut self.allocator_type + } + + // Take field + pub fn take_allocator_type(&mut self) -> ::std::string::String { + ::std::mem::replace(&mut self.allocator_type, ::std::string::String::new()) + } + + // int64 deferred_deletion_bytes = 3; + + + pub fn get_deferred_deletion_bytes(&self) -> i64 { + self.deferred_deletion_bytes + } + pub fn clear_deferred_deletion_bytes(&mut self) { + self.deferred_deletion_bytes = 0; + } + + // Param is passed by value, moved + pub fn set_deferred_deletion_bytes(&mut self, v: i64) { + self.deferred_deletion_bytes = v; + } + + // string visible_device_list = 5; + + + pub fn get_visible_device_list(&self) -> &str { + &self.visible_device_list + } + pub fn clear_visible_device_list(&mut self) { + self.visible_device_list.clear(); + } + + // Param is passed by value, moved + pub fn set_visible_device_list(&mut self, v: ::std::string::String) { + self.visible_device_list = v; + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_visible_device_list(&mut self) -> &mut ::std::string::String { + &mut self.visible_device_list + } + + // Take field + pub fn take_visible_device_list(&mut self) -> ::std::string::String { + ::std::mem::replace(&mut self.visible_device_list, ::std::string::String::new()) + } + + // int32 polling_active_delay_usecs = 6; + + + pub fn get_polling_active_delay_usecs(&self) -> i32 { + self.polling_active_delay_usecs + } + pub fn clear_polling_active_delay_usecs(&mut self) { + self.polling_active_delay_usecs = 0; + } + + // Param is passed by value, moved + pub fn set_polling_active_delay_usecs(&mut self, v: i32) { + self.polling_active_delay_usecs = v; + } + + // int32 polling_inactive_delay_msecs = 7; + + + pub fn get_polling_inactive_delay_msecs(&self) -> i32 { + self.polling_inactive_delay_msecs + } + pub fn clear_polling_inactive_delay_msecs(&mut self) { + self.polling_inactive_delay_msecs = 0; + } + + // Param is passed by value, moved + pub fn set_polling_inactive_delay_msecs(&mut self, v: i32) { + self.polling_inactive_delay_msecs = v; + } + + // bool force_gpu_compatible = 8; + + + pub fn get_force_gpu_compatible(&self) -> bool { + self.force_gpu_compatible + } + pub fn clear_force_gpu_compatible(&mut self) { + self.force_gpu_compatible = false; + } + + // Param is passed by value, moved + pub fn set_force_gpu_compatible(&mut self, v: bool) { + self.force_gpu_compatible = v; + } + + // .tensorflow.GPUOptions.Experimental experimental = 9; + + + pub fn get_experimental(&self) -> &GPUOptions_Experimental { + self.experimental.as_ref().unwrap_or_else(|| GPUOptions_Experimental::default_instance()) + } + pub fn clear_experimental(&mut self) { + self.experimental.clear(); + } + + pub fn has_experimental(&self) -> bool { + self.experimental.is_some() + } + + // Param is passed by value, moved + pub fn set_experimental(&mut self, v: GPUOptions_Experimental) { + self.experimental = ::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(&mut self) -> &mut GPUOptions_Experimental { + if self.experimental.is_none() { + self.experimental.set_default(); + } + self.experimental.as_mut().unwrap() + } + + // Take field + pub fn take_experimental(&mut self) -> GPUOptions_Experimental { + self.experimental.take().unwrap_or_else(|| GPUOptions_Experimental::new()) + } +} + +impl ::protobuf::Message for GPUOptions { + fn is_initialized(&self) -> bool { + for v in &self.experimental { + 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::WireTypeFixed64 { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + let tmp = is.read_double()?; + self.per_process_gpu_memory_fraction = tmp; + }, + 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.allow_growth = tmp; + }, + 2 => { + ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.allocator_type)?; + }, + 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.deferred_deletion_bytes = tmp; + }, + 5 => { + ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.visible_device_list)?; + }, + 6 => { + 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.polling_active_delay_usecs = 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_int32()?; + self.polling_inactive_delay_msecs = tmp; + }, + 8 => { + 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.force_gpu_compatible = tmp; + }, + 9 => { + ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.experimental)?; + }, + _ => { + ::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.per_process_gpu_memory_fraction != 0. { + my_size += 9; + } + if self.allow_growth != false { + my_size += 2; + } + if !self.allocator_type.is_empty() { + my_size += ::protobuf::rt::string_size(2, &self.allocator_type); + } + if self.deferred_deletion_bytes != 0 { + my_size += ::protobuf::rt::value_size(3, self.deferred_deletion_bytes, ::protobuf::wire_format::WireTypeVarint); + } + if !self.visible_device_list.is_empty() { + my_size += ::protobuf::rt::string_size(5, &self.visible_device_list); + } + if self.polling_active_delay_usecs != 0 { + my_size += ::protobuf::rt::value_size(6, self.polling_active_delay_usecs, ::protobuf::wire_format::WireTypeVarint); + } + if self.polling_inactive_delay_msecs != 0 { + my_size += ::protobuf::rt::value_size(7, self.polling_inactive_delay_msecs, ::protobuf::wire_format::WireTypeVarint); + } + if self.force_gpu_compatible != false { + my_size += 2; + } + if let Some(ref v) = self.experimental.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.per_process_gpu_memory_fraction != 0. { + os.write_double(1, self.per_process_gpu_memory_fraction)?; + } + if self.allow_growth != false { + os.write_bool(4, self.allow_growth)?; + } + if !self.allocator_type.is_empty() { + os.write_string(2, &self.allocator_type)?; + } + if self.deferred_deletion_bytes != 0 { + os.write_int64(3, self.deferred_deletion_bytes)?; + } + if !self.visible_device_list.is_empty() { + os.write_string(5, &self.visible_device_list)?; + } + if self.polling_active_delay_usecs != 0 { + os.write_int32(6, self.polling_active_delay_usecs)?; + } + if self.polling_inactive_delay_msecs != 0 { + os.write_int32(7, self.polling_inactive_delay_msecs)?; + } + if self.force_gpu_compatible != false { + os.write_bool(8, self.force_gpu_compatible)?; + } + if let Some(ref v) = self.experimental.as_ref() { + 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: Box) -> ::std::boxed::Box { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> GPUOptions { + GPUOptions::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, + }; + unsafe { + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeDouble>( + "per_process_gpu_memory_fraction", + |m: &GPUOptions| { &m.per_process_gpu_memory_fraction }, + |m: &mut GPUOptions| { &mut m.per_process_gpu_memory_fraction }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBool>( + "allow_growth", + |m: &GPUOptions| { &m.allow_growth }, + |m: &mut GPUOptions| { &mut m.allow_growth }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "allocator_type", + |m: &GPUOptions| { &m.allocator_type }, + |m: &mut GPUOptions| { &mut m.allocator_type }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt64>( + "deferred_deletion_bytes", + |m: &GPUOptions| { &m.deferred_deletion_bytes }, + |m: &mut GPUOptions| { &mut m.deferred_deletion_bytes }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "visible_device_list", + |m: &GPUOptions| { &m.visible_device_list }, + |m: &mut GPUOptions| { &mut m.visible_device_list }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt32>( + "polling_active_delay_usecs", + |m: &GPUOptions| { &m.polling_active_delay_usecs }, + |m: &mut GPUOptions| { &mut m.polling_active_delay_usecs }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt32>( + "polling_inactive_delay_msecs", + |m: &GPUOptions| { &m.polling_inactive_delay_msecs }, + |m: &mut GPUOptions| { &mut m.polling_inactive_delay_msecs }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBool>( + "force_gpu_compatible", + |m: &GPUOptions| { &m.force_gpu_compatible }, + |m: &mut GPUOptions| { &mut m.force_gpu_compatible }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( + "experimental", + |m: &GPUOptions| { &m.experimental }, + |m: &mut GPUOptions| { &mut m.experimental }, + )); + ::protobuf::reflect::MessageDescriptor::new::( + "GPUOptions", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static GPUOptions { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const GPUOptions, + }; + unsafe { + instance.get(GPUOptions::new) + } + } +} + +impl ::protobuf::Clear for GPUOptions { + fn clear(&mut self) { + self.per_process_gpu_memory_fraction = 0.; + self.allow_growth = false; + self.allocator_type.clear(); + self.deferred_deletion_bytes = 0; + self.visible_device_list.clear(); + self.polling_active_delay_usecs = 0; + self.polling_inactive_delay_msecs = 0; + self.force_gpu_compatible = false; + self.experimental.clear(); + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for GPUOptions { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for GPUOptions { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct GPUOptions_Experimental { + // message fields + pub virtual_devices: ::protobuf::RepeatedField, + pub use_unified_memory: bool, + pub num_dev_to_dev_copy_streams: i32, + pub collective_ring_order: ::std::string::String, + // special fields + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, +} + +impl<'a> ::std::default::Default for &'a GPUOptions_Experimental { + fn default() -> &'a GPUOptions_Experimental { + ::default_instance() + } +} + +impl GPUOptions_Experimental { + pub fn new() -> GPUOptions_Experimental { + ::std::default::Default::default() + } + + // repeated .tensorflow.GPUOptions.Experimental.VirtualDevices virtual_devices = 1; + + + pub fn get_virtual_devices(&self) -> &[GPUOptions_Experimental_VirtualDevices] { + &self.virtual_devices + } + pub fn clear_virtual_devices(&mut self) { + self.virtual_devices.clear(); + } + + // Param is passed by value, moved + pub fn set_virtual_devices(&mut self, v: ::protobuf::RepeatedField) { + self.virtual_devices = v; + } + + // Mutable pointer to the field. + pub fn mut_virtual_devices(&mut self) -> &mut ::protobuf::RepeatedField { + &mut self.virtual_devices + } + + // Take field + pub fn take_virtual_devices(&mut self) -> ::protobuf::RepeatedField { + ::std::mem::replace(&mut self.virtual_devices, ::protobuf::RepeatedField::new()) + } + + // bool use_unified_memory = 2; + + + pub fn get_use_unified_memory(&self) -> bool { + self.use_unified_memory + } + pub fn clear_use_unified_memory(&mut self) { + self.use_unified_memory = false; + } + + // Param is passed by value, moved + pub fn set_use_unified_memory(&mut self, v: bool) { + self.use_unified_memory = v; + } + + // int32 num_dev_to_dev_copy_streams = 3; + + + pub fn get_num_dev_to_dev_copy_streams(&self) -> i32 { + self.num_dev_to_dev_copy_streams + } + pub fn clear_num_dev_to_dev_copy_streams(&mut self) { + self.num_dev_to_dev_copy_streams = 0; + } + + // Param is passed by value, moved + pub fn set_num_dev_to_dev_copy_streams(&mut self, v: i32) { + self.num_dev_to_dev_copy_streams = v; + } + + // string collective_ring_order = 4; + + + pub fn get_collective_ring_order(&self) -> &str { + &self.collective_ring_order + } + pub fn clear_collective_ring_order(&mut self) { + self.collective_ring_order.clear(); + } + + // Param is passed by value, moved + pub fn set_collective_ring_order(&mut self, v: ::std::string::String) { + self.collective_ring_order = v; + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_collective_ring_order(&mut self) -> &mut ::std::string::String { + &mut self.collective_ring_order + } + + // Take field + pub fn take_collective_ring_order(&mut self) -> ::std::string::String { + ::std::mem::replace(&mut self.collective_ring_order, ::std::string::String::new()) + } +} + +impl ::protobuf::Message for GPUOptions_Experimental { + fn is_initialized(&self) -> bool { + for v in &self.virtual_devices { + 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.virtual_devices)?; + }, + 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.use_unified_memory = tmp; + }, + 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.num_dev_to_dev_copy_streams = tmp; + }, + 4 => { + ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.collective_ring_order)?; + }, + _ => { + ::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.virtual_devices { + let len = value.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; + }; + if self.use_unified_memory != false { + my_size += 2; + } + if self.num_dev_to_dev_copy_streams != 0 { + my_size += ::protobuf::rt::value_size(3, self.num_dev_to_dev_copy_streams, ::protobuf::wire_format::WireTypeVarint); + } + if !self.collective_ring_order.is_empty() { + my_size += ::protobuf::rt::string_size(4, &self.collective_ring_order); + } + 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.virtual_devices { + 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.use_unified_memory != false { + os.write_bool(2, self.use_unified_memory)?; + } + if self.num_dev_to_dev_copy_streams != 0 { + os.write_int32(3, self.num_dev_to_dev_copy_streams)?; + } + if !self.collective_ring_order.is_empty() { + os.write_string(4, &self.collective_ring_order)?; + } + 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: Box) -> ::std::boxed::Box { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> GPUOptions_Experimental { + GPUOptions_Experimental::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, + }; + unsafe { + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( + "virtual_devices", + |m: &GPUOptions_Experimental| { &m.virtual_devices }, + |m: &mut GPUOptions_Experimental| { &mut m.virtual_devices }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBool>( + "use_unified_memory", + |m: &GPUOptions_Experimental| { &m.use_unified_memory }, + |m: &mut GPUOptions_Experimental| { &mut m.use_unified_memory }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt32>( + "num_dev_to_dev_copy_streams", + |m: &GPUOptions_Experimental| { &m.num_dev_to_dev_copy_streams }, + |m: &mut GPUOptions_Experimental| { &mut m.num_dev_to_dev_copy_streams }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "collective_ring_order", + |m: &GPUOptions_Experimental| { &m.collective_ring_order }, + |m: &mut GPUOptions_Experimental| { &mut m.collective_ring_order }, + )); + ::protobuf::reflect::MessageDescriptor::new::( + "GPUOptions_Experimental", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static GPUOptions_Experimental { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const GPUOptions_Experimental, + }; + unsafe { + instance.get(GPUOptions_Experimental::new) + } + } +} + +impl ::protobuf::Clear for GPUOptions_Experimental { + fn clear(&mut self) { + self.virtual_devices.clear(); + self.use_unified_memory = false; + self.num_dev_to_dev_copy_streams = 0; + self.collective_ring_order.clear(); + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for GPUOptions_Experimental { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for GPUOptions_Experimental { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct GPUOptions_Experimental_VirtualDevices { + // message fields + pub memory_limit_mb: ::std::vec::Vec, + // special fields + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, +} + +impl<'a> ::std::default::Default for &'a GPUOptions_Experimental_VirtualDevices { + fn default() -> &'a GPUOptions_Experimental_VirtualDevices { + ::default_instance() + } +} + +impl GPUOptions_Experimental_VirtualDevices { + pub fn new() -> GPUOptions_Experimental_VirtualDevices { + ::std::default::Default::default() + } + + // repeated float memory_limit_mb = 1; + + + pub fn get_memory_limit_mb(&self) -> &[f32] { + &self.memory_limit_mb + } + pub fn clear_memory_limit_mb(&mut self) { + self.memory_limit_mb.clear(); + } + + // Param is passed by value, moved + pub fn set_memory_limit_mb(&mut self, v: ::std::vec::Vec) { + self.memory_limit_mb = v; + } + + // Mutable pointer to the field. + pub fn mut_memory_limit_mb(&mut self) -> &mut ::std::vec::Vec { + &mut self.memory_limit_mb + } + + // Take field + pub fn take_memory_limit_mb(&mut self) -> ::std::vec::Vec { + ::std::mem::replace(&mut self.memory_limit_mb, ::std::vec::Vec::new()) + } +} + +impl ::protobuf::Message for GPUOptions_Experimental_VirtualDevices { + 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.memory_limit_mb)?; + }, + _ => { + ::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 += 5 * self.memory_limit_mb.len() 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<()> { + for v in &self.memory_limit_mb { + os.write_float(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: Box) -> ::std::boxed::Box { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> GPUOptions_Experimental_VirtualDevices { + GPUOptions_Experimental_VirtualDevices::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, + }; + unsafe { + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_vec_accessor::<_, ::protobuf::types::ProtobufTypeFloat>( + "memory_limit_mb", + |m: &GPUOptions_Experimental_VirtualDevices| { &m.memory_limit_mb }, + |m: &mut GPUOptions_Experimental_VirtualDevices| { &mut m.memory_limit_mb }, + )); + ::protobuf::reflect::MessageDescriptor::new::( + "GPUOptions_Experimental_VirtualDevices", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static GPUOptions_Experimental_VirtualDevices { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const GPUOptions_Experimental_VirtualDevices, + }; + unsafe { + instance.get(GPUOptions_Experimental_VirtualDevices::new) + } + } +} + +impl ::protobuf::Clear for GPUOptions_Experimental_VirtualDevices { + fn clear(&mut self) { + self.memory_limit_mb.clear(); + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for GPUOptions_Experimental_VirtualDevices { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for GPUOptions_Experimental_VirtualDevices { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct OptimizerOptions { + // message fields + pub do_common_subexpression_elimination: bool, + pub do_constant_folding: bool, + pub max_folded_constant_in_bytes: i64, + pub do_function_inlining: bool, + pub opt_level: OptimizerOptions_Level, + pub global_jit_level: OptimizerOptions_GlobalJitLevel, + // special fields + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, +} + +impl<'a> ::std::default::Default for &'a OptimizerOptions { + fn default() -> &'a OptimizerOptions { + ::default_instance() + } +} + +impl OptimizerOptions { + pub fn new() -> OptimizerOptions { + ::std::default::Default::default() + } + + // bool do_common_subexpression_elimination = 1; + + + pub fn get_do_common_subexpression_elimination(&self) -> bool { + self.do_common_subexpression_elimination + } + pub fn clear_do_common_subexpression_elimination(&mut self) { + self.do_common_subexpression_elimination = false; + } + + // Param is passed by value, moved + pub fn set_do_common_subexpression_elimination(&mut self, v: bool) { + self.do_common_subexpression_elimination = v; + } + + // bool do_constant_folding = 2; + + + pub fn get_do_constant_folding(&self) -> bool { + self.do_constant_folding + } + pub fn clear_do_constant_folding(&mut self) { + self.do_constant_folding = false; + } + + // Param is passed by value, moved + pub fn set_do_constant_folding(&mut self, v: bool) { + self.do_constant_folding = v; + } + + // int64 max_folded_constant_in_bytes = 6; + + + pub fn get_max_folded_constant_in_bytes(&self) -> i64 { + self.max_folded_constant_in_bytes + } + pub fn clear_max_folded_constant_in_bytes(&mut self) { + self.max_folded_constant_in_bytes = 0; + } + + // Param is passed by value, moved + pub fn set_max_folded_constant_in_bytes(&mut self, v: i64) { + self.max_folded_constant_in_bytes = v; + } + + // bool do_function_inlining = 4; + + + pub fn get_do_function_inlining(&self) -> bool { + self.do_function_inlining + } + pub fn clear_do_function_inlining(&mut self) { + self.do_function_inlining = false; + } + + // Param is passed by value, moved + pub fn set_do_function_inlining(&mut self, v: bool) { + self.do_function_inlining = v; + } + + // .tensorflow.OptimizerOptions.Level opt_level = 3; + + + pub fn get_opt_level(&self) -> OptimizerOptions_Level { + self.opt_level + } + pub fn clear_opt_level(&mut self) { + self.opt_level = OptimizerOptions_Level::L1; + } + + // Param is passed by value, moved + pub fn set_opt_level(&mut self, v: OptimizerOptions_Level) { + self.opt_level = v; + } + + // .tensorflow.OptimizerOptions.GlobalJitLevel global_jit_level = 5; + + + pub fn get_global_jit_level(&self) -> OptimizerOptions_GlobalJitLevel { + self.global_jit_level + } + pub fn clear_global_jit_level(&mut self) { + self.global_jit_level = OptimizerOptions_GlobalJitLevel::DEFAULT; + } + + // Param is passed by value, moved + pub fn set_global_jit_level(&mut self, v: OptimizerOptions_GlobalJitLevel) { + self.global_jit_level = v; + } +} + +impl ::protobuf::Message for OptimizerOptions { + 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_bool()?; + self.do_common_subexpression_elimination = 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_bool()?; + self.do_constant_folding = 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.max_folded_constant_in_bytes = tmp; + }, + 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.do_function_inlining = tmp; + }, + 3 => { + ::protobuf::rt::read_proto3_enum_with_unknown_fields_into(wire_type, is, &mut self.opt_level, 3, &mut self.unknown_fields)? + }, + 5 => { + ::protobuf::rt::read_proto3_enum_with_unknown_fields_into(wire_type, is, &mut self.global_jit_level, 5, &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.do_common_subexpression_elimination != false { + my_size += 2; + } + if self.do_constant_folding != false { + my_size += 2; + } + if self.max_folded_constant_in_bytes != 0 { + my_size += ::protobuf::rt::value_size(6, self.max_folded_constant_in_bytes, ::protobuf::wire_format::WireTypeVarint); + } + if self.do_function_inlining != false { + my_size += 2; + } + if self.opt_level != OptimizerOptions_Level::L1 { + my_size += ::protobuf::rt::enum_size(3, self.opt_level); + } + if self.global_jit_level != OptimizerOptions_GlobalJitLevel::DEFAULT { + my_size += ::protobuf::rt::enum_size(5, self.global_jit_level); + } + 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.do_common_subexpression_elimination != false { + os.write_bool(1, self.do_common_subexpression_elimination)?; + } + if self.do_constant_folding != false { + os.write_bool(2, self.do_constant_folding)?; + } + if self.max_folded_constant_in_bytes != 0 { + os.write_int64(6, self.max_folded_constant_in_bytes)?; + } + if self.do_function_inlining != false { + os.write_bool(4, self.do_function_inlining)?; + } + if self.opt_level != OptimizerOptions_Level::L1 { + os.write_enum(3, self.opt_level.value())?; + } + if self.global_jit_level != OptimizerOptions_GlobalJitLevel::DEFAULT { + os.write_enum(5, self.global_jit_level.value())?; + } + 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: Box) -> ::std::boxed::Box { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> OptimizerOptions { + OptimizerOptions::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, + }; + unsafe { + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBool>( + "do_common_subexpression_elimination", + |m: &OptimizerOptions| { &m.do_common_subexpression_elimination }, + |m: &mut OptimizerOptions| { &mut m.do_common_subexpression_elimination }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBool>( + "do_constant_folding", + |m: &OptimizerOptions| { &m.do_constant_folding }, + |m: &mut OptimizerOptions| { &mut m.do_constant_folding }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt64>( + "max_folded_constant_in_bytes", + |m: &OptimizerOptions| { &m.max_folded_constant_in_bytes }, + |m: &mut OptimizerOptions| { &mut m.max_folded_constant_in_bytes }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBool>( + "do_function_inlining", + |m: &OptimizerOptions| { &m.do_function_inlining }, + |m: &mut OptimizerOptions| { &mut m.do_function_inlining }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeEnum>( + "opt_level", + |m: &OptimizerOptions| { &m.opt_level }, + |m: &mut OptimizerOptions| { &mut m.opt_level }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeEnum>( + "global_jit_level", + |m: &OptimizerOptions| { &m.global_jit_level }, + |m: &mut OptimizerOptions| { &mut m.global_jit_level }, + )); + ::protobuf::reflect::MessageDescriptor::new::( + "OptimizerOptions", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static OptimizerOptions { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const OptimizerOptions, + }; + unsafe { + instance.get(OptimizerOptions::new) + } + } +} + +impl ::protobuf::Clear for OptimizerOptions { + fn clear(&mut self) { + self.do_common_subexpression_elimination = false; + self.do_constant_folding = false; + self.max_folded_constant_in_bytes = 0; + self.do_function_inlining = false; + self.opt_level = OptimizerOptions_Level::L1; + self.global_jit_level = OptimizerOptions_GlobalJitLevel::DEFAULT; + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for OptimizerOptions { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for OptimizerOptions { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(Clone,PartialEq,Eq,Debug,Hash)] +pub enum OptimizerOptions_Level { + L1 = 0, + L0 = -1, +} + +impl ::protobuf::ProtobufEnum for OptimizerOptions_Level { + fn value(&self) -> i32 { + *self as i32 + } + + fn from_i32(value: i32) -> ::std::option::Option { + match value { + 0 => ::std::option::Option::Some(OptimizerOptions_Level::L1), + -1 => ::std::option::Option::Some(OptimizerOptions_Level::L0), + _ => ::std::option::Option::None + } + } + + fn values() -> &'static [Self] { + static values: &'static [OptimizerOptions_Level] = &[ + OptimizerOptions_Level::L1, + OptimizerOptions_Level::L0, + ]; + values + } + + fn enum_descriptor_static() -> &'static ::protobuf::reflect::EnumDescriptor { + static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::EnumDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::EnumDescriptor, + }; + unsafe { + descriptor.get(|| { + ::protobuf::reflect::EnumDescriptor::new("OptimizerOptions_Level", file_descriptor_proto()) + }) + } + } +} + +impl ::std::marker::Copy for OptimizerOptions_Level { +} + +impl ::std::default::Default for OptimizerOptions_Level { + fn default() -> Self { + OptimizerOptions_Level::L1 + } +} + +impl ::protobuf::reflect::ProtobufValue for OptimizerOptions_Level { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Enum(self.descriptor()) + } +} + +#[derive(Clone,PartialEq,Eq,Debug,Hash)] +pub enum OptimizerOptions_GlobalJitLevel { + DEFAULT = 0, + OFF = -1, + ON_1 = 1, + ON_2 = 2, +} + +impl ::protobuf::ProtobufEnum for OptimizerOptions_GlobalJitLevel { + fn value(&self) -> i32 { + *self as i32 + } + + fn from_i32(value: i32) -> ::std::option::Option { + match value { + 0 => ::std::option::Option::Some(OptimizerOptions_GlobalJitLevel::DEFAULT), + -1 => ::std::option::Option::Some(OptimizerOptions_GlobalJitLevel::OFF), + 1 => ::std::option::Option::Some(OptimizerOptions_GlobalJitLevel::ON_1), + 2 => ::std::option::Option::Some(OptimizerOptions_GlobalJitLevel::ON_2), + _ => ::std::option::Option::None + } + } + + fn values() -> &'static [Self] { + static values: &'static [OptimizerOptions_GlobalJitLevel] = &[ + OptimizerOptions_GlobalJitLevel::DEFAULT, + OptimizerOptions_GlobalJitLevel::OFF, + OptimizerOptions_GlobalJitLevel::ON_1, + OptimizerOptions_GlobalJitLevel::ON_2, + ]; + values + } + + fn enum_descriptor_static() -> &'static ::protobuf::reflect::EnumDescriptor { + static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::EnumDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::EnumDescriptor, + }; + unsafe { + descriptor.get(|| { + ::protobuf::reflect::EnumDescriptor::new("OptimizerOptions_GlobalJitLevel", file_descriptor_proto()) + }) + } + } +} + +impl ::std::marker::Copy for OptimizerOptions_GlobalJitLevel { +} + +impl ::std::default::Default for OptimizerOptions_GlobalJitLevel { + fn default() -> Self { + OptimizerOptions_GlobalJitLevel::DEFAULT + } +} + +impl ::protobuf::reflect::ProtobufValue for OptimizerOptions_GlobalJitLevel { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Enum(self.descriptor()) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct GraphOptions { + // message fields + pub enable_recv_scheduling: bool, + pub optimizer_options: ::protobuf::SingularPtrField, + pub build_cost_model: i64, + pub build_cost_model_after: i64, + pub infer_shapes: bool, + pub place_pruned_graph: bool, + pub enable_bfloat16_sendrecv: bool, + pub timeline_step: i32, + pub rewrite_options: ::protobuf::SingularPtrField, + // special fields + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, +} + +impl<'a> ::std::default::Default for &'a GraphOptions { + fn default() -> &'a GraphOptions { + ::default_instance() + } +} + +impl GraphOptions { + pub fn new() -> GraphOptions { + ::std::default::Default::default() + } + + // bool enable_recv_scheduling = 2; + + + pub fn get_enable_recv_scheduling(&self) -> bool { + self.enable_recv_scheduling + } + pub fn clear_enable_recv_scheduling(&mut self) { + self.enable_recv_scheduling = false; + } + + // Param is passed by value, moved + pub fn set_enable_recv_scheduling(&mut self, v: bool) { + self.enable_recv_scheduling = v; + } + + // .tensorflow.OptimizerOptions optimizer_options = 3; + + + pub fn get_optimizer_options(&self) -> &OptimizerOptions { + self.optimizer_options.as_ref().unwrap_or_else(|| OptimizerOptions::default_instance()) + } + pub fn clear_optimizer_options(&mut self) { + self.optimizer_options.clear(); + } + + pub fn has_optimizer_options(&self) -> bool { + self.optimizer_options.is_some() + } + + // Param is passed by value, moved + pub fn set_optimizer_options(&mut self, v: OptimizerOptions) { + self.optimizer_options = ::protobuf::SingularPtrField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_optimizer_options(&mut self) -> &mut OptimizerOptions { + if self.optimizer_options.is_none() { + self.optimizer_options.set_default(); + } + self.optimizer_options.as_mut().unwrap() + } + + // Take field + pub fn take_optimizer_options(&mut self) -> OptimizerOptions { + self.optimizer_options.take().unwrap_or_else(|| OptimizerOptions::new()) + } + + // int64 build_cost_model = 4; + + + pub fn get_build_cost_model(&self) -> i64 { + self.build_cost_model + } + pub fn clear_build_cost_model(&mut self) { + self.build_cost_model = 0; + } + + // Param is passed by value, moved + pub fn set_build_cost_model(&mut self, v: i64) { + self.build_cost_model = v; + } + + // int64 build_cost_model_after = 9; + + + pub fn get_build_cost_model_after(&self) -> i64 { + self.build_cost_model_after + } + pub fn clear_build_cost_model_after(&mut self) { + self.build_cost_model_after = 0; + } + + // Param is passed by value, moved + pub fn set_build_cost_model_after(&mut self, v: i64) { + self.build_cost_model_after = v; + } + + // bool infer_shapes = 5; + + + pub fn get_infer_shapes(&self) -> bool { + self.infer_shapes + } + pub fn clear_infer_shapes(&mut self) { + self.infer_shapes = false; + } + + // Param is passed by value, moved + pub fn set_infer_shapes(&mut self, v: bool) { + self.infer_shapes = v; + } + + // bool place_pruned_graph = 6; + + + pub fn get_place_pruned_graph(&self) -> bool { + self.place_pruned_graph + } + pub fn clear_place_pruned_graph(&mut self) { + self.place_pruned_graph = false; + } + + // Param is passed by value, moved + pub fn set_place_pruned_graph(&mut self, v: bool) { + self.place_pruned_graph = v; + } + + // bool enable_bfloat16_sendrecv = 7; + + + pub fn get_enable_bfloat16_sendrecv(&self) -> bool { + self.enable_bfloat16_sendrecv + } + pub fn clear_enable_bfloat16_sendrecv(&mut self) { + self.enable_bfloat16_sendrecv = false; + } + + // Param is passed by value, moved + pub fn set_enable_bfloat16_sendrecv(&mut self, v: bool) { + self.enable_bfloat16_sendrecv = v; + } + + // int32 timeline_step = 8; + + + pub fn get_timeline_step(&self) -> i32 { + self.timeline_step + } + pub fn clear_timeline_step(&mut self) { + self.timeline_step = 0; + } + + // Param is passed by value, moved + pub fn set_timeline_step(&mut self, v: i32) { + self.timeline_step = v; + } + + // .tensorflow.RewriterConfig rewrite_options = 10; + + + pub fn get_rewrite_options(&self) -> &super::rewriter_config::RewriterConfig { + self.rewrite_options.as_ref().unwrap_or_else(|| super::rewriter_config::RewriterConfig::default_instance()) + } + pub fn clear_rewrite_options(&mut self) { + self.rewrite_options.clear(); + } + + pub fn has_rewrite_options(&self) -> bool { + self.rewrite_options.is_some() + } + + // Param is passed by value, moved + pub fn set_rewrite_options(&mut self, v: super::rewriter_config::RewriterConfig) { + self.rewrite_options = ::protobuf::SingularPtrField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_rewrite_options(&mut self) -> &mut super::rewriter_config::RewriterConfig { + if self.rewrite_options.is_none() { + self.rewrite_options.set_default(); + } + self.rewrite_options.as_mut().unwrap() + } + + // Take field + pub fn take_rewrite_options(&mut self) -> super::rewriter_config::RewriterConfig { + self.rewrite_options.take().unwrap_or_else(|| super::rewriter_config::RewriterConfig::new()) + } +} + +impl ::protobuf::Message for GraphOptions { + fn is_initialized(&self) -> bool { + for v in &self.optimizer_options { + if !v.is_initialized() { + return false; + } + }; + for v in &self.rewrite_options { + 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::WireTypeVarint { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + let tmp = is.read_bool()?; + self.enable_recv_scheduling = tmp; + }, + 3 => { + ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.optimizer_options)?; + }, + 4 => { + 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.build_cost_model = tmp; + }, + 9 => { + 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.build_cost_model_after = 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.infer_shapes = 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_bool()?; + self.place_pruned_graph = 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.enable_bfloat16_sendrecv = tmp; + }, + 8 => { + 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.timeline_step = tmp; + }, + 10 => { + ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.rewrite_options)?; + }, + _ => { + ::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.enable_recv_scheduling != false { + my_size += 2; + } + if let Some(ref v) = self.optimizer_options.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; + } + if self.build_cost_model != 0 { + my_size += ::protobuf::rt::value_size(4, self.build_cost_model, ::protobuf::wire_format::WireTypeVarint); + } + if self.build_cost_model_after != 0 { + my_size += ::protobuf::rt::value_size(9, self.build_cost_model_after, ::protobuf::wire_format::WireTypeVarint); + } + if self.infer_shapes != false { + my_size += 2; + } + if self.place_pruned_graph != false { + my_size += 2; + } + if self.enable_bfloat16_sendrecv != false { + my_size += 2; + } + if self.timeline_step != 0 { + my_size += ::protobuf::rt::value_size(8, self.timeline_step, ::protobuf::wire_format::WireTypeVarint); + } + if let Some(ref v) = self.rewrite_options.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.enable_recv_scheduling != false { + os.write_bool(2, self.enable_recv_scheduling)?; + } + if let Some(ref v) = self.optimizer_options.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.build_cost_model != 0 { + os.write_int64(4, self.build_cost_model)?; + } + if self.build_cost_model_after != 0 { + os.write_int64(9, self.build_cost_model_after)?; + } + if self.infer_shapes != false { + os.write_bool(5, self.infer_shapes)?; + } + if self.place_pruned_graph != false { + os.write_bool(6, self.place_pruned_graph)?; + } + if self.enable_bfloat16_sendrecv != false { + os.write_bool(7, self.enable_bfloat16_sendrecv)?; + } + if self.timeline_step != 0 { + os.write_int32(8, self.timeline_step)?; + } + if let Some(ref v) = self.rewrite_options.as_ref() { + 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: Box) -> ::std::boxed::Box { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> GraphOptions { + GraphOptions::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, + }; + unsafe { + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBool>( + "enable_recv_scheduling", + |m: &GraphOptions| { &m.enable_recv_scheduling }, + |m: &mut GraphOptions| { &mut m.enable_recv_scheduling }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( + "optimizer_options", + |m: &GraphOptions| { &m.optimizer_options }, + |m: &mut GraphOptions| { &mut m.optimizer_options }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt64>( + "build_cost_model", + |m: &GraphOptions| { &m.build_cost_model }, + |m: &mut GraphOptions| { &mut m.build_cost_model }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt64>( + "build_cost_model_after", + |m: &GraphOptions| { &m.build_cost_model_after }, + |m: &mut GraphOptions| { &mut m.build_cost_model_after }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBool>( + "infer_shapes", + |m: &GraphOptions| { &m.infer_shapes }, + |m: &mut GraphOptions| { &mut m.infer_shapes }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBool>( + "place_pruned_graph", + |m: &GraphOptions| { &m.place_pruned_graph }, + |m: &mut GraphOptions| { &mut m.place_pruned_graph }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBool>( + "enable_bfloat16_sendrecv", + |m: &GraphOptions| { &m.enable_bfloat16_sendrecv }, + |m: &mut GraphOptions| { &mut m.enable_bfloat16_sendrecv }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt32>( + "timeline_step", + |m: &GraphOptions| { &m.timeline_step }, + |m: &mut GraphOptions| { &mut m.timeline_step }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( + "rewrite_options", + |m: &GraphOptions| { &m.rewrite_options }, + |m: &mut GraphOptions| { &mut m.rewrite_options }, + )); + ::protobuf::reflect::MessageDescriptor::new::( + "GraphOptions", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static GraphOptions { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const GraphOptions, + }; + unsafe { + instance.get(GraphOptions::new) + } + } +} + +impl ::protobuf::Clear for GraphOptions { + fn clear(&mut self) { + self.enable_recv_scheduling = false; + self.optimizer_options.clear(); + self.build_cost_model = 0; + self.build_cost_model_after = 0; + self.infer_shapes = false; + self.place_pruned_graph = false; + self.enable_bfloat16_sendrecv = false; + self.timeline_step = 0; + self.rewrite_options.clear(); + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for GraphOptions { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for GraphOptions { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct ThreadPoolOptionProto { + // message fields + pub num_threads: i32, + pub global_name: ::std::string::String, + // special fields + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, +} + +impl<'a> ::std::default::Default for &'a ThreadPoolOptionProto { + fn default() -> &'a ThreadPoolOptionProto { + ::default_instance() + } +} + +impl ThreadPoolOptionProto { + pub fn new() -> ThreadPoolOptionProto { + ::std::default::Default::default() + } + + // int32 num_threads = 1; + + + pub fn get_num_threads(&self) -> i32 { + self.num_threads + } + pub fn clear_num_threads(&mut self) { + self.num_threads = 0; + } + + // Param is passed by value, moved + pub fn set_num_threads(&mut self, v: i32) { + self.num_threads = v; + } + + // string global_name = 2; + + + pub fn get_global_name(&self) -> &str { + &self.global_name + } + pub fn clear_global_name(&mut self) { + self.global_name.clear(); + } + + // Param is passed by value, moved + pub fn set_global_name(&mut self, v: ::std::string::String) { + self.global_name = v; + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_global_name(&mut self) -> &mut ::std::string::String { + &mut self.global_name + } + + // Take field + pub fn take_global_name(&mut self) -> ::std::string::String { + ::std::mem::replace(&mut self.global_name, ::std::string::String::new()) + } +} + +impl ::protobuf::Message for ThreadPoolOptionProto { + 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.num_threads = tmp; + }, + 2 => { + ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.global_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.num_threads != 0 { + my_size += ::protobuf::rt::value_size(1, self.num_threads, ::protobuf::wire_format::WireTypeVarint); + } + if !self.global_name.is_empty() { + my_size += ::protobuf::rt::string_size(2, &self.global_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.num_threads != 0 { + os.write_int32(1, self.num_threads)?; + } + if !self.global_name.is_empty() { + os.write_string(2, &self.global_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: Box) -> ::std::boxed::Box { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> ThreadPoolOptionProto { + ThreadPoolOptionProto::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, + }; + unsafe { + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt32>( + "num_threads", + |m: &ThreadPoolOptionProto| { &m.num_threads }, + |m: &mut ThreadPoolOptionProto| { &mut m.num_threads }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "global_name", + |m: &ThreadPoolOptionProto| { &m.global_name }, + |m: &mut ThreadPoolOptionProto| { &mut m.global_name }, + )); + ::protobuf::reflect::MessageDescriptor::new::( + "ThreadPoolOptionProto", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static ThreadPoolOptionProto { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ThreadPoolOptionProto, + }; + unsafe { + instance.get(ThreadPoolOptionProto::new) + } + } +} + +impl ::protobuf::Clear for ThreadPoolOptionProto { + fn clear(&mut self) { + self.num_threads = 0; + self.global_name.clear(); + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for ThreadPoolOptionProto { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for ThreadPoolOptionProto { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct RPCOptions { + // message fields + pub use_rpc_for_inprocess_master: bool, + pub compression_algorithm: ::std::string::String, + pub compression_level: i32, + // special fields + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, +} + +impl<'a> ::std::default::Default for &'a RPCOptions { + fn default() -> &'a RPCOptions { + ::default_instance() + } +} + +impl RPCOptions { + pub fn new() -> RPCOptions { + ::std::default::Default::default() + } + + // bool use_rpc_for_inprocess_master = 1; + + + pub fn get_use_rpc_for_inprocess_master(&self) -> bool { + self.use_rpc_for_inprocess_master + } + pub fn clear_use_rpc_for_inprocess_master(&mut self) { + self.use_rpc_for_inprocess_master = false; + } + + // Param is passed by value, moved + pub fn set_use_rpc_for_inprocess_master(&mut self, v: bool) { + self.use_rpc_for_inprocess_master = v; + } + + // string compression_algorithm = 2; + + + pub fn get_compression_algorithm(&self) -> &str { + &self.compression_algorithm + } + pub fn clear_compression_algorithm(&mut self) { + self.compression_algorithm.clear(); + } + + // Param is passed by value, moved + pub fn set_compression_algorithm(&mut self, v: ::std::string::String) { + self.compression_algorithm = v; + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_compression_algorithm(&mut self) -> &mut ::std::string::String { + &mut self.compression_algorithm + } + + // Take field + pub fn take_compression_algorithm(&mut self) -> ::std::string::String { + ::std::mem::replace(&mut self.compression_algorithm, ::std::string::String::new()) + } + + // int32 compression_level = 3; + + + pub fn get_compression_level(&self) -> i32 { + self.compression_level + } + pub fn clear_compression_level(&mut self) { + self.compression_level = 0; + } + + // Param is passed by value, moved + pub fn set_compression_level(&mut self, v: i32) { + self.compression_level = v; + } +} + +impl ::protobuf::Message for RPCOptions { + 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_bool()?; + self.use_rpc_for_inprocess_master = tmp; + }, + 2 => { + ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.compression_algorithm)?; + }, + 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.compression_level = 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.use_rpc_for_inprocess_master != false { + my_size += 2; + } + if !self.compression_algorithm.is_empty() { + my_size += ::protobuf::rt::string_size(2, &self.compression_algorithm); + } + if self.compression_level != 0 { + my_size += ::protobuf::rt::value_size(3, self.compression_level, ::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.use_rpc_for_inprocess_master != false { + os.write_bool(1, self.use_rpc_for_inprocess_master)?; + } + if !self.compression_algorithm.is_empty() { + os.write_string(2, &self.compression_algorithm)?; + } + if self.compression_level != 0 { + os.write_int32(3, self.compression_level)?; + } + 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: Box) -> ::std::boxed::Box { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> RPCOptions { + RPCOptions::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, + }; + unsafe { + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBool>( + "use_rpc_for_inprocess_master", + |m: &RPCOptions| { &m.use_rpc_for_inprocess_master }, + |m: &mut RPCOptions| { &mut m.use_rpc_for_inprocess_master }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "compression_algorithm", + |m: &RPCOptions| { &m.compression_algorithm }, + |m: &mut RPCOptions| { &mut m.compression_algorithm }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt32>( + "compression_level", + |m: &RPCOptions| { &m.compression_level }, + |m: &mut RPCOptions| { &mut m.compression_level }, + )); + ::protobuf::reflect::MessageDescriptor::new::( + "RPCOptions", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static RPCOptions { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const RPCOptions, + }; + unsafe { + instance.get(RPCOptions::new) + } + } +} + +impl ::protobuf::Clear for RPCOptions { + fn clear(&mut self) { + self.use_rpc_for_inprocess_master = false; + self.compression_algorithm.clear(); + self.compression_level = 0; + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for RPCOptions { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for RPCOptions { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct ConfigProto { + // message fields + pub device_count: ::std::collections::HashMap<::std::string::String, i32>, + pub intra_op_parallelism_threads: i32, + pub inter_op_parallelism_threads: i32, + pub use_per_session_threads: bool, + pub session_inter_op_thread_pool: ::protobuf::RepeatedField, + pub placement_period: i32, + pub device_filters: ::protobuf::RepeatedField<::std::string::String>, + pub gpu_options: ::protobuf::SingularPtrField, + pub allow_soft_placement: bool, + pub log_device_placement: bool, + pub graph_options: ::protobuf::SingularPtrField, + pub operation_timeout_in_ms: i64, + pub rpc_options: ::protobuf::SingularPtrField, + pub cluster_def: ::protobuf::SingularPtrField, + pub isolate_session_state: bool, + pub experimental: ::protobuf::SingularPtrField, + // special fields + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, +} + +impl<'a> ::std::default::Default for &'a ConfigProto { + fn default() -> &'a ConfigProto { + ::default_instance() + } +} + +impl ConfigProto { + pub fn new() -> ConfigProto { + ::std::default::Default::default() + } + + // repeated .tensorflow.ConfigProto.DeviceCountEntry device_count = 1; + + + pub fn get_device_count(&self) -> &::std::collections::HashMap<::std::string::String, i32> { + &self.device_count + } + pub fn clear_device_count(&mut self) { + self.device_count.clear(); + } + + // Param is passed by value, moved + pub fn set_device_count(&mut self, v: ::std::collections::HashMap<::std::string::String, i32>) { + self.device_count = v; + } + + // Mutable pointer to the field. + pub fn mut_device_count(&mut self) -> &mut ::std::collections::HashMap<::std::string::String, i32> { + &mut self.device_count + } + + // Take field + pub fn take_device_count(&mut self) -> ::std::collections::HashMap<::std::string::String, i32> { + ::std::mem::replace(&mut self.device_count, ::std::collections::HashMap::new()) + } + + // int32 intra_op_parallelism_threads = 2; + + + pub fn get_intra_op_parallelism_threads(&self) -> i32 { + self.intra_op_parallelism_threads + } + pub fn clear_intra_op_parallelism_threads(&mut self) { + self.intra_op_parallelism_threads = 0; + } + + // Param is passed by value, moved + pub fn set_intra_op_parallelism_threads(&mut self, v: i32) { + self.intra_op_parallelism_threads = v; + } + + // int32 inter_op_parallelism_threads = 5; + + + pub fn get_inter_op_parallelism_threads(&self) -> i32 { + self.inter_op_parallelism_threads + } + pub fn clear_inter_op_parallelism_threads(&mut self) { + self.inter_op_parallelism_threads = 0; + } + + // Param is passed by value, moved + pub fn set_inter_op_parallelism_threads(&mut self, v: i32) { + self.inter_op_parallelism_threads = v; + } + + // bool use_per_session_threads = 9; + + + pub fn get_use_per_session_threads(&self) -> bool { + self.use_per_session_threads + } + pub fn clear_use_per_session_threads(&mut self) { + self.use_per_session_threads = false; + } + + // Param is passed by value, moved + pub fn set_use_per_session_threads(&mut self, v: bool) { + self.use_per_session_threads = v; + } + + // repeated .tensorflow.ThreadPoolOptionProto session_inter_op_thread_pool = 12; + + + pub fn get_session_inter_op_thread_pool(&self) -> &[ThreadPoolOptionProto] { + &self.session_inter_op_thread_pool + } + pub fn clear_session_inter_op_thread_pool(&mut self) { + self.session_inter_op_thread_pool.clear(); + } + + // Param is passed by value, moved + pub fn set_session_inter_op_thread_pool(&mut self, v: ::protobuf::RepeatedField) { + self.session_inter_op_thread_pool = v; + } + + // Mutable pointer to the field. + pub fn mut_session_inter_op_thread_pool(&mut self) -> &mut ::protobuf::RepeatedField { + &mut self.session_inter_op_thread_pool + } + + // Take field + pub fn take_session_inter_op_thread_pool(&mut self) -> ::protobuf::RepeatedField { + ::std::mem::replace(&mut self.session_inter_op_thread_pool, ::protobuf::RepeatedField::new()) + } + + // int32 placement_period = 3; + + + pub fn get_placement_period(&self) -> i32 { + self.placement_period + } + pub fn clear_placement_period(&mut self) { + self.placement_period = 0; + } + + // Param is passed by value, moved + pub fn set_placement_period(&mut self, v: i32) { + self.placement_period = v; + } + + // repeated string device_filters = 4; + + + pub fn get_device_filters(&self) -> &[::std::string::String] { + &self.device_filters + } + pub fn clear_device_filters(&mut self) { + self.device_filters.clear(); + } + + // Param is passed by value, moved + pub fn set_device_filters(&mut self, v: ::protobuf::RepeatedField<::std::string::String>) { + self.device_filters = v; + } + + // Mutable pointer to the field. + pub fn mut_device_filters(&mut self) -> &mut ::protobuf::RepeatedField<::std::string::String> { + &mut self.device_filters + } + + // Take field + pub fn take_device_filters(&mut self) -> ::protobuf::RepeatedField<::std::string::String> { + ::std::mem::replace(&mut self.device_filters, ::protobuf::RepeatedField::new()) + } + + // .tensorflow.GPUOptions gpu_options = 6; + + + pub fn get_gpu_options(&self) -> &GPUOptions { + self.gpu_options.as_ref().unwrap_or_else(|| GPUOptions::default_instance()) + } + pub fn clear_gpu_options(&mut self) { + self.gpu_options.clear(); + } + + pub fn has_gpu_options(&self) -> bool { + self.gpu_options.is_some() + } + + // Param is passed by value, moved + pub fn set_gpu_options(&mut self, v: GPUOptions) { + self.gpu_options = ::protobuf::SingularPtrField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_gpu_options(&mut self) -> &mut GPUOptions { + if self.gpu_options.is_none() { + self.gpu_options.set_default(); + } + self.gpu_options.as_mut().unwrap() + } + + // Take field + pub fn take_gpu_options(&mut self) -> GPUOptions { + self.gpu_options.take().unwrap_or_else(|| GPUOptions::new()) + } + + // bool allow_soft_placement = 7; + + + pub fn get_allow_soft_placement(&self) -> bool { + self.allow_soft_placement + } + pub fn clear_allow_soft_placement(&mut self) { + self.allow_soft_placement = false; + } + + // Param is passed by value, moved + pub fn set_allow_soft_placement(&mut self, v: bool) { + self.allow_soft_placement = v; + } + + // bool log_device_placement = 8; + + + pub fn get_log_device_placement(&self) -> bool { + self.log_device_placement + } + pub fn clear_log_device_placement(&mut self) { + self.log_device_placement = false; + } + + // Param is passed by value, moved + pub fn set_log_device_placement(&mut self, v: bool) { + self.log_device_placement = v; + } + + // .tensorflow.GraphOptions graph_options = 10; + + + pub fn get_graph_options(&self) -> &GraphOptions { + self.graph_options.as_ref().unwrap_or_else(|| GraphOptions::default_instance()) + } + pub fn clear_graph_options(&mut self) { + self.graph_options.clear(); + } + + pub fn has_graph_options(&self) -> bool { + self.graph_options.is_some() + } + + // Param is passed by value, moved + pub fn set_graph_options(&mut self, v: GraphOptions) { + self.graph_options = ::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_options(&mut self) -> &mut GraphOptions { + if self.graph_options.is_none() { + self.graph_options.set_default(); + } + self.graph_options.as_mut().unwrap() + } + + // Take field + pub fn take_graph_options(&mut self) -> GraphOptions { + self.graph_options.take().unwrap_or_else(|| GraphOptions::new()) + } + + // int64 operation_timeout_in_ms = 11; + + + pub fn get_operation_timeout_in_ms(&self) -> i64 { + self.operation_timeout_in_ms + } + pub fn clear_operation_timeout_in_ms(&mut self) { + self.operation_timeout_in_ms = 0; + } + + // Param is passed by value, moved + pub fn set_operation_timeout_in_ms(&mut self, v: i64) { + self.operation_timeout_in_ms = v; + } + + // .tensorflow.RPCOptions rpc_options = 13; + + + pub fn get_rpc_options(&self) -> &RPCOptions { + self.rpc_options.as_ref().unwrap_or_else(|| RPCOptions::default_instance()) + } + pub fn clear_rpc_options(&mut self) { + self.rpc_options.clear(); + } + + pub fn has_rpc_options(&self) -> bool { + self.rpc_options.is_some() + } + + // Param is passed by value, moved + pub fn set_rpc_options(&mut self, v: RPCOptions) { + self.rpc_options = ::protobuf::SingularPtrField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_rpc_options(&mut self) -> &mut RPCOptions { + if self.rpc_options.is_none() { + self.rpc_options.set_default(); + } + self.rpc_options.as_mut().unwrap() + } + + // Take field + pub fn take_rpc_options(&mut self) -> RPCOptions { + self.rpc_options.take().unwrap_or_else(|| RPCOptions::new()) + } + + // .tensorflow.ClusterDef cluster_def = 14; + + + pub fn get_cluster_def(&self) -> &super::cluster::ClusterDef { + self.cluster_def.as_ref().unwrap_or_else(|| super::cluster::ClusterDef::default_instance()) + } + pub fn clear_cluster_def(&mut self) { + self.cluster_def.clear(); + } + + pub fn has_cluster_def(&self) -> bool { + self.cluster_def.is_some() + } + + // Param is passed by value, moved + pub fn set_cluster_def(&mut self, v: super::cluster::ClusterDef) { + self.cluster_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_cluster_def(&mut self) -> &mut super::cluster::ClusterDef { + if self.cluster_def.is_none() { + self.cluster_def.set_default(); + } + self.cluster_def.as_mut().unwrap() + } + + // Take field + pub fn take_cluster_def(&mut self) -> super::cluster::ClusterDef { + self.cluster_def.take().unwrap_or_else(|| super::cluster::ClusterDef::new()) + } + + // bool isolate_session_state = 15; + + + pub fn get_isolate_session_state(&self) -> bool { + self.isolate_session_state + } + pub fn clear_isolate_session_state(&mut self) { + self.isolate_session_state = false; + } + + // Param is passed by value, moved + pub fn set_isolate_session_state(&mut self, v: bool) { + self.isolate_session_state = v; + } + + // .tensorflow.ConfigProto.Experimental experimental = 16; + + + pub fn get_experimental(&self) -> &ConfigProto_Experimental { + self.experimental.as_ref().unwrap_or_else(|| ConfigProto_Experimental::default_instance()) + } + pub fn clear_experimental(&mut self) { + self.experimental.clear(); + } + + pub fn has_experimental(&self) -> bool { + self.experimental.is_some() + } + + // Param is passed by value, moved + pub fn set_experimental(&mut self, v: ConfigProto_Experimental) { + self.experimental = ::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(&mut self) -> &mut ConfigProto_Experimental { + if self.experimental.is_none() { + self.experimental.set_default(); + } + self.experimental.as_mut().unwrap() + } + + // Take field + pub fn take_experimental(&mut self) -> ConfigProto_Experimental { + self.experimental.take().unwrap_or_else(|| ConfigProto_Experimental::new()) + } +} + +impl ::protobuf::Message for ConfigProto { + fn is_initialized(&self) -> bool { + for v in &self.session_inter_op_thread_pool { + if !v.is_initialized() { + return false; + } + }; + for v in &self.gpu_options { + if !v.is_initialized() { + return false; + } + }; + for v in &self.graph_options { + if !v.is_initialized() { + return false; + } + }; + for v in &self.rpc_options { + if !v.is_initialized() { + return false; + } + }; + for v in &self.cluster_def { + if !v.is_initialized() { + return false; + } + }; + for v in &self.experimental { + 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_map_into::<::protobuf::types::ProtobufTypeString, ::protobuf::types::ProtobufTypeInt32>(wire_type, is, &mut self.device_count)?; + }, + 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.intra_op_parallelism_threads = 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_int32()?; + self.inter_op_parallelism_threads = tmp; + }, + 9 => { + 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.use_per_session_threads = tmp; + }, + 12 => { + ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.session_inter_op_thread_pool)?; + }, + 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.placement_period = tmp; + }, + 4 => { + ::protobuf::rt::read_repeated_string_into(wire_type, is, &mut self.device_filters)?; + }, + 6 => { + ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.gpu_options)?; + }, + 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.allow_soft_placement = tmp; + }, + 8 => { + 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.log_device_placement = tmp; + }, + 10 => { + ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.graph_options)?; + }, + 11 => { + 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.operation_timeout_in_ms = tmp; + }, + 13 => { + ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.rpc_options)?; + }, + 14 => { + ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.cluster_def)?; + }, + 15 => { + 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.isolate_session_state = tmp; + }, + 16 => { + ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.experimental)?; + }, + _ => { + ::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::ProtobufTypeInt32>(1, &self.device_count); + if self.intra_op_parallelism_threads != 0 { + my_size += ::protobuf::rt::value_size(2, self.intra_op_parallelism_threads, ::protobuf::wire_format::WireTypeVarint); + } + if self.inter_op_parallelism_threads != 0 { + my_size += ::protobuf::rt::value_size(5, self.inter_op_parallelism_threads, ::protobuf::wire_format::WireTypeVarint); + } + if self.use_per_session_threads != false { + my_size += 2; + } + for value in &self.session_inter_op_thread_pool { + let len = value.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; + }; + if self.placement_period != 0 { + my_size += ::protobuf::rt::value_size(3, self.placement_period, ::protobuf::wire_format::WireTypeVarint); + } + for value in &self.device_filters { + my_size += ::protobuf::rt::string_size(4, &value); + }; + if let Some(ref v) = self.gpu_options.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; + } + if self.allow_soft_placement != false { + my_size += 2; + } + if self.log_device_placement != false { + my_size += 2; + } + if let Some(ref v) = self.graph_options.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; + } + if self.operation_timeout_in_ms != 0 { + my_size += ::protobuf::rt::value_size(11, self.operation_timeout_in_ms, ::protobuf::wire_format::WireTypeVarint); + } + if let Some(ref v) = self.rpc_options.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; + } + if let Some(ref v) = self.cluster_def.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; + } + if self.isolate_session_state != false { + my_size += 2; + } + if let Some(ref v) = self.experimental.as_ref() { + 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<()> { + ::protobuf::rt::write_map_with_cached_sizes::<::protobuf::types::ProtobufTypeString, ::protobuf::types::ProtobufTypeInt32>(1, &self.device_count, os)?; + if self.intra_op_parallelism_threads != 0 { + os.write_int32(2, self.intra_op_parallelism_threads)?; + } + if self.inter_op_parallelism_threads != 0 { + os.write_int32(5, self.inter_op_parallelism_threads)?; + } + if self.use_per_session_threads != false { + os.write_bool(9, self.use_per_session_threads)?; + } + for v in &self.session_inter_op_thread_pool { + os.write_tag(12, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; + }; + if self.placement_period != 0 { + os.write_int32(3, self.placement_period)?; + } + for v in &self.device_filters { + os.write_string(4, &v)?; + }; + if let Some(ref v) = self.gpu_options.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)?; + } + if self.allow_soft_placement != false { + os.write_bool(7, self.allow_soft_placement)?; + } + if self.log_device_placement != false { + os.write_bool(8, self.log_device_placement)?; + } + if let Some(ref v) = self.graph_options.as_ref() { + os.write_tag(10, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; + } + if self.operation_timeout_in_ms != 0 { + os.write_int64(11, self.operation_timeout_in_ms)?; + } + if let Some(ref v) = self.rpc_options.as_ref() { + os.write_tag(13, ::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.cluster_def.as_ref() { + os.write_tag(14, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; + } + if self.isolate_session_state != false { + os.write_bool(15, self.isolate_session_state)?; + } + if let Some(ref v) = self.experimental.as_ref() { + os.write_tag(16, ::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: Box) -> ::std::boxed::Box { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> ConfigProto { + ConfigProto::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, + }; + unsafe { + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_map_accessor::<_, ::protobuf::types::ProtobufTypeString, ::protobuf::types::ProtobufTypeInt32>( + "device_count", + |m: &ConfigProto| { &m.device_count }, + |m: &mut ConfigProto| { &mut m.device_count }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt32>( + "intra_op_parallelism_threads", + |m: &ConfigProto| { &m.intra_op_parallelism_threads }, + |m: &mut ConfigProto| { &mut m.intra_op_parallelism_threads }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt32>( + "inter_op_parallelism_threads", + |m: &ConfigProto| { &m.inter_op_parallelism_threads }, + |m: &mut ConfigProto| { &mut m.inter_op_parallelism_threads }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBool>( + "use_per_session_threads", + |m: &ConfigProto| { &m.use_per_session_threads }, + |m: &mut ConfigProto| { &mut m.use_per_session_threads }, + )); + fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( + "session_inter_op_thread_pool", + |m: &ConfigProto| { &m.session_inter_op_thread_pool }, + |m: &mut ConfigProto| { &mut m.session_inter_op_thread_pool }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt32>( + "placement_period", + |m: &ConfigProto| { &m.placement_period }, + |m: &mut ConfigProto| { &mut m.placement_period }, + )); + fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "device_filters", + |m: &ConfigProto| { &m.device_filters }, + |m: &mut ConfigProto| { &mut m.device_filters }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( + "gpu_options", + |m: &ConfigProto| { &m.gpu_options }, + |m: &mut ConfigProto| { &mut m.gpu_options }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBool>( + "allow_soft_placement", + |m: &ConfigProto| { &m.allow_soft_placement }, + |m: &mut ConfigProto| { &mut m.allow_soft_placement }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBool>( + "log_device_placement", + |m: &ConfigProto| { &m.log_device_placement }, + |m: &mut ConfigProto| { &mut m.log_device_placement }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( + "graph_options", + |m: &ConfigProto| { &m.graph_options }, + |m: &mut ConfigProto| { &mut m.graph_options }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt64>( + "operation_timeout_in_ms", + |m: &ConfigProto| { &m.operation_timeout_in_ms }, + |m: &mut ConfigProto| { &mut m.operation_timeout_in_ms }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( + "rpc_options", + |m: &ConfigProto| { &m.rpc_options }, + |m: &mut ConfigProto| { &mut m.rpc_options }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( + "cluster_def", + |m: &ConfigProto| { &m.cluster_def }, + |m: &mut ConfigProto| { &mut m.cluster_def }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBool>( + "isolate_session_state", + |m: &ConfigProto| { &m.isolate_session_state }, + |m: &mut ConfigProto| { &mut m.isolate_session_state }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( + "experimental", + |m: &ConfigProto| { &m.experimental }, + |m: &mut ConfigProto| { &mut m.experimental }, + )); + ::protobuf::reflect::MessageDescriptor::new::( + "ConfigProto", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static ConfigProto { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ConfigProto, + }; + unsafe { + instance.get(ConfigProto::new) + } + } +} + +impl ::protobuf::Clear for ConfigProto { + fn clear(&mut self) { + self.device_count.clear(); + self.intra_op_parallelism_threads = 0; + self.inter_op_parallelism_threads = 0; + self.use_per_session_threads = false; + self.session_inter_op_thread_pool.clear(); + self.placement_period = 0; + self.device_filters.clear(); + self.gpu_options.clear(); + self.allow_soft_placement = false; + self.log_device_placement = false; + self.graph_options.clear(); + self.operation_timeout_in_ms = 0; + self.rpc_options.clear(); + self.cluster_def.clear(); + self.isolate_session_state = false; + self.experimental.clear(); + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for ConfigProto { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for ConfigProto { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct ConfigProto_Experimental { + // message fields + pub collective_group_leader: ::std::string::String, + pub executor_type: ::std::string::String, + pub recv_buf_max_chunk: i32, + pub use_numa_affinity: bool, + // special fields + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, +} + +impl<'a> ::std::default::Default for &'a ConfigProto_Experimental { + fn default() -> &'a ConfigProto_Experimental { + ::default_instance() + } +} + +impl ConfigProto_Experimental { + pub fn new() -> ConfigProto_Experimental { + ::std::default::Default::default() + } + + // string collective_group_leader = 1; + + + pub fn get_collective_group_leader(&self) -> &str { + &self.collective_group_leader + } + pub fn clear_collective_group_leader(&mut self) { + self.collective_group_leader.clear(); + } + + // Param is passed by value, moved + pub fn set_collective_group_leader(&mut self, v: ::std::string::String) { + self.collective_group_leader = v; + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_collective_group_leader(&mut self) -> &mut ::std::string::String { + &mut self.collective_group_leader + } + + // Take field + pub fn take_collective_group_leader(&mut self) -> ::std::string::String { + ::std::mem::replace(&mut self.collective_group_leader, ::std::string::String::new()) + } + + // string executor_type = 3; + + + pub fn get_executor_type(&self) -> &str { + &self.executor_type + } + pub fn clear_executor_type(&mut self) { + self.executor_type.clear(); + } + + // Param is passed by value, moved + pub fn set_executor_type(&mut self, v: ::std::string::String) { + self.executor_type = v; + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_executor_type(&mut self) -> &mut ::std::string::String { + &mut self.executor_type + } + + // Take field + pub fn take_executor_type(&mut self) -> ::std::string::String { + ::std::mem::replace(&mut self.executor_type, ::std::string::String::new()) + } + + // int32 recv_buf_max_chunk = 4; + + + pub fn get_recv_buf_max_chunk(&self) -> i32 { + self.recv_buf_max_chunk + } + pub fn clear_recv_buf_max_chunk(&mut self) { + self.recv_buf_max_chunk = 0; + } + + // Param is passed by value, moved + pub fn set_recv_buf_max_chunk(&mut self, v: i32) { + self.recv_buf_max_chunk = v; + } + + // bool use_numa_affinity = 5; + + + pub fn get_use_numa_affinity(&self) -> bool { + self.use_numa_affinity + } + pub fn clear_use_numa_affinity(&mut self) { + self.use_numa_affinity = false; + } + + // Param is passed by value, moved + pub fn set_use_numa_affinity(&mut self, v: bool) { + self.use_numa_affinity = v; + } +} + +impl ::protobuf::Message for ConfigProto_Experimental { + 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.collective_group_leader)?; + }, + 3 => { + ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.executor_type)?; + }, + 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.recv_buf_max_chunk = 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.use_numa_affinity = 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.collective_group_leader.is_empty() { + my_size += ::protobuf::rt::string_size(1, &self.collective_group_leader); + } + if !self.executor_type.is_empty() { + my_size += ::protobuf::rt::string_size(3, &self.executor_type); + } + if self.recv_buf_max_chunk != 0 { + my_size += ::protobuf::rt::value_size(4, self.recv_buf_max_chunk, ::protobuf::wire_format::WireTypeVarint); + } + if self.use_numa_affinity != 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.collective_group_leader.is_empty() { + os.write_string(1, &self.collective_group_leader)?; + } + if !self.executor_type.is_empty() { + os.write_string(3, &self.executor_type)?; + } + if self.recv_buf_max_chunk != 0 { + os.write_int32(4, self.recv_buf_max_chunk)?; + } + if self.use_numa_affinity != false { + os.write_bool(5, self.use_numa_affinity)?; + } + 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: Box) -> ::std::boxed::Box { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> ConfigProto_Experimental { + ConfigProto_Experimental::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, + }; + unsafe { + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "collective_group_leader", + |m: &ConfigProto_Experimental| { &m.collective_group_leader }, + |m: &mut ConfigProto_Experimental| { &mut m.collective_group_leader }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "executor_type", + |m: &ConfigProto_Experimental| { &m.executor_type }, + |m: &mut ConfigProto_Experimental| { &mut m.executor_type }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt32>( + "recv_buf_max_chunk", + |m: &ConfigProto_Experimental| { &m.recv_buf_max_chunk }, + |m: &mut ConfigProto_Experimental| { &mut m.recv_buf_max_chunk }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBool>( + "use_numa_affinity", + |m: &ConfigProto_Experimental| { &m.use_numa_affinity }, + |m: &mut ConfigProto_Experimental| { &mut m.use_numa_affinity }, + )); + ::protobuf::reflect::MessageDescriptor::new::( + "ConfigProto_Experimental", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static ConfigProto_Experimental { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ConfigProto_Experimental, + }; + unsafe { + instance.get(ConfigProto_Experimental::new) + } + } +} + +impl ::protobuf::Clear for ConfigProto_Experimental { + fn clear(&mut self) { + self.collective_group_leader.clear(); + self.executor_type.clear(); + self.recv_buf_max_chunk = 0; + self.use_numa_affinity = false; + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for ConfigProto_Experimental { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for ConfigProto_Experimental { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct RunOptions { + // message fields + pub trace_level: RunOptions_TraceLevel, + pub timeout_in_ms: i64, + pub inter_op_thread_pool: i32, + pub output_partition_graphs: bool, + pub debug_options: ::protobuf::SingularPtrField, + pub report_tensor_allocations_upon_oom: bool, + pub experimental: ::protobuf::SingularPtrField, + // special fields + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, +} + +impl<'a> ::std::default::Default for &'a RunOptions { + fn default() -> &'a RunOptions { + ::default_instance() + } +} + +impl RunOptions { + pub fn new() -> RunOptions { + ::std::default::Default::default() + } + + // .tensorflow.RunOptions.TraceLevel trace_level = 1; + + + pub fn get_trace_level(&self) -> RunOptions_TraceLevel { + self.trace_level + } + pub fn clear_trace_level(&mut self) { + self.trace_level = RunOptions_TraceLevel::NO_TRACE; + } + + // Param is passed by value, moved + pub fn set_trace_level(&mut self, v: RunOptions_TraceLevel) { + self.trace_level = v; + } + + // int64 timeout_in_ms = 2; + + + pub fn get_timeout_in_ms(&self) -> i64 { + self.timeout_in_ms + } + pub fn clear_timeout_in_ms(&mut self) { + self.timeout_in_ms = 0; + } + + // Param is passed by value, moved + pub fn set_timeout_in_ms(&mut self, v: i64) { + self.timeout_in_ms = v; + } + + // int32 inter_op_thread_pool = 3; + + + pub fn get_inter_op_thread_pool(&self) -> i32 { + self.inter_op_thread_pool + } + pub fn clear_inter_op_thread_pool(&mut self) { + self.inter_op_thread_pool = 0; + } + + // Param is passed by value, moved + pub fn set_inter_op_thread_pool(&mut self, v: i32) { + self.inter_op_thread_pool = v; + } + + // bool output_partition_graphs = 5; + + + pub fn get_output_partition_graphs(&self) -> bool { + self.output_partition_graphs + } + pub fn clear_output_partition_graphs(&mut self) { + self.output_partition_graphs = false; + } + + // Param is passed by value, moved + pub fn set_output_partition_graphs(&mut self, v: bool) { + self.output_partition_graphs = v; + } + + // .tensorflow.DebugOptions debug_options = 6; + + + pub fn get_debug_options(&self) -> &super::debug::DebugOptions { + self.debug_options.as_ref().unwrap_or_else(|| super::debug::DebugOptions::default_instance()) + } + pub fn clear_debug_options(&mut self) { + self.debug_options.clear(); + } + + pub fn has_debug_options(&self) -> bool { + self.debug_options.is_some() + } + + // Param is passed by value, moved + pub fn set_debug_options(&mut self, v: super::debug::DebugOptions) { + self.debug_options = ::protobuf::SingularPtrField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_debug_options(&mut self) -> &mut super::debug::DebugOptions { + if self.debug_options.is_none() { + self.debug_options.set_default(); + } + self.debug_options.as_mut().unwrap() + } + + // Take field + pub fn take_debug_options(&mut self) -> super::debug::DebugOptions { + self.debug_options.take().unwrap_or_else(|| super::debug::DebugOptions::new()) + } + + // bool report_tensor_allocations_upon_oom = 7; + + + pub fn get_report_tensor_allocations_upon_oom(&self) -> bool { + self.report_tensor_allocations_upon_oom + } + pub fn clear_report_tensor_allocations_upon_oom(&mut self) { + self.report_tensor_allocations_upon_oom = false; + } + + // Param is passed by value, moved + pub fn set_report_tensor_allocations_upon_oom(&mut self, v: bool) { + self.report_tensor_allocations_upon_oom = v; + } + + // .tensorflow.RunOptions.Experimental experimental = 8; + + + pub fn get_experimental(&self) -> &RunOptions_Experimental { + self.experimental.as_ref().unwrap_or_else(|| RunOptions_Experimental::default_instance()) + } + pub fn clear_experimental(&mut self) { + self.experimental.clear(); + } + + pub fn has_experimental(&self) -> bool { + self.experimental.is_some() + } + + // Param is passed by value, moved + pub fn set_experimental(&mut self, v: RunOptions_Experimental) { + self.experimental = ::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(&mut self) -> &mut RunOptions_Experimental { + if self.experimental.is_none() { + self.experimental.set_default(); + } + self.experimental.as_mut().unwrap() + } + + // Take field + pub fn take_experimental(&mut self) -> RunOptions_Experimental { + self.experimental.take().unwrap_or_else(|| RunOptions_Experimental::new()) + } +} + +impl ::protobuf::Message for RunOptions { + fn is_initialized(&self) -> bool { + for v in &self.debug_options { + if !v.is_initialized() { + return false; + } + }; + for v in &self.experimental { + 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.trace_level, 1, &mut self.unknown_fields)? + }, + 2 => { + 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.timeout_in_ms = tmp; + }, + 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.inter_op_thread_pool = 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.output_partition_graphs = tmp; + }, + 6 => { + ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.debug_options)?; + }, + 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.report_tensor_allocations_upon_oom = tmp; + }, + 8 => { + ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.experimental)?; + }, + _ => { + ::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.trace_level != RunOptions_TraceLevel::NO_TRACE { + my_size += ::protobuf::rt::enum_size(1, self.trace_level); + } + if self.timeout_in_ms != 0 { + my_size += ::protobuf::rt::value_size(2, self.timeout_in_ms, ::protobuf::wire_format::WireTypeVarint); + } + if self.inter_op_thread_pool != 0 { + my_size += ::protobuf::rt::value_size(3, self.inter_op_thread_pool, ::protobuf::wire_format::WireTypeVarint); + } + if self.output_partition_graphs != false { + my_size += 2; + } + if let Some(ref v) = self.debug_options.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; + } + if self.report_tensor_allocations_upon_oom != false { + my_size += 2; + } + if let Some(ref v) = self.experimental.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.trace_level != RunOptions_TraceLevel::NO_TRACE { + os.write_enum(1, self.trace_level.value())?; + } + if self.timeout_in_ms != 0 { + os.write_int64(2, self.timeout_in_ms)?; + } + if self.inter_op_thread_pool != 0 { + os.write_int32(3, self.inter_op_thread_pool)?; + } + if self.output_partition_graphs != false { + os.write_bool(5, self.output_partition_graphs)?; + } + if let Some(ref v) = self.debug_options.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)?; + } + if self.report_tensor_allocations_upon_oom != false { + os.write_bool(7, self.report_tensor_allocations_upon_oom)?; + } + if let Some(ref v) = self.experimental.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)?; + } + 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: Box) -> ::std::boxed::Box { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> RunOptions { + RunOptions::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, + }; + unsafe { + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeEnum>( + "trace_level", + |m: &RunOptions| { &m.trace_level }, + |m: &mut RunOptions| { &mut m.trace_level }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt64>( + "timeout_in_ms", + |m: &RunOptions| { &m.timeout_in_ms }, + |m: &mut RunOptions| { &mut m.timeout_in_ms }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt32>( + "inter_op_thread_pool", + |m: &RunOptions| { &m.inter_op_thread_pool }, + |m: &mut RunOptions| { &mut m.inter_op_thread_pool }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBool>( + "output_partition_graphs", + |m: &RunOptions| { &m.output_partition_graphs }, + |m: &mut RunOptions| { &mut m.output_partition_graphs }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( + "debug_options", + |m: &RunOptions| { &m.debug_options }, + |m: &mut RunOptions| { &mut m.debug_options }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBool>( + "report_tensor_allocations_upon_oom", + |m: &RunOptions| { &m.report_tensor_allocations_upon_oom }, + |m: &mut RunOptions| { &mut m.report_tensor_allocations_upon_oom }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( + "experimental", + |m: &RunOptions| { &m.experimental }, + |m: &mut RunOptions| { &mut m.experimental }, + )); + ::protobuf::reflect::MessageDescriptor::new::( + "RunOptions", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static RunOptions { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const RunOptions, + }; + unsafe { + instance.get(RunOptions::new) + } + } +} + +impl ::protobuf::Clear for RunOptions { + fn clear(&mut self) { + self.trace_level = RunOptions_TraceLevel::NO_TRACE; + self.timeout_in_ms = 0; + self.inter_op_thread_pool = 0; + self.output_partition_graphs = false; + self.debug_options.clear(); + self.report_tensor_allocations_upon_oom = false; + self.experimental.clear(); + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for RunOptions { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for RunOptions { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct RunOptions_Experimental { + // message fields + pub collective_graph_key: i64, + pub use_run_handler_pool: bool, + // special fields + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, +} + +impl<'a> ::std::default::Default for &'a RunOptions_Experimental { + fn default() -> &'a RunOptions_Experimental { + ::default_instance() + } +} + +impl RunOptions_Experimental { + pub fn new() -> RunOptions_Experimental { + ::std::default::Default::default() + } + + // int64 collective_graph_key = 1; + + + pub fn get_collective_graph_key(&self) -> i64 { + self.collective_graph_key + } + pub fn clear_collective_graph_key(&mut self) { + self.collective_graph_key = 0; + } + + // Param is passed by value, moved + pub fn set_collective_graph_key(&mut self, v: i64) { + self.collective_graph_key = v; + } + + // bool use_run_handler_pool = 2; + + + pub fn get_use_run_handler_pool(&self) -> bool { + self.use_run_handler_pool + } + pub fn clear_use_run_handler_pool(&mut self) { + self.use_run_handler_pool = false; + } + + // Param is passed by value, moved + pub fn set_use_run_handler_pool(&mut self, v: bool) { + self.use_run_handler_pool = v; + } +} + +impl ::protobuf::Message for RunOptions_Experimental { + 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.collective_graph_key = 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_bool()?; + self.use_run_handler_pool = 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.collective_graph_key != 0 { + my_size += ::protobuf::rt::value_size(1, self.collective_graph_key, ::protobuf::wire_format::WireTypeVarint); + } + if self.use_run_handler_pool != 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.collective_graph_key != 0 { + os.write_int64(1, self.collective_graph_key)?; + } + if self.use_run_handler_pool != false { + os.write_bool(2, self.use_run_handler_pool)?; + } + 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: Box) -> ::std::boxed::Box { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> RunOptions_Experimental { + RunOptions_Experimental::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, + }; + unsafe { + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt64>( + "collective_graph_key", + |m: &RunOptions_Experimental| { &m.collective_graph_key }, + |m: &mut RunOptions_Experimental| { &mut m.collective_graph_key }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBool>( + "use_run_handler_pool", + |m: &RunOptions_Experimental| { &m.use_run_handler_pool }, + |m: &mut RunOptions_Experimental| { &mut m.use_run_handler_pool }, + )); + ::protobuf::reflect::MessageDescriptor::new::( + "RunOptions_Experimental", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static RunOptions_Experimental { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const RunOptions_Experimental, + }; + unsafe { + instance.get(RunOptions_Experimental::new) + } + } +} + +impl ::protobuf::Clear for RunOptions_Experimental { + fn clear(&mut self) { + self.collective_graph_key = 0; + self.use_run_handler_pool = false; + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for RunOptions_Experimental { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for RunOptions_Experimental { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(Clone,PartialEq,Eq,Debug,Hash)] +pub enum RunOptions_TraceLevel { + NO_TRACE = 0, + SOFTWARE_TRACE = 1, + HARDWARE_TRACE = 2, + FULL_TRACE = 3, +} + +impl ::protobuf::ProtobufEnum for RunOptions_TraceLevel { + fn value(&self) -> i32 { + *self as i32 + } + + fn from_i32(value: i32) -> ::std::option::Option { + match value { + 0 => ::std::option::Option::Some(RunOptions_TraceLevel::NO_TRACE), + 1 => ::std::option::Option::Some(RunOptions_TraceLevel::SOFTWARE_TRACE), + 2 => ::std::option::Option::Some(RunOptions_TraceLevel::HARDWARE_TRACE), + 3 => ::std::option::Option::Some(RunOptions_TraceLevel::FULL_TRACE), + _ => ::std::option::Option::None + } + } + + fn values() -> &'static [Self] { + static values: &'static [RunOptions_TraceLevel] = &[ + RunOptions_TraceLevel::NO_TRACE, + RunOptions_TraceLevel::SOFTWARE_TRACE, + RunOptions_TraceLevel::HARDWARE_TRACE, + RunOptions_TraceLevel::FULL_TRACE, + ]; + values + } + + fn enum_descriptor_static() -> &'static ::protobuf::reflect::EnumDescriptor { + static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::EnumDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::EnumDescriptor, + }; + unsafe { + descriptor.get(|| { + ::protobuf::reflect::EnumDescriptor::new("RunOptions_TraceLevel", file_descriptor_proto()) + }) + } + } +} + +impl ::std::marker::Copy for RunOptions_TraceLevel { +} + +impl ::std::default::Default for RunOptions_TraceLevel { + fn default() -> Self { + RunOptions_TraceLevel::NO_TRACE + } +} + +impl ::protobuf::reflect::ProtobufValue for RunOptions_TraceLevel { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Enum(self.descriptor()) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct RunMetadata { + // message fields + pub step_stats: ::protobuf::SingularPtrField, + pub cost_graph: ::protobuf::SingularPtrField, + pub partition_graphs: ::protobuf::RepeatedField, + // special fields + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, +} + +impl<'a> ::std::default::Default for &'a RunMetadata { + fn default() -> &'a RunMetadata { + ::default_instance() + } +} + +impl RunMetadata { + pub fn new() -> RunMetadata { + ::std::default::Default::default() + } + + // .tensorflow.StepStats step_stats = 1; + + + pub fn get_step_stats(&self) -> &super::step_stats::StepStats { + self.step_stats.as_ref().unwrap_or_else(|| super::step_stats::StepStats::default_instance()) + } + pub fn clear_step_stats(&mut self) { + self.step_stats.clear(); + } + + pub fn has_step_stats(&self) -> bool { + self.step_stats.is_some() + } + + // Param is passed by value, moved + pub fn set_step_stats(&mut self, v: super::step_stats::StepStats) { + self.step_stats = ::protobuf::SingularPtrField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_step_stats(&mut self) -> &mut super::step_stats::StepStats { + if self.step_stats.is_none() { + self.step_stats.set_default(); + } + self.step_stats.as_mut().unwrap() + } + + // Take field + pub fn take_step_stats(&mut self) -> super::step_stats::StepStats { + self.step_stats.take().unwrap_or_else(|| super::step_stats::StepStats::new()) + } + + // .tensorflow.CostGraphDef cost_graph = 2; + + + pub fn get_cost_graph(&self) -> &super::cost_graph::CostGraphDef { + self.cost_graph.as_ref().unwrap_or_else(|| super::cost_graph::CostGraphDef::default_instance()) + } + pub fn clear_cost_graph(&mut self) { + self.cost_graph.clear(); + } + + pub fn has_cost_graph(&self) -> bool { + self.cost_graph.is_some() + } + + // Param is passed by value, moved + pub fn set_cost_graph(&mut self, v: super::cost_graph::CostGraphDef) { + self.cost_graph = ::protobuf::SingularPtrField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_cost_graph(&mut self) -> &mut super::cost_graph::CostGraphDef { + if self.cost_graph.is_none() { + self.cost_graph.set_default(); + } + self.cost_graph.as_mut().unwrap() + } + + // Take field + pub fn take_cost_graph(&mut self) -> super::cost_graph::CostGraphDef { + self.cost_graph.take().unwrap_or_else(|| super::cost_graph::CostGraphDef::new()) + } + + // repeated .tensorflow.GraphDef partition_graphs = 3; + + + pub fn get_partition_graphs(&self) -> &[super::graph::GraphDef] { + &self.partition_graphs + } + pub fn clear_partition_graphs(&mut self) { + self.partition_graphs.clear(); + } + + // Param is passed by value, moved + pub fn set_partition_graphs(&mut self, v: ::protobuf::RepeatedField) { + self.partition_graphs = v; + } + + // Mutable pointer to the field. + pub fn mut_partition_graphs(&mut self) -> &mut ::protobuf::RepeatedField { + &mut self.partition_graphs + } + + // Take field + pub fn take_partition_graphs(&mut self) -> ::protobuf::RepeatedField { + ::std::mem::replace(&mut self.partition_graphs, ::protobuf::RepeatedField::new()) + } +} + +impl ::protobuf::Message for RunMetadata { + fn is_initialized(&self) -> bool { + for v in &self.step_stats { + if !v.is_initialized() { + return false; + } + }; + for v in &self.cost_graph { + if !v.is_initialized() { + return false; + } + }; + for v in &self.partition_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 => { + ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.step_stats)?; + }, + 2 => { + ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.cost_graph)?; + }, + 3 => { + ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.partition_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 let Some(ref v) = self.step_stats.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; + } + if let Some(ref v) = self.cost_graph.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; + } + for value in &self.partition_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 let Some(ref v) = self.step_stats.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.cost_graph.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)?; + } + for v in &self.partition_graphs { + 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: Box) -> ::std::boxed::Box { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> RunMetadata { + RunMetadata::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, + }; + unsafe { + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( + "step_stats", + |m: &RunMetadata| { &m.step_stats }, + |m: &mut RunMetadata| { &mut m.step_stats }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( + "cost_graph", + |m: &RunMetadata| { &m.cost_graph }, + |m: &mut RunMetadata| { &mut m.cost_graph }, + )); + fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( + "partition_graphs", + |m: &RunMetadata| { &m.partition_graphs }, + |m: &mut RunMetadata| { &mut m.partition_graphs }, + )); + ::protobuf::reflect::MessageDescriptor::new::( + "RunMetadata", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static RunMetadata { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const RunMetadata, + }; + unsafe { + instance.get(RunMetadata::new) + } + } +} + +impl ::protobuf::Clear for RunMetadata { + fn clear(&mut self) { + self.step_stats.clear(); + self.cost_graph.clear(); + self.partition_graphs.clear(); + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for RunMetadata { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for RunMetadata { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct TensorConnection { + // message fields + pub from_tensor: ::std::string::String, + pub to_tensor: ::std::string::String, + // special fields + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, +} + +impl<'a> ::std::default::Default for &'a TensorConnection { + fn default() -> &'a TensorConnection { + ::default_instance() + } +} + +impl TensorConnection { + pub fn new() -> TensorConnection { + ::std::default::Default::default() + } + + // string from_tensor = 1; + + + pub fn get_from_tensor(&self) -> &str { + &self.from_tensor + } + pub fn clear_from_tensor(&mut self) { + self.from_tensor.clear(); + } + + // Param is passed by value, moved + pub fn set_from_tensor(&mut self, v: ::std::string::String) { + self.from_tensor = v; + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_from_tensor(&mut self) -> &mut ::std::string::String { + &mut self.from_tensor + } + + // Take field + pub fn take_from_tensor(&mut self) -> ::std::string::String { + ::std::mem::replace(&mut self.from_tensor, ::std::string::String::new()) + } + + // string to_tensor = 2; + + + pub fn get_to_tensor(&self) -> &str { + &self.to_tensor + } + pub fn clear_to_tensor(&mut self) { + self.to_tensor.clear(); + } + + // Param is passed by value, moved + pub fn set_to_tensor(&mut self, v: ::std::string::String) { + self.to_tensor = v; + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_to_tensor(&mut self) -> &mut ::std::string::String { + &mut self.to_tensor + } + + // Take field + pub fn take_to_tensor(&mut self) -> ::std::string::String { + ::std::mem::replace(&mut self.to_tensor, ::std::string::String::new()) + } +} + +impl ::protobuf::Message for TensorConnection { + 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.from_tensor)?; + }, + 2 => { + ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.to_tensor)?; + }, + _ => { + ::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.from_tensor.is_empty() { + my_size += ::protobuf::rt::string_size(1, &self.from_tensor); + } + if !self.to_tensor.is_empty() { + my_size += ::protobuf::rt::string_size(2, &self.to_tensor); + } + 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.from_tensor.is_empty() { + os.write_string(1, &self.from_tensor)?; + } + if !self.to_tensor.is_empty() { + os.write_string(2, &self.to_tensor)?; + } + 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: Box) -> ::std::boxed::Box { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> TensorConnection { + TensorConnection::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, + }; + unsafe { + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "from_tensor", + |m: &TensorConnection| { &m.from_tensor }, + |m: &mut TensorConnection| { &mut m.from_tensor }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "to_tensor", + |m: &TensorConnection| { &m.to_tensor }, + |m: &mut TensorConnection| { &mut m.to_tensor }, + )); + ::protobuf::reflect::MessageDescriptor::new::( + "TensorConnection", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static TensorConnection { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const TensorConnection, + }; + unsafe { + instance.get(TensorConnection::new) + } + } +} + +impl ::protobuf::Clear for TensorConnection { + fn clear(&mut self) { + self.from_tensor.clear(); + self.to_tensor.clear(); + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for TensorConnection { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for TensorConnection { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct CallableOptions { + // message fields + pub feed: ::protobuf::RepeatedField<::std::string::String>, + pub fetch: ::protobuf::RepeatedField<::std::string::String>, + pub target: ::protobuf::RepeatedField<::std::string::String>, + pub run_options: ::protobuf::SingularPtrField, + pub tensor_connection: ::protobuf::RepeatedField, + pub feed_devices: ::std::collections::HashMap<::std::string::String, ::std::string::String>, + pub fetch_devices: ::std::collections::HashMap<::std::string::String, ::std::string::String>, + pub fetch_skip_sync: bool, + // special fields + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, +} + +impl<'a> ::std::default::Default for &'a CallableOptions { + fn default() -> &'a CallableOptions { + ::default_instance() + } +} + +impl CallableOptions { + pub fn new() -> CallableOptions { + ::std::default::Default::default() + } + + // repeated string feed = 1; + + + pub fn get_feed(&self) -> &[::std::string::String] { + &self.feed + } + pub fn clear_feed(&mut self) { + self.feed.clear(); + } + + // Param is passed by value, moved + pub fn set_feed(&mut self, v: ::protobuf::RepeatedField<::std::string::String>) { + self.feed = v; + } + + // Mutable pointer to the field. + pub fn mut_feed(&mut self) -> &mut ::protobuf::RepeatedField<::std::string::String> { + &mut self.feed + } + + // Take field + pub fn take_feed(&mut self) -> ::protobuf::RepeatedField<::std::string::String> { + ::std::mem::replace(&mut self.feed, ::protobuf::RepeatedField::new()) + } + + // repeated string fetch = 2; + + + pub fn get_fetch(&self) -> &[::std::string::String] { + &self.fetch + } + pub fn clear_fetch(&mut self) { + self.fetch.clear(); + } + + // Param is passed by value, moved + pub fn set_fetch(&mut self, v: ::protobuf::RepeatedField<::std::string::String>) { + self.fetch = v; + } + + // Mutable pointer to the field. + pub fn mut_fetch(&mut self) -> &mut ::protobuf::RepeatedField<::std::string::String> { + &mut self.fetch + } + + // Take field + pub fn take_fetch(&mut self) -> ::protobuf::RepeatedField<::std::string::String> { + ::std::mem::replace(&mut self.fetch, ::protobuf::RepeatedField::new()) + } + + // repeated string target = 3; + + + pub fn get_target(&self) -> &[::std::string::String] { + &self.target + } + pub fn clear_target(&mut self) { + self.target.clear(); + } + + // Param is passed by value, moved + pub fn set_target(&mut self, v: ::protobuf::RepeatedField<::std::string::String>) { + self.target = v; + } + + // Mutable pointer to the field. + pub fn mut_target(&mut self) -> &mut ::protobuf::RepeatedField<::std::string::String> { + &mut self.target + } + + // Take field + pub fn take_target(&mut self) -> ::protobuf::RepeatedField<::std::string::String> { + ::std::mem::replace(&mut self.target, ::protobuf::RepeatedField::new()) + } + + // .tensorflow.RunOptions run_options = 4; + + + pub fn get_run_options(&self) -> &RunOptions { + self.run_options.as_ref().unwrap_or_else(|| RunOptions::default_instance()) + } + pub fn clear_run_options(&mut self) { + self.run_options.clear(); + } + + pub fn has_run_options(&self) -> bool { + self.run_options.is_some() + } + + // Param is passed by value, moved + pub fn set_run_options(&mut self, v: RunOptions) { + self.run_options = ::protobuf::SingularPtrField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_run_options(&mut self) -> &mut RunOptions { + if self.run_options.is_none() { + self.run_options.set_default(); + } + self.run_options.as_mut().unwrap() + } + + // Take field + pub fn take_run_options(&mut self) -> RunOptions { + self.run_options.take().unwrap_or_else(|| RunOptions::new()) + } + + // repeated .tensorflow.TensorConnection tensor_connection = 5; + + + pub fn get_tensor_connection(&self) -> &[TensorConnection] { + &self.tensor_connection + } + pub fn clear_tensor_connection(&mut self) { + self.tensor_connection.clear(); + } + + // Param is passed by value, moved + pub fn set_tensor_connection(&mut self, v: ::protobuf::RepeatedField) { + self.tensor_connection = v; + } + + // Mutable pointer to the field. + pub fn mut_tensor_connection(&mut self) -> &mut ::protobuf::RepeatedField { + &mut self.tensor_connection + } + + // Take field + pub fn take_tensor_connection(&mut self) -> ::protobuf::RepeatedField { + ::std::mem::replace(&mut self.tensor_connection, ::protobuf::RepeatedField::new()) + } + + // repeated .tensorflow.CallableOptions.FeedDevicesEntry feed_devices = 6; + + + pub fn get_feed_devices(&self) -> &::std::collections::HashMap<::std::string::String, ::std::string::String> { + &self.feed_devices + } + pub fn clear_feed_devices(&mut self) { + self.feed_devices.clear(); + } + + // Param is passed by value, moved + pub fn set_feed_devices(&mut self, v: ::std::collections::HashMap<::std::string::String, ::std::string::String>) { + self.feed_devices = v; + } + + // Mutable pointer to the field. + pub fn mut_feed_devices(&mut self) -> &mut ::std::collections::HashMap<::std::string::String, ::std::string::String> { + &mut self.feed_devices + } + + // Take field + pub fn take_feed_devices(&mut self) -> ::std::collections::HashMap<::std::string::String, ::std::string::String> { + ::std::mem::replace(&mut self.feed_devices, ::std::collections::HashMap::new()) + } + + // repeated .tensorflow.CallableOptions.FetchDevicesEntry fetch_devices = 7; + + + pub fn get_fetch_devices(&self) -> &::std::collections::HashMap<::std::string::String, ::std::string::String> { + &self.fetch_devices + } + pub fn clear_fetch_devices(&mut self) { + self.fetch_devices.clear(); + } + + // Param is passed by value, moved + pub fn set_fetch_devices(&mut self, v: ::std::collections::HashMap<::std::string::String, ::std::string::String>) { + self.fetch_devices = v; + } + + // Mutable pointer to the field. + pub fn mut_fetch_devices(&mut self) -> &mut ::std::collections::HashMap<::std::string::String, ::std::string::String> { + &mut self.fetch_devices + } + + // Take field + pub fn take_fetch_devices(&mut self) -> ::std::collections::HashMap<::std::string::String, ::std::string::String> { + ::std::mem::replace(&mut self.fetch_devices, ::std::collections::HashMap::new()) + } + + // bool fetch_skip_sync = 8; + + + pub fn get_fetch_skip_sync(&self) -> bool { + self.fetch_skip_sync + } + pub fn clear_fetch_skip_sync(&mut self) { + self.fetch_skip_sync = false; + } + + // Param is passed by value, moved + pub fn set_fetch_skip_sync(&mut self, v: bool) { + self.fetch_skip_sync = v; + } +} + +impl ::protobuf::Message for CallableOptions { + fn is_initialized(&self) -> bool { + for v in &self.run_options { + if !v.is_initialized() { + return false; + } + }; + for v in &self.tensor_connection { + 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.feed)?; + }, + 2 => { + ::protobuf::rt::read_repeated_string_into(wire_type, is, &mut self.fetch)?; + }, + 3 => { + ::protobuf::rt::read_repeated_string_into(wire_type, is, &mut self.target)?; + }, + 4 => { + ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.run_options)?; + }, + 5 => { + ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.tensor_connection)?; + }, + 6 => { + ::protobuf::rt::read_map_into::<::protobuf::types::ProtobufTypeString, ::protobuf::types::ProtobufTypeString>(wire_type, is, &mut self.feed_devices)?; + }, + 7 => { + ::protobuf::rt::read_map_into::<::protobuf::types::ProtobufTypeString, ::protobuf::types::ProtobufTypeString>(wire_type, is, &mut self.fetch_devices)?; + }, + 8 => { + 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.fetch_skip_sync = 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.feed { + my_size += ::protobuf::rt::string_size(1, &value); + }; + for value in &self.fetch { + my_size += ::protobuf::rt::string_size(2, &value); + }; + for value in &self.target { + my_size += ::protobuf::rt::string_size(3, &value); + }; + if let Some(ref v) = self.run_options.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; + } + for value in &self.tensor_connection { + 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>(6, &self.feed_devices); + my_size += ::protobuf::rt::compute_map_size::<::protobuf::types::ProtobufTypeString, ::protobuf::types::ProtobufTypeString>(7, &self.fetch_devices); + if self.fetch_skip_sync != 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.feed { + os.write_string(1, &v)?; + }; + for v in &self.fetch { + os.write_string(2, &v)?; + }; + for v in &self.target { + os.write_string(3, &v)?; + }; + if let Some(ref v) = self.run_options.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)?; + } + for v in &self.tensor_connection { + os.write_tag(5, ::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>(6, &self.feed_devices, os)?; + ::protobuf::rt::write_map_with_cached_sizes::<::protobuf::types::ProtobufTypeString, ::protobuf::types::ProtobufTypeString>(7, &self.fetch_devices, os)?; + if self.fetch_skip_sync != false { + os.write_bool(8, self.fetch_skip_sync)?; + } + 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: Box) -> ::std::boxed::Box { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> CallableOptions { + CallableOptions::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, + }; + unsafe { + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "feed", + |m: &CallableOptions| { &m.feed }, + |m: &mut CallableOptions| { &mut m.feed }, + )); + fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "fetch", + |m: &CallableOptions| { &m.fetch }, + |m: &mut CallableOptions| { &mut m.fetch }, + )); + fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "target", + |m: &CallableOptions| { &m.target }, + |m: &mut CallableOptions| { &mut m.target }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( + "run_options", + |m: &CallableOptions| { &m.run_options }, + |m: &mut CallableOptions| { &mut m.run_options }, + )); + fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( + "tensor_connection", + |m: &CallableOptions| { &m.tensor_connection }, + |m: &mut CallableOptions| { &mut m.tensor_connection }, + )); + fields.push(::protobuf::reflect::accessor::make_map_accessor::<_, ::protobuf::types::ProtobufTypeString, ::protobuf::types::ProtobufTypeString>( + "feed_devices", + |m: &CallableOptions| { &m.feed_devices }, + |m: &mut CallableOptions| { &mut m.feed_devices }, + )); + fields.push(::protobuf::reflect::accessor::make_map_accessor::<_, ::protobuf::types::ProtobufTypeString, ::protobuf::types::ProtobufTypeString>( + "fetch_devices", + |m: &CallableOptions| { &m.fetch_devices }, + |m: &mut CallableOptions| { &mut m.fetch_devices }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBool>( + "fetch_skip_sync", + |m: &CallableOptions| { &m.fetch_skip_sync }, + |m: &mut CallableOptions| { &mut m.fetch_skip_sync }, + )); + ::protobuf::reflect::MessageDescriptor::new::( + "CallableOptions", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static CallableOptions { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const CallableOptions, + }; + unsafe { + instance.get(CallableOptions::new) + } + } +} + +impl ::protobuf::Clear for CallableOptions { + fn clear(&mut self) { + self.feed.clear(); + self.fetch.clear(); + self.target.clear(); + self.run_options.clear(); + self.tensor_connection.clear(); + self.feed_devices.clear(); + self.fetch_devices.clear(); + self.fetch_skip_sync = false; + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for CallableOptions { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for CallableOptions { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +static file_descriptor_proto_data: &'static [u8] = b"\ + \n%tensorflow/core/protobuf/config.proto\x12\ntensorflow\x1a*tensorflow/\ + core/framework/cost_graph.proto\x1a%tensorflow/core/framework/graph.prot\ + o\x1a*tensorflow/core/framework/step_stats.proto\x1a$tensorflow/core/pro\ + tobuf/debug.proto\x1a&tensorflow/core/protobuf/cluster.proto\x1a.tensorf\ + low/core/protobuf/rewriter_config.proto\"\xc4\x06\n\nGPUOptions\x12D\n\ + \x1fper_process_gpu_memory_fraction\x18\x01\x20\x01(\x01R\x1bperProcessG\ + puMemoryFraction\x12!\n\x0callow_growth\x18\x04\x20\x01(\x08R\x0ballowGr\ + owth\x12%\n\x0eallocator_type\x18\x02\x20\x01(\tR\rallocatorType\x126\n\ + \x17deferred_deletion_bytes\x18\x03\x20\x01(\x03R\x15deferredDeletionByt\ + es\x12.\n\x13visible_device_list\x18\x05\x20\x01(\tR\x11visibleDeviceLis\ + t\x12;\n\x1apolling_active_delay_usecs\x18\x06\x20\x01(\x05R\x17pollingA\ + ctiveDelayUsecs\x12?\n\x1cpolling_inactive_delay_msecs\x18\x07\x20\x01(\ + \x05R\x19pollingInactiveDelayMsecs\x120\n\x14force_gpu_compatible\x18\ + \x08\x20\x01(\x08R\x12forceGpuCompatible\x12G\n\x0cexperimental\x18\t\ + \x20\x01(\x0b2#.tensorflow.GPUOptions.ExperimentalR\x0cexperimental\x1a\ + \xc4\x02\n\x0cExperimental\x12[\n\x0fvirtual_devices\x18\x01\x20\x03(\ + \x0b22.tensorflow.GPUOptions.Experimental.VirtualDevicesR\x0evirtualDevi\ + ces\x12,\n\x12use_unified_memory\x18\x02\x20\x01(\x08R\x10useUnifiedMemo\ + ry\x12;\n\x1bnum_dev_to_dev_copy_streams\x18\x03\x20\x01(\x05R\x16numDev\ + ToDevCopyStreams\x122\n\x15collective_ring_order\x18\x04\x20\x01(\tR\x13\ + collectiveRingOrder\x1a8\n\x0eVirtualDevices\x12&\n\x0fmemory_limit_mb\ + \x18\x01\x20\x03(\x02R\rmemoryLimitMb\"\x82\x04\n\x10OptimizerOptions\ + \x12M\n#do_common_subexpression_elimination\x18\x01\x20\x01(\x08R\x20doC\ + ommonSubexpressionElimination\x12.\n\x13do_constant_folding\x18\x02\x20\ + \x01(\x08R\x11doConstantFolding\x12>\n\x1cmax_folded_constant_in_bytes\ + \x18\x06\x20\x01(\x03R\x18maxFoldedConstantInBytes\x120\n\x14do_function\ + _inlining\x18\x04\x20\x01(\x08R\x12doFunctionInlining\x12?\n\topt_level\ + \x18\x03\x20\x01(\x0e2\".tensorflow.OptimizerOptions.LevelR\x08optLevel\ + \x12U\n\x10global_jit_level\x18\x05\x20\x01(\x0e2+.tensorflow.OptimizerO\ + ptions.GlobalJitLevelR\x0eglobalJitLevel\"\x20\n\x05Level\x12\x06\n\x02L\ + 1\x10\0\x12\x0f\n\x02L0\x10\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\"C\n\ + \x0eGlobalJitLevel\x12\x0b\n\x07DEFAULT\x10\0\x12\x10\n\x03OFF\x10\xff\ + \xff\xff\xff\xff\xff\xff\xff\xff\x01\x12\x08\n\x04ON_1\x10\x01\x12\x08\n\ + \x04ON_2\x10\x02\"\x90\x04\n\x0cGraphOptions\x124\n\x16enable_recv_sched\ + uling\x18\x02\x20\x01(\x08R\x14enableRecvScheduling\x12I\n\x11optimizer_\ + options\x18\x03\x20\x01(\x0b2\x1c.tensorflow.OptimizerOptionsR\x10optimi\ + zerOptions\x12(\n\x10build_cost_model\x18\x04\x20\x01(\x03R\x0ebuildCost\ + Model\x123\n\x16build_cost_model_after\x18\t\x20\x01(\x03R\x13buildCostM\ + odelAfter\x12!\n\x0cinfer_shapes\x18\x05\x20\x01(\x08R\x0binferShapes\ + \x12,\n\x12place_pruned_graph\x18\x06\x20\x01(\x08R\x10placePrunedGraph\ + \x128\n\x18enable_bfloat16_sendrecv\x18\x07\x20\x01(\x08R\x16enableBfloa\ + t16Sendrecv\x12#\n\rtimeline_step\x18\x08\x20\x01(\x05R\x0ctimelineStep\ + \x12C\n\x0frewrite_options\x18\n\x20\x01(\x0b2\x1a.tensorflow.RewriterCo\ + nfigR\x0erewriteOptionsJ\x04\x08\x01\x10\x02R%skip_common_subexpression_\ + elimination\"Y\n\x15ThreadPoolOptionProto\x12\x1f\n\x0bnum_threads\x18\ + \x01\x20\x01(\x05R\nnumThreads\x12\x1f\n\x0bglobal_name\x18\x02\x20\x01(\ + \tR\nglobalName\"\xae\x01\n\nRPCOptions\x12>\n\x1cuse_rpc_for_inprocess_\ + master\x18\x01\x20\x01(\x08R\x18useRpcForInprocessMaster\x123\n\x15compr\ + ession_algorithm\x18\x02\x20\x01(\tR\x14compressionAlgorithm\x12+\n\x11c\ + ompression_level\x18\x03\x20\x01(\x05R\x10compressionLevel\"\xd8\t\n\x0b\ + ConfigProto\x12K\n\x0cdevice_count\x18\x01\x20\x03(\x0b2(.tensorflow.Con\ + figProto.DeviceCountEntryR\x0bdeviceCount\x12?\n\x1cintra_op_parallelism\ + _threads\x18\x02\x20\x01(\x05R\x19intraOpParallelismThreads\x12?\n\x1cin\ + ter_op_parallelism_threads\x18\x05\x20\x01(\x05R\x19interOpParallelismTh\ + reads\x125\n\x17use_per_session_threads\x18\t\x20\x01(\x08R\x14usePerSes\ + sionThreads\x12a\n\x1csession_inter_op_thread_pool\x18\x0c\x20\x03(\x0b2\ + !.tensorflow.ThreadPoolOptionProtoR\x18sessionInterOpThreadPool\x12)\n\ + \x10placement_period\x18\x03\x20\x01(\x05R\x0fplacementPeriod\x12%\n\x0e\ + device_filters\x18\x04\x20\x03(\tR\rdeviceFilters\x127\n\x0bgpu_options\ + \x18\x06\x20\x01(\x0b2\x16.tensorflow.GPUOptionsR\ngpuOptions\x120\n\x14\ + allow_soft_placement\x18\x07\x20\x01(\x08R\x12allowSoftPlacement\x120\n\ + \x14log_device_placement\x18\x08\x20\x01(\x08R\x12logDevicePlacement\x12\ + =\n\rgraph_options\x18\n\x20\x01(\x0b2\x18.tensorflow.GraphOptionsR\x0cg\ + raphOptions\x125\n\x17operation_timeout_in_ms\x18\x0b\x20\x01(\x03R\x14o\ + perationTimeoutInMs\x127\n\x0brpc_options\x18\r\x20\x01(\x0b2\x16.tensor\ + flow.RPCOptionsR\nrpcOptions\x127\n\x0bcluster_def\x18\x0e\x20\x01(\x0b2\ + \x16.tensorflow.ClusterDefR\nclusterDef\x122\n\x15isolate_session_state\ + \x18\x0f\x20\x01(\x08R\x13isolateSessionState\x12H\n\x0cexperimental\x18\ + \x10\x20\x01(\x0b2$.tensorflow.ConfigProto.ExperimentalR\x0cexperimental\ + \x1a>\n\x10DeviceCountEntry\x12\x10\n\x03key\x18\x01\x20\x01(\tR\x03key\ + \x12\x14\n\x05value\x18\x02\x20\x01(\x05R\x05value:\x028\x01\x1a\xca\x01\ + \n\x0cExperimental\x126\n\x17collective_group_leader\x18\x01\x20\x01(\tR\ + \x15collectiveGroupLeader\x12#\n\rexecutor_type\x18\x03\x20\x01(\tR\x0ce\ + xecutorType\x12+\n\x12recv_buf_max_chunk\x18\x04\x20\x01(\x05R\x0frecvBu\ + fMaxChunk\x12*\n\x11use_numa_affinity\x18\x05\x20\x01(\x08R\x0fuseNumaAf\ + finityJ\x04\x08\x02\x10\x03\"\xfe\x04\n\nRunOptions\x12B\n\x0btrace_leve\ + l\x18\x01\x20\x01(\x0e2!.tensorflow.RunOptions.TraceLevelR\ntraceLevel\ + \x12\"\n\rtimeout_in_ms\x18\x02\x20\x01(\x03R\x0btimeoutInMs\x12/\n\x14i\ + nter_op_thread_pool\x18\x03\x20\x01(\x05R\x11interOpThreadPool\x126\n\ + \x17output_partition_graphs\x18\x05\x20\x01(\x08R\x15outputPartitionGrap\ + hs\x12=\n\rdebug_options\x18\x06\x20\x01(\x0b2\x18.tensorflow.DebugOptio\ + nsR\x0cdebugOptions\x12J\n\"report_tensor_allocations_upon_oom\x18\x07\ + \x20\x01(\x08R\x1ereportTensorAllocationsUponOom\x12G\n\x0cexperimental\ + \x18\x08\x20\x01(\x0b2#.tensorflow.RunOptions.ExperimentalR\x0cexperimen\ + tal\x1aq\n\x0cExperimental\x120\n\x14collective_graph_key\x18\x01\x20\ + \x01(\x03R\x12collectiveGraphKey\x12/\n\x14use_run_handler_pool\x18\x02\ + \x20\x01(\x08R\x11useRunHandlerPool\"R\n\nTraceLevel\x12\x0c\n\x08NO_TRA\ + CE\x10\0\x12\x12\n\x0eSOFTWARE_TRACE\x10\x01\x12\x12\n\x0eHARDWARE_TRACE\ + \x10\x02\x12\x0e\n\nFULL_TRACE\x10\x03J\x04\x08\x04\x10\x05\"\xbd\x01\n\ + \x0bRunMetadata\x124\n\nstep_stats\x18\x01\x20\x01(\x0b2\x15.tensorflow.\ + StepStatsR\tstepStats\x127\n\ncost_graph\x18\x02\x20\x01(\x0b2\x18.tenso\ + rflow.CostGraphDefR\tcostGraph\x12?\n\x10partition_graphs\x18\x03\x20\ + \x03(\x0b2\x14.tensorflow.GraphDefR\x0fpartitionGraphs\"P\n\x10TensorCon\ + nection\x12\x1f\n\x0bfrom_tensor\x18\x01\x20\x01(\tR\nfromTensor\x12\x1b\ + \n\tto_tensor\x18\x02\x20\x01(\tR\x08toTensor\"\xa5\x04\n\x0fCallableOpt\ + ions\x12\x12\n\x04feed\x18\x01\x20\x03(\tR\x04feed\x12\x14\n\x05fetch\ + \x18\x02\x20\x03(\tR\x05fetch\x12\x16\n\x06target\x18\x03\x20\x03(\tR\ + \x06target\x127\n\x0brun_options\x18\x04\x20\x01(\x0b2\x16.tensorflow.Ru\ + nOptionsR\nrunOptions\x12I\n\x11tensor_connection\x18\x05\x20\x03(\x0b2\ + \x1c.tensorflow.TensorConnectionR\x10tensorConnection\x12O\n\x0cfeed_dev\ + ices\x18\x06\x20\x03(\x0b2,.tensorflow.CallableOptions.FeedDevicesEntryR\ + \x0bfeedDevices\x12R\n\rfetch_devices\x18\x07\x20\x03(\x0b2-.tensorflow.\ + CallableOptions.FetchDevicesEntryR\x0cfetchDevices\x12&\n\x0ffetch_skip_\ + sync\x18\x08\x20\x01(\x08R\rfetchSkipSync\x1a>\n\x10FeedDevicesEntry\x12\ + \x10\n\x03key\x18\x01\x20\x01(\tR\x03key\x12\x14\n\x05value\x18\x02\x20\ + \x01(\tR\x05value:\x028\x01\x1a?\n\x11FetchDevicesEntry\x12\x10\n\x03key\ + \x18\x01\x20\x01(\tR\x03key\x12\x14\n\x05value\x18\x02\x20\x01(\tR\x05va\ + lue:\x028\x01B-\n\x18org.tensorflow.frameworkB\x0cConfigProtosP\x01\xf8\ + \x01\x01b\x06proto3\ +"; + +static mut file_descriptor_proto_lazy: ::protobuf::lazy::Lazy<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::descriptor::FileDescriptorProto, +}; + +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 { + unsafe { + file_descriptor_proto_lazy.get(|| { + parse_descriptor_proto() + }) + } +} diff --git a/sticker-tf-proto/src/cost_graph.rs b/sticker-tf-proto/src/cost_graph.rs new file mode 100644 index 0000000..a0b76d4 --- /dev/null +++ b/sticker-tf-proto/src/cost_graph.rs @@ -0,0 +1,1468 @@ +// This file is generated by rust-protobuf 2.8.0. Do not edit +// @generated + +// https://github.com/Manishearth/rust-clippy/issues/702 +#![allow(unknown_lints)] +#![allow(clippy::all)] + +#![cfg_attr(rustfmt, 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(unsafe_code)] +#![allow(unused_imports)] +#![allow(unused_results)] +//! Generated file from `tensorflow/core/framework/cost_graph.proto` + +use protobuf::Message as Message_imported_for_functions; +use protobuf::ProtobufEnum as ProtobufEnum_imported_for_functions; + +/// Generated files are compatible only with the same version +/// of protobuf runtime. +const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_8_0; + +#[derive(PartialEq,Clone,Default)] +pub struct CostGraphDef { + // message fields + pub node: ::protobuf::RepeatedField, + // special fields + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, +} + +impl<'a> ::std::default::Default for &'a CostGraphDef { + fn default() -> &'a CostGraphDef { + ::default_instance() + } +} + +impl CostGraphDef { + pub fn new() -> CostGraphDef { + ::std::default::Default::default() + } + + // repeated .tensorflow.CostGraphDef.Node node = 1; + + + pub fn get_node(&self) -> &[CostGraphDef_Node] { + &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()) + } +} + +impl ::protobuf::Message for CostGraphDef { + fn is_initialized(&self) -> bool { + for v in &self.node { + 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)?; + }, + _ => { + ::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; + }; + 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)?; + }; + 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: Box) -> ::std::boxed::Box { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> CostGraphDef { + CostGraphDef::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, + }; + unsafe { + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( + "node", + |m: &CostGraphDef| { &m.node }, + |m: &mut CostGraphDef| { &mut m.node }, + )); + ::protobuf::reflect::MessageDescriptor::new::( + "CostGraphDef", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static CostGraphDef { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const CostGraphDef, + }; + unsafe { + instance.get(CostGraphDef::new) + } + } +} + +impl ::protobuf::Clear for CostGraphDef { + fn clear(&mut self) { + self.node.clear(); + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for CostGraphDef { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for CostGraphDef { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct CostGraphDef_Node { + // message fields + pub name: ::std::string::String, + pub device: ::std::string::String, + pub id: i32, + pub input_info: ::protobuf::RepeatedField, + pub output_info: ::protobuf::RepeatedField, + pub temporary_memory_size: i64, + pub persistent_memory_size: i64, + pub host_temp_memory_size: i64, + pub device_temp_memory_size: i64, + pub device_persistent_memory_size: i64, + pub compute_cost: i64, + pub compute_time: i64, + pub memory_time: i64, + pub is_final: bool, + pub control_input: ::std::vec::Vec, + pub inaccurate: bool, + // special fields + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, +} + +impl<'a> ::std::default::Default for &'a CostGraphDef_Node { + fn default() -> &'a CostGraphDef_Node { + ::default_instance() + } +} + +impl CostGraphDef_Node { + pub fn new() -> CostGraphDef_Node { + ::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 device = 2; + + + 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()) + } + + // int32 id = 3; + + + pub fn get_id(&self) -> i32 { + self.id + } + pub fn clear_id(&mut self) { + self.id = 0; + } + + // Param is passed by value, moved + pub fn set_id(&mut self, v: i32) { + self.id = v; + } + + // repeated .tensorflow.CostGraphDef.Node.InputInfo input_info = 4; + + + pub fn get_input_info(&self) -> &[CostGraphDef_Node_InputInfo] { + &self.input_info + } + pub fn clear_input_info(&mut self) { + self.input_info.clear(); + } + + // Param is passed by value, moved + pub fn set_input_info(&mut self, v: ::protobuf::RepeatedField) { + self.input_info = v; + } + + // Mutable pointer to the field. + pub fn mut_input_info(&mut self) -> &mut ::protobuf::RepeatedField { + &mut self.input_info + } + + // Take field + pub fn take_input_info(&mut self) -> ::protobuf::RepeatedField { + ::std::mem::replace(&mut self.input_info, ::protobuf::RepeatedField::new()) + } + + // repeated .tensorflow.CostGraphDef.Node.OutputInfo output_info = 5; + + + pub fn get_output_info(&self) -> &[CostGraphDef_Node_OutputInfo] { + &self.output_info + } + pub fn clear_output_info(&mut self) { + self.output_info.clear(); + } + + // Param is passed by value, moved + pub fn set_output_info(&mut self, v: ::protobuf::RepeatedField) { + self.output_info = v; + } + + // Mutable pointer to the field. + pub fn mut_output_info(&mut self) -> &mut ::protobuf::RepeatedField { + &mut self.output_info + } + + // Take field + pub fn take_output_info(&mut self) -> ::protobuf::RepeatedField { + ::std::mem::replace(&mut self.output_info, ::protobuf::RepeatedField::new()) + } + + // int64 temporary_memory_size = 6; + + + pub fn get_temporary_memory_size(&self) -> i64 { + self.temporary_memory_size + } + pub fn clear_temporary_memory_size(&mut self) { + self.temporary_memory_size = 0; + } + + // Param is passed by value, moved + pub fn set_temporary_memory_size(&mut self, v: i64) { + self.temporary_memory_size = v; + } + + // int64 persistent_memory_size = 12; + + + pub fn get_persistent_memory_size(&self) -> i64 { + self.persistent_memory_size + } + pub fn clear_persistent_memory_size(&mut self) { + self.persistent_memory_size = 0; + } + + // Param is passed by value, moved + pub fn set_persistent_memory_size(&mut self, v: i64) { + self.persistent_memory_size = v; + } + + // int64 host_temp_memory_size = 10; + + + pub fn get_host_temp_memory_size(&self) -> i64 { + self.host_temp_memory_size + } + pub fn clear_host_temp_memory_size(&mut self) { + self.host_temp_memory_size = 0; + } + + // Param is passed by value, moved + pub fn set_host_temp_memory_size(&mut self, v: i64) { + self.host_temp_memory_size = v; + } + + // int64 device_temp_memory_size = 11; + + + pub fn get_device_temp_memory_size(&self) -> i64 { + self.device_temp_memory_size + } + pub fn clear_device_temp_memory_size(&mut self) { + self.device_temp_memory_size = 0; + } + + // Param is passed by value, moved + pub fn set_device_temp_memory_size(&mut self, v: i64) { + self.device_temp_memory_size = v; + } + + // int64 device_persistent_memory_size = 16; + + + pub fn get_device_persistent_memory_size(&self) -> i64 { + self.device_persistent_memory_size + } + pub fn clear_device_persistent_memory_size(&mut self) { + self.device_persistent_memory_size = 0; + } + + // Param is passed by value, moved + pub fn set_device_persistent_memory_size(&mut self, v: i64) { + self.device_persistent_memory_size = v; + } + + // int64 compute_cost = 9; + + + pub fn get_compute_cost(&self) -> i64 { + self.compute_cost + } + pub fn clear_compute_cost(&mut self) { + self.compute_cost = 0; + } + + // Param is passed by value, moved + pub fn set_compute_cost(&mut self, v: i64) { + self.compute_cost = v; + } + + // int64 compute_time = 14; + + + pub fn get_compute_time(&self) -> i64 { + self.compute_time + } + pub fn clear_compute_time(&mut self) { + self.compute_time = 0; + } + + // Param is passed by value, moved + pub fn set_compute_time(&mut self, v: i64) { + self.compute_time = v; + } + + // int64 memory_time = 15; + + + pub fn get_memory_time(&self) -> i64 { + self.memory_time + } + pub fn clear_memory_time(&mut self) { + self.memory_time = 0; + } + + // Param is passed by value, moved + pub fn set_memory_time(&mut self, v: i64) { + self.memory_time = v; + } + + // bool is_final = 7; + + + pub fn get_is_final(&self) -> bool { + self.is_final + } + pub fn clear_is_final(&mut self) { + self.is_final = false; + } + + // Param is passed by value, moved + pub fn set_is_final(&mut self, v: bool) { + self.is_final = v; + } + + // repeated int32 control_input = 8; + + + pub fn get_control_input(&self) -> &[i32] { + &self.control_input + } + pub fn clear_control_input(&mut self) { + self.control_input.clear(); + } + + // Param is passed by value, moved + pub fn set_control_input(&mut self, v: ::std::vec::Vec) { + self.control_input = v; + } + + // Mutable pointer to the field. + pub fn mut_control_input(&mut self) -> &mut ::std::vec::Vec { + &mut self.control_input + } + + // Take field + pub fn take_control_input(&mut self) -> ::std::vec::Vec { + ::std::mem::replace(&mut self.control_input, ::std::vec::Vec::new()) + } + + // bool inaccurate = 17; + + + pub fn get_inaccurate(&self) -> bool { + self.inaccurate + } + pub fn clear_inaccurate(&mut self) { + self.inaccurate = false; + } + + // Param is passed by value, moved + pub fn set_inaccurate(&mut self, v: bool) { + self.inaccurate = v; + } +} + +impl ::protobuf::Message for CostGraphDef_Node { + fn is_initialized(&self) -> bool { + for v in &self.input_info { + if !v.is_initialized() { + return false; + } + }; + for v in &self.output_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.device)?; + }, + 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.id = tmp; + }, + 4 => { + ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.input_info)?; + }, + 5 => { + ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.output_info)?; + }, + 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.temporary_memory_size = tmp; + }, + 12 => { + 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.persistent_memory_size = tmp; + }, + 10 => { + 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.host_temp_memory_size = tmp; + }, + 11 => { + 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.device_temp_memory_size = 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_int64()?; + self.device_persistent_memory_size = tmp; + }, + 9 => { + 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.compute_cost = tmp; + }, + 14 => { + 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.compute_time = tmp; + }, + 15 => { + 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.memory_time = 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.is_final = tmp; + }, + 8 => { + ::protobuf::rt::read_repeated_int32_into(wire_type, is, &mut self.control_input)?; + }, + 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.inaccurate = 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.device.is_empty() { + my_size += ::protobuf::rt::string_size(2, &self.device); + } + if self.id != 0 { + my_size += ::protobuf::rt::value_size(3, self.id, ::protobuf::wire_format::WireTypeVarint); + } + for value in &self.input_info { + let len = value.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; + }; + for value in &self.output_info { + let len = value.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; + }; + if self.temporary_memory_size != 0 { + my_size += ::protobuf::rt::value_size(6, self.temporary_memory_size, ::protobuf::wire_format::WireTypeVarint); + } + if self.persistent_memory_size != 0 { + my_size += ::protobuf::rt::value_size(12, self.persistent_memory_size, ::protobuf::wire_format::WireTypeVarint); + } + if self.host_temp_memory_size != 0 { + my_size += ::protobuf::rt::value_size(10, self.host_temp_memory_size, ::protobuf::wire_format::WireTypeVarint); + } + if self.device_temp_memory_size != 0 { + my_size += ::protobuf::rt::value_size(11, self.device_temp_memory_size, ::protobuf::wire_format::WireTypeVarint); + } + if self.device_persistent_memory_size != 0 { + my_size += ::protobuf::rt::value_size(16, self.device_persistent_memory_size, ::protobuf::wire_format::WireTypeVarint); + } + if self.compute_cost != 0 { + my_size += ::protobuf::rt::value_size(9, self.compute_cost, ::protobuf::wire_format::WireTypeVarint); + } + if self.compute_time != 0 { + my_size += ::protobuf::rt::value_size(14, self.compute_time, ::protobuf::wire_format::WireTypeVarint); + } + if self.memory_time != 0 { + my_size += ::protobuf::rt::value_size(15, self.memory_time, ::protobuf::wire_format::WireTypeVarint); + } + if self.is_final != false { + my_size += 2; + } + for value in &self.control_input { + my_size += ::protobuf::rt::value_size(8, *value, ::protobuf::wire_format::WireTypeVarint); + }; + if self.inaccurate != 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.device.is_empty() { + os.write_string(2, &self.device)?; + } + if self.id != 0 { + os.write_int32(3, self.id)?; + } + for v in &self.input_info { + os.write_tag(4, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; + }; + for v in &self.output_info { + os.write_tag(5, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; + }; + if self.temporary_memory_size != 0 { + os.write_int64(6, self.temporary_memory_size)?; + } + if self.persistent_memory_size != 0 { + os.write_int64(12, self.persistent_memory_size)?; + } + if self.host_temp_memory_size != 0 { + os.write_int64(10, self.host_temp_memory_size)?; + } + if self.device_temp_memory_size != 0 { + os.write_int64(11, self.device_temp_memory_size)?; + } + if self.device_persistent_memory_size != 0 { + os.write_int64(16, self.device_persistent_memory_size)?; + } + if self.compute_cost != 0 { + os.write_int64(9, self.compute_cost)?; + } + if self.compute_time != 0 { + os.write_int64(14, self.compute_time)?; + } + if self.memory_time != 0 { + os.write_int64(15, self.memory_time)?; + } + if self.is_final != false { + os.write_bool(7, self.is_final)?; + } + for v in &self.control_input { + os.write_int32(8, *v)?; + }; + if self.inaccurate != false { + os.write_bool(17, self.inaccurate)?; + } + 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: Box) -> ::std::boxed::Box { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> CostGraphDef_Node { + CostGraphDef_Node::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, + }; + unsafe { + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "name", + |m: &CostGraphDef_Node| { &m.name }, + |m: &mut CostGraphDef_Node| { &mut m.name }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "device", + |m: &CostGraphDef_Node| { &m.device }, + |m: &mut CostGraphDef_Node| { &mut m.device }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt32>( + "id", + |m: &CostGraphDef_Node| { &m.id }, + |m: &mut CostGraphDef_Node| { &mut m.id }, + )); + fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( + "input_info", + |m: &CostGraphDef_Node| { &m.input_info }, + |m: &mut CostGraphDef_Node| { &mut m.input_info }, + )); + fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( + "output_info", + |m: &CostGraphDef_Node| { &m.output_info }, + |m: &mut CostGraphDef_Node| { &mut m.output_info }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt64>( + "temporary_memory_size", + |m: &CostGraphDef_Node| { &m.temporary_memory_size }, + |m: &mut CostGraphDef_Node| { &mut m.temporary_memory_size }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt64>( + "persistent_memory_size", + |m: &CostGraphDef_Node| { &m.persistent_memory_size }, + |m: &mut CostGraphDef_Node| { &mut m.persistent_memory_size }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt64>( + "host_temp_memory_size", + |m: &CostGraphDef_Node| { &m.host_temp_memory_size }, + |m: &mut CostGraphDef_Node| { &mut m.host_temp_memory_size }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt64>( + "device_temp_memory_size", + |m: &CostGraphDef_Node| { &m.device_temp_memory_size }, + |m: &mut CostGraphDef_Node| { &mut m.device_temp_memory_size }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt64>( + "device_persistent_memory_size", + |m: &CostGraphDef_Node| { &m.device_persistent_memory_size }, + |m: &mut CostGraphDef_Node| { &mut m.device_persistent_memory_size }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt64>( + "compute_cost", + |m: &CostGraphDef_Node| { &m.compute_cost }, + |m: &mut CostGraphDef_Node| { &mut m.compute_cost }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt64>( + "compute_time", + |m: &CostGraphDef_Node| { &m.compute_time }, + |m: &mut CostGraphDef_Node| { &mut m.compute_time }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt64>( + "memory_time", + |m: &CostGraphDef_Node| { &m.memory_time }, + |m: &mut CostGraphDef_Node| { &mut m.memory_time }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBool>( + "is_final", + |m: &CostGraphDef_Node| { &m.is_final }, + |m: &mut CostGraphDef_Node| { &mut m.is_final }, + )); + fields.push(::protobuf::reflect::accessor::make_vec_accessor::<_, ::protobuf::types::ProtobufTypeInt32>( + "control_input", + |m: &CostGraphDef_Node| { &m.control_input }, + |m: &mut CostGraphDef_Node| { &mut m.control_input }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBool>( + "inaccurate", + |m: &CostGraphDef_Node| { &m.inaccurate }, + |m: &mut CostGraphDef_Node| { &mut m.inaccurate }, + )); + ::protobuf::reflect::MessageDescriptor::new::( + "CostGraphDef_Node", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static CostGraphDef_Node { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const CostGraphDef_Node, + }; + unsafe { + instance.get(CostGraphDef_Node::new) + } + } +} + +impl ::protobuf::Clear for CostGraphDef_Node { + fn clear(&mut self) { + self.name.clear(); + self.device.clear(); + self.id = 0; + self.input_info.clear(); + self.output_info.clear(); + self.temporary_memory_size = 0; + self.persistent_memory_size = 0; + self.host_temp_memory_size = 0; + self.device_temp_memory_size = 0; + self.device_persistent_memory_size = 0; + self.compute_cost = 0; + self.compute_time = 0; + self.memory_time = 0; + self.is_final = false; + self.control_input.clear(); + self.inaccurate = false; + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for CostGraphDef_Node { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for CostGraphDef_Node { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct CostGraphDef_Node_InputInfo { + // message fields + pub preceding_node: i32, + pub preceding_port: i32, + // special fields + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, +} + +impl<'a> ::std::default::Default for &'a CostGraphDef_Node_InputInfo { + fn default() -> &'a CostGraphDef_Node_InputInfo { + ::default_instance() + } +} + +impl CostGraphDef_Node_InputInfo { + pub fn new() -> CostGraphDef_Node_InputInfo { + ::std::default::Default::default() + } + + // int32 preceding_node = 1; + + + pub fn get_preceding_node(&self) -> i32 { + self.preceding_node + } + pub fn clear_preceding_node(&mut self) { + self.preceding_node = 0; + } + + // Param is passed by value, moved + pub fn set_preceding_node(&mut self, v: i32) { + self.preceding_node = v; + } + + // int32 preceding_port = 2; + + + pub fn get_preceding_port(&self) -> i32 { + self.preceding_port + } + pub fn clear_preceding_port(&mut self) { + self.preceding_port = 0; + } + + // Param is passed by value, moved + pub fn set_preceding_port(&mut self, v: i32) { + self.preceding_port = v; + } +} + +impl ::protobuf::Message for CostGraphDef_Node_InputInfo { + 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.preceding_node = 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.preceding_port = 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.preceding_node != 0 { + my_size += ::protobuf::rt::value_size(1, self.preceding_node, ::protobuf::wire_format::WireTypeVarint); + } + if self.preceding_port != 0 { + my_size += ::protobuf::rt::value_size(2, self.preceding_port, ::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.preceding_node != 0 { + os.write_int32(1, self.preceding_node)?; + } + if self.preceding_port != 0 { + os.write_int32(2, self.preceding_port)?; + } + 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: Box) -> ::std::boxed::Box { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> CostGraphDef_Node_InputInfo { + CostGraphDef_Node_InputInfo::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, + }; + unsafe { + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt32>( + "preceding_node", + |m: &CostGraphDef_Node_InputInfo| { &m.preceding_node }, + |m: &mut CostGraphDef_Node_InputInfo| { &mut m.preceding_node }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt32>( + "preceding_port", + |m: &CostGraphDef_Node_InputInfo| { &m.preceding_port }, + |m: &mut CostGraphDef_Node_InputInfo| { &mut m.preceding_port }, + )); + ::protobuf::reflect::MessageDescriptor::new::( + "CostGraphDef_Node_InputInfo", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static CostGraphDef_Node_InputInfo { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const CostGraphDef_Node_InputInfo, + }; + unsafe { + instance.get(CostGraphDef_Node_InputInfo::new) + } + } +} + +impl ::protobuf::Clear for CostGraphDef_Node_InputInfo { + fn clear(&mut self) { + self.preceding_node = 0; + self.preceding_port = 0; + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for CostGraphDef_Node_InputInfo { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for CostGraphDef_Node_InputInfo { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct CostGraphDef_Node_OutputInfo { + // message fields + pub size: i64, + pub alias_input_port: i64, + 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 CostGraphDef_Node_OutputInfo { + fn default() -> &'a CostGraphDef_Node_OutputInfo { + ::default_instance() + } +} + +impl CostGraphDef_Node_OutputInfo { + pub fn new() -> CostGraphDef_Node_OutputInfo { + ::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; + } + + // int64 alias_input_port = 2; + + + pub fn get_alias_input_port(&self) -> i64 { + self.alias_input_port + } + pub fn clear_alias_input_port(&mut self) { + self.alias_input_port = 0; + } + + // Param is passed by value, moved + pub fn set_alias_input_port(&mut self, v: i64) { + self.alias_input_port = v; + } + + // .tensorflow.TensorShapeProto shape = 3; + + + pub fn get_shape(&self) -> &super::tensor_shape::TensorShapeProto { + self.shape.as_ref().unwrap_or_else(|| super::tensor_shape::TensorShapeProto::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 = 4; + + + 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 CostGraphDef_Node_OutputInfo { + 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 => { + 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 => { + 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.alias_input_port = tmp; + }, + 3 => { + ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.shape)?; + }, + 4 => { + ::protobuf::rt::read_proto3_enum_with_unknown_fields_into(wire_type, is, &mut self.dtype, 4, &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.size != 0 { + my_size += ::protobuf::rt::value_size(1, self.size, ::protobuf::wire_format::WireTypeVarint); + } + if self.alias_input_port != 0 { + my_size += ::protobuf::rt::value_size(2, self.alias_input_port, ::protobuf::wire_format::WireTypeVarint); + } + 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(4, 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.size != 0 { + os.write_int64(1, self.size)?; + } + if self.alias_input_port != 0 { + os.write_int64(2, self.alias_input_port)?; + } + if let Some(ref v) = self.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 self.dtype != super::types::DataType::DT_INVALID { + os.write_enum(4, self.dtype.value())?; + } + 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: Box) -> ::std::boxed::Box { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> CostGraphDef_Node_OutputInfo { + CostGraphDef_Node_OutputInfo::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, + }; + unsafe { + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt64>( + "size", + |m: &CostGraphDef_Node_OutputInfo| { &m.size }, + |m: &mut CostGraphDef_Node_OutputInfo| { &mut m.size }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt64>( + "alias_input_port", + |m: &CostGraphDef_Node_OutputInfo| { &m.alias_input_port }, + |m: &mut CostGraphDef_Node_OutputInfo| { &mut m.alias_input_port }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( + "shape", + |m: &CostGraphDef_Node_OutputInfo| { &m.shape }, + |m: &mut CostGraphDef_Node_OutputInfo| { &mut m.shape }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeEnum>( + "dtype", + |m: &CostGraphDef_Node_OutputInfo| { &m.dtype }, + |m: &mut CostGraphDef_Node_OutputInfo| { &mut m.dtype }, + )); + ::protobuf::reflect::MessageDescriptor::new::( + "CostGraphDef_Node_OutputInfo", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static CostGraphDef_Node_OutputInfo { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const CostGraphDef_Node_OutputInfo, + }; + unsafe { + instance.get(CostGraphDef_Node_OutputInfo::new) + } + } +} + +impl ::protobuf::Clear for CostGraphDef_Node_OutputInfo { + fn clear(&mut self) { + self.size = 0; + self.alias_input_port = 0; + self.shape.clear(); + self.dtype = super::types::DataType::DT_INVALID; + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for CostGraphDef_Node_OutputInfo { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for CostGraphDef_Node_OutputInfo { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +static file_descriptor_proto_data: &'static [u8] = b"\ + \n*tensorflow/core/framework/cost_graph.proto\x12\ntensorflow\x1a,tensor\ + flow/core/framework/tensor_shape.proto\x1a%tensorflow/core/framework/typ\ + es.proto\"\x8b\x08\n\x0cCostGraphDef\x121\n\x04node\x18\x01\x20\x03(\x0b\ + 2\x1d.tensorflow.CostGraphDef.NodeR\x04node\x1a\xc7\x07\n\x04Node\x12\ + \x12\n\x04name\x18\x01\x20\x01(\tR\x04name\x12\x16\n\x06device\x18\x02\ + \x20\x01(\tR\x06device\x12\x0e\n\x02id\x18\x03\x20\x01(\x05R\x02id\x12F\ + \n\ninput_info\x18\x04\x20\x03(\x0b2'.tensorflow.CostGraphDef.Node.Input\ + InfoR\tinputInfo\x12I\n\x0boutput_info\x18\x05\x20\x03(\x0b2(.tensorflow\ + .CostGraphDef.Node.OutputInfoR\noutputInfo\x122\n\x15temporary_memory_si\ + ze\x18\x06\x20\x01(\x03R\x13temporaryMemorySize\x124\n\x16persistent_mem\ + ory_size\x18\x0c\x20\x01(\x03R\x14persistentMemorySize\x125\n\x15host_te\ + mp_memory_size\x18\n\x20\x01(\x03R\x12hostTempMemorySizeB\x02\x18\x01\ + \x129\n\x17device_temp_memory_size\x18\x0b\x20\x01(\x03R\x14deviceTempMe\ + morySizeB\x02\x18\x01\x12E\n\x1ddevice_persistent_memory_size\x18\x10\ + \x20\x01(\x03R\x1adevicePersistentMemorySizeB\x02\x18\x01\x12!\n\x0ccomp\ + ute_cost\x18\t\x20\x01(\x03R\x0bcomputeCost\x12!\n\x0ccompute_time\x18\ + \x0e\x20\x01(\x03R\x0bcomputeTime\x12\x1f\n\x0bmemory_time\x18\x0f\x20\ + \x01(\x03R\nmemoryTime\x12\x19\n\x08is_final\x18\x07\x20\x01(\x08R\x07is\ + Final\x12#\n\rcontrol_input\x18\x08\x20\x03(\x05R\x0ccontrolInput\x12\ + \x1e\n\ninaccurate\x18\x11\x20\x01(\x08R\ninaccurate\x1aY\n\tInputInfo\ + \x12%\n\x0epreceding_node\x18\x01\x20\x01(\x05R\rprecedingNode\x12%\n\ + \x0epreceding_port\x18\x02\x20\x01(\x05R\rprecedingPort\x1a\xaa\x01\n\nO\ + utputInfo\x12\x12\n\x04size\x18\x01\x20\x01(\x03R\x04size\x12(\n\x10alia\ + s_input_port\x18\x02\x20\x01(\x03R\x0ealiasInputPort\x122\n\x05shape\x18\ + \x03\x20\x01(\x0b2\x1c.tensorflow.TensorShapeProtoR\x05shape\x12*\n\x05d\ + type\x18\x04\x20\x01(\x0e2\x14.tensorflow.DataTypeR\x05dtypeBo\n\x18org.\ + tensorflow.frameworkB\x0fCostGraphProtosP\x01Z=github.com/tensorflow/ten\ + sorflow/tensorflow/go/core/framework\xf8\x01\x01b\x06proto3\ +"; + +static mut file_descriptor_proto_lazy: ::protobuf::lazy::Lazy<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::descriptor::FileDescriptorProto, +}; + +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 { + unsafe { + file_descriptor_proto_lazy.get(|| { + parse_descriptor_proto() + }) + } +} diff --git a/sticker-tf-proto/src/debug.rs b/sticker-tf-proto/src/debug.rs new file mode 100644 index 0000000..b53ee77 --- /dev/null +++ b/sticker-tf-proto/src/debug.rs @@ -0,0 +1,1130 @@ +// This file is generated by rust-protobuf 2.8.0. Do not edit +// @generated + +// https://github.com/Manishearth/rust-clippy/issues/702 +#![allow(unknown_lints)] +#![allow(clippy::all)] + +#![cfg_attr(rustfmt, 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(unsafe_code)] +#![allow(unused_imports)] +#![allow(unused_results)] +//! Generated file from `tensorflow/core/protobuf/debug.proto` + +use protobuf::Message as Message_imported_for_functions; +use protobuf::ProtobufEnum as ProtobufEnum_imported_for_functions; + +/// Generated files are compatible only with the same version +/// of protobuf runtime. +const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_8_0; + +#[derive(PartialEq,Clone,Default)] +pub struct DebugTensorWatch { + // message fields + pub node_name: ::std::string::String, + pub output_slot: i32, + pub debug_ops: ::protobuf::RepeatedField<::std::string::String>, + pub debug_urls: ::protobuf::RepeatedField<::std::string::String>, + pub tolerate_debug_op_creation_failures: bool, + // special fields + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, +} + +impl<'a> ::std::default::Default for &'a DebugTensorWatch { + fn default() -> &'a DebugTensorWatch { + ::default_instance() + } +} + +impl DebugTensorWatch { + pub fn new() -> DebugTensorWatch { + ::std::default::Default::default() + } + + // string node_name = 1; + + + pub fn get_node_name(&self) -> &str { + &self.node_name + } + pub fn clear_node_name(&mut self) { + self.node_name.clear(); + } + + // Param is passed by value, moved + pub fn set_node_name(&mut self, v: ::std::string::String) { + self.node_name = v; + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_node_name(&mut self) -> &mut ::std::string::String { + &mut self.node_name + } + + // Take field + pub fn take_node_name(&mut self) -> ::std::string::String { + ::std::mem::replace(&mut self.node_name, ::std::string::String::new()) + } + + // int32 output_slot = 2; + + + pub fn get_output_slot(&self) -> i32 { + self.output_slot + } + pub fn clear_output_slot(&mut self) { + self.output_slot = 0; + } + + // Param is passed by value, moved + pub fn set_output_slot(&mut self, v: i32) { + self.output_slot = v; + } + + // repeated string debug_ops = 3; + + + pub fn get_debug_ops(&self) -> &[::std::string::String] { + &self.debug_ops + } + pub fn clear_debug_ops(&mut self) { + self.debug_ops.clear(); + } + + // Param is passed by value, moved + pub fn set_debug_ops(&mut self, v: ::protobuf::RepeatedField<::std::string::String>) { + self.debug_ops = v; + } + + // Mutable pointer to the field. + pub fn mut_debug_ops(&mut self) -> &mut ::protobuf::RepeatedField<::std::string::String> { + &mut self.debug_ops + } + + // Take field + pub fn take_debug_ops(&mut self) -> ::protobuf::RepeatedField<::std::string::String> { + ::std::mem::replace(&mut self.debug_ops, ::protobuf::RepeatedField::new()) + } + + // repeated string debug_urls = 4; + + + pub fn get_debug_urls(&self) -> &[::std::string::String] { + &self.debug_urls + } + pub fn clear_debug_urls(&mut self) { + self.debug_urls.clear(); + } + + // Param is passed by value, moved + pub fn set_debug_urls(&mut self, v: ::protobuf::RepeatedField<::std::string::String>) { + self.debug_urls = v; + } + + // Mutable pointer to the field. + pub fn mut_debug_urls(&mut self) -> &mut ::protobuf::RepeatedField<::std::string::String> { + &mut self.debug_urls + } + + // Take field + pub fn take_debug_urls(&mut self) -> ::protobuf::RepeatedField<::std::string::String> { + ::std::mem::replace(&mut self.debug_urls, ::protobuf::RepeatedField::new()) + } + + // bool tolerate_debug_op_creation_failures = 5; + + + pub fn get_tolerate_debug_op_creation_failures(&self) -> bool { + self.tolerate_debug_op_creation_failures + } + pub fn clear_tolerate_debug_op_creation_failures(&mut self) { + self.tolerate_debug_op_creation_failures = false; + } + + // Param is passed by value, moved + pub fn set_tolerate_debug_op_creation_failures(&mut self, v: bool) { + self.tolerate_debug_op_creation_failures = v; + } +} + +impl ::protobuf::Message for DebugTensorWatch { + 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.node_name)?; + }, + 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.output_slot = tmp; + }, + 3 => { + ::protobuf::rt::read_repeated_string_into(wire_type, is, &mut self.debug_ops)?; + }, + 4 => { + ::protobuf::rt::read_repeated_string_into(wire_type, is, &mut self.debug_urls)?; + }, + 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.tolerate_debug_op_creation_failures = 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.node_name.is_empty() { + my_size += ::protobuf::rt::string_size(1, &self.node_name); + } + if self.output_slot != 0 { + my_size += ::protobuf::rt::value_size(2, self.output_slot, ::protobuf::wire_format::WireTypeVarint); + } + for value in &self.debug_ops { + my_size += ::protobuf::rt::string_size(3, &value); + }; + for value in &self.debug_urls { + my_size += ::protobuf::rt::string_size(4, &value); + }; + if self.tolerate_debug_op_creation_failures != 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.node_name.is_empty() { + os.write_string(1, &self.node_name)?; + } + if self.output_slot != 0 { + os.write_int32(2, self.output_slot)?; + } + for v in &self.debug_ops { + os.write_string(3, &v)?; + }; + for v in &self.debug_urls { + os.write_string(4, &v)?; + }; + if self.tolerate_debug_op_creation_failures != false { + os.write_bool(5, self.tolerate_debug_op_creation_failures)?; + } + 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: Box) -> ::std::boxed::Box { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> DebugTensorWatch { + DebugTensorWatch::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, + }; + unsafe { + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "node_name", + |m: &DebugTensorWatch| { &m.node_name }, + |m: &mut DebugTensorWatch| { &mut m.node_name }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt32>( + "output_slot", + |m: &DebugTensorWatch| { &m.output_slot }, + |m: &mut DebugTensorWatch| { &mut m.output_slot }, + )); + fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "debug_ops", + |m: &DebugTensorWatch| { &m.debug_ops }, + |m: &mut DebugTensorWatch| { &mut m.debug_ops }, + )); + fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "debug_urls", + |m: &DebugTensorWatch| { &m.debug_urls }, + |m: &mut DebugTensorWatch| { &mut m.debug_urls }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBool>( + "tolerate_debug_op_creation_failures", + |m: &DebugTensorWatch| { &m.tolerate_debug_op_creation_failures }, + |m: &mut DebugTensorWatch| { &mut m.tolerate_debug_op_creation_failures }, + )); + ::protobuf::reflect::MessageDescriptor::new::( + "DebugTensorWatch", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static DebugTensorWatch { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const DebugTensorWatch, + }; + unsafe { + instance.get(DebugTensorWatch::new) + } + } +} + +impl ::protobuf::Clear for DebugTensorWatch { + fn clear(&mut self) { + self.node_name.clear(); + self.output_slot = 0; + self.debug_ops.clear(); + self.debug_urls.clear(); + self.tolerate_debug_op_creation_failures = false; + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for DebugTensorWatch { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for DebugTensorWatch { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct DebugOptions { + // message fields + pub debug_tensor_watch_opts: ::protobuf::RepeatedField, + pub global_step: i64, + pub reset_disk_byte_usage: bool, + // special fields + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, +} + +impl<'a> ::std::default::Default for &'a DebugOptions { + fn default() -> &'a DebugOptions { + ::default_instance() + } +} + +impl DebugOptions { + pub fn new() -> DebugOptions { + ::std::default::Default::default() + } + + // repeated .tensorflow.DebugTensorWatch debug_tensor_watch_opts = 4; + + + pub fn get_debug_tensor_watch_opts(&self) -> &[DebugTensorWatch] { + &self.debug_tensor_watch_opts + } + pub fn clear_debug_tensor_watch_opts(&mut self) { + self.debug_tensor_watch_opts.clear(); + } + + // Param is passed by value, moved + pub fn set_debug_tensor_watch_opts(&mut self, v: ::protobuf::RepeatedField) { + self.debug_tensor_watch_opts = v; + } + + // Mutable pointer to the field. + pub fn mut_debug_tensor_watch_opts(&mut self) -> &mut ::protobuf::RepeatedField { + &mut self.debug_tensor_watch_opts + } + + // Take field + pub fn take_debug_tensor_watch_opts(&mut self) -> ::protobuf::RepeatedField { + ::std::mem::replace(&mut self.debug_tensor_watch_opts, ::protobuf::RepeatedField::new()) + } + + // int64 global_step = 10; + + + pub fn get_global_step(&self) -> i64 { + self.global_step + } + pub fn clear_global_step(&mut self) { + self.global_step = 0; + } + + // Param is passed by value, moved + pub fn set_global_step(&mut self, v: i64) { + self.global_step = v; + } + + // bool reset_disk_byte_usage = 11; + + + pub fn get_reset_disk_byte_usage(&self) -> bool { + self.reset_disk_byte_usage + } + pub fn clear_reset_disk_byte_usage(&mut self) { + self.reset_disk_byte_usage = false; + } + + // Param is passed by value, moved + pub fn set_reset_disk_byte_usage(&mut self, v: bool) { + self.reset_disk_byte_usage = v; + } +} + +impl ::protobuf::Message for DebugOptions { + fn is_initialized(&self) -> bool { + for v in &self.debug_tensor_watch_opts { + 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 { + 4 => { + ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.debug_tensor_watch_opts)?; + }, + 10 => { + 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.global_step = tmp; + }, + 11 => { + 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.reset_disk_byte_usage = 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.debug_tensor_watch_opts { + let len = value.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; + }; + if self.global_step != 0 { + my_size += ::protobuf::rt::value_size(10, self.global_step, ::protobuf::wire_format::WireTypeVarint); + } + if self.reset_disk_byte_usage != 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.debug_tensor_watch_opts { + 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.global_step != 0 { + os.write_int64(10, self.global_step)?; + } + if self.reset_disk_byte_usage != false { + os.write_bool(11, self.reset_disk_byte_usage)?; + } + 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: Box) -> ::std::boxed::Box { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> DebugOptions { + DebugOptions::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, + }; + unsafe { + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( + "debug_tensor_watch_opts", + |m: &DebugOptions| { &m.debug_tensor_watch_opts }, + |m: &mut DebugOptions| { &mut m.debug_tensor_watch_opts }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt64>( + "global_step", + |m: &DebugOptions| { &m.global_step }, + |m: &mut DebugOptions| { &mut m.global_step }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBool>( + "reset_disk_byte_usage", + |m: &DebugOptions| { &m.reset_disk_byte_usage }, + |m: &mut DebugOptions| { &mut m.reset_disk_byte_usage }, + )); + ::protobuf::reflect::MessageDescriptor::new::( + "DebugOptions", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static DebugOptions { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const DebugOptions, + }; + unsafe { + instance.get(DebugOptions::new) + } + } +} + +impl ::protobuf::Clear for DebugOptions { + fn clear(&mut self) { + self.debug_tensor_watch_opts.clear(); + self.global_step = 0; + self.reset_disk_byte_usage = false; + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for DebugOptions { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for DebugOptions { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct DebuggedSourceFile { + // message fields + pub host: ::std::string::String, + pub file_path: ::std::string::String, + pub last_modified: i64, + pub bytes: i64, + pub lines: ::protobuf::RepeatedField<::std::string::String>, + // special fields + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, +} + +impl<'a> ::std::default::Default for &'a DebuggedSourceFile { + fn default() -> &'a DebuggedSourceFile { + ::default_instance() + } +} + +impl DebuggedSourceFile { + pub fn new() -> DebuggedSourceFile { + ::std::default::Default::default() + } + + // string host = 1; + + + pub fn get_host(&self) -> &str { + &self.host + } + pub fn clear_host(&mut self) { + self.host.clear(); + } + + // Param is passed by value, moved + pub fn set_host(&mut self, v: ::std::string::String) { + self.host = v; + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_host(&mut self) -> &mut ::std::string::String { + &mut self.host + } + + // Take field + pub fn take_host(&mut self) -> ::std::string::String { + ::std::mem::replace(&mut self.host, ::std::string::String::new()) + } + + // string file_path = 2; + + + pub fn get_file_path(&self) -> &str { + &self.file_path + } + pub fn clear_file_path(&mut self) { + self.file_path.clear(); + } + + // Param is passed by value, moved + pub fn set_file_path(&mut self, v: ::std::string::String) { + self.file_path = v; + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_file_path(&mut self) -> &mut ::std::string::String { + &mut self.file_path + } + + // Take field + pub fn take_file_path(&mut self) -> ::std::string::String { + ::std::mem::replace(&mut self.file_path, ::std::string::String::new()) + } + + // int64 last_modified = 3; + + + pub fn get_last_modified(&self) -> i64 { + self.last_modified + } + pub fn clear_last_modified(&mut self) { + self.last_modified = 0; + } + + // Param is passed by value, moved + pub fn set_last_modified(&mut self, v: i64) { + self.last_modified = v; + } + + // int64 bytes = 4; + + + pub fn get_bytes(&self) -> i64 { + self.bytes + } + pub fn clear_bytes(&mut self) { + self.bytes = 0; + } + + // Param is passed by value, moved + pub fn set_bytes(&mut self, v: i64) { + self.bytes = v; + } + + // repeated string lines = 5; + + + pub fn get_lines(&self) -> &[::std::string::String] { + &self.lines + } + pub fn clear_lines(&mut self) { + self.lines.clear(); + } + + // Param is passed by value, moved + pub fn set_lines(&mut self, v: ::protobuf::RepeatedField<::std::string::String>) { + self.lines = v; + } + + // Mutable pointer to the field. + pub fn mut_lines(&mut self) -> &mut ::protobuf::RepeatedField<::std::string::String> { + &mut self.lines + } + + // Take field + pub fn take_lines(&mut self) -> ::protobuf::RepeatedField<::std::string::String> { + ::std::mem::replace(&mut self.lines, ::protobuf::RepeatedField::new()) + } +} + +impl ::protobuf::Message for DebuggedSourceFile { + 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.host)?; + }, + 2 => { + ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.file_path)?; + }, + 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.last_modified = tmp; + }, + 4 => { + 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.bytes = tmp; + }, + 5 => { + ::protobuf::rt::read_repeated_string_into(wire_type, is, &mut self.lines)?; + }, + _ => { + ::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.host.is_empty() { + my_size += ::protobuf::rt::string_size(1, &self.host); + } + if !self.file_path.is_empty() { + my_size += ::protobuf::rt::string_size(2, &self.file_path); + } + if self.last_modified != 0 { + my_size += ::protobuf::rt::value_size(3, self.last_modified, ::protobuf::wire_format::WireTypeVarint); + } + if self.bytes != 0 { + my_size += ::protobuf::rt::value_size(4, self.bytes, ::protobuf::wire_format::WireTypeVarint); + } + for value in &self.lines { + my_size += ::protobuf::rt::string_size(5, &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.host.is_empty() { + os.write_string(1, &self.host)?; + } + if !self.file_path.is_empty() { + os.write_string(2, &self.file_path)?; + } + if self.last_modified != 0 { + os.write_int64(3, self.last_modified)?; + } + if self.bytes != 0 { + os.write_int64(4, self.bytes)?; + } + for v in &self.lines { + os.write_string(5, &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: Box) -> ::std::boxed::Box { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> DebuggedSourceFile { + DebuggedSourceFile::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, + }; + unsafe { + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "host", + |m: &DebuggedSourceFile| { &m.host }, + |m: &mut DebuggedSourceFile| { &mut m.host }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "file_path", + |m: &DebuggedSourceFile| { &m.file_path }, + |m: &mut DebuggedSourceFile| { &mut m.file_path }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt64>( + "last_modified", + |m: &DebuggedSourceFile| { &m.last_modified }, + |m: &mut DebuggedSourceFile| { &mut m.last_modified }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt64>( + "bytes", + |m: &DebuggedSourceFile| { &m.bytes }, + |m: &mut DebuggedSourceFile| { &mut m.bytes }, + )); + fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "lines", + |m: &DebuggedSourceFile| { &m.lines }, + |m: &mut DebuggedSourceFile| { &mut m.lines }, + )); + ::protobuf::reflect::MessageDescriptor::new::( + "DebuggedSourceFile", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static DebuggedSourceFile { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const DebuggedSourceFile, + }; + unsafe { + instance.get(DebuggedSourceFile::new) + } + } +} + +impl ::protobuf::Clear for DebuggedSourceFile { + fn clear(&mut self) { + self.host.clear(); + self.file_path.clear(); + self.last_modified = 0; + self.bytes = 0; + self.lines.clear(); + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for DebuggedSourceFile { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for DebuggedSourceFile { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct DebuggedSourceFiles { + // message fields + pub source_files: ::protobuf::RepeatedField, + // special fields + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, +} + +impl<'a> ::std::default::Default for &'a DebuggedSourceFiles { + fn default() -> &'a DebuggedSourceFiles { + ::default_instance() + } +} + +impl DebuggedSourceFiles { + pub fn new() -> DebuggedSourceFiles { + ::std::default::Default::default() + } + + // repeated .tensorflow.DebuggedSourceFile source_files = 1; + + + pub fn get_source_files(&self) -> &[DebuggedSourceFile] { + &self.source_files + } + pub fn clear_source_files(&mut self) { + self.source_files.clear(); + } + + // Param is passed by value, moved + pub fn set_source_files(&mut self, v: ::protobuf::RepeatedField) { + self.source_files = v; + } + + // Mutable pointer to the field. + pub fn mut_source_files(&mut self) -> &mut ::protobuf::RepeatedField { + &mut self.source_files + } + + // Take field + pub fn take_source_files(&mut self) -> ::protobuf::RepeatedField { + ::std::mem::replace(&mut self.source_files, ::protobuf::RepeatedField::new()) + } +} + +impl ::protobuf::Message for DebuggedSourceFiles { + fn is_initialized(&self) -> bool { + for v in &self.source_files { + 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.source_files)?; + }, + _ => { + ::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.source_files { + 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.source_files { + 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: Box) -> ::std::boxed::Box { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> DebuggedSourceFiles { + DebuggedSourceFiles::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, + }; + unsafe { + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( + "source_files", + |m: &DebuggedSourceFiles| { &m.source_files }, + |m: &mut DebuggedSourceFiles| { &mut m.source_files }, + )); + ::protobuf::reflect::MessageDescriptor::new::( + "DebuggedSourceFiles", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static DebuggedSourceFiles { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const DebuggedSourceFiles, + }; + unsafe { + instance.get(DebuggedSourceFiles::new) + } + } +} + +impl ::protobuf::Clear for DebuggedSourceFiles { + fn clear(&mut self) { + self.source_files.clear(); + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for DebuggedSourceFiles { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for DebuggedSourceFiles { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +static file_descriptor_proto_data: &'static [u8] = b"\ + \n$tensorflow/core/protobuf/debug.proto\x12\ntensorflow\"\xda\x01\n\x10D\ + ebugTensorWatch\x12\x1b\n\tnode_name\x18\x01\x20\x01(\tR\x08nodeName\x12\ + \x1f\n\x0boutput_slot\x18\x02\x20\x01(\x05R\noutputSlot\x12\x1b\n\tdebug\ + _ops\x18\x03\x20\x03(\tR\x08debugOps\x12\x1d\n\ndebug_urls\x18\x04\x20\ + \x03(\tR\tdebugUrls\x12L\n#tolerate_debug_op_creation_failures\x18\x05\ + \x20\x01(\x08R\x1ftolerateDebugOpCreationFailures\"\xb7\x01\n\x0cDebugOp\ + tions\x12S\n\x17debug_tensor_watch_opts\x18\x04\x20\x03(\x0b2\x1c.tensor\ + flow.DebugTensorWatchR\x14debugTensorWatchOpts\x12\x1f\n\x0bglobal_step\ + \x18\n\x20\x01(\x03R\nglobalStep\x121\n\x15reset_disk_byte_usage\x18\x0b\ + \x20\x01(\x08R\x12resetDiskByteUsage\"\x96\x01\n\x12DebuggedSourceFile\ + \x12\x12\n\x04host\x18\x01\x20\x01(\tR\x04host\x12\x1b\n\tfile_path\x18\ + \x02\x20\x01(\tR\x08filePath\x12#\n\rlast_modified\x18\x03\x20\x01(\x03R\ + \x0clastModified\x12\x14\n\x05bytes\x18\x04\x20\x01(\x03R\x05bytes\x12\ + \x14\n\x05lines\x18\x05\x20\x03(\tR\x05lines\"X\n\x13DebuggedSourceFiles\ + \x12A\n\x0csource_files\x18\x01\x20\x03(\x0b2\x1e.tensorflow.DebuggedSou\ + rceFileR\x0bsourceFilesBj\n\x18org.tensorflow.frameworkB\x0bDebugProtosP\ + \x01Z = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::descriptor::FileDescriptorProto, +}; + +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 { + unsafe { + file_descriptor_proto_lazy.get(|| { + parse_descriptor_proto() + }) + } +} diff --git a/sticker-tf-proto/src/function.rs b/sticker-tf-proto/src/function.rs new file mode 100644 index 0000000..d5ec4ce --- /dev/null +++ b/sticker-tf-proto/src/function.rs @@ -0,0 +1,808 @@ +// This file is generated by rust-protobuf 2.8.0. Do not edit +// @generated + +// https://github.com/Manishearth/rust-clippy/issues/702 +#![allow(unknown_lints)] +#![allow(clippy::all)] + +#![cfg_attr(rustfmt, 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(unsafe_code)] +#![allow(unused_imports)] +#![allow(unused_results)] +//! Generated file from `tensorflow/core/framework/function.proto` + +use protobuf::Message as Message_imported_for_functions; +use protobuf::ProtobufEnum as ProtobufEnum_imported_for_functions; + +/// Generated files are compatible only with the same version +/// of protobuf runtime. +const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_8_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: 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 mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, + }; + unsafe { + 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::( + "FunctionDefLibrary", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static FunctionDefLibrary { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const FunctionDefLibrary, + }; + unsafe { + 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::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::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 node_def: ::protobuf::RepeatedField, + pub 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(|| super::op_def::OpDef::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.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()) + } +} + +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)?; + }, + 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)?; + }, + _ => { + ::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); + 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::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)?; + 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)?; + 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: 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 mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, + }; + unsafe { + 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_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 }, + )); + ::protobuf::reflect::MessageDescriptor::new::( + "FunctionDef", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static FunctionDef { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const FunctionDef, + }; + unsafe { + instance.get(FunctionDef::new) + } + } +} + +impl ::protobuf::Clear for FunctionDef { + fn clear(&mut self) { + self.signature.clear(); + self.attr.clear(); + self.node_def.clear(); + self.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::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::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: 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 mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, + }; + unsafe { + 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::( + "GradientDef", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static GradientDef { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const GradientDef, + }; + unsafe { + 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::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::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\"\xe7\x02\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\ + node_def\x18\x03\x20\x03(\x0b2\x13.tensorflow.NodeDefR\x07nodeDef\x122\n\ + \x03ret\x18\x04\x20\x03(\x0b2\x20.tensorflow.FunctionDef.RetEntryR\x03re\ + t\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\x1a6\n\x08RetEntry\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\x0cfu\ + nctionName\x12#\n\rgradient_func\x18\x02\x20\x01(\tR\x0cgradientFuncBn\n\ + \x18org.tensorflow.frameworkB\x0eFunctionProtosP\x01Z=github.com/tensorf\ + low/tensorflow/tensorflow/go/core/framework\xf8\x01\x01b\x06proto3\ +"; + +static mut file_descriptor_proto_lazy: ::protobuf::lazy::Lazy<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::descriptor::FileDescriptorProto, +}; + +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 { + unsafe { + file_descriptor_proto_lazy.get(|| { + parse_descriptor_proto() + }) + } +} diff --git a/sticker-tf-proto/src/graph.rs b/sticker-tf-proto/src/graph.rs new file mode 100644 index 0000000..ecb9cd0 --- /dev/null +++ b/sticker-tf-proto/src/graph.rs @@ -0,0 +1,382 @@ +// This file is generated by rust-protobuf 2.8.0. Do not edit +// @generated + +// https://github.com/Manishearth/rust-clippy/issues/702 +#![allow(unknown_lints)] +#![allow(clippy::all)] + +#![cfg_attr(rustfmt, 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(unsafe_code)] +#![allow(unused_imports)] +#![allow(unused_results)] +//! Generated file from `tensorflow/core/framework/graph.proto` + +use protobuf::Message as Message_imported_for_functions; +use protobuf::ProtobufEnum as ProtobufEnum_imported_for_functions; + +/// Generated files are compatible only with the same version +/// of protobuf runtime. +const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_8_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(|| super::versions::VersionDef::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(|| super::function::FunctionDefLibrary::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: 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 mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, + }; + unsafe { + 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::( + "GraphDef", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static GraphDef { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const GraphDef, + }; + unsafe { + 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::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::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 mut file_descriptor_proto_lazy: ::protobuf::lazy::Lazy<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::descriptor::FileDescriptorProto, +}; + +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 { + unsafe { + file_descriptor_proto_lazy.get(|| { + parse_descriptor_proto() + }) + } +} diff --git a/sticker-tf-proto/src/node_def.rs b/sticker-tf-proto/src/node_def.rs new file mode 100644 index 0000000..4aa4904 --- /dev/null +++ b/sticker-tf-proto/src/node_def.rs @@ -0,0 +1,616 @@ +// This file is generated by rust-protobuf 2.8.0. Do not edit +// @generated + +// https://github.com/Manishearth/rust-clippy/issues/702 +#![allow(unknown_lints)] +#![allow(clippy::all)] + +#![cfg_attr(rustfmt, 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(unsafe_code)] +#![allow(unused_imports)] +#![allow(unused_results)] +//! Generated file from `tensorflow/core/framework/node_def.proto` + +use protobuf::Message as Message_imported_for_functions; +use protobuf::ProtobufEnum as ProtobufEnum_imported_for_functions; + +/// Generated files are compatible only with the same version +/// of protobuf runtime. +const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_8_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(|| NodeDef_ExperimentalDebugInfo::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: 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 mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, + }; + unsafe { + 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::( + "NodeDef", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static NodeDef { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const NodeDef, + }; + unsafe { + 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::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct NodeDef_ExperimentalDebugInfo { + // message fields + pub original_node_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()) + } +} + +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)?; + }, + _ => { + ::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); + }; + 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)?; + }; + 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: 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 mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, + }; + unsafe { + 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 }, + )); + ::protobuf::reflect::MessageDescriptor::new::( + "NodeDef_ExperimentalDebugInfo", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static NodeDef_ExperimentalDebugInfo { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const NodeDef_ExperimentalDebugInfo, + }; + unsafe { + instance.get(NodeDef_ExperimentalDebugInfo::new) + } + } +} + +impl ::protobuf::Clear for NodeDef_ExperimentalDebugInfo { + fn clear(&mut self) { + self.original_node_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::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::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\"\x8a\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\x1aG\n\x15ExperimentalDebugInfo\x12.\n\x13original_n\ + ode_names\x18\x01\x20\x03(\tR\x11originalNodeNamesBi\n\x18org.tensorflow\ + .frameworkB\tNodeProtoP\x01Z=github.com/tensorflow/tensorflow/tensorflow\ + /go/core/framework\xf8\x01\x01b\x06proto3\ +"; + +static mut file_descriptor_proto_lazy: ::protobuf::lazy::Lazy<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::descriptor::FileDescriptorProto, +}; + +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 { + unsafe { + file_descriptor_proto_lazy.get(|| { + parse_descriptor_proto() + }) + } +} diff --git a/sticker-tf-proto/src/op_def.rs b/sticker-tf-proto/src/op_def.rs new file mode 100644 index 0000000..cef3b61 --- /dev/null +++ b/sticker-tf-proto/src/op_def.rs @@ -0,0 +1,1895 @@ +// This file is generated by rust-protobuf 2.8.0. Do not edit +// @generated + +// https://github.com/Manishearth/rust-clippy/issues/702 +#![allow(unknown_lints)] +#![allow(clippy::all)] + +#![cfg_attr(rustfmt, 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(unsafe_code)] +#![allow(unused_imports)] +#![allow(unused_results)] +//! Generated file from `tensorflow/core/framework/op_def.proto` + +use protobuf::Message as Message_imported_for_functions; +use protobuf::ProtobufEnum as ProtobufEnum_imported_for_functions; + +/// Generated files are compatible only with the same version +/// of protobuf runtime. +const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_8_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 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 .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(|| OpDeprecation::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)?; + }, + 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.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.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: 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 mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, + }; + unsafe { + 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::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::( + "OpDef", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static OpDef { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const OpDef, + }; + unsafe { + 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.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::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::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, self.field_type.value())?; + } + 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: 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 mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, + }; + unsafe { + 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::( + "OpDef_ArgDef", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static OpDef_ArgDef { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const OpDef_ArgDef, + }; + unsafe { + 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::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::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(|| super::attr_value::AttrValue::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(|| super::attr_value::AttrValue::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: 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 mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, + }; + unsafe { + 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::( + "OpDef_AttrDef", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static OpDef_AttrDef { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const OpDef_AttrDef, + }; + unsafe { + 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::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::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: 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 mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, + }; + unsafe { + 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::( + "OpDeprecation", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static OpDeprecation { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const OpDeprecation, + }; + unsafe { + 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::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::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: 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 mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, + }; + unsafe { + 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::( + "OpList", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static OpList { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const OpList, + }; + unsafe { + 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::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::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\"\xcd\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\x04attr\x18\x04\x20\x03(\x0b2\x19.tensorflo\ + w.OpDef.AttrDefR\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\x0b\ + description\x12%\n\x0eis_commutative\x18\x12\x20\x01(\x08R\risCommutativ\ + e\x12!\n\x0cis_aggregate\x18\x10\x20\x01(\x08R\x0bisAggregate\x12\x1f\n\ + \x0bis_stateful\x18\x11\x20\x01(\x08R\nisStateful\x12<\n\x1aallows_unini\ + tialized_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\ + \x0bdescription\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\nnumberAttr\x12$\n\x0etype_list_attr\x18\x06\x20\x01(\tR\x0ctyp\ + eListAttr\x12\x15\n\x06is_ref\x18\x10\x20\x01(\x08R\x05isRef\x1a\x88\x02\ + \n\x07AttrDef\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\x0bdescri\ + ption\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(\x03\ + R\x07minimum\x12<\n\x0eallowed_values\x18\x07\x20\x01(\x0b2\x15.tensorfl\ + ow.AttrValueR\rallowedValues\"K\n\rOpDeprecation\x12\x18\n\x07version\ + \x18\x01\x20\x01(\x05R\x07version\x12\x20\n\x0bexplanation\x18\x02\x20\ + \x01(\tR\x0bexplanation\"+\n\x06OpList\x12!\n\x02op\x18\x01\x20\x03(\x0b\ + 2\x11.tensorflow.OpDefR\x02opBk\n\x18org.tensorflow.frameworkB\x0bOpDefP\ + rotosP\x01Z=github.com/tensorflow/tensorflow/tensorflow/go/core/framewor\ + k\xf8\x01\x01b\x06proto3\ +"; + +static mut file_descriptor_proto_lazy: ::protobuf::lazy::Lazy<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::descriptor::FileDescriptorProto, +}; + +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 { + unsafe { + file_descriptor_proto_lazy.get(|| { + parse_descriptor_proto() + }) + } +} diff --git a/sticker-tf-proto/src/resource_handle.rs b/sticker-tf-proto/src/resource_handle.rs new file mode 100644 index 0000000..365204e --- /dev/null +++ b/sticker-tf-proto/src/resource_handle.rs @@ -0,0 +1,385 @@ +// This file is generated by rust-protobuf 2.8.0. Do not edit +// @generated + +// https://github.com/Manishearth/rust-clippy/issues/702 +#![allow(unknown_lints)] +#![allow(clippy::all)] + +#![cfg_attr(rustfmt, 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(unsafe_code)] +#![allow(unused_imports)] +#![allow(unused_results)] +//! Generated file from `tensorflow/core/framework/resource_handle.proto` + +use protobuf::Message as Message_imported_for_functions; +use protobuf::ProtobufEnum as ProtobufEnum_imported_for_functions; + +/// Generated files are compatible only with the same version +/// of protobuf runtime. +const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_8_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, + // 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()) + } +} + +impl ::protobuf::Message for ResourceHandleProto { + 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)?; + }, + 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)?; + }, + _ => { + ::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); + } + 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)?; + } + 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: 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 mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, + }; + unsafe { + 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 }, + )); + ::protobuf::reflect::MessageDescriptor::new::( + "ResourceHandleProto", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static ResourceHandleProto { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ResourceHandleProto, + }; + unsafe { + 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.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::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +static file_descriptor_proto_data: &'static [u8] = b"\ + \n/tensorflow/core/framework/resource_handle.proto\x12\ntensorflow\"\xa4\ + \x01\n\x13ResourceHandleProto\x12\x16\n\x06device\x18\x01\x20\x01(\tR\ + \x06device\x12\x1c\n\tcontainer\x18\x02\x20\x01(\tR\tcontainer\x12\x12\n\ + \x04name\x18\x03\x20\x01(\tR\x04name\x12\x1b\n\thash_code\x18\x04\x20\ + \x01(\x04R\x08hashCode\x12&\n\x0fmaybe_type_name\x18\x05\x20\x01(\tR\rma\ + ybeTypeNameBn\n\x18org.tensorflow.frameworkB\x0eResourceHandleP\x01Z=git\ + hub.com/tensorflow/tensorflow/tensorflow/go/core/framework\xf8\x01\x01b\ + \x06proto3\ +"; + +static mut file_descriptor_proto_lazy: ::protobuf::lazy::Lazy<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::descriptor::FileDescriptorProto, +}; + +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 { + unsafe { + file_descriptor_proto_lazy.get(|| { + parse_descriptor_proto() + }) + } +} diff --git a/sticker-tf-proto/src/rewriter_config.rs b/sticker-tf-proto/src/rewriter_config.rs new file mode 100644 index 0000000..073af84 --- /dev/null +++ b/sticker-tf-proto/src/rewriter_config.rs @@ -0,0 +1,1810 @@ +// This file is generated by rust-protobuf 2.8.0. Do not edit +// @generated + +// https://github.com/Manishearth/rust-clippy/issues/702 +#![allow(unknown_lints)] +#![allow(clippy::all)] + +#![cfg_attr(rustfmt, 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(unsafe_code)] +#![allow(unused_imports)] +#![allow(unused_results)] +//! Generated file from `tensorflow/core/protobuf/rewriter_config.proto` + +use protobuf::Message as Message_imported_for_functions; +use protobuf::ProtobufEnum as ProtobufEnum_imported_for_functions; + +/// Generated files are compatible only with the same version +/// of protobuf runtime. +const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_8_0; + +#[derive(PartialEq,Clone,Default)] +pub struct AutoParallelOptions { + // message fields + pub enable: bool, + pub num_replicas: i32, + // special fields + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, +} + +impl<'a> ::std::default::Default for &'a AutoParallelOptions { + fn default() -> &'a AutoParallelOptions { + ::default_instance() + } +} + +impl AutoParallelOptions { + pub fn new() -> AutoParallelOptions { + ::std::default::Default::default() + } + + // bool enable = 1; + + + pub fn get_enable(&self) -> bool { + self.enable + } + pub fn clear_enable(&mut self) { + self.enable = false; + } + + // Param is passed by value, moved + pub fn set_enable(&mut self, v: bool) { + self.enable = v; + } + + // int32 num_replicas = 2; + + + pub fn get_num_replicas(&self) -> i32 { + self.num_replicas + } + pub fn clear_num_replicas(&mut self) { + self.num_replicas = 0; + } + + // Param is passed by value, moved + pub fn set_num_replicas(&mut self, v: i32) { + self.num_replicas = v; + } +} + +impl ::protobuf::Message for AutoParallelOptions { + 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_bool()?; + self.enable = 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.num_replicas = 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.enable != false { + my_size += 2; + } + if self.num_replicas != 0 { + my_size += ::protobuf::rt::value_size(2, self.num_replicas, ::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.enable != false { + os.write_bool(1, self.enable)?; + } + if self.num_replicas != 0 { + os.write_int32(2, self.num_replicas)?; + } + 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: Box) -> ::std::boxed::Box { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> AutoParallelOptions { + AutoParallelOptions::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, + }; + unsafe { + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBool>( + "enable", + |m: &AutoParallelOptions| { &m.enable }, + |m: &mut AutoParallelOptions| { &mut m.enable }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt32>( + "num_replicas", + |m: &AutoParallelOptions| { &m.num_replicas }, + |m: &mut AutoParallelOptions| { &mut m.num_replicas }, + )); + ::protobuf::reflect::MessageDescriptor::new::( + "AutoParallelOptions", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static AutoParallelOptions { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const AutoParallelOptions, + }; + unsafe { + instance.get(AutoParallelOptions::new) + } + } +} + +impl ::protobuf::Clear for AutoParallelOptions { + fn clear(&mut self) { + self.enable = false; + self.num_replicas = 0; + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for AutoParallelOptions { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for AutoParallelOptions { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct ScopedAllocatorOptions { + // message fields + pub enable_op: ::protobuf::RepeatedField<::std::string::String>, + // special fields + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, +} + +impl<'a> ::std::default::Default for &'a ScopedAllocatorOptions { + fn default() -> &'a ScopedAllocatorOptions { + ::default_instance() + } +} + +impl ScopedAllocatorOptions { + pub fn new() -> ScopedAllocatorOptions { + ::std::default::Default::default() + } + + // repeated string enable_op = 1; + + + pub fn get_enable_op(&self) -> &[::std::string::String] { + &self.enable_op + } + pub fn clear_enable_op(&mut self) { + self.enable_op.clear(); + } + + // Param is passed by value, moved + pub fn set_enable_op(&mut self, v: ::protobuf::RepeatedField<::std::string::String>) { + self.enable_op = v; + } + + // Mutable pointer to the field. + pub fn mut_enable_op(&mut self) -> &mut ::protobuf::RepeatedField<::std::string::String> { + &mut self.enable_op + } + + // Take field + pub fn take_enable_op(&mut self) -> ::protobuf::RepeatedField<::std::string::String> { + ::std::mem::replace(&mut self.enable_op, ::protobuf::RepeatedField::new()) + } +} + +impl ::protobuf::Message for ScopedAllocatorOptions { + 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.enable_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.enable_op { + 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.enable_op { + 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: Box) -> ::std::boxed::Box { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> ScopedAllocatorOptions { + ScopedAllocatorOptions::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, + }; + unsafe { + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "enable_op", + |m: &ScopedAllocatorOptions| { &m.enable_op }, + |m: &mut ScopedAllocatorOptions| { &mut m.enable_op }, + )); + ::protobuf::reflect::MessageDescriptor::new::( + "ScopedAllocatorOptions", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static ScopedAllocatorOptions { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ScopedAllocatorOptions, + }; + unsafe { + instance.get(ScopedAllocatorOptions::new) + } + } +} + +impl ::protobuf::Clear for ScopedAllocatorOptions { + fn clear(&mut self) { + self.enable_op.clear(); + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for ScopedAllocatorOptions { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for ScopedAllocatorOptions { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct RewriterConfig { + // message fields + pub layout_optimizer: RewriterConfig_Toggle, + pub constant_folding: RewriterConfig_Toggle, + pub shape_optimization: RewriterConfig_Toggle, + pub remapping: RewriterConfig_Toggle, + pub arithmetic_optimization: RewriterConfig_Toggle, + pub dependency_optimization: RewriterConfig_Toggle, + pub loop_optimization: RewriterConfig_Toggle, + pub function_optimization: RewriterConfig_Toggle, + pub debug_stripper: RewriterConfig_Toggle, + pub disable_model_pruning: bool, + pub scoped_allocator_optimization: RewriterConfig_Toggle, + pub pin_to_host_optimization: RewriterConfig_Toggle, + pub disable_meta_optimizer: bool, + pub meta_optimizer_iterations: RewriterConfig_NumIterationsType, + pub min_graph_nodes: i32, + pub memory_optimization: RewriterConfig_MemOptType, + pub memory_optimizer_target_node_name_scope: ::std::string::String, + pub meta_optimizer_timeout_ms: i64, + pub auto_parallel: ::protobuf::SingularPtrField, + pub fail_on_optimizer_errors: bool, + pub scoped_allocator_opts: ::protobuf::SingularPtrField, + pub optimizers: ::protobuf::RepeatedField<::std::string::String>, + pub custom_optimizers: ::protobuf::RepeatedField, + // special fields + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, +} + +impl<'a> ::std::default::Default for &'a RewriterConfig { + fn default() -> &'a RewriterConfig { + ::default_instance() + } +} + +impl RewriterConfig { + pub fn new() -> RewriterConfig { + ::std::default::Default::default() + } + + // .tensorflow.RewriterConfig.Toggle layout_optimizer = 1; + + + pub fn get_layout_optimizer(&self) -> RewriterConfig_Toggle { + self.layout_optimizer + } + pub fn clear_layout_optimizer(&mut self) { + self.layout_optimizer = RewriterConfig_Toggle::DEFAULT; + } + + // Param is passed by value, moved + pub fn set_layout_optimizer(&mut self, v: RewriterConfig_Toggle) { + self.layout_optimizer = v; + } + + // .tensorflow.RewriterConfig.Toggle constant_folding = 3; + + + pub fn get_constant_folding(&self) -> RewriterConfig_Toggle { + self.constant_folding + } + pub fn clear_constant_folding(&mut self) { + self.constant_folding = RewriterConfig_Toggle::DEFAULT; + } + + // Param is passed by value, moved + pub fn set_constant_folding(&mut self, v: RewriterConfig_Toggle) { + self.constant_folding = v; + } + + // .tensorflow.RewriterConfig.Toggle shape_optimization = 13; + + + pub fn get_shape_optimization(&self) -> RewriterConfig_Toggle { + self.shape_optimization + } + pub fn clear_shape_optimization(&mut self) { + self.shape_optimization = RewriterConfig_Toggle::DEFAULT; + } + + // Param is passed by value, moved + pub fn set_shape_optimization(&mut self, v: RewriterConfig_Toggle) { + self.shape_optimization = v; + } + + // .tensorflow.RewriterConfig.Toggle remapping = 14; + + + pub fn get_remapping(&self) -> RewriterConfig_Toggle { + self.remapping + } + pub fn clear_remapping(&mut self) { + self.remapping = RewriterConfig_Toggle::DEFAULT; + } + + // Param is passed by value, moved + pub fn set_remapping(&mut self, v: RewriterConfig_Toggle) { + self.remapping = v; + } + + // .tensorflow.RewriterConfig.Toggle arithmetic_optimization = 7; + + + pub fn get_arithmetic_optimization(&self) -> RewriterConfig_Toggle { + self.arithmetic_optimization + } + pub fn clear_arithmetic_optimization(&mut self) { + self.arithmetic_optimization = RewriterConfig_Toggle::DEFAULT; + } + + // Param is passed by value, moved + pub fn set_arithmetic_optimization(&mut self, v: RewriterConfig_Toggle) { + self.arithmetic_optimization = v; + } + + // .tensorflow.RewriterConfig.Toggle dependency_optimization = 8; + + + pub fn get_dependency_optimization(&self) -> RewriterConfig_Toggle { + self.dependency_optimization + } + pub fn clear_dependency_optimization(&mut self) { + self.dependency_optimization = RewriterConfig_Toggle::DEFAULT; + } + + // Param is passed by value, moved + pub fn set_dependency_optimization(&mut self, v: RewriterConfig_Toggle) { + self.dependency_optimization = v; + } + + // .tensorflow.RewriterConfig.Toggle loop_optimization = 9; + + + pub fn get_loop_optimization(&self) -> RewriterConfig_Toggle { + self.loop_optimization + } + pub fn clear_loop_optimization(&mut self) { + self.loop_optimization = RewriterConfig_Toggle::DEFAULT; + } + + // Param is passed by value, moved + pub fn set_loop_optimization(&mut self, v: RewriterConfig_Toggle) { + self.loop_optimization = v; + } + + // .tensorflow.RewriterConfig.Toggle function_optimization = 10; + + + pub fn get_function_optimization(&self) -> RewriterConfig_Toggle { + self.function_optimization + } + pub fn clear_function_optimization(&mut self) { + self.function_optimization = RewriterConfig_Toggle::DEFAULT; + } + + // Param is passed by value, moved + pub fn set_function_optimization(&mut self, v: RewriterConfig_Toggle) { + self.function_optimization = v; + } + + // .tensorflow.RewriterConfig.Toggle debug_stripper = 11; + + + pub fn get_debug_stripper(&self) -> RewriterConfig_Toggle { + self.debug_stripper + } + pub fn clear_debug_stripper(&mut self) { + self.debug_stripper = RewriterConfig_Toggle::DEFAULT; + } + + // Param is passed by value, moved + pub fn set_debug_stripper(&mut self, v: RewriterConfig_Toggle) { + self.debug_stripper = v; + } + + // bool disable_model_pruning = 2; + + + pub fn get_disable_model_pruning(&self) -> bool { + self.disable_model_pruning + } + pub fn clear_disable_model_pruning(&mut self) { + self.disable_model_pruning = false; + } + + // Param is passed by value, moved + pub fn set_disable_model_pruning(&mut self, v: bool) { + self.disable_model_pruning = v; + } + + // .tensorflow.RewriterConfig.Toggle scoped_allocator_optimization = 15; + + + pub fn get_scoped_allocator_optimization(&self) -> RewriterConfig_Toggle { + self.scoped_allocator_optimization + } + pub fn clear_scoped_allocator_optimization(&mut self) { + self.scoped_allocator_optimization = RewriterConfig_Toggle::DEFAULT; + } + + // Param is passed by value, moved + pub fn set_scoped_allocator_optimization(&mut self, v: RewriterConfig_Toggle) { + self.scoped_allocator_optimization = v; + } + + // .tensorflow.RewriterConfig.Toggle pin_to_host_optimization = 18; + + + pub fn get_pin_to_host_optimization(&self) -> RewriterConfig_Toggle { + self.pin_to_host_optimization + } + pub fn clear_pin_to_host_optimization(&mut self) { + self.pin_to_host_optimization = RewriterConfig_Toggle::DEFAULT; + } + + // Param is passed by value, moved + pub fn set_pin_to_host_optimization(&mut self, v: RewriterConfig_Toggle) { + self.pin_to_host_optimization = v; + } + + // bool disable_meta_optimizer = 19; + + + pub fn get_disable_meta_optimizer(&self) -> bool { + self.disable_meta_optimizer + } + pub fn clear_disable_meta_optimizer(&mut self) { + self.disable_meta_optimizer = false; + } + + // Param is passed by value, moved + pub fn set_disable_meta_optimizer(&mut self, v: bool) { + self.disable_meta_optimizer = v; + } + + // .tensorflow.RewriterConfig.NumIterationsType meta_optimizer_iterations = 12; + + + pub fn get_meta_optimizer_iterations(&self) -> RewriterConfig_NumIterationsType { + self.meta_optimizer_iterations + } + pub fn clear_meta_optimizer_iterations(&mut self) { + self.meta_optimizer_iterations = RewriterConfig_NumIterationsType::DEFAULT_NUM_ITERS; + } + + // Param is passed by value, moved + pub fn set_meta_optimizer_iterations(&mut self, v: RewriterConfig_NumIterationsType) { + self.meta_optimizer_iterations = v; + } + + // int32 min_graph_nodes = 17; + + + pub fn get_min_graph_nodes(&self) -> i32 { + self.min_graph_nodes + } + pub fn clear_min_graph_nodes(&mut self) { + self.min_graph_nodes = 0; + } + + // Param is passed by value, moved + pub fn set_min_graph_nodes(&mut self, v: i32) { + self.min_graph_nodes = v; + } + + // .tensorflow.RewriterConfig.MemOptType memory_optimization = 4; + + + pub fn get_memory_optimization(&self) -> RewriterConfig_MemOptType { + self.memory_optimization + } + pub fn clear_memory_optimization(&mut self) { + self.memory_optimization = RewriterConfig_MemOptType::DEFAULT_MEM_OPT; + } + + // Param is passed by value, moved + pub fn set_memory_optimization(&mut self, v: RewriterConfig_MemOptType) { + self.memory_optimization = v; + } + + // string memory_optimizer_target_node_name_scope = 6; + + + pub fn get_memory_optimizer_target_node_name_scope(&self) -> &str { + &self.memory_optimizer_target_node_name_scope + } + pub fn clear_memory_optimizer_target_node_name_scope(&mut self) { + self.memory_optimizer_target_node_name_scope.clear(); + } + + // Param is passed by value, moved + pub fn set_memory_optimizer_target_node_name_scope(&mut self, v: ::std::string::String) { + self.memory_optimizer_target_node_name_scope = v; + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_memory_optimizer_target_node_name_scope(&mut self) -> &mut ::std::string::String { + &mut self.memory_optimizer_target_node_name_scope + } + + // Take field + pub fn take_memory_optimizer_target_node_name_scope(&mut self) -> ::std::string::String { + ::std::mem::replace(&mut self.memory_optimizer_target_node_name_scope, ::std::string::String::new()) + } + + // int64 meta_optimizer_timeout_ms = 20; + + + pub fn get_meta_optimizer_timeout_ms(&self) -> i64 { + self.meta_optimizer_timeout_ms + } + pub fn clear_meta_optimizer_timeout_ms(&mut self) { + self.meta_optimizer_timeout_ms = 0; + } + + // Param is passed by value, moved + pub fn set_meta_optimizer_timeout_ms(&mut self, v: i64) { + self.meta_optimizer_timeout_ms = v; + } + + // .tensorflow.AutoParallelOptions auto_parallel = 5; + + + pub fn get_auto_parallel(&self) -> &AutoParallelOptions { + self.auto_parallel.as_ref().unwrap_or_else(|| AutoParallelOptions::default_instance()) + } + pub fn clear_auto_parallel(&mut self) { + self.auto_parallel.clear(); + } + + pub fn has_auto_parallel(&self) -> bool { + self.auto_parallel.is_some() + } + + // Param is passed by value, moved + pub fn set_auto_parallel(&mut self, v: AutoParallelOptions) { + self.auto_parallel = ::protobuf::SingularPtrField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_auto_parallel(&mut self) -> &mut AutoParallelOptions { + if self.auto_parallel.is_none() { + self.auto_parallel.set_default(); + } + self.auto_parallel.as_mut().unwrap() + } + + // Take field + pub fn take_auto_parallel(&mut self) -> AutoParallelOptions { + self.auto_parallel.take().unwrap_or_else(|| AutoParallelOptions::new()) + } + + // bool fail_on_optimizer_errors = 21; + + + pub fn get_fail_on_optimizer_errors(&self) -> bool { + self.fail_on_optimizer_errors + } + pub fn clear_fail_on_optimizer_errors(&mut self) { + self.fail_on_optimizer_errors = false; + } + + // Param is passed by value, moved + pub fn set_fail_on_optimizer_errors(&mut self, v: bool) { + self.fail_on_optimizer_errors = v; + } + + // .tensorflow.ScopedAllocatorOptions scoped_allocator_opts = 16; + + + pub fn get_scoped_allocator_opts(&self) -> &ScopedAllocatorOptions { + self.scoped_allocator_opts.as_ref().unwrap_or_else(|| ScopedAllocatorOptions::default_instance()) + } + pub fn clear_scoped_allocator_opts(&mut self) { + self.scoped_allocator_opts.clear(); + } + + pub fn has_scoped_allocator_opts(&self) -> bool { + self.scoped_allocator_opts.is_some() + } + + // Param is passed by value, moved + pub fn set_scoped_allocator_opts(&mut self, v: ScopedAllocatorOptions) { + self.scoped_allocator_opts = ::protobuf::SingularPtrField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_scoped_allocator_opts(&mut self) -> &mut ScopedAllocatorOptions { + if self.scoped_allocator_opts.is_none() { + self.scoped_allocator_opts.set_default(); + } + self.scoped_allocator_opts.as_mut().unwrap() + } + + // Take field + pub fn take_scoped_allocator_opts(&mut self) -> ScopedAllocatorOptions { + self.scoped_allocator_opts.take().unwrap_or_else(|| ScopedAllocatorOptions::new()) + } + + // repeated string optimizers = 100; + + + pub fn get_optimizers(&self) -> &[::std::string::String] { + &self.optimizers + } + pub fn clear_optimizers(&mut self) { + self.optimizers.clear(); + } + + // Param is passed by value, moved + pub fn set_optimizers(&mut self, v: ::protobuf::RepeatedField<::std::string::String>) { + self.optimizers = v; + } + + // Mutable pointer to the field. + pub fn mut_optimizers(&mut self) -> &mut ::protobuf::RepeatedField<::std::string::String> { + &mut self.optimizers + } + + // Take field + pub fn take_optimizers(&mut self) -> ::protobuf::RepeatedField<::std::string::String> { + ::std::mem::replace(&mut self.optimizers, ::protobuf::RepeatedField::new()) + } + + // repeated .tensorflow.RewriterConfig.CustomGraphOptimizer custom_optimizers = 200; + + + pub fn get_custom_optimizers(&self) -> &[RewriterConfig_CustomGraphOptimizer] { + &self.custom_optimizers + } + pub fn clear_custom_optimizers(&mut self) { + self.custom_optimizers.clear(); + } + + // Param is passed by value, moved + pub fn set_custom_optimizers(&mut self, v: ::protobuf::RepeatedField) { + self.custom_optimizers = v; + } + + // Mutable pointer to the field. + pub fn mut_custom_optimizers(&mut self) -> &mut ::protobuf::RepeatedField { + &mut self.custom_optimizers + } + + // Take field + pub fn take_custom_optimizers(&mut self) -> ::protobuf::RepeatedField { + ::std::mem::replace(&mut self.custom_optimizers, ::protobuf::RepeatedField::new()) + } +} + +impl ::protobuf::Message for RewriterConfig { + fn is_initialized(&self) -> bool { + for v in &self.auto_parallel { + if !v.is_initialized() { + return false; + } + }; + for v in &self.scoped_allocator_opts { + if !v.is_initialized() { + return false; + } + }; + for v in &self.custom_optimizers { + 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.layout_optimizer, 1, &mut self.unknown_fields)? + }, + 3 => { + ::protobuf::rt::read_proto3_enum_with_unknown_fields_into(wire_type, is, &mut self.constant_folding, 3, &mut self.unknown_fields)? + }, + 13 => { + ::protobuf::rt::read_proto3_enum_with_unknown_fields_into(wire_type, is, &mut self.shape_optimization, 13, &mut self.unknown_fields)? + }, + 14 => { + ::protobuf::rt::read_proto3_enum_with_unknown_fields_into(wire_type, is, &mut self.remapping, 14, &mut self.unknown_fields)? + }, + 7 => { + ::protobuf::rt::read_proto3_enum_with_unknown_fields_into(wire_type, is, &mut self.arithmetic_optimization, 7, &mut self.unknown_fields)? + }, + 8 => { + ::protobuf::rt::read_proto3_enum_with_unknown_fields_into(wire_type, is, &mut self.dependency_optimization, 8, &mut self.unknown_fields)? + }, + 9 => { + ::protobuf::rt::read_proto3_enum_with_unknown_fields_into(wire_type, is, &mut self.loop_optimization, 9, &mut self.unknown_fields)? + }, + 10 => { + ::protobuf::rt::read_proto3_enum_with_unknown_fields_into(wire_type, is, &mut self.function_optimization, 10, &mut self.unknown_fields)? + }, + 11 => { + ::protobuf::rt::read_proto3_enum_with_unknown_fields_into(wire_type, is, &mut self.debug_stripper, 11, &mut self.unknown_fields)? + }, + 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.disable_model_pruning = tmp; + }, + 15 => { + ::protobuf::rt::read_proto3_enum_with_unknown_fields_into(wire_type, is, &mut self.scoped_allocator_optimization, 15, &mut self.unknown_fields)? + }, + 18 => { + ::protobuf::rt::read_proto3_enum_with_unknown_fields_into(wire_type, is, &mut self.pin_to_host_optimization, 18, &mut self.unknown_fields)? + }, + 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.disable_meta_optimizer = tmp; + }, + 12 => { + ::protobuf::rt::read_proto3_enum_with_unknown_fields_into(wire_type, is, &mut self.meta_optimizer_iterations, 12, &mut self.unknown_fields)? + }, + 17 => { + 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_graph_nodes = tmp; + }, + 4 => { + ::protobuf::rt::read_proto3_enum_with_unknown_fields_into(wire_type, is, &mut self.memory_optimization, 4, &mut self.unknown_fields)? + }, + 6 => { + ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.memory_optimizer_target_node_name_scope)?; + }, + 20 => { + 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.meta_optimizer_timeout_ms = tmp; + }, + 5 => { + ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.auto_parallel)?; + }, + 21 => { + 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.fail_on_optimizer_errors = tmp; + }, + 16 => { + ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.scoped_allocator_opts)?; + }, + 100 => { + ::protobuf::rt::read_repeated_string_into(wire_type, is, &mut self.optimizers)?; + }, + 200 => { + ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.custom_optimizers)?; + }, + _ => { + ::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.layout_optimizer != RewriterConfig_Toggle::DEFAULT { + my_size += ::protobuf::rt::enum_size(1, self.layout_optimizer); + } + if self.constant_folding != RewriterConfig_Toggle::DEFAULT { + my_size += ::protobuf::rt::enum_size(3, self.constant_folding); + } + if self.shape_optimization != RewriterConfig_Toggle::DEFAULT { + my_size += ::protobuf::rt::enum_size(13, self.shape_optimization); + } + if self.remapping != RewriterConfig_Toggle::DEFAULT { + my_size += ::protobuf::rt::enum_size(14, self.remapping); + } + if self.arithmetic_optimization != RewriterConfig_Toggle::DEFAULT { + my_size += ::protobuf::rt::enum_size(7, self.arithmetic_optimization); + } + if self.dependency_optimization != RewriterConfig_Toggle::DEFAULT { + my_size += ::protobuf::rt::enum_size(8, self.dependency_optimization); + } + if self.loop_optimization != RewriterConfig_Toggle::DEFAULT { + my_size += ::protobuf::rt::enum_size(9, self.loop_optimization); + } + if self.function_optimization != RewriterConfig_Toggle::DEFAULT { + my_size += ::protobuf::rt::enum_size(10, self.function_optimization); + } + if self.debug_stripper != RewriterConfig_Toggle::DEFAULT { + my_size += ::protobuf::rt::enum_size(11, self.debug_stripper); + } + if self.disable_model_pruning != false { + my_size += 2; + } + if self.scoped_allocator_optimization != RewriterConfig_Toggle::DEFAULT { + my_size += ::protobuf::rt::enum_size(15, self.scoped_allocator_optimization); + } + if self.pin_to_host_optimization != RewriterConfig_Toggle::DEFAULT { + my_size += ::protobuf::rt::enum_size(18, self.pin_to_host_optimization); + } + if self.disable_meta_optimizer != false { + my_size += 3; + } + if self.meta_optimizer_iterations != RewriterConfig_NumIterationsType::DEFAULT_NUM_ITERS { + my_size += ::protobuf::rt::enum_size(12, self.meta_optimizer_iterations); + } + if self.min_graph_nodes != 0 { + my_size += ::protobuf::rt::value_size(17, self.min_graph_nodes, ::protobuf::wire_format::WireTypeVarint); + } + if self.memory_optimization != RewriterConfig_MemOptType::DEFAULT_MEM_OPT { + my_size += ::protobuf::rt::enum_size(4, self.memory_optimization); + } + if !self.memory_optimizer_target_node_name_scope.is_empty() { + my_size += ::protobuf::rt::string_size(6, &self.memory_optimizer_target_node_name_scope); + } + if self.meta_optimizer_timeout_ms != 0 { + my_size += ::protobuf::rt::value_size(20, self.meta_optimizer_timeout_ms, ::protobuf::wire_format::WireTypeVarint); + } + if let Some(ref v) = self.auto_parallel.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; + } + if self.fail_on_optimizer_errors != false { + my_size += 3; + } + if let Some(ref v) = self.scoped_allocator_opts.as_ref() { + let len = v.compute_size(); + my_size += 2 + ::protobuf::rt::compute_raw_varint32_size(len) + len; + } + for value in &self.optimizers { + my_size += ::protobuf::rt::string_size(100, &value); + }; + for value in &self.custom_optimizers { + let len = value.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 self.layout_optimizer != RewriterConfig_Toggle::DEFAULT { + os.write_enum(1, self.layout_optimizer.value())?; + } + if self.constant_folding != RewriterConfig_Toggle::DEFAULT { + os.write_enum(3, self.constant_folding.value())?; + } + if self.shape_optimization != RewriterConfig_Toggle::DEFAULT { + os.write_enum(13, self.shape_optimization.value())?; + } + if self.remapping != RewriterConfig_Toggle::DEFAULT { + os.write_enum(14, self.remapping.value())?; + } + if self.arithmetic_optimization != RewriterConfig_Toggle::DEFAULT { + os.write_enum(7, self.arithmetic_optimization.value())?; + } + if self.dependency_optimization != RewriterConfig_Toggle::DEFAULT { + os.write_enum(8, self.dependency_optimization.value())?; + } + if self.loop_optimization != RewriterConfig_Toggle::DEFAULT { + os.write_enum(9, self.loop_optimization.value())?; + } + if self.function_optimization != RewriterConfig_Toggle::DEFAULT { + os.write_enum(10, self.function_optimization.value())?; + } + if self.debug_stripper != RewriterConfig_Toggle::DEFAULT { + os.write_enum(11, self.debug_stripper.value())?; + } + if self.disable_model_pruning != false { + os.write_bool(2, self.disable_model_pruning)?; + } + if self.scoped_allocator_optimization != RewriterConfig_Toggle::DEFAULT { + os.write_enum(15, self.scoped_allocator_optimization.value())?; + } + if self.pin_to_host_optimization != RewriterConfig_Toggle::DEFAULT { + os.write_enum(18, self.pin_to_host_optimization.value())?; + } + if self.disable_meta_optimizer != false { + os.write_bool(19, self.disable_meta_optimizer)?; + } + if self.meta_optimizer_iterations != RewriterConfig_NumIterationsType::DEFAULT_NUM_ITERS { + os.write_enum(12, self.meta_optimizer_iterations.value())?; + } + if self.min_graph_nodes != 0 { + os.write_int32(17, self.min_graph_nodes)?; + } + if self.memory_optimization != RewriterConfig_MemOptType::DEFAULT_MEM_OPT { + os.write_enum(4, self.memory_optimization.value())?; + } + if !self.memory_optimizer_target_node_name_scope.is_empty() { + os.write_string(6, &self.memory_optimizer_target_node_name_scope)?; + } + if self.meta_optimizer_timeout_ms != 0 { + os.write_int64(20, self.meta_optimizer_timeout_ms)?; + } + if let Some(ref v) = self.auto_parallel.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)?; + } + if self.fail_on_optimizer_errors != false { + os.write_bool(21, self.fail_on_optimizer_errors)?; + } + if let Some(ref v) = self.scoped_allocator_opts.as_ref() { + os.write_tag(16, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; + } + for v in &self.optimizers { + os.write_string(100, &v)?; + }; + for v in &self.custom_optimizers { + os.write_tag(200, ::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: Box) -> ::std::boxed::Box { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> RewriterConfig { + RewriterConfig::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, + }; + unsafe { + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeEnum>( + "layout_optimizer", + |m: &RewriterConfig| { &m.layout_optimizer }, + |m: &mut RewriterConfig| { &mut m.layout_optimizer }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeEnum>( + "constant_folding", + |m: &RewriterConfig| { &m.constant_folding }, + |m: &mut RewriterConfig| { &mut m.constant_folding }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeEnum>( + "shape_optimization", + |m: &RewriterConfig| { &m.shape_optimization }, + |m: &mut RewriterConfig| { &mut m.shape_optimization }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeEnum>( + "remapping", + |m: &RewriterConfig| { &m.remapping }, + |m: &mut RewriterConfig| { &mut m.remapping }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeEnum>( + "arithmetic_optimization", + |m: &RewriterConfig| { &m.arithmetic_optimization }, + |m: &mut RewriterConfig| { &mut m.arithmetic_optimization }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeEnum>( + "dependency_optimization", + |m: &RewriterConfig| { &m.dependency_optimization }, + |m: &mut RewriterConfig| { &mut m.dependency_optimization }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeEnum>( + "loop_optimization", + |m: &RewriterConfig| { &m.loop_optimization }, + |m: &mut RewriterConfig| { &mut m.loop_optimization }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeEnum>( + "function_optimization", + |m: &RewriterConfig| { &m.function_optimization }, + |m: &mut RewriterConfig| { &mut m.function_optimization }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeEnum>( + "debug_stripper", + |m: &RewriterConfig| { &m.debug_stripper }, + |m: &mut RewriterConfig| { &mut m.debug_stripper }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBool>( + "disable_model_pruning", + |m: &RewriterConfig| { &m.disable_model_pruning }, + |m: &mut RewriterConfig| { &mut m.disable_model_pruning }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeEnum>( + "scoped_allocator_optimization", + |m: &RewriterConfig| { &m.scoped_allocator_optimization }, + |m: &mut RewriterConfig| { &mut m.scoped_allocator_optimization }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeEnum>( + "pin_to_host_optimization", + |m: &RewriterConfig| { &m.pin_to_host_optimization }, + |m: &mut RewriterConfig| { &mut m.pin_to_host_optimization }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBool>( + "disable_meta_optimizer", + |m: &RewriterConfig| { &m.disable_meta_optimizer }, + |m: &mut RewriterConfig| { &mut m.disable_meta_optimizer }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeEnum>( + "meta_optimizer_iterations", + |m: &RewriterConfig| { &m.meta_optimizer_iterations }, + |m: &mut RewriterConfig| { &mut m.meta_optimizer_iterations }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt32>( + "min_graph_nodes", + |m: &RewriterConfig| { &m.min_graph_nodes }, + |m: &mut RewriterConfig| { &mut m.min_graph_nodes }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeEnum>( + "memory_optimization", + |m: &RewriterConfig| { &m.memory_optimization }, + |m: &mut RewriterConfig| { &mut m.memory_optimization }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "memory_optimizer_target_node_name_scope", + |m: &RewriterConfig| { &m.memory_optimizer_target_node_name_scope }, + |m: &mut RewriterConfig| { &mut m.memory_optimizer_target_node_name_scope }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt64>( + "meta_optimizer_timeout_ms", + |m: &RewriterConfig| { &m.meta_optimizer_timeout_ms }, + |m: &mut RewriterConfig| { &mut m.meta_optimizer_timeout_ms }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( + "auto_parallel", + |m: &RewriterConfig| { &m.auto_parallel }, + |m: &mut RewriterConfig| { &mut m.auto_parallel }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBool>( + "fail_on_optimizer_errors", + |m: &RewriterConfig| { &m.fail_on_optimizer_errors }, + |m: &mut RewriterConfig| { &mut m.fail_on_optimizer_errors }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( + "scoped_allocator_opts", + |m: &RewriterConfig| { &m.scoped_allocator_opts }, + |m: &mut RewriterConfig| { &mut m.scoped_allocator_opts }, + )); + fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "optimizers", + |m: &RewriterConfig| { &m.optimizers }, + |m: &mut RewriterConfig| { &mut m.optimizers }, + )); + fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( + "custom_optimizers", + |m: &RewriterConfig| { &m.custom_optimizers }, + |m: &mut RewriterConfig| { &mut m.custom_optimizers }, + )); + ::protobuf::reflect::MessageDescriptor::new::( + "RewriterConfig", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static RewriterConfig { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const RewriterConfig, + }; + unsafe { + instance.get(RewriterConfig::new) + } + } +} + +impl ::protobuf::Clear for RewriterConfig { + fn clear(&mut self) { + self.layout_optimizer = RewriterConfig_Toggle::DEFAULT; + self.constant_folding = RewriterConfig_Toggle::DEFAULT; + self.shape_optimization = RewriterConfig_Toggle::DEFAULT; + self.remapping = RewriterConfig_Toggle::DEFAULT; + self.arithmetic_optimization = RewriterConfig_Toggle::DEFAULT; + self.dependency_optimization = RewriterConfig_Toggle::DEFAULT; + self.loop_optimization = RewriterConfig_Toggle::DEFAULT; + self.function_optimization = RewriterConfig_Toggle::DEFAULT; + self.debug_stripper = RewriterConfig_Toggle::DEFAULT; + self.disable_model_pruning = false; + self.scoped_allocator_optimization = RewriterConfig_Toggle::DEFAULT; + self.pin_to_host_optimization = RewriterConfig_Toggle::DEFAULT; + self.disable_meta_optimizer = false; + self.meta_optimizer_iterations = RewriterConfig_NumIterationsType::DEFAULT_NUM_ITERS; + self.min_graph_nodes = 0; + self.memory_optimization = RewriterConfig_MemOptType::DEFAULT_MEM_OPT; + self.memory_optimizer_target_node_name_scope.clear(); + self.meta_optimizer_timeout_ms = 0; + self.auto_parallel.clear(); + self.fail_on_optimizer_errors = false; + self.scoped_allocator_opts.clear(); + self.optimizers.clear(); + self.custom_optimizers.clear(); + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for RewriterConfig { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for RewriterConfig { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct RewriterConfig_CustomGraphOptimizer { + // message fields + pub name: ::std::string::String, + pub parameter_map: ::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 RewriterConfig_CustomGraphOptimizer { + fn default() -> &'a RewriterConfig_CustomGraphOptimizer { + ::default_instance() + } +} + +impl RewriterConfig_CustomGraphOptimizer { + pub fn new() -> RewriterConfig_CustomGraphOptimizer { + ::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.RewriterConfig.CustomGraphOptimizer.ParameterMapEntry parameter_map = 2; + + + pub fn get_parameter_map(&self) -> &::std::collections::HashMap<::std::string::String, super::attr_value::AttrValue> { + &self.parameter_map + } + pub fn clear_parameter_map(&mut self) { + self.parameter_map.clear(); + } + + // Param is passed by value, moved + pub fn set_parameter_map(&mut self, v: ::std::collections::HashMap<::std::string::String, super::attr_value::AttrValue>) { + self.parameter_map = v; + } + + // Mutable pointer to the field. + pub fn mut_parameter_map(&mut self) -> &mut ::std::collections::HashMap<::std::string::String, super::attr_value::AttrValue> { + &mut self.parameter_map + } + + // Take field + pub fn take_parameter_map(&mut self) -> ::std::collections::HashMap<::std::string::String, super::attr_value::AttrValue> { + ::std::mem::replace(&mut self.parameter_map, ::std::collections::HashMap::new()) + } +} + +impl ::protobuf::Message for RewriterConfig_CustomGraphOptimizer { + 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.parameter_map)?; + }, + _ => { + ::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.parameter_map); + 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.parameter_map, 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: Box) -> ::std::boxed::Box { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> RewriterConfig_CustomGraphOptimizer { + RewriterConfig_CustomGraphOptimizer::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, + }; + unsafe { + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "name", + |m: &RewriterConfig_CustomGraphOptimizer| { &m.name }, + |m: &mut RewriterConfig_CustomGraphOptimizer| { &mut m.name }, + )); + fields.push(::protobuf::reflect::accessor::make_map_accessor::<_, ::protobuf::types::ProtobufTypeString, ::protobuf::types::ProtobufTypeMessage>( + "parameter_map", + |m: &RewriterConfig_CustomGraphOptimizer| { &m.parameter_map }, + |m: &mut RewriterConfig_CustomGraphOptimizer| { &mut m.parameter_map }, + )); + ::protobuf::reflect::MessageDescriptor::new::( + "RewriterConfig_CustomGraphOptimizer", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static RewriterConfig_CustomGraphOptimizer { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const RewriterConfig_CustomGraphOptimizer, + }; + unsafe { + instance.get(RewriterConfig_CustomGraphOptimizer::new) + } + } +} + +impl ::protobuf::Clear for RewriterConfig_CustomGraphOptimizer { + fn clear(&mut self) { + self.name.clear(); + self.parameter_map.clear(); + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for RewriterConfig_CustomGraphOptimizer { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for RewriterConfig_CustomGraphOptimizer { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(Clone,PartialEq,Eq,Debug,Hash)] +pub enum RewriterConfig_Toggle { + DEFAULT = 0, + ON = 1, + OFF = 2, + AGGRESSIVE = 3, +} + +impl ::protobuf::ProtobufEnum for RewriterConfig_Toggle { + fn value(&self) -> i32 { + *self as i32 + } + + fn from_i32(value: i32) -> ::std::option::Option { + match value { + 0 => ::std::option::Option::Some(RewriterConfig_Toggle::DEFAULT), + 1 => ::std::option::Option::Some(RewriterConfig_Toggle::ON), + 2 => ::std::option::Option::Some(RewriterConfig_Toggle::OFF), + 3 => ::std::option::Option::Some(RewriterConfig_Toggle::AGGRESSIVE), + _ => ::std::option::Option::None + } + } + + fn values() -> &'static [Self] { + static values: &'static [RewriterConfig_Toggle] = &[ + RewriterConfig_Toggle::DEFAULT, + RewriterConfig_Toggle::ON, + RewriterConfig_Toggle::OFF, + RewriterConfig_Toggle::AGGRESSIVE, + ]; + values + } + + fn enum_descriptor_static() -> &'static ::protobuf::reflect::EnumDescriptor { + static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::EnumDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::EnumDescriptor, + }; + unsafe { + descriptor.get(|| { + ::protobuf::reflect::EnumDescriptor::new("RewriterConfig_Toggle", file_descriptor_proto()) + }) + } + } +} + +impl ::std::marker::Copy for RewriterConfig_Toggle { +} + +impl ::std::default::Default for RewriterConfig_Toggle { + fn default() -> Self { + RewriterConfig_Toggle::DEFAULT + } +} + +impl ::protobuf::reflect::ProtobufValue for RewriterConfig_Toggle { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Enum(self.descriptor()) + } +} + +#[derive(Clone,PartialEq,Eq,Debug,Hash)] +pub enum RewriterConfig_NumIterationsType { + DEFAULT_NUM_ITERS = 0, + ONE = 1, + TWO = 2, +} + +impl ::protobuf::ProtobufEnum for RewriterConfig_NumIterationsType { + fn value(&self) -> i32 { + *self as i32 + } + + fn from_i32(value: i32) -> ::std::option::Option { + match value { + 0 => ::std::option::Option::Some(RewriterConfig_NumIterationsType::DEFAULT_NUM_ITERS), + 1 => ::std::option::Option::Some(RewriterConfig_NumIterationsType::ONE), + 2 => ::std::option::Option::Some(RewriterConfig_NumIterationsType::TWO), + _ => ::std::option::Option::None + } + } + + fn values() -> &'static [Self] { + static values: &'static [RewriterConfig_NumIterationsType] = &[ + RewriterConfig_NumIterationsType::DEFAULT_NUM_ITERS, + RewriterConfig_NumIterationsType::ONE, + RewriterConfig_NumIterationsType::TWO, + ]; + values + } + + fn enum_descriptor_static() -> &'static ::protobuf::reflect::EnumDescriptor { + static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::EnumDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::EnumDescriptor, + }; + unsafe { + descriptor.get(|| { + ::protobuf::reflect::EnumDescriptor::new("RewriterConfig_NumIterationsType", file_descriptor_proto()) + }) + } + } +} + +impl ::std::marker::Copy for RewriterConfig_NumIterationsType { +} + +impl ::std::default::Default for RewriterConfig_NumIterationsType { + fn default() -> Self { + RewriterConfig_NumIterationsType::DEFAULT_NUM_ITERS + } +} + +impl ::protobuf::reflect::ProtobufValue for RewriterConfig_NumIterationsType { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Enum(self.descriptor()) + } +} + +#[derive(Clone,PartialEq,Eq,Debug,Hash)] +pub enum RewriterConfig_MemOptType { + DEFAULT_MEM_OPT = 0, + NO_MEM_OPT = 1, + MANUAL = 2, + SWAPPING_HEURISTICS = 4, + RECOMPUTATION_HEURISTICS = 5, + SCHEDULING_HEURISTICS = 6, + HEURISTICS = 3, +} + +impl ::protobuf::ProtobufEnum for RewriterConfig_MemOptType { + fn value(&self) -> i32 { + *self as i32 + } + + fn from_i32(value: i32) -> ::std::option::Option { + match value { + 0 => ::std::option::Option::Some(RewriterConfig_MemOptType::DEFAULT_MEM_OPT), + 1 => ::std::option::Option::Some(RewriterConfig_MemOptType::NO_MEM_OPT), + 2 => ::std::option::Option::Some(RewriterConfig_MemOptType::MANUAL), + 4 => ::std::option::Option::Some(RewriterConfig_MemOptType::SWAPPING_HEURISTICS), + 5 => ::std::option::Option::Some(RewriterConfig_MemOptType::RECOMPUTATION_HEURISTICS), + 6 => ::std::option::Option::Some(RewriterConfig_MemOptType::SCHEDULING_HEURISTICS), + 3 => ::std::option::Option::Some(RewriterConfig_MemOptType::HEURISTICS), + _ => ::std::option::Option::None + } + } + + fn values() -> &'static [Self] { + static values: &'static [RewriterConfig_MemOptType] = &[ + RewriterConfig_MemOptType::DEFAULT_MEM_OPT, + RewriterConfig_MemOptType::NO_MEM_OPT, + RewriterConfig_MemOptType::MANUAL, + RewriterConfig_MemOptType::SWAPPING_HEURISTICS, + RewriterConfig_MemOptType::RECOMPUTATION_HEURISTICS, + RewriterConfig_MemOptType::SCHEDULING_HEURISTICS, + RewriterConfig_MemOptType::HEURISTICS, + ]; + values + } + + fn enum_descriptor_static() -> &'static ::protobuf::reflect::EnumDescriptor { + static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::EnumDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::EnumDescriptor, + }; + unsafe { + descriptor.get(|| { + ::protobuf::reflect::EnumDescriptor::new("RewriterConfig_MemOptType", file_descriptor_proto()) + }) + } + } +} + +impl ::std::marker::Copy for RewriterConfig_MemOptType { +} + +impl ::std::default::Default for RewriterConfig_MemOptType { + fn default() -> Self { + RewriterConfig_MemOptType::DEFAULT_MEM_OPT + } +} + +impl ::protobuf::reflect::ProtobufValue for RewriterConfig_MemOptType { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Enum(self.descriptor()) + } +} + +static file_descriptor_proto_data: &'static [u8] = b"\ + \n.tensorflow/core/protobuf/rewriter_config.proto\x12\ntensorflow\x1a*te\ + nsorflow/core/framework/attr_value.proto\"P\n\x13AutoParallelOptions\x12\ + \x16\n\x06enable\x18\x01\x20\x01(\x08R\x06enable\x12!\n\x0cnum_replicas\ + \x18\x02\x20\x01(\x05R\x0bnumReplicas\"5\n\x16ScopedAllocatorOptions\x12\ + \x1b\n\tenable_op\x18\x01\x20\x03(\tR\x08enableOp\"\xeb\x11\n\x0eRewrite\ + rConfig\x12L\n\x10layout_optimizer\x18\x01\x20\x01(\x0e2!.tensorflow.Rew\ + riterConfig.ToggleR\x0flayoutOptimizer\x12L\n\x10constant_folding\x18\ + \x03\x20\x01(\x0e2!.tensorflow.RewriterConfig.ToggleR\x0fconstantFolding\ + \x12P\n\x12shape_optimization\x18\r\x20\x01(\x0e2!.tensorflow.RewriterCo\ + nfig.ToggleR\x11shapeOptimization\x12?\n\tremapping\x18\x0e\x20\x01(\x0e\ + 2!.tensorflow.RewriterConfig.ToggleR\tremapping\x12Z\n\x17arithmetic_opt\ + imization\x18\x07\x20\x01(\x0e2!.tensorflow.RewriterConfig.ToggleR\x16ar\ + ithmeticOptimization\x12Z\n\x17dependency_optimization\x18\x08\x20\x01(\ + \x0e2!.tensorflow.RewriterConfig.ToggleR\x16dependencyOptimization\x12N\ + \n\x11loop_optimization\x18\t\x20\x01(\x0e2!.tensorflow.RewriterConfig.T\ + oggleR\x10loopOptimization\x12V\n\x15function_optimization\x18\n\x20\x01\ + (\x0e2!.tensorflow.RewriterConfig.ToggleR\x14functionOptimization\x12H\n\ + \x0edebug_stripper\x18\x0b\x20\x01(\x0e2!.tensorflow.RewriterConfig.Togg\ + leR\rdebugStripper\x122\n\x15disable_model_pruning\x18\x02\x20\x01(\x08R\ + \x13disableModelPruning\x12e\n\x1dscoped_allocator_optimization\x18\x0f\ + \x20\x01(\x0e2!.tensorflow.RewriterConfig.ToggleR\x1bscopedAllocatorOpti\ + mization\x12Z\n\x18pin_to_host_optimization\x18\x12\x20\x01(\x0e2!.tenso\ + rflow.RewriterConfig.ToggleR\x15pinToHostOptimization\x124\n\x16disable_\ + meta_optimizer\x18\x13\x20\x01(\x08R\x14disableMetaOptimizer\x12h\n\x19m\ + eta_optimizer_iterations\x18\x0c\x20\x01(\x0e2,.tensorflow.RewriterConfi\ + g.NumIterationsTypeR\x17metaOptimizerIterations\x12&\n\x0fmin_graph_node\ + s\x18\x11\x20\x01(\x05R\rminGraphNodes\x12V\n\x13memory_optimization\x18\ + \x04\x20\x01(\x0e2%.tensorflow.RewriterConfig.MemOptTypeR\x12memoryOptim\ + ization\x12S\n'memory_optimizer_target_node_name_scope\x18\x06\x20\x01(\ + \tR\"memoryOptimizerTargetNodeNameScope\x129\n\x19meta_optimizer_timeout\ + _ms\x18\x14\x20\x01(\x03R\x16metaOptimizerTimeoutMs\x12D\n\rauto_paralle\ + l\x18\x05\x20\x01(\x0b2\x1f.tensorflow.AutoParallelOptionsR\x0cautoParal\ + lel\x127\n\x18fail_on_optimizer_errors\x18\x15\x20\x01(\x08R\x15failOnOp\ + timizerErrors\x12V\n\x15scoped_allocator_opts\x18\x10\x20\x01(\x0b2\".te\ + nsorflow.ScopedAllocatorOptionsR\x13scopedAllocatorOpts\x12\x1e\n\noptim\ + izers\x18d\x20\x03(\tR\noptimizers\x12]\n\x11custom_optimizers\x18\xc8\ + \x01\x20\x03(\x0b2/.tensorflow.RewriterConfig.CustomGraphOptimizerR\x10c\ + ustomOptimizers\x1a\xea\x01\n\x14CustomGraphOptimizer\x12\x12\n\x04name\ + \x18\x01\x20\x01(\tR\x04name\x12f\n\rparameter_map\x18\x02\x20\x03(\x0b2\ + A.tensorflow.RewriterConfig.CustomGraphOptimizer.ParameterMapEntryR\x0cp\ + arameterMap\x1aV\n\x11ParameterMapEntry\x12\x10\n\x03key\x18\x01\x20\x01\ + (\tR\x03key\x12+\n\x05value\x18\x02\x20\x01(\x0b2\x15.tensorflow.AttrVal\ + ueR\x05value:\x028\x01\"6\n\x06Toggle\x12\x0b\n\x07DEFAULT\x10\0\x12\x06\ + \n\x02ON\x10\x01\x12\x07\n\x03OFF\x10\x02\x12\x0e\n\nAGGRESSIVE\x10\x03\ + \"<\n\x11NumIterationsType\x12\x15\n\x11DEFAULT_NUM_ITERS\x10\0\x12\x07\ + \n\x03ONE\x10\x01\x12\x07\n\x03TWO\x10\x02\"\x9f\x01\n\nMemOptType\x12\ + \x13\n\x0fDEFAULT_MEM_OPT\x10\0\x12\x0e\n\nNO_MEM_OPT\x10\x01\x12\n\n\ + \x06MANUAL\x10\x02\x12\x17\n\x13SWAPPING_HEURISTICS\x10\x04\x12\x1c\n\ + \x18RECOMPUTATION_HEURISTICS\x10\x05\x12\x19\n\x15SCHEDULING_HEURISTICS\ + \x10\x06\x12\x0e\n\nHEURISTICS\x10\x03Bs\n\x18org.tensorflow.frameworkB\ + \x14RewriterConfigProtosP\x01Z = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::descriptor::FileDescriptorProto, +}; + +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 { + unsafe { + file_descriptor_proto_lazy.get(|| { + parse_descriptor_proto() + }) + } +} diff --git a/sticker-tf-proto/src/step_stats.rs b/sticker-tf-proto/src/step_stats.rs new file mode 100644 index 0000000..01ca05d --- /dev/null +++ b/sticker-tf-proto/src/step_stats.rs @@ -0,0 +1,2408 @@ +// This file is generated by rust-protobuf 2.8.0. Do not edit +// @generated + +// https://github.com/Manishearth/rust-clippy/issues/702 +#![allow(unknown_lints)] +#![allow(clippy::all)] + +#![cfg_attr(rustfmt, 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(unsafe_code)] +#![allow(unused_imports)] +#![allow(unused_results)] +//! Generated file from `tensorflow/core/framework/step_stats.proto` + +use protobuf::Message as Message_imported_for_functions; +use protobuf::ProtobufEnum as ProtobufEnum_imported_for_functions; + +/// Generated files are compatible only with the same version +/// of protobuf runtime. +const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_8_0; + +#[derive(PartialEq,Clone,Default)] +pub struct AllocationRecord { + // message fields + pub alloc_micros: i64, + pub alloc_bytes: i64, + // special fields + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, +} + +impl<'a> ::std::default::Default for &'a AllocationRecord { + fn default() -> &'a AllocationRecord { + ::default_instance() + } +} + +impl AllocationRecord { + pub fn new() -> AllocationRecord { + ::std::default::Default::default() + } + + // int64 alloc_micros = 1; + + + pub fn get_alloc_micros(&self) -> i64 { + self.alloc_micros + } + pub fn clear_alloc_micros(&mut self) { + self.alloc_micros = 0; + } + + // Param is passed by value, moved + pub fn set_alloc_micros(&mut self, v: i64) { + self.alloc_micros = v; + } + + // int64 alloc_bytes = 2; + + + pub fn get_alloc_bytes(&self) -> i64 { + self.alloc_bytes + } + pub fn clear_alloc_bytes(&mut self) { + self.alloc_bytes = 0; + } + + // Param is passed by value, moved + pub fn set_alloc_bytes(&mut self, v: i64) { + self.alloc_bytes = v; + } +} + +impl ::protobuf::Message for AllocationRecord { + 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.alloc_micros = 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_int64()?; + self.alloc_bytes = 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.alloc_micros != 0 { + my_size += ::protobuf::rt::value_size(1, self.alloc_micros, ::protobuf::wire_format::WireTypeVarint); + } + if self.alloc_bytes != 0 { + my_size += ::protobuf::rt::value_size(2, self.alloc_bytes, ::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.alloc_micros != 0 { + os.write_int64(1, self.alloc_micros)?; + } + if self.alloc_bytes != 0 { + os.write_int64(2, self.alloc_bytes)?; + } + 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: Box) -> ::std::boxed::Box { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> AllocationRecord { + AllocationRecord::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, + }; + unsafe { + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt64>( + "alloc_micros", + |m: &AllocationRecord| { &m.alloc_micros }, + |m: &mut AllocationRecord| { &mut m.alloc_micros }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt64>( + "alloc_bytes", + |m: &AllocationRecord| { &m.alloc_bytes }, + |m: &mut AllocationRecord| { &mut m.alloc_bytes }, + )); + ::protobuf::reflect::MessageDescriptor::new::( + "AllocationRecord", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static AllocationRecord { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const AllocationRecord, + }; + unsafe { + instance.get(AllocationRecord::new) + } + } +} + +impl ::protobuf::Clear for AllocationRecord { + fn clear(&mut self) { + self.alloc_micros = 0; + self.alloc_bytes = 0; + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for AllocationRecord { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for AllocationRecord { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct AllocatorMemoryUsed { + // message fields + pub allocator_name: ::std::string::String, + pub total_bytes: i64, + pub peak_bytes: i64, + pub live_bytes: i64, + pub allocation_records: ::protobuf::RepeatedField, + pub allocator_bytes_in_use: i64, + // special fields + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, +} + +impl<'a> ::std::default::Default for &'a AllocatorMemoryUsed { + fn default() -> &'a AllocatorMemoryUsed { + ::default_instance() + } +} + +impl AllocatorMemoryUsed { + pub fn new() -> AllocatorMemoryUsed { + ::std::default::Default::default() + } + + // string allocator_name = 1; + + + pub fn get_allocator_name(&self) -> &str { + &self.allocator_name + } + pub fn clear_allocator_name(&mut self) { + self.allocator_name.clear(); + } + + // Param is passed by value, moved + pub fn set_allocator_name(&mut self, v: ::std::string::String) { + self.allocator_name = v; + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_allocator_name(&mut self) -> &mut ::std::string::String { + &mut self.allocator_name + } + + // Take field + pub fn take_allocator_name(&mut self) -> ::std::string::String { + ::std::mem::replace(&mut self.allocator_name, ::std::string::String::new()) + } + + // int64 total_bytes = 2; + + + pub fn get_total_bytes(&self) -> i64 { + self.total_bytes + } + pub fn clear_total_bytes(&mut self) { + self.total_bytes = 0; + } + + // Param is passed by value, moved + pub fn set_total_bytes(&mut self, v: i64) { + self.total_bytes = v; + } + + // int64 peak_bytes = 3; + + + pub fn get_peak_bytes(&self) -> i64 { + self.peak_bytes + } + pub fn clear_peak_bytes(&mut self) { + self.peak_bytes = 0; + } + + // Param is passed by value, moved + pub fn set_peak_bytes(&mut self, v: i64) { + self.peak_bytes = v; + } + + // int64 live_bytes = 4; + + + pub fn get_live_bytes(&self) -> i64 { + self.live_bytes + } + pub fn clear_live_bytes(&mut self) { + self.live_bytes = 0; + } + + // Param is passed by value, moved + pub fn set_live_bytes(&mut self, v: i64) { + self.live_bytes = v; + } + + // repeated .tensorflow.AllocationRecord allocation_records = 6; + + + pub fn get_allocation_records(&self) -> &[AllocationRecord] { + &self.allocation_records + } + pub fn clear_allocation_records(&mut self) { + self.allocation_records.clear(); + } + + // Param is passed by value, moved + pub fn set_allocation_records(&mut self, v: ::protobuf::RepeatedField) { + self.allocation_records = v; + } + + // Mutable pointer to the field. + pub fn mut_allocation_records(&mut self) -> &mut ::protobuf::RepeatedField { + &mut self.allocation_records + } + + // Take field + pub fn take_allocation_records(&mut self) -> ::protobuf::RepeatedField { + ::std::mem::replace(&mut self.allocation_records, ::protobuf::RepeatedField::new()) + } + + // int64 allocator_bytes_in_use = 5; + + + pub fn get_allocator_bytes_in_use(&self) -> i64 { + self.allocator_bytes_in_use + } + pub fn clear_allocator_bytes_in_use(&mut self) { + self.allocator_bytes_in_use = 0; + } + + // Param is passed by value, moved + pub fn set_allocator_bytes_in_use(&mut self, v: i64) { + self.allocator_bytes_in_use = v; + } +} + +impl ::protobuf::Message for AllocatorMemoryUsed { + fn is_initialized(&self) -> bool { + for v in &self.allocation_records { + 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.allocator_name)?; + }, + 2 => { + 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.total_bytes = tmp; + }, + 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.peak_bytes = tmp; + }, + 4 => { + 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.live_bytes = tmp; + }, + 6 => { + ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.allocation_records)?; + }, + 5 => { + 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.allocator_bytes_in_use = 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.allocator_name.is_empty() { + my_size += ::protobuf::rt::string_size(1, &self.allocator_name); + } + if self.total_bytes != 0 { + my_size += ::protobuf::rt::value_size(2, self.total_bytes, ::protobuf::wire_format::WireTypeVarint); + } + if self.peak_bytes != 0 { + my_size += ::protobuf::rt::value_size(3, self.peak_bytes, ::protobuf::wire_format::WireTypeVarint); + } + if self.live_bytes != 0 { + my_size += ::protobuf::rt::value_size(4, self.live_bytes, ::protobuf::wire_format::WireTypeVarint); + } + for value in &self.allocation_records { + let len = value.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; + }; + if self.allocator_bytes_in_use != 0 { + my_size += ::protobuf::rt::value_size(5, self.allocator_bytes_in_use, ::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.allocator_name.is_empty() { + os.write_string(1, &self.allocator_name)?; + } + if self.total_bytes != 0 { + os.write_int64(2, self.total_bytes)?; + } + if self.peak_bytes != 0 { + os.write_int64(3, self.peak_bytes)?; + } + if self.live_bytes != 0 { + os.write_int64(4, self.live_bytes)?; + } + for v in &self.allocation_records { + os.write_tag(6, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; + }; + if self.allocator_bytes_in_use != 0 { + os.write_int64(5, self.allocator_bytes_in_use)?; + } + 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: Box) -> ::std::boxed::Box { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> AllocatorMemoryUsed { + AllocatorMemoryUsed::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, + }; + unsafe { + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "allocator_name", + |m: &AllocatorMemoryUsed| { &m.allocator_name }, + |m: &mut AllocatorMemoryUsed| { &mut m.allocator_name }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt64>( + "total_bytes", + |m: &AllocatorMemoryUsed| { &m.total_bytes }, + |m: &mut AllocatorMemoryUsed| { &mut m.total_bytes }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt64>( + "peak_bytes", + |m: &AllocatorMemoryUsed| { &m.peak_bytes }, + |m: &mut AllocatorMemoryUsed| { &mut m.peak_bytes }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt64>( + "live_bytes", + |m: &AllocatorMemoryUsed| { &m.live_bytes }, + |m: &mut AllocatorMemoryUsed| { &mut m.live_bytes }, + )); + fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( + "allocation_records", + |m: &AllocatorMemoryUsed| { &m.allocation_records }, + |m: &mut AllocatorMemoryUsed| { &mut m.allocation_records }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt64>( + "allocator_bytes_in_use", + |m: &AllocatorMemoryUsed| { &m.allocator_bytes_in_use }, + |m: &mut AllocatorMemoryUsed| { &mut m.allocator_bytes_in_use }, + )); + ::protobuf::reflect::MessageDescriptor::new::( + "AllocatorMemoryUsed", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static AllocatorMemoryUsed { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const AllocatorMemoryUsed, + }; + unsafe { + instance.get(AllocatorMemoryUsed::new) + } + } +} + +impl ::protobuf::Clear for AllocatorMemoryUsed { + fn clear(&mut self) { + self.allocator_name.clear(); + self.total_bytes = 0; + self.peak_bytes = 0; + self.live_bytes = 0; + self.allocation_records.clear(); + self.allocator_bytes_in_use = 0; + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for AllocatorMemoryUsed { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for AllocatorMemoryUsed { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct NodeOutput { + // message fields + pub slot: i32, + pub tensor_description: ::protobuf::SingularPtrField, + // special fields + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, +} + +impl<'a> ::std::default::Default for &'a NodeOutput { + fn default() -> &'a NodeOutput { + ::default_instance() + } +} + +impl NodeOutput { + pub fn new() -> NodeOutput { + ::std::default::Default::default() + } + + // int32 slot = 1; + + + pub fn get_slot(&self) -> i32 { + self.slot + } + pub fn clear_slot(&mut self) { + self.slot = 0; + } + + // Param is passed by value, moved + pub fn set_slot(&mut self, v: i32) { + self.slot = v; + } + + // .tensorflow.TensorDescription tensor_description = 3; + + + pub fn get_tensor_description(&self) -> &super::tensor_description::TensorDescription { + self.tensor_description.as_ref().unwrap_or_else(|| super::tensor_description::TensorDescription::default_instance()) + } + pub fn clear_tensor_description(&mut self) { + self.tensor_description.clear(); + } + + pub fn has_tensor_description(&self) -> bool { + self.tensor_description.is_some() + } + + // Param is passed by value, moved + pub fn set_tensor_description(&mut self, v: super::tensor_description::TensorDescription) { + self.tensor_description = ::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_description(&mut self) -> &mut super::tensor_description::TensorDescription { + if self.tensor_description.is_none() { + self.tensor_description.set_default(); + } + self.tensor_description.as_mut().unwrap() + } + + // Take field + pub fn take_tensor_description(&mut self) -> super::tensor_description::TensorDescription { + self.tensor_description.take().unwrap_or_else(|| super::tensor_description::TensorDescription::new()) + } +} + +impl ::protobuf::Message for NodeOutput { + fn is_initialized(&self) -> bool { + for v in &self.tensor_description { + 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_int32()?; + self.slot = tmp; + }, + 3 => { + ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.tensor_description)?; + }, + _ => { + ::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.slot != 0 { + my_size += ::protobuf::rt::value_size(1, self.slot, ::protobuf::wire_format::WireTypeVarint); + } + if let Some(ref v) = self.tensor_description.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.slot != 0 { + os.write_int32(1, self.slot)?; + } + if let Some(ref v) = self.tensor_description.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)?; + } + 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: Box) -> ::std::boxed::Box { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> NodeOutput { + NodeOutput::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, + }; + unsafe { + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt32>( + "slot", + |m: &NodeOutput| { &m.slot }, + |m: &mut NodeOutput| { &mut m.slot }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( + "tensor_description", + |m: &NodeOutput| { &m.tensor_description }, + |m: &mut NodeOutput| { &mut m.tensor_description }, + )); + ::protobuf::reflect::MessageDescriptor::new::( + "NodeOutput", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static NodeOutput { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const NodeOutput, + }; + unsafe { + instance.get(NodeOutput::new) + } + } +} + +impl ::protobuf::Clear for NodeOutput { + fn clear(&mut self) { + self.slot = 0; + self.tensor_description.clear(); + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for NodeOutput { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for NodeOutput { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct MemoryStats { + // message fields + pub temp_memory_size: i64, + pub persistent_memory_size: i64, + pub persistent_tensor_alloc_ids: ::std::vec::Vec, + pub device_temp_memory_size: i64, + pub device_persistent_memory_size: i64, + pub device_persistent_tensor_alloc_ids: ::std::vec::Vec, + // special fields + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, +} + +impl<'a> ::std::default::Default for &'a MemoryStats { + fn default() -> &'a MemoryStats { + ::default_instance() + } +} + +impl MemoryStats { + pub fn new() -> MemoryStats { + ::std::default::Default::default() + } + + // int64 temp_memory_size = 1; + + + pub fn get_temp_memory_size(&self) -> i64 { + self.temp_memory_size + } + pub fn clear_temp_memory_size(&mut self) { + self.temp_memory_size = 0; + } + + // Param is passed by value, moved + pub fn set_temp_memory_size(&mut self, v: i64) { + self.temp_memory_size = v; + } + + // int64 persistent_memory_size = 3; + + + pub fn get_persistent_memory_size(&self) -> i64 { + self.persistent_memory_size + } + pub fn clear_persistent_memory_size(&mut self) { + self.persistent_memory_size = 0; + } + + // Param is passed by value, moved + pub fn set_persistent_memory_size(&mut self, v: i64) { + self.persistent_memory_size = v; + } + + // repeated int64 persistent_tensor_alloc_ids = 5; + + + pub fn get_persistent_tensor_alloc_ids(&self) -> &[i64] { + &self.persistent_tensor_alloc_ids + } + pub fn clear_persistent_tensor_alloc_ids(&mut self) { + self.persistent_tensor_alloc_ids.clear(); + } + + // Param is passed by value, moved + pub fn set_persistent_tensor_alloc_ids(&mut self, v: ::std::vec::Vec) { + self.persistent_tensor_alloc_ids = v; + } + + // Mutable pointer to the field. + pub fn mut_persistent_tensor_alloc_ids(&mut self) -> &mut ::std::vec::Vec { + &mut self.persistent_tensor_alloc_ids + } + + // Take field + pub fn take_persistent_tensor_alloc_ids(&mut self) -> ::std::vec::Vec { + ::std::mem::replace(&mut self.persistent_tensor_alloc_ids, ::std::vec::Vec::new()) + } + + // int64 device_temp_memory_size = 2; + + + pub fn get_device_temp_memory_size(&self) -> i64 { + self.device_temp_memory_size + } + pub fn clear_device_temp_memory_size(&mut self) { + self.device_temp_memory_size = 0; + } + + // Param is passed by value, moved + pub fn set_device_temp_memory_size(&mut self, v: i64) { + self.device_temp_memory_size = v; + } + + // int64 device_persistent_memory_size = 4; + + + pub fn get_device_persistent_memory_size(&self) -> i64 { + self.device_persistent_memory_size + } + pub fn clear_device_persistent_memory_size(&mut self) { + self.device_persistent_memory_size = 0; + } + + // Param is passed by value, moved + pub fn set_device_persistent_memory_size(&mut self, v: i64) { + self.device_persistent_memory_size = v; + } + + // repeated int64 device_persistent_tensor_alloc_ids = 6; + + + pub fn get_device_persistent_tensor_alloc_ids(&self) -> &[i64] { + &self.device_persistent_tensor_alloc_ids + } + pub fn clear_device_persistent_tensor_alloc_ids(&mut self) { + self.device_persistent_tensor_alloc_ids.clear(); + } + + // Param is passed by value, moved + pub fn set_device_persistent_tensor_alloc_ids(&mut self, v: ::std::vec::Vec) { + self.device_persistent_tensor_alloc_ids = v; + } + + // Mutable pointer to the field. + pub fn mut_device_persistent_tensor_alloc_ids(&mut self) -> &mut ::std::vec::Vec { + &mut self.device_persistent_tensor_alloc_ids + } + + // Take field + pub fn take_device_persistent_tensor_alloc_ids(&mut self) -> ::std::vec::Vec { + ::std::mem::replace(&mut self.device_persistent_tensor_alloc_ids, ::std::vec::Vec::new()) + } +} + +impl ::protobuf::Message for MemoryStats { + 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.temp_memory_size = tmp; + }, + 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.persistent_memory_size = tmp; + }, + 5 => { + ::protobuf::rt::read_repeated_int64_into(wire_type, is, &mut self.persistent_tensor_alloc_ids)?; + }, + 2 => { + 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.device_temp_memory_size = tmp; + }, + 4 => { + 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.device_persistent_memory_size = tmp; + }, + 6 => { + ::protobuf::rt::read_repeated_int64_into(wire_type, is, &mut self.device_persistent_tensor_alloc_ids)?; + }, + _ => { + ::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.temp_memory_size != 0 { + my_size += ::protobuf::rt::value_size(1, self.temp_memory_size, ::protobuf::wire_format::WireTypeVarint); + } + if self.persistent_memory_size != 0 { + my_size += ::protobuf::rt::value_size(3, self.persistent_memory_size, ::protobuf::wire_format::WireTypeVarint); + } + for value in &self.persistent_tensor_alloc_ids { + my_size += ::protobuf::rt::value_size(5, *value, ::protobuf::wire_format::WireTypeVarint); + }; + if self.device_temp_memory_size != 0 { + my_size += ::protobuf::rt::value_size(2, self.device_temp_memory_size, ::protobuf::wire_format::WireTypeVarint); + } + if self.device_persistent_memory_size != 0 { + my_size += ::protobuf::rt::value_size(4, self.device_persistent_memory_size, ::protobuf::wire_format::WireTypeVarint); + } + for value in &self.device_persistent_tensor_alloc_ids { + my_size += ::protobuf::rt::value_size(6, *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.temp_memory_size != 0 { + os.write_int64(1, self.temp_memory_size)?; + } + if self.persistent_memory_size != 0 { + os.write_int64(3, self.persistent_memory_size)?; + } + for v in &self.persistent_tensor_alloc_ids { + os.write_int64(5, *v)?; + }; + if self.device_temp_memory_size != 0 { + os.write_int64(2, self.device_temp_memory_size)?; + } + if self.device_persistent_memory_size != 0 { + os.write_int64(4, self.device_persistent_memory_size)?; + } + for v in &self.device_persistent_tensor_alloc_ids { + os.write_int64(6, *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: Box) -> ::std::boxed::Box { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> MemoryStats { + MemoryStats::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, + }; + unsafe { + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt64>( + "temp_memory_size", + |m: &MemoryStats| { &m.temp_memory_size }, + |m: &mut MemoryStats| { &mut m.temp_memory_size }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt64>( + "persistent_memory_size", + |m: &MemoryStats| { &m.persistent_memory_size }, + |m: &mut MemoryStats| { &mut m.persistent_memory_size }, + )); + fields.push(::protobuf::reflect::accessor::make_vec_accessor::<_, ::protobuf::types::ProtobufTypeInt64>( + "persistent_tensor_alloc_ids", + |m: &MemoryStats| { &m.persistent_tensor_alloc_ids }, + |m: &mut MemoryStats| { &mut m.persistent_tensor_alloc_ids }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt64>( + "device_temp_memory_size", + |m: &MemoryStats| { &m.device_temp_memory_size }, + |m: &mut MemoryStats| { &mut m.device_temp_memory_size }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt64>( + "device_persistent_memory_size", + |m: &MemoryStats| { &m.device_persistent_memory_size }, + |m: &mut MemoryStats| { &mut m.device_persistent_memory_size }, + )); + fields.push(::protobuf::reflect::accessor::make_vec_accessor::<_, ::protobuf::types::ProtobufTypeInt64>( + "device_persistent_tensor_alloc_ids", + |m: &MemoryStats| { &m.device_persistent_tensor_alloc_ids }, + |m: &mut MemoryStats| { &mut m.device_persistent_tensor_alloc_ids }, + )); + ::protobuf::reflect::MessageDescriptor::new::( + "MemoryStats", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static MemoryStats { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const MemoryStats, + }; + unsafe { + instance.get(MemoryStats::new) + } + } +} + +impl ::protobuf::Clear for MemoryStats { + fn clear(&mut self) { + self.temp_memory_size = 0; + self.persistent_memory_size = 0; + self.persistent_tensor_alloc_ids.clear(); + self.device_temp_memory_size = 0; + self.device_persistent_memory_size = 0; + self.device_persistent_tensor_alloc_ids.clear(); + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for MemoryStats { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for MemoryStats { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct NodeExecStats { + // message fields + pub node_name: ::std::string::String, + pub all_start_micros: i64, + pub op_start_rel_micros: i64, + pub op_end_rel_micros: i64, + pub all_end_rel_micros: i64, + pub memory: ::protobuf::RepeatedField, + pub output: ::protobuf::RepeatedField, + pub timeline_label: ::std::string::String, + pub scheduled_micros: i64, + pub thread_id: u32, + pub referenced_tensor: ::protobuf::RepeatedField, + pub memory_stats: ::protobuf::SingularPtrField, + pub all_start_nanos: i64, + pub op_start_rel_nanos: i64, + pub op_end_rel_nanos: i64, + pub all_end_rel_nanos: i64, + pub scheduled_nanos: i64, + // special fields + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, +} + +impl<'a> ::std::default::Default for &'a NodeExecStats { + fn default() -> &'a NodeExecStats { + ::default_instance() + } +} + +impl NodeExecStats { + pub fn new() -> NodeExecStats { + ::std::default::Default::default() + } + + // string node_name = 1; + + + pub fn get_node_name(&self) -> &str { + &self.node_name + } + pub fn clear_node_name(&mut self) { + self.node_name.clear(); + } + + // Param is passed by value, moved + pub fn set_node_name(&mut self, v: ::std::string::String) { + self.node_name = v; + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_node_name(&mut self) -> &mut ::std::string::String { + &mut self.node_name + } + + // Take field + pub fn take_node_name(&mut self) -> ::std::string::String { + ::std::mem::replace(&mut self.node_name, ::std::string::String::new()) + } + + // int64 all_start_micros = 2; + + + pub fn get_all_start_micros(&self) -> i64 { + self.all_start_micros + } + pub fn clear_all_start_micros(&mut self) { + self.all_start_micros = 0; + } + + // Param is passed by value, moved + pub fn set_all_start_micros(&mut self, v: i64) { + self.all_start_micros = v; + } + + // int64 op_start_rel_micros = 3; + + + pub fn get_op_start_rel_micros(&self) -> i64 { + self.op_start_rel_micros + } + pub fn clear_op_start_rel_micros(&mut self) { + self.op_start_rel_micros = 0; + } + + // Param is passed by value, moved + pub fn set_op_start_rel_micros(&mut self, v: i64) { + self.op_start_rel_micros = v; + } + + // int64 op_end_rel_micros = 4; + + + pub fn get_op_end_rel_micros(&self) -> i64 { + self.op_end_rel_micros + } + pub fn clear_op_end_rel_micros(&mut self) { + self.op_end_rel_micros = 0; + } + + // Param is passed by value, moved + pub fn set_op_end_rel_micros(&mut self, v: i64) { + self.op_end_rel_micros = v; + } + + // int64 all_end_rel_micros = 5; + + + pub fn get_all_end_rel_micros(&self) -> i64 { + self.all_end_rel_micros + } + pub fn clear_all_end_rel_micros(&mut self) { + self.all_end_rel_micros = 0; + } + + // Param is passed by value, moved + pub fn set_all_end_rel_micros(&mut self, v: i64) { + self.all_end_rel_micros = v; + } + + // repeated .tensorflow.AllocatorMemoryUsed memory = 6; + + + pub fn get_memory(&self) -> &[AllocatorMemoryUsed] { + &self.memory + } + pub fn clear_memory(&mut self) { + self.memory.clear(); + } + + // Param is passed by value, moved + pub fn set_memory(&mut self, v: ::protobuf::RepeatedField) { + self.memory = v; + } + + // Mutable pointer to the field. + pub fn mut_memory(&mut self) -> &mut ::protobuf::RepeatedField { + &mut self.memory + } + + // Take field + pub fn take_memory(&mut self) -> ::protobuf::RepeatedField { + ::std::mem::replace(&mut self.memory, ::protobuf::RepeatedField::new()) + } + + // repeated .tensorflow.NodeOutput output = 7; + + + pub fn get_output(&self) -> &[NodeOutput] { + &self.output + } + pub fn clear_output(&mut self) { + self.output.clear(); + } + + // Param is passed by value, moved + pub fn set_output(&mut self, v: ::protobuf::RepeatedField) { + self.output = v; + } + + // Mutable pointer to the field. + pub fn mut_output(&mut self) -> &mut ::protobuf::RepeatedField { + &mut self.output + } + + // Take field + pub fn take_output(&mut self) -> ::protobuf::RepeatedField { + ::std::mem::replace(&mut self.output, ::protobuf::RepeatedField::new()) + } + + // string timeline_label = 8; + + + pub fn get_timeline_label(&self) -> &str { + &self.timeline_label + } + pub fn clear_timeline_label(&mut self) { + self.timeline_label.clear(); + } + + // Param is passed by value, moved + pub fn set_timeline_label(&mut self, v: ::std::string::String) { + self.timeline_label = v; + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_timeline_label(&mut self) -> &mut ::std::string::String { + &mut self.timeline_label + } + + // Take field + pub fn take_timeline_label(&mut self) -> ::std::string::String { + ::std::mem::replace(&mut self.timeline_label, ::std::string::String::new()) + } + + // int64 scheduled_micros = 9; + + + pub fn get_scheduled_micros(&self) -> i64 { + self.scheduled_micros + } + pub fn clear_scheduled_micros(&mut self) { + self.scheduled_micros = 0; + } + + // Param is passed by value, moved + pub fn set_scheduled_micros(&mut self, v: i64) { + self.scheduled_micros = v; + } + + // uint32 thread_id = 10; + + + pub fn get_thread_id(&self) -> u32 { + self.thread_id + } + pub fn clear_thread_id(&mut self) { + self.thread_id = 0; + } + + // Param is passed by value, moved + pub fn set_thread_id(&mut self, v: u32) { + self.thread_id = v; + } + + // repeated .tensorflow.AllocationDescription referenced_tensor = 11; + + + pub fn get_referenced_tensor(&self) -> &[super::allocation_description::AllocationDescription] { + &self.referenced_tensor + } + pub fn clear_referenced_tensor(&mut self) { + self.referenced_tensor.clear(); + } + + // Param is passed by value, moved + pub fn set_referenced_tensor(&mut self, v: ::protobuf::RepeatedField) { + self.referenced_tensor = v; + } + + // Mutable pointer to the field. + pub fn mut_referenced_tensor(&mut self) -> &mut ::protobuf::RepeatedField { + &mut self.referenced_tensor + } + + // Take field + pub fn take_referenced_tensor(&mut self) -> ::protobuf::RepeatedField { + ::std::mem::replace(&mut self.referenced_tensor, ::protobuf::RepeatedField::new()) + } + + // .tensorflow.MemoryStats memory_stats = 12; + + + pub fn get_memory_stats(&self) -> &MemoryStats { + self.memory_stats.as_ref().unwrap_or_else(|| MemoryStats::default_instance()) + } + pub fn clear_memory_stats(&mut self) { + self.memory_stats.clear(); + } + + pub fn has_memory_stats(&self) -> bool { + self.memory_stats.is_some() + } + + // Param is passed by value, moved + pub fn set_memory_stats(&mut self, v: MemoryStats) { + self.memory_stats = ::protobuf::SingularPtrField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_memory_stats(&mut self) -> &mut MemoryStats { + if self.memory_stats.is_none() { + self.memory_stats.set_default(); + } + self.memory_stats.as_mut().unwrap() + } + + // Take field + pub fn take_memory_stats(&mut self) -> MemoryStats { + self.memory_stats.take().unwrap_or_else(|| MemoryStats::new()) + } + + // int64 all_start_nanos = 13; + + + pub fn get_all_start_nanos(&self) -> i64 { + self.all_start_nanos + } + pub fn clear_all_start_nanos(&mut self) { + self.all_start_nanos = 0; + } + + // Param is passed by value, moved + pub fn set_all_start_nanos(&mut self, v: i64) { + self.all_start_nanos = v; + } + + // int64 op_start_rel_nanos = 14; + + + pub fn get_op_start_rel_nanos(&self) -> i64 { + self.op_start_rel_nanos + } + pub fn clear_op_start_rel_nanos(&mut self) { + self.op_start_rel_nanos = 0; + } + + // Param is passed by value, moved + pub fn set_op_start_rel_nanos(&mut self, v: i64) { + self.op_start_rel_nanos = v; + } + + // int64 op_end_rel_nanos = 15; + + + pub fn get_op_end_rel_nanos(&self) -> i64 { + self.op_end_rel_nanos + } + pub fn clear_op_end_rel_nanos(&mut self) { + self.op_end_rel_nanos = 0; + } + + // Param is passed by value, moved + pub fn set_op_end_rel_nanos(&mut self, v: i64) { + self.op_end_rel_nanos = v; + } + + // int64 all_end_rel_nanos = 16; + + + pub fn get_all_end_rel_nanos(&self) -> i64 { + self.all_end_rel_nanos + } + pub fn clear_all_end_rel_nanos(&mut self) { + self.all_end_rel_nanos = 0; + } + + // Param is passed by value, moved + pub fn set_all_end_rel_nanos(&mut self, v: i64) { + self.all_end_rel_nanos = v; + } + + // int64 scheduled_nanos = 17; + + + pub fn get_scheduled_nanos(&self) -> i64 { + self.scheduled_nanos + } + pub fn clear_scheduled_nanos(&mut self) { + self.scheduled_nanos = 0; + } + + // Param is passed by value, moved + pub fn set_scheduled_nanos(&mut self, v: i64) { + self.scheduled_nanos = v; + } +} + +impl ::protobuf::Message for NodeExecStats { + fn is_initialized(&self) -> bool { + for v in &self.memory { + if !v.is_initialized() { + return false; + } + }; + for v in &self.output { + if !v.is_initialized() { + return false; + } + }; + for v in &self.referenced_tensor { + if !v.is_initialized() { + return false; + } + }; + for v in &self.memory_stats { + 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.node_name)?; + }, + 2 => { + 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.all_start_micros = tmp; + }, + 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.op_start_rel_micros = tmp; + }, + 4 => { + 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.op_end_rel_micros = 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_int64()?; + self.all_end_rel_micros = tmp; + }, + 6 => { + ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.memory)?; + }, + 7 => { + ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.output)?; + }, + 8 => { + ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.timeline_label)?; + }, + 9 => { + 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.scheduled_micros = tmp; + }, + 10 => { + if wire_type != ::protobuf::wire_format::WireTypeVarint { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + let tmp = is.read_uint32()?; + self.thread_id = tmp; + }, + 11 => { + ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.referenced_tensor)?; + }, + 12 => { + ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.memory_stats)?; + }, + 13 => { + 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.all_start_nanos = tmp; + }, + 14 => { + 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.op_start_rel_nanos = tmp; + }, + 15 => { + 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.op_end_rel_nanos = 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_int64()?; + self.all_end_rel_nanos = 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_int64()?; + self.scheduled_nanos = 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.node_name.is_empty() { + my_size += ::protobuf::rt::string_size(1, &self.node_name); + } + if self.all_start_micros != 0 { + my_size += ::protobuf::rt::value_size(2, self.all_start_micros, ::protobuf::wire_format::WireTypeVarint); + } + if self.op_start_rel_micros != 0 { + my_size += ::protobuf::rt::value_size(3, self.op_start_rel_micros, ::protobuf::wire_format::WireTypeVarint); + } + if self.op_end_rel_micros != 0 { + my_size += ::protobuf::rt::value_size(4, self.op_end_rel_micros, ::protobuf::wire_format::WireTypeVarint); + } + if self.all_end_rel_micros != 0 { + my_size += ::protobuf::rt::value_size(5, self.all_end_rel_micros, ::protobuf::wire_format::WireTypeVarint); + } + for value in &self.memory { + let len = value.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; + }; + for value in &self.output { + let len = value.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; + }; + if !self.timeline_label.is_empty() { + my_size += ::protobuf::rt::string_size(8, &self.timeline_label); + } + if self.scheduled_micros != 0 { + my_size += ::protobuf::rt::value_size(9, self.scheduled_micros, ::protobuf::wire_format::WireTypeVarint); + } + if self.thread_id != 0 { + my_size += ::protobuf::rt::value_size(10, self.thread_id, ::protobuf::wire_format::WireTypeVarint); + } + for value in &self.referenced_tensor { + let len = value.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; + }; + if let Some(ref v) = self.memory_stats.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; + } + if self.all_start_nanos != 0 { + my_size += ::protobuf::rt::value_size(13, self.all_start_nanos, ::protobuf::wire_format::WireTypeVarint); + } + if self.op_start_rel_nanos != 0 { + my_size += ::protobuf::rt::value_size(14, self.op_start_rel_nanos, ::protobuf::wire_format::WireTypeVarint); + } + if self.op_end_rel_nanos != 0 { + my_size += ::protobuf::rt::value_size(15, self.op_end_rel_nanos, ::protobuf::wire_format::WireTypeVarint); + } + if self.all_end_rel_nanos != 0 { + my_size += ::protobuf::rt::value_size(16, self.all_end_rel_nanos, ::protobuf::wire_format::WireTypeVarint); + } + if self.scheduled_nanos != 0 { + my_size += ::protobuf::rt::value_size(17, self.scheduled_nanos, ::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.node_name.is_empty() { + os.write_string(1, &self.node_name)?; + } + if self.all_start_micros != 0 { + os.write_int64(2, self.all_start_micros)?; + } + if self.op_start_rel_micros != 0 { + os.write_int64(3, self.op_start_rel_micros)?; + } + if self.op_end_rel_micros != 0 { + os.write_int64(4, self.op_end_rel_micros)?; + } + if self.all_end_rel_micros != 0 { + os.write_int64(5, self.all_end_rel_micros)?; + } + for v in &self.memory { + os.write_tag(6, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; + }; + for v in &self.output { + os.write_tag(7, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; + }; + if !self.timeline_label.is_empty() { + os.write_string(8, &self.timeline_label)?; + } + if self.scheduled_micros != 0 { + os.write_int64(9, self.scheduled_micros)?; + } + if self.thread_id != 0 { + os.write_uint32(10, self.thread_id)?; + } + for v in &self.referenced_tensor { + os.write_tag(11, ::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.memory_stats.as_ref() { + os.write_tag(12, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; + } + if self.all_start_nanos != 0 { + os.write_int64(13, self.all_start_nanos)?; + } + if self.op_start_rel_nanos != 0 { + os.write_int64(14, self.op_start_rel_nanos)?; + } + if self.op_end_rel_nanos != 0 { + os.write_int64(15, self.op_end_rel_nanos)?; + } + if self.all_end_rel_nanos != 0 { + os.write_int64(16, self.all_end_rel_nanos)?; + } + if self.scheduled_nanos != 0 { + os.write_int64(17, self.scheduled_nanos)?; + } + 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: Box) -> ::std::boxed::Box { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> NodeExecStats { + NodeExecStats::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, + }; + unsafe { + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "node_name", + |m: &NodeExecStats| { &m.node_name }, + |m: &mut NodeExecStats| { &mut m.node_name }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt64>( + "all_start_micros", + |m: &NodeExecStats| { &m.all_start_micros }, + |m: &mut NodeExecStats| { &mut m.all_start_micros }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt64>( + "op_start_rel_micros", + |m: &NodeExecStats| { &m.op_start_rel_micros }, + |m: &mut NodeExecStats| { &mut m.op_start_rel_micros }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt64>( + "op_end_rel_micros", + |m: &NodeExecStats| { &m.op_end_rel_micros }, + |m: &mut NodeExecStats| { &mut m.op_end_rel_micros }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt64>( + "all_end_rel_micros", + |m: &NodeExecStats| { &m.all_end_rel_micros }, + |m: &mut NodeExecStats| { &mut m.all_end_rel_micros }, + )); + fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( + "memory", + |m: &NodeExecStats| { &m.memory }, + |m: &mut NodeExecStats| { &mut m.memory }, + )); + fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( + "output", + |m: &NodeExecStats| { &m.output }, + |m: &mut NodeExecStats| { &mut m.output }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "timeline_label", + |m: &NodeExecStats| { &m.timeline_label }, + |m: &mut NodeExecStats| { &mut m.timeline_label }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt64>( + "scheduled_micros", + |m: &NodeExecStats| { &m.scheduled_micros }, + |m: &mut NodeExecStats| { &mut m.scheduled_micros }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeUint32>( + "thread_id", + |m: &NodeExecStats| { &m.thread_id }, + |m: &mut NodeExecStats| { &mut m.thread_id }, + )); + fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( + "referenced_tensor", + |m: &NodeExecStats| { &m.referenced_tensor }, + |m: &mut NodeExecStats| { &mut m.referenced_tensor }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( + "memory_stats", + |m: &NodeExecStats| { &m.memory_stats }, + |m: &mut NodeExecStats| { &mut m.memory_stats }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt64>( + "all_start_nanos", + |m: &NodeExecStats| { &m.all_start_nanos }, + |m: &mut NodeExecStats| { &mut m.all_start_nanos }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt64>( + "op_start_rel_nanos", + |m: &NodeExecStats| { &m.op_start_rel_nanos }, + |m: &mut NodeExecStats| { &mut m.op_start_rel_nanos }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt64>( + "op_end_rel_nanos", + |m: &NodeExecStats| { &m.op_end_rel_nanos }, + |m: &mut NodeExecStats| { &mut m.op_end_rel_nanos }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt64>( + "all_end_rel_nanos", + |m: &NodeExecStats| { &m.all_end_rel_nanos }, + |m: &mut NodeExecStats| { &mut m.all_end_rel_nanos }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt64>( + "scheduled_nanos", + |m: &NodeExecStats| { &m.scheduled_nanos }, + |m: &mut NodeExecStats| { &mut m.scheduled_nanos }, + )); + ::protobuf::reflect::MessageDescriptor::new::( + "NodeExecStats", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static NodeExecStats { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const NodeExecStats, + }; + unsafe { + instance.get(NodeExecStats::new) + } + } +} + +impl ::protobuf::Clear for NodeExecStats { + fn clear(&mut self) { + self.node_name.clear(); + self.all_start_micros = 0; + self.op_start_rel_micros = 0; + self.op_end_rel_micros = 0; + self.all_end_rel_micros = 0; + self.memory.clear(); + self.output.clear(); + self.timeline_label.clear(); + self.scheduled_micros = 0; + self.thread_id = 0; + self.referenced_tensor.clear(); + self.memory_stats.clear(); + self.all_start_nanos = 0; + self.op_start_rel_nanos = 0; + self.op_end_rel_nanos = 0; + self.all_end_rel_nanos = 0; + self.scheduled_nanos = 0; + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for NodeExecStats { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for NodeExecStats { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct DeviceStepStats { + // message fields + pub device: ::std::string::String, + pub node_stats: ::protobuf::RepeatedField, + // special fields + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, +} + +impl<'a> ::std::default::Default for &'a DeviceStepStats { + fn default() -> &'a DeviceStepStats { + ::default_instance() + } +} + +impl DeviceStepStats { + pub fn new() -> DeviceStepStats { + ::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()) + } + + // repeated .tensorflow.NodeExecStats node_stats = 2; + + + pub fn get_node_stats(&self) -> &[NodeExecStats] { + &self.node_stats + } + pub fn clear_node_stats(&mut self) { + self.node_stats.clear(); + } + + // Param is passed by value, moved + pub fn set_node_stats(&mut self, v: ::protobuf::RepeatedField) { + self.node_stats = v; + } + + // Mutable pointer to the field. + pub fn mut_node_stats(&mut self) -> &mut ::protobuf::RepeatedField { + &mut self.node_stats + } + + // Take field + pub fn take_node_stats(&mut self) -> ::protobuf::RepeatedField { + ::std::mem::replace(&mut self.node_stats, ::protobuf::RepeatedField::new()) + } +} + +impl ::protobuf::Message for DeviceStepStats { + fn is_initialized(&self) -> bool { + for v in &self.node_stats { + 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_repeated_message_into(wire_type, is, &mut self.node_stats)?; + }, + _ => { + ::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); + } + for value in &self.node_stats { + 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)?; + } + for v in &self.node_stats { + 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: Box) -> ::std::boxed::Box { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> DeviceStepStats { + DeviceStepStats::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, + }; + unsafe { + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "device", + |m: &DeviceStepStats| { &m.device }, + |m: &mut DeviceStepStats| { &mut m.device }, + )); + fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( + "node_stats", + |m: &DeviceStepStats| { &m.node_stats }, + |m: &mut DeviceStepStats| { &mut m.node_stats }, + )); + ::protobuf::reflect::MessageDescriptor::new::( + "DeviceStepStats", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static DeviceStepStats { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const DeviceStepStats, + }; + unsafe { + instance.get(DeviceStepStats::new) + } + } +} + +impl ::protobuf::Clear for DeviceStepStats { + fn clear(&mut self) { + self.device.clear(); + self.node_stats.clear(); + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for DeviceStepStats { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for DeviceStepStats { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct StepStats { + // message fields + pub dev_stats: ::protobuf::RepeatedField, + // special fields + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, +} + +impl<'a> ::std::default::Default for &'a StepStats { + fn default() -> &'a StepStats { + ::default_instance() + } +} + +impl StepStats { + pub fn new() -> StepStats { + ::std::default::Default::default() + } + + // repeated .tensorflow.DeviceStepStats dev_stats = 1; + + + pub fn get_dev_stats(&self) -> &[DeviceStepStats] { + &self.dev_stats + } + pub fn clear_dev_stats(&mut self) { + self.dev_stats.clear(); + } + + // Param is passed by value, moved + pub fn set_dev_stats(&mut self, v: ::protobuf::RepeatedField) { + self.dev_stats = v; + } + + // Mutable pointer to the field. + pub fn mut_dev_stats(&mut self) -> &mut ::protobuf::RepeatedField { + &mut self.dev_stats + } + + // Take field + pub fn take_dev_stats(&mut self) -> ::protobuf::RepeatedField { + ::std::mem::replace(&mut self.dev_stats, ::protobuf::RepeatedField::new()) + } +} + +impl ::protobuf::Message for StepStats { + fn is_initialized(&self) -> bool { + for v in &self.dev_stats { + 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.dev_stats)?; + }, + _ => { + ::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.dev_stats { + 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.dev_stats { + 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: Box) -> ::std::boxed::Box { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> StepStats { + StepStats::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, + }; + unsafe { + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( + "dev_stats", + |m: &StepStats| { &m.dev_stats }, + |m: &mut StepStats| { &mut m.dev_stats }, + )); + ::protobuf::reflect::MessageDescriptor::new::( + "StepStats", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static StepStats { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const StepStats, + }; + unsafe { + instance.get(StepStats::new) + } + } +} + +impl ::protobuf::Clear for StepStats { + fn clear(&mut self) { + self.dev_stats.clear(); + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for StepStats { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for StepStats { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +static file_descriptor_proto_data: &'static [u8] = b"\ + \n*tensorflow/core/framework/step_stats.proto\x12\ntensorflow\x1a6tensor\ + flow/core/framework/allocation_description.proto\x1a2tensorflow/core/fra\ + mework/tensor_description.proto\"V\n\x10AllocationRecord\x12!\n\x0calloc\ + _micros\x18\x01\x20\x01(\x03R\x0ballocMicros\x12\x1f\n\x0balloc_bytes\ + \x18\x02\x20\x01(\x03R\nallocBytes\"\x9d\x02\n\x13AllocatorMemoryUsed\ + \x12%\n\x0eallocator_name\x18\x01\x20\x01(\tR\rallocatorName\x12\x1f\n\ + \x0btotal_bytes\x18\x02\x20\x01(\x03R\ntotalBytes\x12\x1d\n\npeak_bytes\ + \x18\x03\x20\x01(\x03R\tpeakBytes\x12\x1d\n\nlive_bytes\x18\x04\x20\x01(\ + \x03R\tliveBytes\x12K\n\x12allocation_records\x18\x06\x20\x03(\x0b2\x1c.\ + tensorflow.AllocationRecordR\x11allocationRecords\x123\n\x16allocator_by\ + tes_in_use\x18\x05\x20\x01(\x03R\x13allocatorBytesInUse\"n\n\nNodeOutput\ + \x12\x12\n\x04slot\x18\x01\x20\x01(\x05R\x04slot\x12L\n\x12tensor_descri\ + ption\x18\x03\x20\x01(\x0b2\x1d.tensorflow.TensorDescriptionR\x11tensorD\ + escription\"\xfe\x02\n\x0bMemoryStats\x12(\n\x10temp_memory_size\x18\x01\ + \x20\x01(\x03R\x0etempMemorySize\x124\n\x16persistent_memory_size\x18\ + \x03\x20\x01(\x03R\x14persistentMemorySize\x12=\n\x1bpersistent_tensor_a\ + lloc_ids\x18\x05\x20\x03(\x03R\x18persistentTensorAllocIds\x129\n\x17dev\ + ice_temp_memory_size\x18\x02\x20\x01(\x03R\x14deviceTempMemorySizeB\x02\ + \x18\x01\x12E\n\x1ddevice_persistent_memory_size\x18\x04\x20\x01(\x03R\ + \x1adevicePersistentMemorySizeB\x02\x18\x01\x12N\n\"device_persistent_te\ + nsor_alloc_ids\x18\x06\x20\x03(\x03R\x1edevicePersistentTensorAllocIdsB\ + \x02\x18\x01\"\x93\x06\n\rNodeExecStats\x12\x1b\n\tnode_name\x18\x01\x20\ + \x01(\tR\x08nodeName\x12(\n\x10all_start_micros\x18\x02\x20\x01(\x03R\ + \x0eallStartMicros\x12-\n\x13op_start_rel_micros\x18\x03\x20\x01(\x03R\ + \x10opStartRelMicros\x12)\n\x11op_end_rel_micros\x18\x04\x20\x01(\x03R\ + \x0eopEndRelMicros\x12+\n\x12all_end_rel_micros\x18\x05\x20\x01(\x03R\ + \x0fallEndRelMicros\x127\n\x06memory\x18\x06\x20\x03(\x0b2\x1f.tensorflo\ + w.AllocatorMemoryUsedR\x06memory\x12.\n\x06output\x18\x07\x20\x03(\x0b2\ + \x16.tensorflow.NodeOutputR\x06output\x12%\n\x0etimeline_label\x18\x08\ + \x20\x01(\tR\rtimelineLabel\x12)\n\x10scheduled_micros\x18\t\x20\x01(\ + \x03R\x0fscheduledMicros\x12\x1b\n\tthread_id\x18\n\x20\x01(\rR\x08threa\ + dId\x12N\n\x11referenced_tensor\x18\x0b\x20\x03(\x0b2!.tensorflow.Alloca\ + tionDescriptionR\x10referencedTensor\x12:\n\x0cmemory_stats\x18\x0c\x20\ + \x01(\x0b2\x17.tensorflow.MemoryStatsR\x0bmemoryStats\x12&\n\x0fall_star\ + t_nanos\x18\r\x20\x01(\x03R\rallStartNanos\x12+\n\x12op_start_rel_nanos\ + \x18\x0e\x20\x01(\x03R\x0fopStartRelNanos\x12'\n\x10op_end_rel_nanos\x18\ + \x0f\x20\x01(\x03R\ropEndRelNanos\x12)\n\x11all_end_rel_nanos\x18\x10\ + \x20\x01(\x03R\x0eallEndRelNanos\x12'\n\x0fscheduled_nanos\x18\x11\x20\ + \x01(\x03R\x0escheduledNanos\"c\n\x0fDeviceStepStats\x12\x16\n\x06device\ + \x18\x01\x20\x01(\tR\x06device\x128\n\nnode_stats\x18\x02\x20\x03(\x0b2\ + \x19.tensorflow.NodeExecStatsR\tnodeStats\"E\n\tStepStats\x128\n\tdev_st\ + ats\x18\x01\x20\x03(\x0b2\x1b.tensorflow.DeviceStepStatsR\x08devStatsBo\ + \n\x18org.tensorflow.frameworkB\x0fStepStatsProtosP\x01Z=github.com/tens\ + orflow/tensorflow/tensorflow/go/core/framework\xf8\x01\x01b\x06proto3\ +"; + +static mut file_descriptor_proto_lazy: ::protobuf::lazy::Lazy<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::descriptor::FileDescriptorProto, +}; + +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 { + unsafe { + file_descriptor_proto_lazy.get(|| { + parse_descriptor_proto() + }) + } +} diff --git a/sticker-tf-proto/src/tensor.rs b/sticker-tf-proto/src/tensor.rs new file mode 100644 index 0000000..a9b653a --- /dev/null +++ b/sticker-tf-proto/src/tensor.rs @@ -0,0 +1,1224 @@ +// This file is generated by rust-protobuf 2.8.0. Do not edit +// @generated + +// https://github.com/Manishearth/rust-clippy/issues/702 +#![allow(unknown_lints)] +#![allow(clippy::all)] + +#![cfg_attr(rustfmt, 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(unsafe_code)] +#![allow(unused_imports)] +#![allow(unused_results)] +//! Generated file from `tensorflow/core/framework/tensor.proto` + +use protobuf::Message as Message_imported_for_functions; +use protobuf::ProtobufEnum as ProtobufEnum_imported_for_functions; + +/// Generated files are compatible only with the same version +/// of protobuf runtime. +const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_8_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(|| super::tensor_shape::TensorShapeProto::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, self.dtype.value())?; + } + 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: 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 mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, + }; + unsafe { + 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>( + "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::( + "TensorProto", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static TensorProto { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const TensorProto, + }; + unsafe { + 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::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::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: 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 mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, + }; + unsafe { + 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::( + "VariantTensorDataProto", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static VariantTensorDataProto { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const VariantTensorDataProto, + }; + unsafe { + 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::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::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 mut file_descriptor_proto_lazy: ::protobuf::lazy::Lazy<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::descriptor::FileDescriptorProto, +}; + +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 { + unsafe { + file_descriptor_proto_lazy.get(|| { + parse_descriptor_proto() + }) + } +} diff --git a/sticker-tf-proto/src/tensor_description.rs b/sticker-tf-proto/src/tensor_description.rs new file mode 100644 index 0000000..4c0216e --- /dev/null +++ b/sticker-tf-proto/src/tensor_description.rs @@ -0,0 +1,329 @@ +// This file is generated by rust-protobuf 2.8.0. Do not edit +// @generated + +// https://github.com/Manishearth/rust-clippy/issues/702 +#![allow(unknown_lints)] +#![allow(clippy::all)] + +#![cfg_attr(rustfmt, 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(unsafe_code)] +#![allow(unused_imports)] +#![allow(unused_results)] +//! Generated file from `tensorflow/core/framework/tensor_description.proto` + +use protobuf::Message as Message_imported_for_functions; +use protobuf::ProtobufEnum as ProtobufEnum_imported_for_functions; + +/// Generated files are compatible only with the same version +/// of protobuf runtime. +const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_8_0; + +#[derive(PartialEq,Clone,Default)] +pub struct TensorDescription { + // message fields + pub dtype: super::types::DataType, + pub shape: ::protobuf::SingularPtrField, + pub allocation_description: ::protobuf::SingularPtrField, + // special fields + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, +} + +impl<'a> ::std::default::Default for &'a TensorDescription { + fn default() -> &'a TensorDescription { + ::default_instance() + } +} + +impl TensorDescription { + pub fn new() -> TensorDescription { + ::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(|| super::tensor_shape::TensorShapeProto::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.AllocationDescription allocation_description = 4; + + + pub fn get_allocation_description(&self) -> &super::allocation_description::AllocationDescription { + self.allocation_description.as_ref().unwrap_or_else(|| super::allocation_description::AllocationDescription::default_instance()) + } + pub fn clear_allocation_description(&mut self) { + self.allocation_description.clear(); + } + + pub fn has_allocation_description(&self) -> bool { + self.allocation_description.is_some() + } + + // Param is passed by value, moved + pub fn set_allocation_description(&mut self, v: super::allocation_description::AllocationDescription) { + self.allocation_description = ::protobuf::SingularPtrField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_allocation_description(&mut self) -> &mut super::allocation_description::AllocationDescription { + if self.allocation_description.is_none() { + self.allocation_description.set_default(); + } + self.allocation_description.as_mut().unwrap() + } + + // Take field + pub fn take_allocation_description(&mut self) -> super::allocation_description::AllocationDescription { + self.allocation_description.take().unwrap_or_else(|| super::allocation_description::AllocationDescription::new()) + } +} + +impl ::protobuf::Message for TensorDescription { + fn is_initialized(&self) -> bool { + for v in &self.shape { + if !v.is_initialized() { + return false; + } + }; + for v in &self.allocation_description { + 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)?; + }, + 4 => { + ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.allocation_description)?; + }, + _ => { + ::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 let Some(ref v) = self.allocation_description.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, self.dtype.value())?; + } + 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 let Some(ref v) = self.allocation_description.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: Box) -> ::std::boxed::Box { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> TensorDescription { + TensorDescription::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, + }; + unsafe { + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeEnum>( + "dtype", + |m: &TensorDescription| { &m.dtype }, + |m: &mut TensorDescription| { &mut m.dtype }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( + "shape", + |m: &TensorDescription| { &m.shape }, + |m: &mut TensorDescription| { &mut m.shape }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( + "allocation_description", + |m: &TensorDescription| { &m.allocation_description }, + |m: &mut TensorDescription| { &mut m.allocation_description }, + )); + ::protobuf::reflect::MessageDescriptor::new::( + "TensorDescription", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static TensorDescription { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const TensorDescription, + }; + unsafe { + instance.get(TensorDescription::new) + } + } +} + +impl ::protobuf::Clear for TensorDescription { + fn clear(&mut self) { + self.dtype = super::types::DataType::DT_INVALID; + self.shape.clear(); + self.allocation_description.clear(); + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for TensorDescription { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for TensorDescription { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +static file_descriptor_proto_data: &'static [u8] = b"\ + \n2tensorflow/core/framework/tensor_description.proto\x12\ntensorflow\ + \x1a%tensorflow/core/framework/types.proto\x1a,tensorflow/core/framework\ + /tensor_shape.proto\x1a6tensorflow/core/framework/allocation_description\ + .proto\"\xcd\x01\n\x11TensorDescription\x12*\n\x05dtype\x18\x01\x20\x01(\ + \x0e2\x14.tensorflow.DataTypeR\x05dtype\x122\n\x05shape\x18\x02\x20\x01(\ + \x0b2\x1c.tensorflow.TensorShapeProtoR\x05shape\x12X\n\x16allocation_des\ + cription\x18\x04\x20\x01(\x0b2!.tensorflow.AllocationDescriptionR\x15all\ + ocationDescriptionBw\n\x18org.tensorflow.frameworkB\x17TensorDescription\ + ProtosP\x01Z=github.com/tensorflow/tensorflow/tensorflow/go/core/framewo\ + rk\xf8\x01\x01b\x06proto3\ +"; + +static mut file_descriptor_proto_lazy: ::protobuf::lazy::Lazy<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::descriptor::FileDescriptorProto, +}; + +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 { + unsafe { + file_descriptor_proto_lazy.get(|| { + parse_descriptor_proto() + }) + } +} diff --git a/sticker-tf-proto/src/tensor_shape.rs b/sticker-tf-proto/src/tensor_shape.rs new file mode 100644 index 0000000..384a8e0 --- /dev/null +++ b/sticker-tf-proto/src/tensor_shape.rs @@ -0,0 +1,469 @@ +// This file is generated by rust-protobuf 2.8.0. Do not edit +// @generated + +// https://github.com/Manishearth/rust-clippy/issues/702 +#![allow(unknown_lints)] +#![allow(clippy::all)] + +#![cfg_attr(rustfmt, 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(unsafe_code)] +#![allow(unused_imports)] +#![allow(unused_results)] +//! Generated file from `tensorflow/core/framework/tensor_shape.proto` + +use protobuf::Message as Message_imported_for_functions; +use protobuf::ProtobufEnum as ProtobufEnum_imported_for_functions; + +/// Generated files are compatible only with the same version +/// of protobuf runtime. +const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_8_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: 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 mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, + }; + unsafe { + 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::( + "TensorShapeProto", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static TensorShapeProto { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const TensorShapeProto, + }; + unsafe { + 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::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::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: 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 mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, + }; + unsafe { + 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::( + "TensorShapeProto_Dim", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static TensorShapeProto_Dim { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const TensorShapeProto_Dim, + }; + unsafe { + 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::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::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 mut file_descriptor_proto_lazy: ::protobuf::lazy::Lazy<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::descriptor::FileDescriptorProto, +}; + +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 { + unsafe { + file_descriptor_proto_lazy.get(|| { + parse_descriptor_proto() + }) + } +} diff --git a/sticker-tf-proto/src/types.rs b/sticker-tf-proto/src/types.rs new file mode 100644 index 0000000..008e406 --- /dev/null +++ b/sticker-tf-proto/src/types.rs @@ -0,0 +1,260 @@ +// This file is generated by rust-protobuf 2.8.0. Do not edit +// @generated + +// https://github.com/Manishearth/rust-clippy/issues/702 +#![allow(unknown_lints)] +#![allow(clippy::all)] + +#![cfg_attr(rustfmt, 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(unsafe_code)] +#![allow(unused_imports)] +#![allow(unused_results)] +//! Generated file from `tensorflow/core/framework/types.proto` + +use protobuf::Message as Message_imported_for_functions; +use protobuf::ProtobufEnum as ProtobufEnum_imported_for_functions; + +/// Generated files are compatible only with the same version +/// of protobuf runtime. +const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_8_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 mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::EnumDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::EnumDescriptor, + }; + unsafe { + descriptor.get(|| { + ::protobuf::reflect::EnumDescriptor::new("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::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Enum(self.descriptor()) + } +} + +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 mut file_descriptor_proto_lazy: ::protobuf::lazy::Lazy<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::descriptor::FileDescriptorProto, +}; + +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 { + unsafe { + file_descriptor_proto_lazy.get(|| { + parse_descriptor_proto() + }) + } +} diff --git a/sticker-tf-proto/src/versions.rs b/sticker-tf-proto/src/versions.rs new file mode 100644 index 0000000..ecff5d7 --- /dev/null +++ b/sticker-tf-proto/src/versions.rs @@ -0,0 +1,291 @@ +// This file is generated by rust-protobuf 2.8.0. Do not edit +// @generated + +// https://github.com/Manishearth/rust-clippy/issues/702 +#![allow(unknown_lints)] +#![allow(clippy::all)] + +#![cfg_attr(rustfmt, 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(unsafe_code)] +#![allow(unused_imports)] +#![allow(unused_results)] +//! Generated file from `tensorflow/core/framework/versions.proto` + +use protobuf::Message as Message_imported_for_functions; +use protobuf::ProtobufEnum as ProtobufEnum_imported_for_functions; + +/// Generated files are compatible only with the same version +/// of protobuf runtime. +const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_8_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: 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 mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, + }; + unsafe { + 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::( + "VersionDef", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static VersionDef { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const VersionDef, + }; + unsafe { + 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::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::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 mut file_descriptor_proto_lazy: ::protobuf::lazy::Lazy<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::descriptor::FileDescriptorProto, +}; + +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 { + unsafe { + file_descriptor_proto_lazy.get(|| { + parse_descriptor_proto() + }) + } +}