diff --git a/src/eager.rs b/src/eager.rs new file mode 100644 index 0000000000..cc950f5a4a --- /dev/null +++ b/src/eager.rs @@ -0,0 +1,10 @@ +//! C API extensions to experiment with eager execution of kernels. +//! +//! WARNING: The underlying C-API for the eager execution is not guaranteed to be +//! stable and can be changed without notice, which could result in breaking. + +mod context; +pub use context::*; + +mod tensor_handle; +pub use tensor_handle::*; diff --git a/src/eager/context.rs b/src/eager/context.rs new file mode 100644 index 0000000000..6558e9ad86 --- /dev/null +++ b/src/eager/context.rs @@ -0,0 +1,166 @@ +use std::ffi::CStr; + +use tensorflow_sys as tf; + +use crate::{Device, Result, Status}; + +/// Options that can be passed during context creation. +#[derive(Debug)] +pub struct ContextOptions { + inner: *mut tf::TFE_ContextOptions, +} +impl_new!( + ContextOptions, + TFE_NewContextOptions, + "Creates a blank set of context options." +); +impl_drop!(ContextOptions, TFE_DeleteContextOptions); + +impl ContextOptions { + /// Set the config. + /// + /// `config` should be a serialized [`ConfigProto` proto](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/core/protobuf/config.proto). + /// Returns an error if config was not parsed successfully as a `ConfigProto`. + pub fn set_config(&mut self, config: &[u8]) -> Result<()> { + let mut status = Status::new(); + unsafe { + tf::TFE_ContextOptionsSetConfig( + self.inner, + config.as_ptr() as *const _, + config.len(), + status.inner(), + ); + } + status.into_result() + } + + /// Sets the default execution mode (sync/async). + pub fn set_async(&mut self, enable: bool) { + unsafe { + tf::TFE_ContextOptionsSetAsync(self.inner, enable as u8); + } + } +} + +/// Context under which operations/functions are executed. +#[derive(Debug)] +pub struct Context { + pub(crate) inner: *mut tf::TFE_Context, +} +impl_drop!(Context, TFE_DeleteContext); + +impl Context { + /// Create a Context + pub fn new(opts: ContextOptions) -> Result { + let status = Status::new(); + + let inner = unsafe { tf::TFE_NewContext(opts.inner, status.inner) }; + if inner.is_null() { + Err(status) + } else { + Ok(Context { inner }) + } + } + + /// Lists all devices in a context. + pub fn device_list(&self) -> Result> { + let status = Status::new(); + unsafe { + let list = tf::TFE_ContextListDevices(self.inner, status.inner); + if !status.is_ok() { + return Err(status); + } + let result = (|| { + let n = tf::TF_DeviceListCount(list); + let mut devices = Vec::with_capacity(n as usize); + for i in 0..n { + let c_name = tf::TF_DeviceListName(list, i, status.inner); + if !status.is_ok() { + return Err(status); + } + let c_type = tf::TF_DeviceListType(list, i, status.inner); + if !status.is_ok() { + return Err(status); + } + let bytes = tf::TF_DeviceListMemoryBytes(list, i, status.inner); + if !status.is_ok() { + return Err(status); + } + let incarnation = tf::TF_DeviceListIncarnation(list, i, status.inner); + if !status.is_ok() { + return Err(status); + } + devices.push(Device { + name: CStr::from_ptr(c_name).to_str()?.to_string(), + device_type: CStr::from_ptr(c_type).to_str()?.to_string(), + memory_bytes: bytes, + incarnation, + }); + } + Ok(devices) + })(); + tf::TF_DeleteDeviceList(list); + result + } + } + + /// Clears the internal caches in the context. + pub fn clear_caches(&mut self) { + unsafe { + tf::TFE_ContextClearCaches(self.inner); + } + } +} + +unsafe impl std::marker::Send for Context {} +unsafe impl std::marker::Sync for Context {} + +#[cfg(test)] +mod test { + use super::*; + + #[test] + fn test_create_context() { + let opts = ContextOptions::new(); + Context::new(opts).unwrap(); + } + + #[test] + fn test_create_async_context() { + let mut opts = ContextOptions::new(); + opts.set_async(true); + Context::new(opts).unwrap(); + } + + #[test] + fn test_context_set_config() { + use crate::protos::config::{ConfigProto, GPUOptions}; + use protobuf::Message; + + let gpu_options = GPUOptions { + per_process_gpu_memory_fraction: 0.5, + allow_growth: true, + ..Default::default() + }; + let mut config = ConfigProto::new(); + config.set_gpu_options(gpu_options); + + let mut buf = vec![]; + config.write_to_writer(&mut buf).unwrap(); + + let mut opts = ContextOptions::new(); + opts.set_config(&buf).unwrap(); + Context::new(opts).unwrap(); + } + + #[test] + fn test_device_list() { + let opts = ContextOptions::new(); + let ctx = Context::new(opts).unwrap(); + + let devices = ctx.device_list().unwrap(); + for d in &devices { + assert_ne!(String::from(""), d.name); + } + } +} diff --git a/src/eager/tensor_handle.rs b/src/eager/tensor_handle.rs new file mode 100644 index 0000000000..8aca0eb7c9 --- /dev/null +++ b/src/eager/tensor_handle.rs @@ -0,0 +1,331 @@ +use std::ffi::{CStr, CString}; +use std::marker::PhantomData; + +use tensorflow_sys as tf; + +use crate::eager::Context; +use crate::{AnyTensor, DataType, Result, Status, Tensor, TensorType}; + +/// A handle to a tensor on a device. +/// +/// Constructing a TensorHandle requires a reference to an execute context so that the +/// generated handle will not out live the context. +/// ``` +/// # use tensorflow::Tensor; +/// use tensorflow::eager::{ContextOptions, Context, TensorHandle}; +/// +/// let opts = ContextOptions::new(); +/// let ctx = Context::new(opts).unwrap(); +/// +/// let t = Tensor::from(&[3i32]); +/// let h = TensorHandle::new(&ctx, &t).unwrap(); +/// let v: Tensor = h.resolve().unwrap(); +/// assert_eq!(&v[..], &[3i32]); +/// ``` +/// +/// Since TensorHandle cannot be alive beyond the lifetime of the context, the following +/// code will not compile. +/// ```compile_fail +/// # use tensorflow::Tensor; +/// use tensorflow::eager::{ContextOptions, Context, TensorHandle}; +/// +/// let h = { +/// let opts = ContextOptions::new(); +/// let ctx = Context::new(opts).unwrap(); +/// +/// let t = Tensor::from(&[3i32]); +/// let h = TensorHandle::new(&ctx, &t).unwrap(); +/// h +/// }; +/// ``` +#[derive(Debug)] +pub struct TensorHandle<'a> { + inner: *mut tf::TFE_TensorHandle, + // TensorHandle should not live longer than a given context. + ctx: PhantomData<&'a Context>, +} + +impl<'a> Drop for TensorHandle<'a> { + fn drop(&mut self) { + unsafe { + tf::TFE_DeleteTensorHandle(self.inner); + } + } +} + +impl<'a> TensorHandle<'a> { + /// Create a TensorHandle from the input Tensor + pub fn new(_ctx: &'a Context, t: &Tensor) -> Result> { + let status = Status::new(); + let inner = unsafe { tf::TFE_NewTensorHandle(t.inner()?, status.inner) }; + + if inner.is_null() { + Err(status) + } else { + Ok(TensorHandle { + inner, + ctx: PhantomData, + }) + } + } + + /// Return the DataType that corresponds to this type. + pub fn data_type(&self) -> DataType { + unsafe { DataType::from_c(tf::TFE_TensorHandleDataType(self.inner)) } + } + + /// Return the number of dimensions. + /// + /// This function will block till the operation that produces the TensorHandle has completed. + pub fn num_dims(&self) -> Result { + let status = Status::new(); + let num_dims = unsafe { tf::TFE_TensorHandleNumDims(self.inner, status.inner) }; + if status.is_ok() { + // num_dims >= 0 when the status is ok, so we can safely cast it to u64. + Ok(num_dims as usize) + } else { + Err(status) + } + } + + /// Return the number of elements + pub fn num_elements(&self) -> Result { + let status = Status::new(); + let num_elements = unsafe { tf::TFE_TensorHandleNumElements(self.inner, status.inner) }; + if status.is_ok() { + // num_elements >= 0 when the status is ok, so we can safely cast it to u64. + Ok(num_elements as u64) + } else { + Err(status) + } + } + + /// Return the number of elements for a given dim_index. + /// + /// This function will block till the operation that produces the TensorHandle has completed. + pub fn dim(&self, dim_index: i32) -> Result { + let status = Status::new(); + let dim = unsafe { tf::TFE_TensorHandleDim(self.inner, dim_index, status.inner) }; + if status.is_ok() { + // dim >= 0 when the status is ok, so we can safely cast it to u64. + Ok(dim as u64) + } else { + Err(status) + } + } + + /// Return the device of the operation that produced the current TensorHandle. + /// + /// If the TensorHandle was produced by a copy, returns the destination device of the copy. + /// Note that the returned device name is not always the device holding the tensor handle's memory. + /// If you want the latter, use backing_device_name. + /// + /// This function will block till the operation that produces the current TensorHandle has completed. + pub fn device_name(&self) -> Result { + let status = Status::new(); + unsafe { + let device_name = tf::TFE_TensorHandleDeviceName(self.inner, status.inner); + if status.is_ok() { + Ok(CStr::from_ptr(device_name).to_str()?.to_string()) + } else { + Err(status) + } + } + } + + /// Returns the name of the device in whose memory underlying the current TensorHandle resides. + /// + /// This function will block till the operation that produces the current TensorHandle has completed. + pub fn backing_device_name(&self) -> Result { + let status = Status::new(); + unsafe { + let device_name = tf::TFE_TensorHandleBackingDeviceName(self.inner, status.inner); + if status.is_ok() { + Ok(CStr::from_ptr(device_name).to_str()?.to_string()) + } else { + Err(status) + } + } + } + + /// Return a new TensorHandle that shares the underlying tensor with the current TensorHandle. + pub fn copy_sharing_tensor(&self) -> Result { + let status = Status::new(); + let inner = unsafe { tf::TFE_TensorHandleCopySharingTensor(self.inner, status.inner) }; + if status.is_ok() { + Ok(Self { + inner, + ctx: self.ctx, + }) + } else { + Err(status) + } + } + + /// This function will block till the operation that produces the current TensorHandle has completed. + /// The memory returned might alias the internal memory used by TensorFlow. + /// Hence, callers should not mutate this memory. + pub fn resolve(&self) -> Result> { + let mut status = Status::new(); + let tf_tensor = unsafe { tf::TFE_TensorHandleResolve(self.inner, status.inner) }; + if !status.is_ok() { + return Err(status); + } + if self.data_type() != T::data_type() { + let msg = format!( + "The expected data type ({}) and underlying data type ({}) did not match.", + T::data_type(), + self.data_type() + ); + + status.set_lossy(crate::Code::InvalidArgument, &msg); + return Err(status); + } + + // Safely unwrap since data_type was checked beforehand. + unsafe { Ok(Tensor::from_tf_tensor(tf_tensor).unwrap()) } + } + + /// Create a new TensorHandle with the same contents as the current TensorHandle but placed + /// in the memory of the device name 'device_name'. + /// If source and destination are the same device, then this creates a new handle + /// that shares the underlying buffer. Otherwise, it currently requires at least + /// one of the source or destination devices to be CPU (i.e., for the source or + /// destination tensor to be placed in host memory). + /// If async execution is enabled, the copy may be enqueued and the call will + /// return "non-ready" TensorHandle. Else, this function returns after the copy has + /// been done. + pub fn copy_to_device<'b>( + &self, + ctx: &'b Context, + device_name: &str, + ) -> Result> { + let status = Status::new(); + + let device_name = CString::new(device_name)?; + unsafe { + let inner = tf::TFE_TensorHandleCopyToDevice( + self.inner, + ctx.inner, + device_name.as_ptr(), + status.inner, + ); + + if status.is_ok() { + Ok(TensorHandle { + inner, + ctx: PhantomData, + }) + } else { + Err(status) + } + } + } +} + +#[cfg(test)] +mod tests { + use super::*; + use crate::eager::ContextOptions; + + #[test] + fn test_tensor_handle() { + let opts = ContextOptions::new(); + let ctx = Context::new(opts).unwrap(); + + let t = Tensor::new(&[2, 3]) + .with_values(&[0_i32, 1, 2, 3, 4, 5]) + .unwrap(); + let h = TensorHandle::new(&ctx, &t).unwrap(); + + assert_eq!(h.data_type(), DataType::Int32); + assert_eq!(h.num_elements().unwrap(), 6); + assert_eq!(h.num_dims().unwrap(), 2); + assert_eq!(h.dim(0).unwrap(), 2); + assert_eq!(h.dim(1).unwrap(), 3); + } + + #[test] + fn test_copy_sharing_tensor() { + let opts = ContextOptions::new(); + let ctx = Context::new(opts).unwrap(); + + let t = Tensor::new(&[2, 3]) + .with_values(&[0_i32, 1, 2, 3, 4, 5]) + .unwrap(); + let h = TensorHandle::new(&ctx, &t).unwrap(); + let h_copy = h.copy_sharing_tensor().unwrap(); + let t2 = h_copy.resolve::().unwrap(); + + // t and t2 may share the same memory, but it's difficuly to check + // since the `resolve` does not guarantee that. + assert_eq!(&t[..], &t2[..]); + } + + /// Following tests are disabled by default because it requires a GPU and some setup. + /// + /// To run this test, you need to pass the `-- --ignored` argument to cargo test. + /// ```sh + /// cargo test --features "eager tensorflow_gpu" -- --ignored + /// ``` + #[cfg(feature = "tensorflow_gpu")] + mod gpu { + use super::*; + use crate::eager::ContextOptions; + + #[test] + #[ignore] + fn test_copy_to_device() { + let values = [0_i32, 1, 2, 3]; + + let opts = ContextOptions::new(); + let ctx = Context::new(opts).unwrap(); + let devices = ctx.device_list().unwrap(); + let gpu_device = devices + .iter() + .find(|d| d.device_type == "GPU") + .expect("No GPU device was found."); + let target_device = &gpu_device.name; + + let t = Tensor::new(&[2, 2]).with_values(&values).unwrap(); + let h = TensorHandle::new(&ctx, &t).unwrap(); + let h_gpu = TensorHandle::copy_to_device(&h, &ctx, target_device).unwrap(); + assert_eq!(&h_gpu.device_name().unwrap(), target_device); + let t2 = h_gpu.resolve::().unwrap(); + + assert_eq!(&t[..], &t2[..]); + } + + #[test] + #[ignore] + fn test_copy_to_device_lifetime() { + let values = [0_i32, 1, 2, 3]; + + let opts = ContextOptions::new(); + let ctx = Context::new(opts).unwrap(); + let devices = ctx.device_list().unwrap(); + let gpu_device = devices + .iter() + .find(|d| d.device_type == "GPU") + .expect("No GPU device was found."); + let target_device = &gpu_device.name; + + let h_gpu = { + // Create a temporal Context + let opts = ContextOptions::new(); + let ctx2 = Context::new(opts).unwrap(); + let t = Tensor::new(&[2, 2]).with_values(&values).unwrap(); + + // Create a TensorHandle managed by the context `ctx2`. + let h = TensorHandle::new(&ctx2, &t).unwrap(); + + // Copy to GPU. This creates a new handle managed by the context `ctx`. + h.copy_to_device(&ctx, target_device).unwrap() + }; + assert_eq!(&h_gpu.device_name().unwrap(), target_device); + let t2 = h_gpu.resolve::().unwrap(); + + assert_eq!(&values[..], &t2[..]); + } + } +} diff --git a/src/lib.rs b/src/lib.rs index 440237f5e2..2ca1bda59a 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -204,6 +204,9 @@ pub mod train; mod saved_model; pub use saved_model::*; +#[cfg(feature = "eager")] +pub mod eager; + //////////////////////// c_enum!("Error values that can be returned.", TF_Code, Code { diff --git a/src/protos.rs b/src/protos.rs index b7cf351440..6b9be487d1 100644 --- a/src/protos.rs +++ b/src/protos.rs @@ -1,4 +1,9 @@ +pub mod allocation_description; pub mod attr_value; +pub mod cluster; +pub mod config; +pub mod cost_graph; +pub mod debug; pub mod full_type; pub mod function; pub mod graph; @@ -6,13 +11,17 @@ pub mod meta_graph; pub mod node_def; pub mod op_def; pub mod resource_handle; +pub mod rewriter_config; pub mod saved_model; pub mod saved_object_graph; pub mod saver; +pub mod step_stats; pub mod struct_pb; pub mod tensor; +pub mod tensor_description; pub mod tensor_shape; pub mod trackable_object_graph; pub mod types; pub mod variable; +pub mod verifier_config; pub mod versions; diff --git a/src/protos/allocation_description.rs b/src/protos/allocation_description.rs new file mode 100644 index 0000000000..6d175344b9 --- /dev/null +++ b/src/protos/allocation_description.rs @@ -0,0 +1,383 @@ +// This file is generated by rust-protobuf 2.25.1. Do not edit +// @generated + +// https://github.com/rust-lang/rust-clippy/issues/702 +#![allow(unknown_lints)] +#![allow(clippy::all)] + +#![allow(unused_attributes)] +#![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(unused_imports)] +#![allow(unused_results)] +//! Generated file from `tensorflow/core/framework/allocation_description.proto` + +/// Generated files are compatible only with the same version +/// of protobuf runtime. +// const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_25_1; + +#[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: ::std::boxed::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 descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt64>( + "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_pb_name::( + "AllocationDescription", + fields, + file_descriptor_proto() + ) + }) + } + + fn default_instance() -> &'static AllocationDescription { + static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; + 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::ReflectValueRef { + ::protobuf::reflect::ReflectValueRef::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\x9b\x01\n\x18org.\ + tensorflow.frameworkB\x1bAllocationDescriptionProtosP\x01Z]github.com/te\ + nsorflow/tensorflow/tensorflow/go/core/framework/allocation_description_\ + go_proto\xf8\x01\x01b\x06proto3\ +"; + +static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT; + +fn parse_descriptor_proto() -> ::protobuf::descriptor::FileDescriptorProto { + ::protobuf::Message::parse_from_bytes(file_descriptor_proto_data).unwrap() +} + +pub fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto { + file_descriptor_proto_lazy.get(|| { + parse_descriptor_proto() + }) +} diff --git a/src/protos/cluster.rs b/src/protos/cluster.rs new file mode 100644 index 0000000000..ef51047d72 --- /dev/null +++ b/src/protos/cluster.rs @@ -0,0 +1,410 @@ +// This file is generated by rust-protobuf 2.25.1. Do not edit +// @generated + +// https://github.com/rust-lang/rust-clippy/issues/702 +#![allow(unknown_lints)] +#![allow(clippy::all)] + +#![allow(unused_attributes)] +#![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(unused_imports)] +#![allow(unused_results)] +//! Generated file from `tensorflow/core/protobuf/cluster.proto` + +/// Generated files are compatible only with the same version +/// of protobuf runtime. +// const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_25_1; + +#[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: ::std::boxed::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 descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "name", + |m: &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_pb_name::( + "JobDef", + fields, + file_descriptor_proto() + ) + }) + } + + fn default_instance() -> &'static JobDef { + static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; + 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::ReflectValueRef { + ::protobuf::reflect::ReflectValueRef::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: ::std::boxed::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 descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( + "job", + |m: &ClusterDef| { &m.job }, + |m: &mut ClusterDef| { &mut m.job }, + )); + ::protobuf::reflect::MessageDescriptor::new_pb_name::( + "ClusterDef", + fields, + file_descriptor_proto() + ) + }) + } + + fn default_instance() -> &'static ClusterDef { + static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; + 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::ReflectValueRef { + ::protobuf::reflect::ReflectValueRef::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\x03jobB\x87\x01\n\x1aor\ + g.tensorflow.distruntimeB\rClusterProtosP\x01ZUgithub.com/tensorflow/ten\ + sorflow/tensorflow/go/core/protobuf/for_core_protos_go_proto\xf8\x01\x01\ + b\x06proto3\ +"; + +static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT; + +fn parse_descriptor_proto() -> ::protobuf::descriptor::FileDescriptorProto { + ::protobuf::Message::parse_from_bytes(file_descriptor_proto_data).unwrap() +} + +pub fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto { + file_descriptor_proto_lazy.get(|| { + parse_descriptor_proto() + }) +} diff --git a/src/protos/config.rs b/src/protos/config.rs new file mode 100644 index 0000000000..328956a17c --- /dev/null +++ b/src/protos/config.rs @@ -0,0 +1,6816 @@ +// This file is generated by rust-protobuf 2.25.1. Do not edit +// @generated + +// https://github.com/rust-lang/rust-clippy/issues/702 +#![allow(unknown_lints)] +#![allow(clippy::all)] + +#![allow(unused_attributes)] +#![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(unused_imports)] +#![allow(unused_results)] +//! Generated file from `tensorflow/core/protobuf/config.proto` + +/// Generated files are compatible only with the same version +/// of protobuf runtime. +// const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_25_1; + +#[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(|| ::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: ::std::boxed::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 descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::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_pb_name::( + "GPUOptions", + fields, + file_descriptor_proto() + ) + }) + } + + fn default_instance() -> &'static GPUOptions { + static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; + 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::ReflectValueRef { + ::protobuf::reflect::ReflectValueRef::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, + pub timestamped_allocator: bool, + pub kernel_tracker_max_interval: i32, + pub kernel_tracker_max_bytes: i32, + pub kernel_tracker_max_pending: i32, + pub internal_fragmentation_fraction: f64, + pub use_cuda_malloc_async: bool, + // 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()) + } + + // bool timestamped_allocator = 5; + + + pub fn get_timestamped_allocator(&self) -> bool { + self.timestamped_allocator + } + pub fn clear_timestamped_allocator(&mut self) { + self.timestamped_allocator = false; + } + + // Param is passed by value, moved + pub fn set_timestamped_allocator(&mut self, v: bool) { + self.timestamped_allocator = v; + } + + // int32 kernel_tracker_max_interval = 7; + + + pub fn get_kernel_tracker_max_interval(&self) -> i32 { + self.kernel_tracker_max_interval + } + pub fn clear_kernel_tracker_max_interval(&mut self) { + self.kernel_tracker_max_interval = 0; + } + + // Param is passed by value, moved + pub fn set_kernel_tracker_max_interval(&mut self, v: i32) { + self.kernel_tracker_max_interval = v; + } + + // int32 kernel_tracker_max_bytes = 8; + + + pub fn get_kernel_tracker_max_bytes(&self) -> i32 { + self.kernel_tracker_max_bytes + } + pub fn clear_kernel_tracker_max_bytes(&mut self) { + self.kernel_tracker_max_bytes = 0; + } + + // Param is passed by value, moved + pub fn set_kernel_tracker_max_bytes(&mut self, v: i32) { + self.kernel_tracker_max_bytes = v; + } + + // int32 kernel_tracker_max_pending = 9; + + + pub fn get_kernel_tracker_max_pending(&self) -> i32 { + self.kernel_tracker_max_pending + } + pub fn clear_kernel_tracker_max_pending(&mut self) { + self.kernel_tracker_max_pending = 0; + } + + // Param is passed by value, moved + pub fn set_kernel_tracker_max_pending(&mut self, v: i32) { + self.kernel_tracker_max_pending = v; + } + + // double internal_fragmentation_fraction = 10; + + + pub fn get_internal_fragmentation_fraction(&self) -> f64 { + self.internal_fragmentation_fraction + } + pub fn clear_internal_fragmentation_fraction(&mut self) { + self.internal_fragmentation_fraction = 0.; + } + + // Param is passed by value, moved + pub fn set_internal_fragmentation_fraction(&mut self, v: f64) { + self.internal_fragmentation_fraction = v; + } + + // bool use_cuda_malloc_async = 11; + + + pub fn get_use_cuda_malloc_async(&self) -> bool { + self.use_cuda_malloc_async + } + pub fn clear_use_cuda_malloc_async(&mut self) { + self.use_cuda_malloc_async = false; + } + + // Param is passed by value, moved + pub fn set_use_cuda_malloc_async(&mut self, v: bool) { + self.use_cuda_malloc_async = v; + } +} + +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)?; + }, + 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.timestamped_allocator = 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.kernel_tracker_max_interval = 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.kernel_tracker_max_bytes = 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_int32()?; + self.kernel_tracker_max_pending = tmp; + }, + 10 => { + 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.internal_fragmentation_fraction = 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.use_cuda_malloc_async = 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.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); + } + if self.timestamped_allocator != false { + my_size += 2; + } + if self.kernel_tracker_max_interval != 0 { + my_size += ::protobuf::rt::value_size(7, self.kernel_tracker_max_interval, ::protobuf::wire_format::WireTypeVarint); + } + if self.kernel_tracker_max_bytes != 0 { + my_size += ::protobuf::rt::value_size(8, self.kernel_tracker_max_bytes, ::protobuf::wire_format::WireTypeVarint); + } + if self.kernel_tracker_max_pending != 0 { + my_size += ::protobuf::rt::value_size(9, self.kernel_tracker_max_pending, ::protobuf::wire_format::WireTypeVarint); + } + if self.internal_fragmentation_fraction != 0. { + my_size += 9; + } + if self.use_cuda_malloc_async != 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.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)?; + } + if self.timestamped_allocator != false { + os.write_bool(5, self.timestamped_allocator)?; + } + if self.kernel_tracker_max_interval != 0 { + os.write_int32(7, self.kernel_tracker_max_interval)?; + } + if self.kernel_tracker_max_bytes != 0 { + os.write_int32(8, self.kernel_tracker_max_bytes)?; + } + if self.kernel_tracker_max_pending != 0 { + os.write_int32(9, self.kernel_tracker_max_pending)?; + } + if self.internal_fragmentation_fraction != 0. { + os.write_double(10, self.internal_fragmentation_fraction)?; + } + if self.use_cuda_malloc_async != false { + os.write_bool(11, self.use_cuda_malloc_async)?; + } + os.write_unknown_fields(self.get_unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn get_cached_size(&self) -> u32 { + self.cached_size.get() + } + + fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { + &self.unknown_fields + } + + fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { + &mut self.unknown_fields + } + + fn as_any(&self) -> &dyn (::std::any::Any) { + self as &dyn (::std::any::Any) + } + fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { + self as &mut dyn (::std::any::Any) + } + fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> GPUOptions_Experimental { + GPUOptions_Experimental::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( + "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 }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBool>( + "timestamped_allocator", + |m: &GPUOptions_Experimental| { &m.timestamped_allocator }, + |m: &mut GPUOptions_Experimental| { &mut m.timestamped_allocator }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt32>( + "kernel_tracker_max_interval", + |m: &GPUOptions_Experimental| { &m.kernel_tracker_max_interval }, + |m: &mut GPUOptions_Experimental| { &mut m.kernel_tracker_max_interval }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt32>( + "kernel_tracker_max_bytes", + |m: &GPUOptions_Experimental| { &m.kernel_tracker_max_bytes }, + |m: &mut GPUOptions_Experimental| { &mut m.kernel_tracker_max_bytes }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt32>( + "kernel_tracker_max_pending", + |m: &GPUOptions_Experimental| { &m.kernel_tracker_max_pending }, + |m: &mut GPUOptions_Experimental| { &mut m.kernel_tracker_max_pending }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeDouble>( + "internal_fragmentation_fraction", + |m: &GPUOptions_Experimental| { &m.internal_fragmentation_fraction }, + |m: &mut GPUOptions_Experimental| { &mut m.internal_fragmentation_fraction }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBool>( + "use_cuda_malloc_async", + |m: &GPUOptions_Experimental| { &m.use_cuda_malloc_async }, + |m: &mut GPUOptions_Experimental| { &mut m.use_cuda_malloc_async }, + )); + ::protobuf::reflect::MessageDescriptor::new_pb_name::( + "GPUOptions.Experimental", + fields, + file_descriptor_proto() + ) + }) + } + + fn default_instance() -> &'static GPUOptions_Experimental { + static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; + 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.timestamped_allocator = false; + self.kernel_tracker_max_interval = 0; + self.kernel_tracker_max_bytes = 0; + self.kernel_tracker_max_pending = 0; + self.internal_fragmentation_fraction = 0.; + self.use_cuda_malloc_async = false; + 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::ReflectValueRef { + ::protobuf::reflect::ReflectValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct GPUOptions_Experimental_VirtualDevices { + // message fields + pub memory_limit_mb: ::std::vec::Vec, + pub priority: ::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()) + } + + // repeated int32 priority = 2; + + + pub fn get_priority(&self) -> &[i32] { + &self.priority + } + pub fn clear_priority(&mut self) { + self.priority.clear(); + } + + // Param is passed by value, moved + pub fn set_priority(&mut self, v: ::std::vec::Vec) { + self.priority = v; + } + + // Mutable pointer to the field. + pub fn mut_priority(&mut self) -> &mut ::std::vec::Vec { + &mut self.priority + } + + // Take field + pub fn take_priority(&mut self) -> ::std::vec::Vec { + ::std::mem::replace(&mut self.priority, ::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)?; + }, + 2 => { + ::protobuf::rt::read_repeated_int32_into(wire_type, is, &mut self.priority)?; + }, + _ => { + ::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; + for value in &self.priority { + my_size += ::protobuf::rt::value_size(2, *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<()> { + for v in &self.memory_limit_mb { + os.write_float(1, *v)?; + }; + for v in &self.priority { + os.write_int32(2, *v)?; + }; + os.write_unknown_fields(self.get_unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn get_cached_size(&self) -> u32 { + self.cached_size.get() + } + + fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { + &self.unknown_fields + } + + fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { + &mut self.unknown_fields + } + + fn as_any(&self) -> &dyn (::std::any::Any) { + self as &dyn (::std::any::Any) + } + fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { + self as &mut dyn (::std::any::Any) + } + fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> GPUOptions_Experimental_VirtualDevices { + GPUOptions_Experimental_VirtualDevices::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_vec_accessor::<_, ::protobuf::types::ProtobufTypeFloat>( + "memory_limit_mb", + |m: &GPUOptions_Experimental_VirtualDevices| { &m.memory_limit_mb }, + |m: &mut GPUOptions_Experimental_VirtualDevices| { &mut m.memory_limit_mb }, + )); + fields.push(::protobuf::reflect::accessor::make_vec_accessor::<_, ::protobuf::types::ProtobufTypeInt32>( + "priority", + |m: &GPUOptions_Experimental_VirtualDevices| { &m.priority }, + |m: &mut GPUOptions_Experimental_VirtualDevices| { &mut m.priority }, + )); + ::protobuf::reflect::MessageDescriptor::new_pb_name::( + "GPUOptions.Experimental.VirtualDevices", + fields, + file_descriptor_proto() + ) + }) + } + + fn default_instance() -> &'static GPUOptions_Experimental_VirtualDevices { + static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; + instance.get(GPUOptions_Experimental_VirtualDevices::new) + } +} + +impl ::protobuf::Clear for GPUOptions_Experimental_VirtualDevices { + fn clear(&mut self) { + self.memory_limit_mb.clear(); + self.priority.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::ReflectValueRef { + ::protobuf::reflect::ReflectValueRef::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, ::protobuf::ProtobufEnum::value(&self.opt_level))?; + } + if self.global_jit_level != OptimizerOptions_GlobalJitLevel::DEFAULT { + os.write_enum(5, ::protobuf::ProtobufEnum::value(&self.global_jit_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: ::std::boxed::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 descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::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_pb_name::( + "OptimizerOptions", + fields, + file_descriptor_proto() + ) + }) + } + + fn default_instance() -> &'static OptimizerOptions { + static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; + 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::ReflectValueRef { + ::protobuf::reflect::ReflectValueRef::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 descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::EnumDescriptor> = ::protobuf::rt::LazyV2::INIT; + descriptor.get(|| { + ::protobuf::reflect::EnumDescriptor::new_pb_name::("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::ReflectValueRef { + ::protobuf::reflect::ReflectValueRef::Enum(::protobuf::ProtobufEnum::descriptor(self)) + } +} + +#[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 descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::EnumDescriptor> = ::protobuf::rt::LazyV2::INIT; + descriptor.get(|| { + ::protobuf::reflect::EnumDescriptor::new_pb_name::("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::ReflectValueRef { + ::protobuf::reflect::ReflectValueRef::Enum(::protobuf::ProtobufEnum::descriptor(self)) + } +} + +#[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(|| ::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(|| ::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: ::std::boxed::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 descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::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_pb_name::( + "GraphOptions", + fields, + file_descriptor_proto() + ) + }) + } + + fn default_instance() -> &'static GraphOptions { + static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; + 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::ReflectValueRef { + ::protobuf::reflect::ReflectValueRef::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: ::std::boxed::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 descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt32>( + "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_pb_name::( + "ThreadPoolOptionProto", + fields, + file_descriptor_proto() + ) + }) + } + + fn default_instance() -> &'static ThreadPoolOptionProto { + static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; + 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::ReflectValueRef { + ::protobuf::reflect::ReflectValueRef::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, + pub cache_rpc_response: bool, + pub disable_session_connection_sharing: bool, + pub num_channels_per_target: 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; + } + + // bool cache_rpc_response = 4; + + + pub fn get_cache_rpc_response(&self) -> bool { + self.cache_rpc_response + } + pub fn clear_cache_rpc_response(&mut self) { + self.cache_rpc_response = false; + } + + // Param is passed by value, moved + pub fn set_cache_rpc_response(&mut self, v: bool) { + self.cache_rpc_response = v; + } + + // bool disable_session_connection_sharing = 5; + + + pub fn get_disable_session_connection_sharing(&self) -> bool { + self.disable_session_connection_sharing + } + pub fn clear_disable_session_connection_sharing(&mut self) { + self.disable_session_connection_sharing = false; + } + + // Param is passed by value, moved + pub fn set_disable_session_connection_sharing(&mut self, v: bool) { + self.disable_session_connection_sharing = v; + } + + // int32 num_channels_per_target = 6; + + + pub fn get_num_channels_per_target(&self) -> i32 { + self.num_channels_per_target + } + pub fn clear_num_channels_per_target(&mut self) { + self.num_channels_per_target = 0; + } + + // Param is passed by value, moved + pub fn set_num_channels_per_target(&mut self, v: i32) { + self.num_channels_per_target = 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; + }, + 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.cache_rpc_response = 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.disable_session_connection_sharing = 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_int32()?; + self.num_channels_per_target = 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); + } + if self.cache_rpc_response != false { + my_size += 2; + } + if self.disable_session_connection_sharing != false { + my_size += 2; + } + if self.num_channels_per_target != 0 { + my_size += ::protobuf::rt::value_size(6, self.num_channels_per_target, ::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)?; + } + if self.cache_rpc_response != false { + os.write_bool(4, self.cache_rpc_response)?; + } + if self.disable_session_connection_sharing != false { + os.write_bool(5, self.disable_session_connection_sharing)?; + } + if self.num_channels_per_target != 0 { + os.write_int32(6, self.num_channels_per_target)?; + } + os.write_unknown_fields(self.get_unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn get_cached_size(&self) -> u32 { + self.cached_size.get() + } + + fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { + &self.unknown_fields + } + + fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { + &mut self.unknown_fields + } + + fn as_any(&self) -> &dyn (::std::any::Any) { + self as &dyn (::std::any::Any) + } + fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { + self as &mut dyn (::std::any::Any) + } + fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> RPCOptions { + RPCOptions::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::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 }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBool>( + "cache_rpc_response", + |m: &RPCOptions| { &m.cache_rpc_response }, + |m: &mut RPCOptions| { &mut m.cache_rpc_response }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBool>( + "disable_session_connection_sharing", + |m: &RPCOptions| { &m.disable_session_connection_sharing }, + |m: &mut RPCOptions| { &mut m.disable_session_connection_sharing }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt32>( + "num_channels_per_target", + |m: &RPCOptions| { &m.num_channels_per_target }, + |m: &mut RPCOptions| { &mut m.num_channels_per_target }, + )); + ::protobuf::reflect::MessageDescriptor::new_pb_name::( + "RPCOptions", + fields, + file_descriptor_proto() + ) + }) + } + + fn default_instance() -> &'static RPCOptions { + static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; + 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.cache_rpc_response = false; + self.disable_session_connection_sharing = false; + self.num_channels_per_target = 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::ReflectValueRef { + ::protobuf::reflect::ReflectValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct SessionMetadata { + // message fields + pub name: ::std::string::String, + pub version: i64, + // special fields + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, +} + +impl<'a> ::std::default::Default for &'a SessionMetadata { + fn default() -> &'a SessionMetadata { + ::default_instance() + } +} + +impl SessionMetadata { + pub fn new() -> SessionMetadata { + ::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()) + } + + // int64 version = 2; + + + pub fn get_version(&self) -> i64 { + self.version + } + pub fn clear_version(&mut self) { + self.version = 0; + } + + // Param is passed by value, moved + pub fn set_version(&mut self, v: i64) { + self.version = v; + } +} + +impl ::protobuf::Message for SessionMetadata { + 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 => { + 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.version = 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.version != 0 { + my_size += ::protobuf::rt::value_size(2, self.version, ::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.name.is_empty() { + os.write_string(1, &self.name)?; + } + if self.version != 0 { + os.write_int64(2, self.version)?; + } + os.write_unknown_fields(self.get_unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn get_cached_size(&self) -> u32 { + self.cached_size.get() + } + + fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { + &self.unknown_fields + } + + fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { + &mut self.unknown_fields + } + + fn as_any(&self) -> &dyn (::std::any::Any) { + self as &dyn (::std::any::Any) + } + fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { + self as &mut dyn (::std::any::Any) + } + fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> SessionMetadata { + SessionMetadata::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "name", + |m: &SessionMetadata| { &m.name }, + |m: &mut SessionMetadata| { &mut m.name }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt64>( + "version", + |m: &SessionMetadata| { &m.version }, + |m: &mut SessionMetadata| { &mut m.version }, + )); + ::protobuf::reflect::MessageDescriptor::new_pb_name::( + "SessionMetadata", + fields, + file_descriptor_proto() + ) + }) + } + + fn default_instance() -> &'static SessionMetadata { + static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; + instance.get(SessionMetadata::new) + } +} + +impl ::protobuf::Clear for SessionMetadata { + fn clear(&mut self) { + self.name.clear(); + self.version = 0; + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for SessionMetadata { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for SessionMetadata { + fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { + ::protobuf::reflect::ReflectValueRef::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 share_cluster_devices_in_session: 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(|| ::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(|| ::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(|| ::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(|| ::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; + } + + // bool share_cluster_devices_in_session = 17; + + + pub fn get_share_cluster_devices_in_session(&self) -> bool { + self.share_cluster_devices_in_session + } + pub fn clear_share_cluster_devices_in_session(&mut self) { + self.share_cluster_devices_in_session = false; + } + + // Param is passed by value, moved + pub fn set_share_cluster_devices_in_session(&mut self, v: bool) { + self.share_cluster_devices_in_session = v; + } + + // .tensorflow.ConfigProto.Experimental experimental = 16; + + + pub fn get_experimental(&self) -> &ConfigProto_Experimental { + self.experimental.as_ref().unwrap_or_else(|| ::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; + }, + 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.share_cluster_devices_in_session = 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 self.share_cluster_devices_in_session != false { + my_size += 3; + } + 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 self.share_cluster_devices_in_session != false { + os.write_bool(17, self.share_cluster_devices_in_session)?; + } + 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: ::std::boxed::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 descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_map_accessor::<_, ::protobuf::types::ProtobufTypeString, ::protobuf::types::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_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBool>( + "share_cluster_devices_in_session", + |m: &ConfigProto| { &m.share_cluster_devices_in_session }, + |m: &mut ConfigProto| { &mut m.share_cluster_devices_in_session }, + )); + 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_pb_name::( + "ConfigProto", + fields, + file_descriptor_proto() + ) + }) + } + + fn default_instance() -> &'static ConfigProto { + static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; + 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.share_cluster_devices_in_session = 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::ReflectValueRef { + ::protobuf::reflect::ReflectValueRef::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, + pub collective_deterministic_sequential_execution: bool, + pub collective_nccl: bool, + pub share_session_state_in_clusterspec_propagation: bool, + pub disable_thread_spinning: bool, + pub share_cluster_devices_in_session: bool, + pub session_metadata: ::protobuf::SingularPtrField, + pub optimize_for_static_graph: bool, + pub enable_mlir_bridge: bool, + pub mlir_bridge_rollout: ConfigProto_Experimental_MlirBridgeRollout, + pub enable_mlir_graph_optimization: bool, + pub disable_output_partition_graphs: bool, + pub xla_fusion_autotuner_thresh: i64, + pub use_tfrt: bool, + pub coordination_service: ::std::string::String, + pub fetch_remote_devices_in_multi_client: 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; + } + + // bool collective_deterministic_sequential_execution = 6; + + + pub fn get_collective_deterministic_sequential_execution(&self) -> bool { + self.collective_deterministic_sequential_execution + } + pub fn clear_collective_deterministic_sequential_execution(&mut self) { + self.collective_deterministic_sequential_execution = false; + } + + // Param is passed by value, moved + pub fn set_collective_deterministic_sequential_execution(&mut self, v: bool) { + self.collective_deterministic_sequential_execution = v; + } + + // bool collective_nccl = 7; + + + pub fn get_collective_nccl(&self) -> bool { + self.collective_nccl + } + pub fn clear_collective_nccl(&mut self) { + self.collective_nccl = false; + } + + // Param is passed by value, moved + pub fn set_collective_nccl(&mut self, v: bool) { + self.collective_nccl = v; + } + + // bool share_session_state_in_clusterspec_propagation = 8; + + + pub fn get_share_session_state_in_clusterspec_propagation(&self) -> bool { + self.share_session_state_in_clusterspec_propagation + } + pub fn clear_share_session_state_in_clusterspec_propagation(&mut self) { + self.share_session_state_in_clusterspec_propagation = false; + } + + // Param is passed by value, moved + pub fn set_share_session_state_in_clusterspec_propagation(&mut self, v: bool) { + self.share_session_state_in_clusterspec_propagation = v; + } + + // bool disable_thread_spinning = 9; + + + pub fn get_disable_thread_spinning(&self) -> bool { + self.disable_thread_spinning + } + pub fn clear_disable_thread_spinning(&mut self) { + self.disable_thread_spinning = false; + } + + // Param is passed by value, moved + pub fn set_disable_thread_spinning(&mut self, v: bool) { + self.disable_thread_spinning = v; + } + + // bool share_cluster_devices_in_session = 10; + + + pub fn get_share_cluster_devices_in_session(&self) -> bool { + self.share_cluster_devices_in_session + } + pub fn clear_share_cluster_devices_in_session(&mut self) { + self.share_cluster_devices_in_session = false; + } + + // Param is passed by value, moved + pub fn set_share_cluster_devices_in_session(&mut self, v: bool) { + self.share_cluster_devices_in_session = v; + } + + // .tensorflow.SessionMetadata session_metadata = 11; + + + pub fn get_session_metadata(&self) -> &SessionMetadata { + self.session_metadata.as_ref().unwrap_or_else(|| ::default_instance()) + } + pub fn clear_session_metadata(&mut self) { + self.session_metadata.clear(); + } + + pub fn has_session_metadata(&self) -> bool { + self.session_metadata.is_some() + } + + // Param is passed by value, moved + pub fn set_session_metadata(&mut self, v: SessionMetadata) { + self.session_metadata = ::protobuf::SingularPtrField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_session_metadata(&mut self) -> &mut SessionMetadata { + if self.session_metadata.is_none() { + self.session_metadata.set_default(); + } + self.session_metadata.as_mut().unwrap() + } + + // Take field + pub fn take_session_metadata(&mut self) -> SessionMetadata { + self.session_metadata.take().unwrap_or_else(|| SessionMetadata::new()) + } + + // bool optimize_for_static_graph = 12; + + + pub fn get_optimize_for_static_graph(&self) -> bool { + self.optimize_for_static_graph + } + pub fn clear_optimize_for_static_graph(&mut self) { + self.optimize_for_static_graph = false; + } + + // Param is passed by value, moved + pub fn set_optimize_for_static_graph(&mut self, v: bool) { + self.optimize_for_static_graph = v; + } + + // bool enable_mlir_bridge = 13; + + + pub fn get_enable_mlir_bridge(&self) -> bool { + self.enable_mlir_bridge + } + pub fn clear_enable_mlir_bridge(&mut self) { + self.enable_mlir_bridge = false; + } + + // Param is passed by value, moved + pub fn set_enable_mlir_bridge(&mut self, v: bool) { + self.enable_mlir_bridge = v; + } + + // .tensorflow.ConfigProto.Experimental.MlirBridgeRollout mlir_bridge_rollout = 17; + + + pub fn get_mlir_bridge_rollout(&self) -> ConfigProto_Experimental_MlirBridgeRollout { + self.mlir_bridge_rollout + } + pub fn clear_mlir_bridge_rollout(&mut self) { + self.mlir_bridge_rollout = ConfigProto_Experimental_MlirBridgeRollout::MLIR_BRIDGE_ROLLOUT_UNSPECIFIED; + } + + // Param is passed by value, moved + pub fn set_mlir_bridge_rollout(&mut self, v: ConfigProto_Experimental_MlirBridgeRollout) { + self.mlir_bridge_rollout = v; + } + + // bool enable_mlir_graph_optimization = 16; + + + pub fn get_enable_mlir_graph_optimization(&self) -> bool { + self.enable_mlir_graph_optimization + } + pub fn clear_enable_mlir_graph_optimization(&mut self) { + self.enable_mlir_graph_optimization = false; + } + + // Param is passed by value, moved + pub fn set_enable_mlir_graph_optimization(&mut self, v: bool) { + self.enable_mlir_graph_optimization = v; + } + + // bool disable_output_partition_graphs = 14; + + + pub fn get_disable_output_partition_graphs(&self) -> bool { + self.disable_output_partition_graphs + } + pub fn clear_disable_output_partition_graphs(&mut self) { + self.disable_output_partition_graphs = false; + } + + // Param is passed by value, moved + pub fn set_disable_output_partition_graphs(&mut self, v: bool) { + self.disable_output_partition_graphs = v; + } + + // int64 xla_fusion_autotuner_thresh = 15; + + + pub fn get_xla_fusion_autotuner_thresh(&self) -> i64 { + self.xla_fusion_autotuner_thresh + } + pub fn clear_xla_fusion_autotuner_thresh(&mut self) { + self.xla_fusion_autotuner_thresh = 0; + } + + // Param is passed by value, moved + pub fn set_xla_fusion_autotuner_thresh(&mut self, v: i64) { + self.xla_fusion_autotuner_thresh = v; + } + + // bool use_tfrt = 18; + + + pub fn get_use_tfrt(&self) -> bool { + self.use_tfrt + } + pub fn clear_use_tfrt(&mut self) { + self.use_tfrt = false; + } + + // Param is passed by value, moved + pub fn set_use_tfrt(&mut self, v: bool) { + self.use_tfrt = v; + } + + // string coordination_service = 19; + + + pub fn get_coordination_service(&self) -> &str { + &self.coordination_service + } + pub fn clear_coordination_service(&mut self) { + self.coordination_service.clear(); + } + + // Param is passed by value, moved + pub fn set_coordination_service(&mut self, v: ::std::string::String) { + self.coordination_service = v; + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_coordination_service(&mut self) -> &mut ::std::string::String { + &mut self.coordination_service + } + + // Take field + pub fn take_coordination_service(&mut self) -> ::std::string::String { + ::std::mem::replace(&mut self.coordination_service, ::std::string::String::new()) + } + + // bool fetch_remote_devices_in_multi_client = 20; + + + pub fn get_fetch_remote_devices_in_multi_client(&self) -> bool { + self.fetch_remote_devices_in_multi_client + } + pub fn clear_fetch_remote_devices_in_multi_client(&mut self) { + self.fetch_remote_devices_in_multi_client = false; + } + + // Param is passed by value, moved + pub fn set_fetch_remote_devices_in_multi_client(&mut self, v: bool) { + self.fetch_remote_devices_in_multi_client = v; + } +} + +impl ::protobuf::Message for ConfigProto_Experimental { + fn is_initialized(&self) -> bool { + for v in &self.session_metadata { + 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.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; + }, + 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.collective_deterministic_sequential_execution = 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.collective_nccl = 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.share_session_state_in_clusterspec_propagation = 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.disable_thread_spinning = 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_bool()?; + self.share_cluster_devices_in_session = tmp; + }, + 11 => { + ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.session_metadata)?; + }, + 12 => { + 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.optimize_for_static_graph = tmp; + }, + 13 => { + 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_mlir_bridge = tmp; + }, + 17 => { + ::protobuf::rt::read_proto3_enum_with_unknown_fields_into(wire_type, is, &mut self.mlir_bridge_rollout, 17, &mut self.unknown_fields)? + }, + 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.enable_mlir_graph_optimization = 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_bool()?; + self.disable_output_partition_graphs = 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.xla_fusion_autotuner_thresh = tmp; + }, + 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.use_tfrt = tmp; + }, + 19 => { + ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.coordination_service)?; + }, + 20 => { + 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_remote_devices_in_multi_client = 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; + } + if self.collective_deterministic_sequential_execution != false { + my_size += 2; + } + if self.collective_nccl != false { + my_size += 2; + } + if self.share_session_state_in_clusterspec_propagation != false { + my_size += 2; + } + if self.disable_thread_spinning != false { + my_size += 2; + } + if self.share_cluster_devices_in_session != false { + my_size += 2; + } + if let Some(ref v) = self.session_metadata.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; + } + if self.optimize_for_static_graph != false { + my_size += 2; + } + if self.enable_mlir_bridge != false { + my_size += 2; + } + if self.mlir_bridge_rollout != ConfigProto_Experimental_MlirBridgeRollout::MLIR_BRIDGE_ROLLOUT_UNSPECIFIED { + my_size += ::protobuf::rt::enum_size(17, self.mlir_bridge_rollout); + } + if self.enable_mlir_graph_optimization != false { + my_size += 3; + } + if self.disable_output_partition_graphs != false { + my_size += 2; + } + if self.xla_fusion_autotuner_thresh != 0 { + my_size += ::protobuf::rt::value_size(15, self.xla_fusion_autotuner_thresh, ::protobuf::wire_format::WireTypeVarint); + } + if self.use_tfrt != false { + my_size += 3; + } + if !self.coordination_service.is_empty() { + my_size += ::protobuf::rt::string_size(19, &self.coordination_service); + } + if self.fetch_remote_devices_in_multi_client != 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.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)?; + } + if self.collective_deterministic_sequential_execution != false { + os.write_bool(6, self.collective_deterministic_sequential_execution)?; + } + if self.collective_nccl != false { + os.write_bool(7, self.collective_nccl)?; + } + if self.share_session_state_in_clusterspec_propagation != false { + os.write_bool(8, self.share_session_state_in_clusterspec_propagation)?; + } + if self.disable_thread_spinning != false { + os.write_bool(9, self.disable_thread_spinning)?; + } + if self.share_cluster_devices_in_session != false { + os.write_bool(10, self.share_cluster_devices_in_session)?; + } + if let Some(ref v) = self.session_metadata.as_ref() { + os.write_tag(11, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; + } + if self.optimize_for_static_graph != false { + os.write_bool(12, self.optimize_for_static_graph)?; + } + if self.enable_mlir_bridge != false { + os.write_bool(13, self.enable_mlir_bridge)?; + } + if self.mlir_bridge_rollout != ConfigProto_Experimental_MlirBridgeRollout::MLIR_BRIDGE_ROLLOUT_UNSPECIFIED { + os.write_enum(17, ::protobuf::ProtobufEnum::value(&self.mlir_bridge_rollout))?; + } + if self.enable_mlir_graph_optimization != false { + os.write_bool(16, self.enable_mlir_graph_optimization)?; + } + if self.disable_output_partition_graphs != false { + os.write_bool(14, self.disable_output_partition_graphs)?; + } + if self.xla_fusion_autotuner_thresh != 0 { + os.write_int64(15, self.xla_fusion_autotuner_thresh)?; + } + if self.use_tfrt != false { + os.write_bool(18, self.use_tfrt)?; + } + if !self.coordination_service.is_empty() { + os.write_string(19, &self.coordination_service)?; + } + if self.fetch_remote_devices_in_multi_client != false { + os.write_bool(20, self.fetch_remote_devices_in_multi_client)?; + } + os.write_unknown_fields(self.get_unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn get_cached_size(&self) -> u32 { + self.cached_size.get() + } + + fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { + &self.unknown_fields + } + + fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { + &mut self.unknown_fields + } + + fn as_any(&self) -> &dyn (::std::any::Any) { + self as &dyn (::std::any::Any) + } + fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { + self as &mut dyn (::std::any::Any) + } + fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> ConfigProto_Experimental { + ConfigProto_Experimental::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "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 }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBool>( + "collective_deterministic_sequential_execution", + |m: &ConfigProto_Experimental| { &m.collective_deterministic_sequential_execution }, + |m: &mut ConfigProto_Experimental| { &mut m.collective_deterministic_sequential_execution }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBool>( + "collective_nccl", + |m: &ConfigProto_Experimental| { &m.collective_nccl }, + |m: &mut ConfigProto_Experimental| { &mut m.collective_nccl }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBool>( + "share_session_state_in_clusterspec_propagation", + |m: &ConfigProto_Experimental| { &m.share_session_state_in_clusterspec_propagation }, + |m: &mut ConfigProto_Experimental| { &mut m.share_session_state_in_clusterspec_propagation }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBool>( + "disable_thread_spinning", + |m: &ConfigProto_Experimental| { &m.disable_thread_spinning }, + |m: &mut ConfigProto_Experimental| { &mut m.disable_thread_spinning }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBool>( + "share_cluster_devices_in_session", + |m: &ConfigProto_Experimental| { &m.share_cluster_devices_in_session }, + |m: &mut ConfigProto_Experimental| { &mut m.share_cluster_devices_in_session }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( + "session_metadata", + |m: &ConfigProto_Experimental| { &m.session_metadata }, + |m: &mut ConfigProto_Experimental| { &mut m.session_metadata }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBool>( + "optimize_for_static_graph", + |m: &ConfigProto_Experimental| { &m.optimize_for_static_graph }, + |m: &mut ConfigProto_Experimental| { &mut m.optimize_for_static_graph }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBool>( + "enable_mlir_bridge", + |m: &ConfigProto_Experimental| { &m.enable_mlir_bridge }, + |m: &mut ConfigProto_Experimental| { &mut m.enable_mlir_bridge }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeEnum>( + "mlir_bridge_rollout", + |m: &ConfigProto_Experimental| { &m.mlir_bridge_rollout }, + |m: &mut ConfigProto_Experimental| { &mut m.mlir_bridge_rollout }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBool>( + "enable_mlir_graph_optimization", + |m: &ConfigProto_Experimental| { &m.enable_mlir_graph_optimization }, + |m: &mut ConfigProto_Experimental| { &mut m.enable_mlir_graph_optimization }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBool>( + "disable_output_partition_graphs", + |m: &ConfigProto_Experimental| { &m.disable_output_partition_graphs }, + |m: &mut ConfigProto_Experimental| { &mut m.disable_output_partition_graphs }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt64>( + "xla_fusion_autotuner_thresh", + |m: &ConfigProto_Experimental| { &m.xla_fusion_autotuner_thresh }, + |m: &mut ConfigProto_Experimental| { &mut m.xla_fusion_autotuner_thresh }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBool>( + "use_tfrt", + |m: &ConfigProto_Experimental| { &m.use_tfrt }, + |m: &mut ConfigProto_Experimental| { &mut m.use_tfrt }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "coordination_service", + |m: &ConfigProto_Experimental| { &m.coordination_service }, + |m: &mut ConfigProto_Experimental| { &mut m.coordination_service }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBool>( + "fetch_remote_devices_in_multi_client", + |m: &ConfigProto_Experimental| { &m.fetch_remote_devices_in_multi_client }, + |m: &mut ConfigProto_Experimental| { &mut m.fetch_remote_devices_in_multi_client }, + )); + ::protobuf::reflect::MessageDescriptor::new_pb_name::( + "ConfigProto.Experimental", + fields, + file_descriptor_proto() + ) + }) + } + + fn default_instance() -> &'static ConfigProto_Experimental { + static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; + 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.collective_deterministic_sequential_execution = false; + self.collective_nccl = false; + self.share_session_state_in_clusterspec_propagation = false; + self.disable_thread_spinning = false; + self.share_cluster_devices_in_session = false; + self.session_metadata.clear(); + self.optimize_for_static_graph = false; + self.enable_mlir_bridge = false; + self.mlir_bridge_rollout = ConfigProto_Experimental_MlirBridgeRollout::MLIR_BRIDGE_ROLLOUT_UNSPECIFIED; + self.enable_mlir_graph_optimization = false; + self.disable_output_partition_graphs = false; + self.xla_fusion_autotuner_thresh = 0; + self.use_tfrt = false; + self.coordination_service.clear(); + self.fetch_remote_devices_in_multi_client = 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::ReflectValueRef { + ::protobuf::reflect::ReflectValueRef::Message(self) + } +} + +#[derive(Clone,PartialEq,Eq,Debug,Hash)] +pub enum ConfigProto_Experimental_MlirBridgeRollout { + MLIR_BRIDGE_ROLLOUT_UNSPECIFIED = 0, + MLIR_BRIDGE_ROLLOUT_ENABLED = 1, + MLIR_BRIDGE_ROLLOUT_DISABLED = 2, + MLIR_BRIDGE_ROLLOUT_SAFE_MODE_ENABLED = 3, + MLIR_BRIDGE_ROLLOUT_SAFE_MODE_FALLBACK_ENABLED = 4, +} + +impl ::protobuf::ProtobufEnum for ConfigProto_Experimental_MlirBridgeRollout { + fn value(&self) -> i32 { + *self as i32 + } + + fn from_i32(value: i32) -> ::std::option::Option { + match value { + 0 => ::std::option::Option::Some(ConfigProto_Experimental_MlirBridgeRollout::MLIR_BRIDGE_ROLLOUT_UNSPECIFIED), + 1 => ::std::option::Option::Some(ConfigProto_Experimental_MlirBridgeRollout::MLIR_BRIDGE_ROLLOUT_ENABLED), + 2 => ::std::option::Option::Some(ConfigProto_Experimental_MlirBridgeRollout::MLIR_BRIDGE_ROLLOUT_DISABLED), + 3 => ::std::option::Option::Some(ConfigProto_Experimental_MlirBridgeRollout::MLIR_BRIDGE_ROLLOUT_SAFE_MODE_ENABLED), + 4 => ::std::option::Option::Some(ConfigProto_Experimental_MlirBridgeRollout::MLIR_BRIDGE_ROLLOUT_SAFE_MODE_FALLBACK_ENABLED), + _ => ::std::option::Option::None + } + } + + fn values() -> &'static [Self] { + static values: &'static [ConfigProto_Experimental_MlirBridgeRollout] = &[ + ConfigProto_Experimental_MlirBridgeRollout::MLIR_BRIDGE_ROLLOUT_UNSPECIFIED, + ConfigProto_Experimental_MlirBridgeRollout::MLIR_BRIDGE_ROLLOUT_ENABLED, + ConfigProto_Experimental_MlirBridgeRollout::MLIR_BRIDGE_ROLLOUT_DISABLED, + ConfigProto_Experimental_MlirBridgeRollout::MLIR_BRIDGE_ROLLOUT_SAFE_MODE_ENABLED, + ConfigProto_Experimental_MlirBridgeRollout::MLIR_BRIDGE_ROLLOUT_SAFE_MODE_FALLBACK_ENABLED, + ]; + values + } + + fn enum_descriptor_static() -> &'static ::protobuf::reflect::EnumDescriptor { + static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::EnumDescriptor> = ::protobuf::rt::LazyV2::INIT; + descriptor.get(|| { + ::protobuf::reflect::EnumDescriptor::new_pb_name::("ConfigProto.Experimental.MlirBridgeRollout", file_descriptor_proto()) + }) + } +} + +impl ::std::marker::Copy for ConfigProto_Experimental_MlirBridgeRollout { +} + +impl ::std::default::Default for ConfigProto_Experimental_MlirBridgeRollout { + fn default() -> Self { + ConfigProto_Experimental_MlirBridgeRollout::MLIR_BRIDGE_ROLLOUT_UNSPECIFIED + } +} + +impl ::protobuf::reflect::ProtobufValue for ConfigProto_Experimental_MlirBridgeRollout { + fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { + ::protobuf::reflect::ReflectValueRef::Enum(::protobuf::ProtobufEnum::descriptor(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(|| ::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(|| ::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, ::protobuf::ProtobufEnum::value(&self.trace_level))?; + } + 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: ::std::boxed::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 descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeEnum>( + "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_pb_name::( + "RunOptions", + fields, + file_descriptor_proto() + ) + }) + } + + fn default_instance() -> &'static RunOptions { + static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; + 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::ReflectValueRef { + ::protobuf::reflect::ReflectValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct RunOptions_Experimental { + // message fields + pub collective_graph_key: i64, + pub use_run_handler_pool: bool, + pub run_handler_pool_options: ::protobuf::SingularPtrField, + // 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; + } + + // .tensorflow.RunOptions.Experimental.RunHandlerPoolOptions run_handler_pool_options = 3; + + + pub fn get_run_handler_pool_options(&self) -> &RunOptions_Experimental_RunHandlerPoolOptions { + self.run_handler_pool_options.as_ref().unwrap_or_else(|| ::default_instance()) + } + pub fn clear_run_handler_pool_options(&mut self) { + self.run_handler_pool_options.clear(); + } + + pub fn has_run_handler_pool_options(&self) -> bool { + self.run_handler_pool_options.is_some() + } + + // Param is passed by value, moved + pub fn set_run_handler_pool_options(&mut self, v: RunOptions_Experimental_RunHandlerPoolOptions) { + self.run_handler_pool_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_handler_pool_options(&mut self) -> &mut RunOptions_Experimental_RunHandlerPoolOptions { + if self.run_handler_pool_options.is_none() { + self.run_handler_pool_options.set_default(); + } + self.run_handler_pool_options.as_mut().unwrap() + } + + // Take field + pub fn take_run_handler_pool_options(&mut self) -> RunOptions_Experimental_RunHandlerPoolOptions { + self.run_handler_pool_options.take().unwrap_or_else(|| RunOptions_Experimental_RunHandlerPoolOptions::new()) + } +} + +impl ::protobuf::Message for RunOptions_Experimental { + fn is_initialized(&self) -> bool { + for v in &self.run_handler_pool_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 { + 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; + }, + 3 => { + ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.run_handler_pool_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.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; + } + if let Some(ref v) = self.run_handler_pool_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.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)?; + } + if let Some(ref v) = self.run_handler_pool_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)?; + } + os.write_unknown_fields(self.get_unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn get_cached_size(&self) -> u32 { + self.cached_size.get() + } + + fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { + &self.unknown_fields + } + + fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { + &mut self.unknown_fields + } + + fn as_any(&self) -> &dyn (::std::any::Any) { + self as &dyn (::std::any::Any) + } + fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { + self as &mut dyn (::std::any::Any) + } + fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> RunOptions_Experimental { + RunOptions_Experimental::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt64>( + "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 }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( + "run_handler_pool_options", + |m: &RunOptions_Experimental| { &m.run_handler_pool_options }, + |m: &mut RunOptions_Experimental| { &mut m.run_handler_pool_options }, + )); + ::protobuf::reflect::MessageDescriptor::new_pb_name::( + "RunOptions.Experimental", + fields, + file_descriptor_proto() + ) + }) + } + + fn default_instance() -> &'static RunOptions_Experimental { + static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; + 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.run_handler_pool_options.clear(); + 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::ReflectValueRef { + ::protobuf::reflect::ReflectValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct RunOptions_Experimental_RunHandlerPoolOptions { + // message fields + pub priority: i64, + // special fields + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, +} + +impl<'a> ::std::default::Default for &'a RunOptions_Experimental_RunHandlerPoolOptions { + fn default() -> &'a RunOptions_Experimental_RunHandlerPoolOptions { + ::default_instance() + } +} + +impl RunOptions_Experimental_RunHandlerPoolOptions { + pub fn new() -> RunOptions_Experimental_RunHandlerPoolOptions { + ::std::default::Default::default() + } + + // int64 priority = 1; + + + pub fn get_priority(&self) -> i64 { + self.priority + } + pub fn clear_priority(&mut self) { + self.priority = 0; + } + + // Param is passed by value, moved + pub fn set_priority(&mut self, v: i64) { + self.priority = v; + } +} + +impl ::protobuf::Message for RunOptions_Experimental_RunHandlerPoolOptions { + 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.priority = 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.priority != 0 { + my_size += ::protobuf::rt::value_size(1, self.priority, ::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.priority != 0 { + os.write_int64(1, self.priority)?; + } + os.write_unknown_fields(self.get_unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn get_cached_size(&self) -> u32 { + self.cached_size.get() + } + + fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { + &self.unknown_fields + } + + fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { + &mut self.unknown_fields + } + + fn as_any(&self) -> &dyn (::std::any::Any) { + self as &dyn (::std::any::Any) + } + fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { + self as &mut dyn (::std::any::Any) + } + fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> RunOptions_Experimental_RunHandlerPoolOptions { + RunOptions_Experimental_RunHandlerPoolOptions::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt64>( + "priority", + |m: &RunOptions_Experimental_RunHandlerPoolOptions| { &m.priority }, + |m: &mut RunOptions_Experimental_RunHandlerPoolOptions| { &mut m.priority }, + )); + ::protobuf::reflect::MessageDescriptor::new_pb_name::( + "RunOptions.Experimental.RunHandlerPoolOptions", + fields, + file_descriptor_proto() + ) + }) + } + + fn default_instance() -> &'static RunOptions_Experimental_RunHandlerPoolOptions { + static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; + instance.get(RunOptions_Experimental_RunHandlerPoolOptions::new) + } +} + +impl ::protobuf::Clear for RunOptions_Experimental_RunHandlerPoolOptions { + fn clear(&mut self) { + self.priority = 0; + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for RunOptions_Experimental_RunHandlerPoolOptions { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for RunOptions_Experimental_RunHandlerPoolOptions { + fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { + ::protobuf::reflect::ReflectValueRef::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 descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::EnumDescriptor> = ::protobuf::rt::LazyV2::INIT; + descriptor.get(|| { + ::protobuf::reflect::EnumDescriptor::new_pb_name::("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::ReflectValueRef { + ::protobuf::reflect::ReflectValueRef::Enum(::protobuf::ProtobufEnum::descriptor(self)) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct RunMetadata { + // message fields + pub step_stats: ::protobuf::SingularPtrField, + pub cost_graph: ::protobuf::SingularPtrField, + pub partition_graphs: ::protobuf::RepeatedField, + pub function_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(|| ::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(|| ::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()) + } + + // repeated .tensorflow.RunMetadata.FunctionGraphs function_graphs = 4; + + + pub fn get_function_graphs(&self) -> &[RunMetadata_FunctionGraphs] { + &self.function_graphs + } + pub fn clear_function_graphs(&mut self) { + self.function_graphs.clear(); + } + + // Param is passed by value, moved + pub fn set_function_graphs(&mut self, v: ::protobuf::RepeatedField) { + self.function_graphs = v; + } + + // Mutable pointer to the field. + pub fn mut_function_graphs(&mut self) -> &mut ::protobuf::RepeatedField { + &mut self.function_graphs + } + + // Take field + pub fn take_function_graphs(&mut self) -> ::protobuf::RepeatedField { + ::std::mem::replace(&mut self.function_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; + } + }; + for v in &self.function_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)?; + }, + 4 => { + ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.function_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; + }; + for value in &self.function_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)?; + }; + for v in &self.function_graphs { + os.write_tag(4, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; + }; + os.write_unknown_fields(self.get_unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn get_cached_size(&self) -> u32 { + self.cached_size.get() + } + + fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { + &self.unknown_fields + } + + fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { + &mut self.unknown_fields + } + + fn as_any(&self) -> &dyn (::std::any::Any) { + self as &dyn (::std::any::Any) + } + fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { + self as &mut dyn (::std::any::Any) + } + fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> RunMetadata { + RunMetadata::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( + "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 }, + )); + fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( + "function_graphs", + |m: &RunMetadata| { &m.function_graphs }, + |m: &mut RunMetadata| { &mut m.function_graphs }, + )); + ::protobuf::reflect::MessageDescriptor::new_pb_name::( + "RunMetadata", + fields, + file_descriptor_proto() + ) + }) + } + + fn default_instance() -> &'static RunMetadata { + static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; + 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.function_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::ReflectValueRef { + ::protobuf::reflect::ReflectValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct RunMetadata_FunctionGraphs { + // message fields + pub partition_graphs: ::protobuf::RepeatedField, + pub pre_optimization_graph: ::protobuf::SingularPtrField, + pub post_optimization_graph: ::protobuf::SingularPtrField, + // special fields + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, +} + +impl<'a> ::std::default::Default for &'a RunMetadata_FunctionGraphs { + fn default() -> &'a RunMetadata_FunctionGraphs { + ::default_instance() + } +} + +impl RunMetadata_FunctionGraphs { + pub fn new() -> RunMetadata_FunctionGraphs { + ::std::default::Default::default() + } + + // repeated .tensorflow.GraphDef partition_graphs = 1; + + + 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()) + } + + // .tensorflow.GraphDef pre_optimization_graph = 2; + + + pub fn get_pre_optimization_graph(&self) -> &super::graph::GraphDef { + self.pre_optimization_graph.as_ref().unwrap_or_else(|| ::default_instance()) + } + pub fn clear_pre_optimization_graph(&mut self) { + self.pre_optimization_graph.clear(); + } + + pub fn has_pre_optimization_graph(&self) -> bool { + self.pre_optimization_graph.is_some() + } + + // Param is passed by value, moved + pub fn set_pre_optimization_graph(&mut self, v: super::graph::GraphDef) { + self.pre_optimization_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_pre_optimization_graph(&mut self) -> &mut super::graph::GraphDef { + if self.pre_optimization_graph.is_none() { + self.pre_optimization_graph.set_default(); + } + self.pre_optimization_graph.as_mut().unwrap() + } + + // Take field + pub fn take_pre_optimization_graph(&mut self) -> super::graph::GraphDef { + self.pre_optimization_graph.take().unwrap_or_else(|| super::graph::GraphDef::new()) + } + + // .tensorflow.GraphDef post_optimization_graph = 3; + + + pub fn get_post_optimization_graph(&self) -> &super::graph::GraphDef { + self.post_optimization_graph.as_ref().unwrap_or_else(|| ::default_instance()) + } + pub fn clear_post_optimization_graph(&mut self) { + self.post_optimization_graph.clear(); + } + + pub fn has_post_optimization_graph(&self) -> bool { + self.post_optimization_graph.is_some() + } + + // Param is passed by value, moved + pub fn set_post_optimization_graph(&mut self, v: super::graph::GraphDef) { + self.post_optimization_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_post_optimization_graph(&mut self) -> &mut super::graph::GraphDef { + if self.post_optimization_graph.is_none() { + self.post_optimization_graph.set_default(); + } + self.post_optimization_graph.as_mut().unwrap() + } + + // Take field + pub fn take_post_optimization_graph(&mut self) -> super::graph::GraphDef { + self.post_optimization_graph.take().unwrap_or_else(|| super::graph::GraphDef::new()) + } +} + +impl ::protobuf::Message for RunMetadata_FunctionGraphs { + fn is_initialized(&self) -> bool { + for v in &self.partition_graphs { + if !v.is_initialized() { + return false; + } + }; + for v in &self.pre_optimization_graph { + if !v.is_initialized() { + return false; + } + }; + for v in &self.post_optimization_graph { + 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.partition_graphs)?; + }, + 2 => { + ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.pre_optimization_graph)?; + }, + 3 => { + ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.post_optimization_graph)?; + }, + _ => { + ::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.partition_graphs { + let len = value.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; + }; + if let Some(ref v) = self.pre_optimization_graph.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; + } + if let Some(ref v) = self.post_optimization_graph.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.partition_graphs { + 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.pre_optimization_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)?; + } + if let Some(ref v) = self.post_optimization_graph.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: ::std::boxed::Box) -> ::std::boxed::Box { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> RunMetadata_FunctionGraphs { + RunMetadata_FunctionGraphs::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( + "partition_graphs", + |m: &RunMetadata_FunctionGraphs| { &m.partition_graphs }, + |m: &mut RunMetadata_FunctionGraphs| { &mut m.partition_graphs }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( + "pre_optimization_graph", + |m: &RunMetadata_FunctionGraphs| { &m.pre_optimization_graph }, + |m: &mut RunMetadata_FunctionGraphs| { &mut m.pre_optimization_graph }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( + "post_optimization_graph", + |m: &RunMetadata_FunctionGraphs| { &m.post_optimization_graph }, + |m: &mut RunMetadata_FunctionGraphs| { &mut m.post_optimization_graph }, + )); + ::protobuf::reflect::MessageDescriptor::new_pb_name::( + "RunMetadata.FunctionGraphs", + fields, + file_descriptor_proto() + ) + }) + } + + fn default_instance() -> &'static RunMetadata_FunctionGraphs { + static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; + instance.get(RunMetadata_FunctionGraphs::new) + } +} + +impl ::protobuf::Clear for RunMetadata_FunctionGraphs { + fn clear(&mut self) { + self.partition_graphs.clear(); + self.pre_optimization_graph.clear(); + self.post_optimization_graph.clear(); + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for RunMetadata_FunctionGraphs { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for RunMetadata_FunctionGraphs { + fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { + ::protobuf::reflect::ReflectValueRef::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: ::std::boxed::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 descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "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_pb_name::( + "TensorConnection", + fields, + file_descriptor_proto() + ) + }) + } + + fn default_instance() -> &'static TensorConnection { + static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; + 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::ReflectValueRef { + ::protobuf::reflect::ReflectValueRef::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(|| ::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: ::std::boxed::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 descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "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_pb_name::( + "CallableOptions", + fields, + file_descriptor_proto() + ) + }) + } + + fn default_instance() -> &'static CallableOptions { + static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; + 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::ReflectValueRef { + ::protobuf::reflect::ReflectValueRef::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/cluster.proto\x1a$tensorflow/core/protobuf/debug.proto\x1a.tensorf\ + low/core/protobuf/rewriter_config.proto\"\xc5\t\n\nGPUOptions\x12D\n\x1f\ + per_process_gpu_memory_fraction\x18\x01\x20\x01(\x01R\x1bperProcessGpuMe\ + moryFraction\x12!\n\x0callow_growth\x18\x04\x20\x01(\x08R\x0ballowGrowth\ + \x12%\n\x0eallocator_type\x18\x02\x20\x01(\tR\rallocatorType\x126\n\x17d\ + eferred_deletion_bytes\x18\x03\x20\x01(\x03R\x15deferredDeletionBytes\ + \x12.\n\x13visible_device_list\x18\x05\x20\x01(\tR\x11visibleDeviceList\ + \x12;\n\x1apolling_active_delay_usecs\x18\x06\x20\x01(\x05R\x17pollingAc\ + tiveDelayUsecs\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\ + \xc5\x05\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\x123\n\x15timestamped_allocator\x18\x05\x20\x01(\x08\ + R\x14timestampedAllocator\x12=\n\x1bkernel_tracker_max_interval\x18\x07\ + \x20\x01(\x05R\x18kernelTrackerMaxInterval\x127\n\x18kernel_tracker_max_\ + bytes\x18\x08\x20\x01(\x05R\x15kernelTrackerMaxBytes\x12;\n\x1akernel_tr\ + acker_max_pending\x18\t\x20\x01(\x05R\x17kernelTrackerMaxPending\x12F\n\ + \x1finternal_fragmentation_fraction\x18\n\x20\x01(\x01R\x1dinternalFragm\ + entationFraction\x121\n\x15use_cuda_malloc_async\x18\x0b\x20\x01(\x08R\ + \x12useCudaMallocAsync\x1aT\n\x0eVirtualDevices\x12&\n\x0fmemory_limit_m\ + b\x18\x01\x20\x03(\x02R\rmemoryLimitMb\x12\x1a\n\x08priority\x18\x02\x20\ + \x03(\x05R\x08priority\"\x82\x04\n\x10OptimizerOptions\x12M\n#do_common_\ + subexpression_elimination\x18\x01\x20\x01(\x08R\x20doCommonSubexpression\ + Elimination\x12.\n\x13do_constant_folding\x18\x02\x20\x01(\x08R\x11doCon\ + stantFolding\x12>\n\x1cmax_folded_constant_in_bytes\x18\x06\x20\x01(\x03\ + R\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_l\ + evel\x18\x05\x20\x01(\x0e2+.tensorflow.OptimizerOptions.GlobalJitLevelR\ + \x0eglobalJitLevel\"\x20\n\x05Level\x12\x06\n\x02L1\x10\0\x12\x0f\n\x02L\ + 0\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_scheduling\x18\x02\x20\x01(\ + \x08R\x14enableRecvScheduling\x12I\n\x11optimizer_options\x18\x03\x20\ + \x01(\x0b2\x1c.tensorflow.OptimizerOptionsR\x10optimizerOptions\x12(\n\ + \x10build_cost_model\x18\x04\x20\x01(\x03R\x0ebuildCostModel\x123\n\x16b\ + uild_cost_model_after\x18\t\x20\x01(\x03R\x13buildCostModelAfter\x12!\n\ + \x0cinfer_shapes\x18\x05\x20\x01(\x08R\x0binferShapes\x12,\n\x12place_pr\ + uned_graph\x18\x06\x20\x01(\x08R\x10placePrunedGraph\x128\n\x18enable_bf\ + loat16_sendrecv\x18\x07\x20\x01(\x08R\x16enableBfloat16Sendrecv\x12#\n\r\ + timeline_step\x18\x08\x20\x01(\x05R\x0ctimelineStep\x12C\n\x0frewrite_op\ + tions\x18\n\x20\x01(\x0b2\x1a.tensorflow.RewriterConfigR\x0erewriteOptio\ + nsJ\x04\x08\x01\x10\x02R%skip_common_subexpression_elimination\"Y\n\x15T\ + hreadPoolOptionProto\x12\x1f\n\x0bnum_threads\x18\x01\x20\x01(\x05R\nnum\ + Threads\x12\x1f\n\x0bglobal_name\x18\x02\x20\x01(\tR\nglobalName\"\xe0\ + \x02\n\nRPCOptions\x12>\n\x1cuse_rpc_for_inprocess_master\x18\x01\x20\ + \x01(\x08R\x18useRpcForInprocessMaster\x123\n\x15compression_algorithm\ + \x18\x02\x20\x01(\tR\x14compressionAlgorithm\x12+\n\x11compression_level\ + \x18\x03\x20\x01(\x05R\x10compressionLevel\x12,\n\x12cache_rpc_response\ + \x18\x04\x20\x01(\x08R\x10cacheRpcResponse\x12K\n\"disable_session_conne\ + ction_sharing\x18\x05\x20\x01(\x08R\x1fdisableSessionConnectionSharing\ + \x125\n\x17num_channels_per_target\x18\x06\x20\x01(\x05R\x14numChannelsP\ + erTarget\"?\n\x0fSessionMetadata\x12\x12\n\x04name\x18\x01\x20\x01(\tR\ + \x04name\x12\x18\n\x07version\x18\x02\x20\x01(\x03R\x07version\"\xed\x13\ + \n\x0bConfigProto\x12K\n\x0cdevice_count\x18\x01\x20\x03(\x0b2(.tensorfl\ + ow.ConfigProto.DeviceCountEntryR\x0bdeviceCount\x12?\n\x1cintra_op_paral\ + lelism_threads\x18\x02\x20\x01(\x05R\x19intraOpParallelismThreads\x12?\n\ + \x1cinter_op_parallelism_threads\x18\x05\x20\x01(\x05R\x19interOpParalle\ + lismThreads\x125\n\x17use_per_session_threads\x18\t\x20\x01(\x08R\x14use\ + PerSessionThreads\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\x0edevice_filters\x18\x04\x20\x03(\tR\rdeviceFilters\x127\n\x0bgpu_o\ + ptions\x18\x06\x20\x01(\x0b2\x16.tensorflow.GPUOptionsR\ngpuOptions\x120\ + \n\x14allow_soft_placement\x18\x07\x20\x01(\x08R\x12allowSoftPlacement\ + \x120\n\x14log_device_placement\x18\x08\x20\x01(\x08R\x12logDevicePlacem\ + ent\x12=\n\rgraph_options\x18\n\x20\x01(\x0b2\x18.tensorflow.GraphOption\ + sR\x0cgraphOptions\x125\n\x17operation_timeout_in_ms\x18\x0b\x20\x01(\ + \x03R\x14operationTimeoutInMs\x127\n\x0brpc_options\x18\r\x20\x01(\x0b2\ + \x16.tensorflow.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\x12F\n\x20sha\ + re_cluster_devices_in_session\x18\x11\x20\x01(\x08R\x1cshareClusterDevic\ + esInSession\x12H\n\x0cexperimental\x18\x10\x20\x01(\x0b2$.tensorflow.Con\ + figProto.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\x97\x0b\n\x0cExperimental\x126\n\x17co\ + llective_group_leader\x18\x01\x20\x01(\tR\x15collectiveGroupLeader\x12#\ + \n\rexecutor_type\x18\x03\x20\x01(\tR\x0cexecutorType\x12+\n\x12recv_buf\ + _max_chunk\x18\x04\x20\x01(\x05R\x0frecvBufMaxChunk\x12*\n\x11use_numa_a\ + ffinity\x18\x05\x20\x01(\x08R\x0fuseNumaAffinity\x12a\n-collective_deter\ + ministic_sequential_execution\x18\x06\x20\x01(\x08R*collectiveDeterminis\ + ticSequentialExecution\x12'\n\x0fcollective_nccl\x18\x07\x20\x01(\x08R\ + \x0ecollectiveNccl\x12a\n.share_session_state_in_clusterspec_propagation\ + \x18\x08\x20\x01(\x08R)shareSessionStateInClusterspecPropagation\x126\n\ + \x17disable_thread_spinning\x18\t\x20\x01(\x08R\x15disableThreadSpinning\ + \x12F\n\x20share_cluster_devices_in_session\x18\n\x20\x01(\x08R\x1cshare\ + ClusterDevicesInSession\x12F\n\x10session_metadata\x18\x0b\x20\x01(\x0b2\ + \x1b.tensorflow.SessionMetadataR\x0fsessionMetadata\x129\n\x19optimize_f\ + or_static_graph\x18\x0c\x20\x01(\x08R\x16optimizeForStaticGraph\x12,\n\ + \x12enable_mlir_bridge\x18\r\x20\x01(\x08R\x10enableMlirBridge\x12f\n\ + \x13mlir_bridge_rollout\x18\x11\x20\x01(\x0e26.tensorflow.ConfigProto.Ex\ + perimental.MlirBridgeRolloutR\x11mlirBridgeRollout\x12C\n\x1eenable_mlir\ + _graph_optimization\x18\x10\x20\x01(\x08R\x1benableMlirGraphOptimization\ + \x12E\n\x1fdisable_output_partition_graphs\x18\x0e\x20\x01(\x08R\x1cdisa\ + bleOutputPartitionGraphs\x12=\n\x1bxla_fusion_autotuner_thresh\x18\x0f\ + \x20\x01(\x03R\x18xlaFusionAutotunerThresh\x12\x19\n\x08use_tfrt\x18\x12\ + \x20\x01(\x08R\x07useTfrt\x121\n\x14coordination_service\x18\x13\x20\x01\ + (\tR\x13coordinationService\x12M\n$fetch_remote_devices_in_multi_client\ + \x18\x14\x20\x01(\x08R\x1ffetchRemoteDevicesInMultiClient\"\xda\x01\n\ + \x11MlirBridgeRollout\x12#\n\x1fMLIR_BRIDGE_ROLLOUT_UNSPECIFIED\x10\0\ + \x12\x1f\n\x1bMLIR_BRIDGE_ROLLOUT_ENABLED\x10\x01\x12\x20\n\x1cMLIR_BRID\ + GE_ROLLOUT_DISABLED\x10\x02\x12)\n%MLIR_BRIDGE_ROLLOUT_SAFE_MODE_ENABLED\ + \x10\x03\x122\n.MLIR_BRIDGE_ROLLOUT_SAFE_MODE_FALLBACK_ENABLED\x10\x04J\ + \x04\x08\x02\x10\x03\"\xa8\x06\n\nRunOptions\x12B\n\x0btrace_level\x18\ + \x01\x20\x01(\x0e2!.tensorflow.RunOptions.TraceLevelR\ntraceLevel\x12\"\ + \n\rtimeout_in_ms\x18\x02\x20\x01(\x03R\x0btimeoutInMs\x12/\n\x14inter_o\ + p_thread_pool\x18\x03\x20\x01(\x05R\x11interOpThreadPool\x126\n\x17outpu\ + t_partition_graphs\x18\x05\x20\x01(\x08R\x15outputPartitionGraphs\x12=\n\ + \rdebug_options\x18\x06\x20\x01(\x0b2\x18.tensorflow.DebugOptionsR\x0cde\ + bugOptions\x12J\n\"report_tensor_allocations_upon_oom\x18\x07\x20\x01(\ + \x08R\x1ereportTensorAllocationsUponOom\x12G\n\x0cexperimental\x18\x08\ + \x20\x01(\x0b2#.tensorflow.RunOptions.ExperimentalR\x0cexperimental\x1a\ + \x9a\x02\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\x12r\n\x18run_handler_pool_options\ + \x18\x03\x20\x01(\x0b29.tensorflow.RunOptions.Experimental.RunHandlerPoo\ + lOptionsR\x15runHandlerPoolOptions\x1a3\n\x15RunHandlerPoolOptions\x12\ + \x1a\n\x08priority\x18\x01\x20\x01(\x03R\x08priority\"R\n\nTraceLevel\ + \x12\x0c\n\x08NO_TRACE\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\"\xfc\x03\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.tensorflow.CostGraphDefR\tcostGraph\x12?\n\x10partiti\ + on_graphs\x18\x03\x20\x03(\x0b2\x14.tensorflow.GraphDefR\x0fpartitionGra\ + phs\x12O\n\x0ffunction_graphs\x18\x04\x20\x03(\x0b2&.tensorflow.RunMetad\ + ata.FunctionGraphsR\x0efunctionGraphs\x1a\xeb\x01\n\x0eFunctionGraphs\ + \x12?\n\x10partition_graphs\x18\x01\x20\x03(\x0b2\x14.tensorflow.GraphDe\ + fR\x0fpartitionGraphs\x12J\n\x16pre_optimization_graph\x18\x02\x20\x01(\ + \x0b2\x14.tensorflow.GraphDefR\x14preOptimizationGraph\x12L\n\x17post_op\ + timization_graph\x18\x03\x20\x01(\x0b2\x14.tensorflow.GraphDefR\x15postO\ + ptimizationGraph\"P\n\x10TensorConnection\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\x0fCallableOptions\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.RunOptionsR\nrunOptions\x12I\n\x11tens\ + or_connection\x18\x05\x20\x03(\x0b2\x1c.tensorflow.TensorConnectionR\x10\ + tensorConnection\x12O\n\x0cfeed_devices\x18\x06\x20\x03(\x0b2,.tensorflo\ + w.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\rfetchS\ + kipSync\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\x05value:\x028\x01B\x84\x01\n\x18org\ + .tensorflow.frameworkB\x0cConfigProtosP\x01ZUgithub.com/tensorflow/tenso\ + rflow/tensorflow/go/core/protobuf/for_core_protos_go_proto\xf8\x01\x01b\ + \x06proto3\ +"; + +static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT; + +fn parse_descriptor_proto() -> ::protobuf::descriptor::FileDescriptorProto { + ::protobuf::Message::parse_from_bytes(file_descriptor_proto_data).unwrap() +} + +pub fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto { + file_descriptor_proto_lazy.get(|| { + parse_descriptor_proto() + }) +} diff --git a/src/protos/cost_graph.rs b/src/protos/cost_graph.rs new file mode 100644 index 0000000000..fddd0f4e59 --- /dev/null +++ b/src/protos/cost_graph.rs @@ -0,0 +1,1666 @@ +// This file is generated by rust-protobuf 2.25.1. Do not edit +// @generated + +// https://github.com/rust-lang/rust-clippy/issues/702 +#![allow(unknown_lints)] +#![allow(clippy::all)] + +#![allow(unused_attributes)] +#![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(unused_imports)] +#![allow(unused_results)] +//! Generated file from `tensorflow/core/framework/cost_graph.proto` + +/// Generated files are compatible only with the same version +/// of protobuf runtime. +// const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_25_1; + +#[derive(PartialEq,Clone,Default)] +pub struct CostGraphDef { + // message fields + pub node: ::protobuf::RepeatedField, + pub cost: ::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()) + } + + // repeated .tensorflow.CostGraphDef.AggregatedCost cost = 2; + + + pub fn get_cost(&self) -> &[CostGraphDef_AggregatedCost] { + &self.cost + } + pub fn clear_cost(&mut self) { + self.cost.clear(); + } + + // Param is passed by value, moved + pub fn set_cost(&mut self, v: ::protobuf::RepeatedField) { + self.cost = v; + } + + // Mutable pointer to the field. + pub fn mut_cost(&mut self) -> &mut ::protobuf::RepeatedField { + &mut self.cost + } + + // Take field + pub fn take_cost(&mut self) -> ::protobuf::RepeatedField { + ::std::mem::replace(&mut self.cost, ::protobuf::RepeatedField::new()) + } +} + +impl ::protobuf::Message for CostGraphDef { + fn is_initialized(&self) -> bool { + for v in &self.node { + if !v.is_initialized() { + return false; + } + }; + for v in &self.cost { + 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)?; + }, + 2 => { + ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.cost)?; + }, + _ => { + ::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; + }; + for value in &self.cost { + 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)?; + }; + for v in &self.cost { + os.write_tag(2, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; + }; + os.write_unknown_fields(self.get_unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn get_cached_size(&self) -> u32 { + self.cached_size.get() + } + + fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { + &self.unknown_fields + } + + fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { + &mut self.unknown_fields + } + + fn as_any(&self) -> &dyn (::std::any::Any) { + self as &dyn (::std::any::Any) + } + fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { + self as &mut dyn (::std::any::Any) + } + fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> CostGraphDef { + CostGraphDef::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( + "node", + |m: &CostGraphDef| { &m.node }, + |m: &mut CostGraphDef| { &mut m.node }, + )); + fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( + "cost", + |m: &CostGraphDef| { &m.cost }, + |m: &mut CostGraphDef| { &mut m.cost }, + )); + ::protobuf::reflect::MessageDescriptor::new_pb_name::( + "CostGraphDef", + fields, + file_descriptor_proto() + ) + }) + } + + fn default_instance() -> &'static CostGraphDef { + static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; + instance.get(CostGraphDef::new) + } +} + +impl ::protobuf::Clear for CostGraphDef { + fn clear(&mut self) { + self.node.clear(); + self.cost.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::ReflectValueRef { + ::protobuf::reflect::ReflectValueRef::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: ::std::boxed::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 descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "name", + |m: &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_pb_name::( + "CostGraphDef.Node", + fields, + file_descriptor_proto() + ) + }) + } + + fn default_instance() -> &'static CostGraphDef_Node { + static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; + 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::ReflectValueRef { + ::protobuf::reflect::ReflectValueRef::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: ::std::boxed::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 descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt32>( + "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_pb_name::( + "CostGraphDef.Node.InputInfo", + fields, + file_descriptor_proto() + ) + }) + } + + fn default_instance() -> &'static CostGraphDef_Node_InputInfo { + static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; + 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::ReflectValueRef { + ::protobuf::reflect::ReflectValueRef::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(|| ::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, ::protobuf::ProtobufEnum::value(&self.dtype))?; + } + os.write_unknown_fields(self.get_unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn get_cached_size(&self) -> u32 { + self.cached_size.get() + } + + fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { + &self.unknown_fields + } + + fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { + &mut self.unknown_fields + } + + fn as_any(&self) -> &dyn (::std::any::Any) { + self as &dyn (::std::any::Any) + } + fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { + self as &mut dyn (::std::any::Any) + } + fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> CostGraphDef_Node_OutputInfo { + CostGraphDef_Node_OutputInfo::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt64>( + "size", + |m: &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_pb_name::( + "CostGraphDef.Node.OutputInfo", + fields, + file_descriptor_proto() + ) + }) + } + + fn default_instance() -> &'static CostGraphDef_Node_OutputInfo { + static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; + 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::ReflectValueRef { + ::protobuf::reflect::ReflectValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct CostGraphDef_AggregatedCost { + // message fields + pub cost: f32, + pub dimension: ::std::string::String, + // special fields + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, +} + +impl<'a> ::std::default::Default for &'a CostGraphDef_AggregatedCost { + fn default() -> &'a CostGraphDef_AggregatedCost { + ::default_instance() + } +} + +impl CostGraphDef_AggregatedCost { + pub fn new() -> CostGraphDef_AggregatedCost { + ::std::default::Default::default() + } + + // float cost = 1; + + + pub fn get_cost(&self) -> f32 { + self.cost + } + pub fn clear_cost(&mut self) { + self.cost = 0.; + } + + // Param is passed by value, moved + pub fn set_cost(&mut self, v: f32) { + self.cost = v; + } + + // string dimension = 2; + + + pub fn get_dimension(&self) -> &str { + &self.dimension + } + pub fn clear_dimension(&mut self) { + self.dimension.clear(); + } + + // Param is passed by value, moved + pub fn set_dimension(&mut self, v: ::std::string::String) { + self.dimension = v; + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_dimension(&mut self) -> &mut ::std::string::String { + &mut self.dimension + } + + // Take field + pub fn take_dimension(&mut self) -> ::std::string::String { + ::std::mem::replace(&mut self.dimension, ::std::string::String::new()) + } +} + +impl ::protobuf::Message for CostGraphDef_AggregatedCost { + 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::WireTypeFixed32 { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + let tmp = is.read_float()?; + self.cost = tmp; + }, + 2 => { + ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.dimension)?; + }, + _ => { + ::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.cost != 0. { + my_size += 5; + } + if !self.dimension.is_empty() { + my_size += ::protobuf::rt::string_size(2, &self.dimension); + } + 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.cost != 0. { + os.write_float(1, self.cost)?; + } + if !self.dimension.is_empty() { + os.write_string(2, &self.dimension)?; + } + os.write_unknown_fields(self.get_unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn get_cached_size(&self) -> u32 { + self.cached_size.get() + } + + fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { + &self.unknown_fields + } + + fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { + &mut self.unknown_fields + } + + fn as_any(&self) -> &dyn (::std::any::Any) { + self as &dyn (::std::any::Any) + } + fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { + self as &mut dyn (::std::any::Any) + } + fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> CostGraphDef_AggregatedCost { + CostGraphDef_AggregatedCost::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeFloat>( + "cost", + |m: &CostGraphDef_AggregatedCost| { &m.cost }, + |m: &mut CostGraphDef_AggregatedCost| { &mut m.cost }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "dimension", + |m: &CostGraphDef_AggregatedCost| { &m.dimension }, + |m: &mut CostGraphDef_AggregatedCost| { &mut m.dimension }, + )); + ::protobuf::reflect::MessageDescriptor::new_pb_name::( + "CostGraphDef.AggregatedCost", + fields, + file_descriptor_proto() + ) + }) + } + + fn default_instance() -> &'static CostGraphDef_AggregatedCost { + static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; + instance.get(CostGraphDef_AggregatedCost::new) + } +} + +impl ::protobuf::Clear for CostGraphDef_AggregatedCost { + fn clear(&mut self) { + self.cost = 0.; + self.dimension.clear(); + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for CostGraphDef_AggregatedCost { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for CostGraphDef_AggregatedCost { + fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { + ::protobuf::reflect::ReflectValueRef::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\"\x8c\t\n\x0cCostGraphDef\x121\n\x04node\x18\x01\x20\x03(\x0b2\ + \x1d.tensorflow.CostGraphDef.NodeR\x04node\x12;\n\x04cost\x18\x02\x20\ + \x03(\x0b2'.tensorflow.CostGraphDef.AggregatedCostR\x04cost\x1a\xc7\x07\ + \n\x04Node\x12\x12\n\x04name\x18\x01\x20\x01(\tR\x04name\x12\x16\n\x06de\ + vice\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.InputInfoR\tinputInfo\x12I\n\x0boutput_info\x18\x05\x20\x03(\x0b2(\ + .tensorflow.CostGraphDef.Node.OutputInfoR\noutputInfo\x122\n\x15temporar\ + y_memory_size\x18\x06\x20\x01(\x03R\x13temporaryMemorySize\x124\n\x16per\ + sistent_memory_size\x18\x0c\x20\x01(\x03R\x14persistentMemorySize\x125\n\ + \x15host_temp_memory_size\x18\n\x20\x01(\x03R\x12hostTempMemorySizeB\x02\ + \x18\x01\x129\n\x17device_temp_memory_size\x18\x0b\x20\x01(\x03R\x14devi\ + ceTempMemorySizeB\x02\x18\x01\x12E\n\x1ddevice_persistent_memory_size\ + \x18\x10\x20\x01(\x03R\x1adevicePersistentMemorySizeB\x02\x18\x01\x12!\n\ + \x0ccompute_cost\x18\t\x20\x01(\x03R\x0bcomputeCost\x12!\n\x0ccompute_ti\ + me\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\ + \x07isFinal\x12#\n\rcontrol_input\x18\x08\x20\x03(\x05R\x0ccontrolInput\ + \x12\x1e\n\ninaccurate\x18\x11\x20\x01(\x08R\ninaccurate\x1aY\n\tInputIn\ + fo\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\x05dtype\x1aB\n\x0eA\ + ggregatedCost\x12\x12\n\x04cost\x18\x01\x20\x01(\x02R\x04cost\x12\x1c\n\ + \tdimension\x18\x02\x20\x01(\tR\tdimensionB\x83\x01\n\x18org.tensorflow.\ + frameworkB\x0fCostGraphProtosP\x01ZQgithub.com/tensorflow/tensorflow/ten\ + sorflow/go/core/framework/cost_graph_go_proto\xf8\x01\x01b\x06proto3\ +"; + +static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT; + +fn parse_descriptor_proto() -> ::protobuf::descriptor::FileDescriptorProto { + ::protobuf::Message::parse_from_bytes(file_descriptor_proto_data).unwrap() +} + +pub fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto { + file_descriptor_proto_lazy.get(|| { + parse_descriptor_proto() + }) +} diff --git a/src/protos/debug.rs b/src/protos/debug.rs new file mode 100644 index 0000000000..a3d74e3376 --- /dev/null +++ b/src/protos/debug.rs @@ -0,0 +1,1082 @@ +// This file is generated by rust-protobuf 2.25.1. Do not edit +// @generated + +// https://github.com/rust-lang/rust-clippy/issues/702 +#![allow(unknown_lints)] +#![allow(clippy::all)] + +#![allow(unused_attributes)] +#![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(unused_imports)] +#![allow(unused_results)] +//! Generated file from `tensorflow/core/protobuf/debug.proto` + +/// Generated files are compatible only with the same version +/// of protobuf runtime. +// const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_25_1; + +#[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: ::std::boxed::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 descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "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_pb_name::( + "DebugTensorWatch", + fields, + file_descriptor_proto() + ) + }) + } + + fn default_instance() -> &'static DebugTensorWatch { + static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; + 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::ReflectValueRef { + ::protobuf::reflect::ReflectValueRef::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: ::std::boxed::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 descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( + "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_pb_name::( + "DebugOptions", + fields, + file_descriptor_proto() + ) + }) + } + + fn default_instance() -> &'static DebugOptions { + static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; + 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::ReflectValueRef { + ::protobuf::reflect::ReflectValueRef::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: ::std::boxed::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 descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "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_pb_name::( + "DebuggedSourceFile", + fields, + file_descriptor_proto() + ) + }) + } + + fn default_instance() -> &'static DebuggedSourceFile { + static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; + 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::ReflectValueRef { + ::protobuf::reflect::ReflectValueRef::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: ::std::boxed::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 descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( + "source_files", + |m: &DebuggedSourceFiles| { &m.source_files }, + |m: &mut DebuggedSourceFiles| { &mut m.source_files }, + )); + ::protobuf::reflect::MessageDescriptor::new_pb_name::( + "DebuggedSourceFiles", + fields, + file_descriptor_proto() + ) + }) + } + + fn default_instance() -> &'static DebuggedSourceFiles { + static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; + 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::ReflectValueRef { + ::protobuf::reflect::ReflectValueRef::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\x0bsourceFilesB\x83\x01\n\x18org.tensorflow.frameworkB\x0bDebug\ + ProtosP\x01ZUgithub.com/tensorflow/tensorflow/tensorflow/go/core/protobu\ + f/for_core_protos_go_proto\xf8\x01\x01b\x06proto3\ +"; + +static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT; + +fn parse_descriptor_proto() -> ::protobuf::descriptor::FileDescriptorProto { + ::protobuf::Message::parse_from_bytes(file_descriptor_proto_data).unwrap() +} + +pub fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto { + file_descriptor_proto_lazy.get(|| { + parse_descriptor_proto() + }) +} diff --git a/src/protos/rewriter_config.rs b/src/protos/rewriter_config.rs new file mode 100644 index 0000000000..8583031ae9 --- /dev/null +++ b/src/protos/rewriter_config.rs @@ -0,0 +1,2190 @@ +// This file is generated by rust-protobuf 2.25.1. Do not edit +// @generated + +// https://github.com/rust-lang/rust-clippy/issues/702 +#![allow(unknown_lints)] +#![allow(clippy::all)] + +#![allow(unused_attributes)] +#![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(unused_imports)] +#![allow(unused_results)] +//! Generated file from `tensorflow/core/protobuf/rewriter_config.proto` + +/// Generated files are compatible only with the same version +/// of protobuf runtime. +// const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_25_1; + +#[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: ::std::boxed::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 descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::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_pb_name::( + "AutoParallelOptions", + fields, + file_descriptor_proto() + ) + }) + } + + fn default_instance() -> &'static AutoParallelOptions { + static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; + 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::ReflectValueRef { + ::protobuf::reflect::ReflectValueRef::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: ::std::boxed::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 descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "enable_op", + |m: &ScopedAllocatorOptions| { &m.enable_op }, + |m: &mut ScopedAllocatorOptions| { &mut m.enable_op }, + )); + ::protobuf::reflect::MessageDescriptor::new_pb_name::( + "ScopedAllocatorOptions", + fields, + file_descriptor_proto() + ) + }) + } + + fn default_instance() -> &'static ScopedAllocatorOptions { + static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; + 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::ReflectValueRef { + ::protobuf::reflect::ReflectValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct RewriterConfig { + // message fields + pub cpu_layout_conversion: RewriterConfig_CpuLayout, + pub layout_optimizer: RewriterConfig_Toggle, + pub constant_folding: RewriterConfig_Toggle, + pub shape_optimization: RewriterConfig_Toggle, + pub remapping: RewriterConfig_Toggle, + pub common_subgraph_elimination: 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 implementation_selector: RewriterConfig_Toggle, + pub auto_mixed_precision: RewriterConfig_Toggle, + pub auto_mixed_precision_mkl: RewriterConfig_Toggle, + pub disable_meta_optimizer: bool, + pub use_plugin_optimizers: RewriterConfig_Toggle, + pub meta_optimizer_iterations: RewriterConfig_NumIterationsType, + pub min_graph_nodes: i32, + pub experimental_disable_compressed_tensor_optimization: bool, + pub experimental_disable_folding_quantization_emulation: bool, + 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, + pub inter_optimizer_verifier_config: ::protobuf::SingularPtrField, + pub post_optimization_verifier_config: ::protobuf::SingularPtrField, + // 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.CpuLayout cpu_layout_conversion = 50; + + + pub fn get_cpu_layout_conversion(&self) -> RewriterConfig_CpuLayout { + self.cpu_layout_conversion + } + pub fn clear_cpu_layout_conversion(&mut self) { + self.cpu_layout_conversion = RewriterConfig_CpuLayout::NO_CONVERSION_ON_CPU; + } + + // Param is passed by value, moved + pub fn set_cpu_layout_conversion(&mut self, v: RewriterConfig_CpuLayout) { + self.cpu_layout_conversion = v; + } + + // .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 common_subgraph_elimination = 24; + + + pub fn get_common_subgraph_elimination(&self) -> RewriterConfig_Toggle { + self.common_subgraph_elimination + } + pub fn clear_common_subgraph_elimination(&mut self) { + self.common_subgraph_elimination = RewriterConfig_Toggle::DEFAULT; + } + + // Param is passed by value, moved + pub fn set_common_subgraph_elimination(&mut self, v: RewriterConfig_Toggle) { + self.common_subgraph_elimination = 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; + } + + // .tensorflow.RewriterConfig.Toggle implementation_selector = 22; + + + pub fn get_implementation_selector(&self) -> RewriterConfig_Toggle { + self.implementation_selector + } + pub fn clear_implementation_selector(&mut self) { + self.implementation_selector = RewriterConfig_Toggle::DEFAULT; + } + + // Param is passed by value, moved + pub fn set_implementation_selector(&mut self, v: RewriterConfig_Toggle) { + self.implementation_selector = v; + } + + // .tensorflow.RewriterConfig.Toggle auto_mixed_precision = 23; + + + pub fn get_auto_mixed_precision(&self) -> RewriterConfig_Toggle { + self.auto_mixed_precision + } + pub fn clear_auto_mixed_precision(&mut self) { + self.auto_mixed_precision = RewriterConfig_Toggle::DEFAULT; + } + + // Param is passed by value, moved + pub fn set_auto_mixed_precision(&mut self, v: RewriterConfig_Toggle) { + self.auto_mixed_precision = v; + } + + // .tensorflow.RewriterConfig.Toggle auto_mixed_precision_mkl = 25; + + + pub fn get_auto_mixed_precision_mkl(&self) -> RewriterConfig_Toggle { + self.auto_mixed_precision_mkl + } + pub fn clear_auto_mixed_precision_mkl(&mut self) { + self.auto_mixed_precision_mkl = RewriterConfig_Toggle::DEFAULT; + } + + // Param is passed by value, moved + pub fn set_auto_mixed_precision_mkl(&mut self, v: RewriterConfig_Toggle) { + self.auto_mixed_precision_mkl = 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.Toggle use_plugin_optimizers = 28; + + + pub fn get_use_plugin_optimizers(&self) -> RewriterConfig_Toggle { + self.use_plugin_optimizers + } + pub fn clear_use_plugin_optimizers(&mut self) { + self.use_plugin_optimizers = RewriterConfig_Toggle::DEFAULT; + } + + // Param is passed by value, moved + pub fn set_use_plugin_optimizers(&mut self, v: RewriterConfig_Toggle) { + self.use_plugin_optimizers = 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; + } + + // bool experimental_disable_compressed_tensor_optimization = 26; + + + pub fn get_experimental_disable_compressed_tensor_optimization(&self) -> bool { + self.experimental_disable_compressed_tensor_optimization + } + pub fn clear_experimental_disable_compressed_tensor_optimization(&mut self) { + self.experimental_disable_compressed_tensor_optimization = false; + } + + // Param is passed by value, moved + pub fn set_experimental_disable_compressed_tensor_optimization(&mut self, v: bool) { + self.experimental_disable_compressed_tensor_optimization = v; + } + + // bool experimental_disable_folding_quantization_emulation = 27; + + + pub fn get_experimental_disable_folding_quantization_emulation(&self) -> bool { + self.experimental_disable_folding_quantization_emulation + } + pub fn clear_experimental_disable_folding_quantization_emulation(&mut self) { + self.experimental_disable_folding_quantization_emulation = false; + } + + // Param is passed by value, moved + pub fn set_experimental_disable_folding_quantization_emulation(&mut self, v: bool) { + self.experimental_disable_folding_quantization_emulation = 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(|| ::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(|| ::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()) + } + + // .tensorflow.VerifierConfig inter_optimizer_verifier_config = 300; + + + pub fn get_inter_optimizer_verifier_config(&self) -> &super::verifier_config::VerifierConfig { + self.inter_optimizer_verifier_config.as_ref().unwrap_or_else(|| ::default_instance()) + } + pub fn clear_inter_optimizer_verifier_config(&mut self) { + self.inter_optimizer_verifier_config.clear(); + } + + pub fn has_inter_optimizer_verifier_config(&self) -> bool { + self.inter_optimizer_verifier_config.is_some() + } + + // Param is passed by value, moved + pub fn set_inter_optimizer_verifier_config(&mut self, v: super::verifier_config::VerifierConfig) { + self.inter_optimizer_verifier_config = ::protobuf::SingularPtrField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_inter_optimizer_verifier_config(&mut self) -> &mut super::verifier_config::VerifierConfig { + if self.inter_optimizer_verifier_config.is_none() { + self.inter_optimizer_verifier_config.set_default(); + } + self.inter_optimizer_verifier_config.as_mut().unwrap() + } + + // Take field + pub fn take_inter_optimizer_verifier_config(&mut self) -> super::verifier_config::VerifierConfig { + self.inter_optimizer_verifier_config.take().unwrap_or_else(|| super::verifier_config::VerifierConfig::new()) + } + + // .tensorflow.VerifierConfig post_optimization_verifier_config = 301; + + + pub fn get_post_optimization_verifier_config(&self) -> &super::verifier_config::VerifierConfig { + self.post_optimization_verifier_config.as_ref().unwrap_or_else(|| ::default_instance()) + } + pub fn clear_post_optimization_verifier_config(&mut self) { + self.post_optimization_verifier_config.clear(); + } + + pub fn has_post_optimization_verifier_config(&self) -> bool { + self.post_optimization_verifier_config.is_some() + } + + // Param is passed by value, moved + pub fn set_post_optimization_verifier_config(&mut self, v: super::verifier_config::VerifierConfig) { + self.post_optimization_verifier_config = ::protobuf::SingularPtrField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_post_optimization_verifier_config(&mut self) -> &mut super::verifier_config::VerifierConfig { + if self.post_optimization_verifier_config.is_none() { + self.post_optimization_verifier_config.set_default(); + } + self.post_optimization_verifier_config.as_mut().unwrap() + } + + // Take field + pub fn take_post_optimization_verifier_config(&mut self) -> super::verifier_config::VerifierConfig { + self.post_optimization_verifier_config.take().unwrap_or_else(|| super::verifier_config::VerifierConfig::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; + } + }; + for v in &self.inter_optimizer_verifier_config { + if !v.is_initialized() { + return false; + } + }; + for v in &self.post_optimization_verifier_config { + 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 { + 50 => { + ::protobuf::rt::read_proto3_enum_with_unknown_fields_into(wire_type, is, &mut self.cpu_layout_conversion, 50, &mut self.unknown_fields)? + }, + 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)? + }, + 24 => { + ::protobuf::rt::read_proto3_enum_with_unknown_fields_into(wire_type, is, &mut self.common_subgraph_elimination, 24, &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)? + }, + 22 => { + ::protobuf::rt::read_proto3_enum_with_unknown_fields_into(wire_type, is, &mut self.implementation_selector, 22, &mut self.unknown_fields)? + }, + 23 => { + ::protobuf::rt::read_proto3_enum_with_unknown_fields_into(wire_type, is, &mut self.auto_mixed_precision, 23, &mut self.unknown_fields)? + }, + 25 => { + ::protobuf::rt::read_proto3_enum_with_unknown_fields_into(wire_type, is, &mut self.auto_mixed_precision_mkl, 25, &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; + }, + 28 => { + ::protobuf::rt::read_proto3_enum_with_unknown_fields_into(wire_type, is, &mut self.use_plugin_optimizers, 28, &mut self.unknown_fields)? + }, + 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; + }, + 26 => { + 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.experimental_disable_compressed_tensor_optimization = tmp; + }, + 27 => { + 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.experimental_disable_folding_quantization_emulation = 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)?; + }, + 300 => { + ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.inter_optimizer_verifier_config)?; + }, + 301 => { + ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.post_optimization_verifier_config)?; + }, + _ => { + ::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.cpu_layout_conversion != RewriterConfig_CpuLayout::NO_CONVERSION_ON_CPU { + my_size += ::protobuf::rt::enum_size(50, self.cpu_layout_conversion); + } + 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.common_subgraph_elimination != RewriterConfig_Toggle::DEFAULT { + my_size += ::protobuf::rt::enum_size(24, self.common_subgraph_elimination); + } + 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.implementation_selector != RewriterConfig_Toggle::DEFAULT { + my_size += ::protobuf::rt::enum_size(22, self.implementation_selector); + } + if self.auto_mixed_precision != RewriterConfig_Toggle::DEFAULT { + my_size += ::protobuf::rt::enum_size(23, self.auto_mixed_precision); + } + if self.auto_mixed_precision_mkl != RewriterConfig_Toggle::DEFAULT { + my_size += ::protobuf::rt::enum_size(25, self.auto_mixed_precision_mkl); + } + if self.disable_meta_optimizer != false { + my_size += 3; + } + if self.use_plugin_optimizers != RewriterConfig_Toggle::DEFAULT { + my_size += ::protobuf::rt::enum_size(28, self.use_plugin_optimizers); + } + 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.experimental_disable_compressed_tensor_optimization != false { + my_size += 3; + } + if self.experimental_disable_folding_quantization_emulation != false { + my_size += 3; + } + 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; + }; + if let Some(ref v) = self.inter_optimizer_verifier_config.as_ref() { + let len = v.compute_size(); + my_size += 2 + ::protobuf::rt::compute_raw_varint32_size(len) + len; + } + if let Some(ref v) = self.post_optimization_verifier_config.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<()> { + if self.cpu_layout_conversion != RewriterConfig_CpuLayout::NO_CONVERSION_ON_CPU { + os.write_enum(50, ::protobuf::ProtobufEnum::value(&self.cpu_layout_conversion))?; + } + if self.layout_optimizer != RewriterConfig_Toggle::DEFAULT { + os.write_enum(1, ::protobuf::ProtobufEnum::value(&self.layout_optimizer))?; + } + if self.constant_folding != RewriterConfig_Toggle::DEFAULT { + os.write_enum(3, ::protobuf::ProtobufEnum::value(&self.constant_folding))?; + } + if self.shape_optimization != RewriterConfig_Toggle::DEFAULT { + os.write_enum(13, ::protobuf::ProtobufEnum::value(&self.shape_optimization))?; + } + if self.remapping != RewriterConfig_Toggle::DEFAULT { + os.write_enum(14, ::protobuf::ProtobufEnum::value(&self.remapping))?; + } + if self.common_subgraph_elimination != RewriterConfig_Toggle::DEFAULT { + os.write_enum(24, ::protobuf::ProtobufEnum::value(&self.common_subgraph_elimination))?; + } + if self.arithmetic_optimization != RewriterConfig_Toggle::DEFAULT { + os.write_enum(7, ::protobuf::ProtobufEnum::value(&self.arithmetic_optimization))?; + } + if self.dependency_optimization != RewriterConfig_Toggle::DEFAULT { + os.write_enum(8, ::protobuf::ProtobufEnum::value(&self.dependency_optimization))?; + } + if self.loop_optimization != RewriterConfig_Toggle::DEFAULT { + os.write_enum(9, ::protobuf::ProtobufEnum::value(&self.loop_optimization))?; + } + if self.function_optimization != RewriterConfig_Toggle::DEFAULT { + os.write_enum(10, ::protobuf::ProtobufEnum::value(&self.function_optimization))?; + } + if self.debug_stripper != RewriterConfig_Toggle::DEFAULT { + os.write_enum(11, ::protobuf::ProtobufEnum::value(&self.debug_stripper))?; + } + 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, ::protobuf::ProtobufEnum::value(&self.scoped_allocator_optimization))?; + } + if self.pin_to_host_optimization != RewriterConfig_Toggle::DEFAULT { + os.write_enum(18, ::protobuf::ProtobufEnum::value(&self.pin_to_host_optimization))?; + } + if self.implementation_selector != RewriterConfig_Toggle::DEFAULT { + os.write_enum(22, ::protobuf::ProtobufEnum::value(&self.implementation_selector))?; + } + if self.auto_mixed_precision != RewriterConfig_Toggle::DEFAULT { + os.write_enum(23, ::protobuf::ProtobufEnum::value(&self.auto_mixed_precision))?; + } + if self.auto_mixed_precision_mkl != RewriterConfig_Toggle::DEFAULT { + os.write_enum(25, ::protobuf::ProtobufEnum::value(&self.auto_mixed_precision_mkl))?; + } + if self.disable_meta_optimizer != false { + os.write_bool(19, self.disable_meta_optimizer)?; + } + if self.use_plugin_optimizers != RewriterConfig_Toggle::DEFAULT { + os.write_enum(28, ::protobuf::ProtobufEnum::value(&self.use_plugin_optimizers))?; + } + if self.meta_optimizer_iterations != RewriterConfig_NumIterationsType::DEFAULT_NUM_ITERS { + os.write_enum(12, ::protobuf::ProtobufEnum::value(&self.meta_optimizer_iterations))?; + } + if self.min_graph_nodes != 0 { + os.write_int32(17, self.min_graph_nodes)?; + } + if self.experimental_disable_compressed_tensor_optimization != false { + os.write_bool(26, self.experimental_disable_compressed_tensor_optimization)?; + } + if self.experimental_disable_folding_quantization_emulation != false { + os.write_bool(27, self.experimental_disable_folding_quantization_emulation)?; + } + if self.memory_optimization != RewriterConfig_MemOptType::DEFAULT_MEM_OPT { + os.write_enum(4, ::protobuf::ProtobufEnum::value(&self.memory_optimization))?; + } + 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)?; + }; + if let Some(ref v) = self.inter_optimizer_verifier_config.as_ref() { + os.write_tag(300, ::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.post_optimization_verifier_config.as_ref() { + os.write_tag(301, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; + } + os.write_unknown_fields(self.get_unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn get_cached_size(&self) -> u32 { + self.cached_size.get() + } + + fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { + &self.unknown_fields + } + + fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { + &mut self.unknown_fields + } + + fn as_any(&self) -> &dyn (::std::any::Any) { + self as &dyn (::std::any::Any) + } + fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { + self as &mut dyn (::std::any::Any) + } + fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> RewriterConfig { + RewriterConfig::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeEnum>( + "cpu_layout_conversion", + |m: &RewriterConfig| { &m.cpu_layout_conversion }, + |m: &mut RewriterConfig| { &mut m.cpu_layout_conversion }, + )); + 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>( + "common_subgraph_elimination", + |m: &RewriterConfig| { &m.common_subgraph_elimination }, + |m: &mut RewriterConfig| { &mut m.common_subgraph_elimination }, + )); + 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::ProtobufTypeEnum>( + "implementation_selector", + |m: &RewriterConfig| { &m.implementation_selector }, + |m: &mut RewriterConfig| { &mut m.implementation_selector }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeEnum>( + "auto_mixed_precision", + |m: &RewriterConfig| { &m.auto_mixed_precision }, + |m: &mut RewriterConfig| { &mut m.auto_mixed_precision }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeEnum>( + "auto_mixed_precision_mkl", + |m: &RewriterConfig| { &m.auto_mixed_precision_mkl }, + |m: &mut RewriterConfig| { &mut m.auto_mixed_precision_mkl }, + )); + 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>( + "use_plugin_optimizers", + |m: &RewriterConfig| { &m.use_plugin_optimizers }, + |m: &mut RewriterConfig| { &mut m.use_plugin_optimizers }, + )); + 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::ProtobufTypeBool>( + "experimental_disable_compressed_tensor_optimization", + |m: &RewriterConfig| { &m.experimental_disable_compressed_tensor_optimization }, + |m: &mut RewriterConfig| { &mut m.experimental_disable_compressed_tensor_optimization }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBool>( + "experimental_disable_folding_quantization_emulation", + |m: &RewriterConfig| { &m.experimental_disable_folding_quantization_emulation }, + |m: &mut RewriterConfig| { &mut m.experimental_disable_folding_quantization_emulation }, + )); + 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 }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( + "inter_optimizer_verifier_config", + |m: &RewriterConfig| { &m.inter_optimizer_verifier_config }, + |m: &mut RewriterConfig| { &mut m.inter_optimizer_verifier_config }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( + "post_optimization_verifier_config", + |m: &RewriterConfig| { &m.post_optimization_verifier_config }, + |m: &mut RewriterConfig| { &mut m.post_optimization_verifier_config }, + )); + ::protobuf::reflect::MessageDescriptor::new_pb_name::( + "RewriterConfig", + fields, + file_descriptor_proto() + ) + }) + } + + fn default_instance() -> &'static RewriterConfig { + static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; + instance.get(RewriterConfig::new) + } +} + +impl ::protobuf::Clear for RewriterConfig { + fn clear(&mut self) { + self.cpu_layout_conversion = RewriterConfig_CpuLayout::NO_CONVERSION_ON_CPU; + self.layout_optimizer = RewriterConfig_Toggle::DEFAULT; + self.constant_folding = RewriterConfig_Toggle::DEFAULT; + self.shape_optimization = RewriterConfig_Toggle::DEFAULT; + self.remapping = RewriterConfig_Toggle::DEFAULT; + self.common_subgraph_elimination = 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.implementation_selector = RewriterConfig_Toggle::DEFAULT; + self.auto_mixed_precision = RewriterConfig_Toggle::DEFAULT; + self.auto_mixed_precision_mkl = RewriterConfig_Toggle::DEFAULT; + self.disable_meta_optimizer = false; + self.use_plugin_optimizers = RewriterConfig_Toggle::DEFAULT; + self.meta_optimizer_iterations = RewriterConfig_NumIterationsType::DEFAULT_NUM_ITERS; + self.min_graph_nodes = 0; + self.experimental_disable_compressed_tensor_optimization = false; + self.experimental_disable_folding_quantization_emulation = false; + 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.inter_optimizer_verifier_config.clear(); + self.post_optimization_verifier_config.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::ReflectValueRef { + ::protobuf::reflect::ReflectValueRef::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: ::std::boxed::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 descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "name", + |m: &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_pb_name::( + "RewriterConfig.CustomGraphOptimizer", + fields, + file_descriptor_proto() + ) + }) + } + + fn default_instance() -> &'static RewriterConfig_CustomGraphOptimizer { + static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; + 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::ReflectValueRef { + ::protobuf::reflect::ReflectValueRef::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 descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::EnumDescriptor> = ::protobuf::rt::LazyV2::INIT; + descriptor.get(|| { + ::protobuf::reflect::EnumDescriptor::new_pb_name::("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::ReflectValueRef { + ::protobuf::reflect::ReflectValueRef::Enum(::protobuf::ProtobufEnum::descriptor(self)) + } +} + +#[derive(Clone,PartialEq,Eq,Debug,Hash)] +pub enum RewriterConfig_CpuLayout { + NO_CONVERSION_ON_CPU = 0, + NCHW_TO_NHWC = 1, + NHWC_TO_NCHW = 2, +} + +impl ::protobuf::ProtobufEnum for RewriterConfig_CpuLayout { + fn value(&self) -> i32 { + *self as i32 + } + + fn from_i32(value: i32) -> ::std::option::Option { + match value { + 0 => ::std::option::Option::Some(RewriterConfig_CpuLayout::NO_CONVERSION_ON_CPU), + 1 => ::std::option::Option::Some(RewriterConfig_CpuLayout::NCHW_TO_NHWC), + 2 => ::std::option::Option::Some(RewriterConfig_CpuLayout::NHWC_TO_NCHW), + _ => ::std::option::Option::None + } + } + + fn values() -> &'static [Self] { + static values: &'static [RewriterConfig_CpuLayout] = &[ + RewriterConfig_CpuLayout::NO_CONVERSION_ON_CPU, + RewriterConfig_CpuLayout::NCHW_TO_NHWC, + RewriterConfig_CpuLayout::NHWC_TO_NCHW, + ]; + values + } + + fn enum_descriptor_static() -> &'static ::protobuf::reflect::EnumDescriptor { + static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::EnumDescriptor> = ::protobuf::rt::LazyV2::INIT; + descriptor.get(|| { + ::protobuf::reflect::EnumDescriptor::new_pb_name::("RewriterConfig.CpuLayout", file_descriptor_proto()) + }) + } +} + +impl ::std::marker::Copy for RewriterConfig_CpuLayout { +} + +impl ::std::default::Default for RewriterConfig_CpuLayout { + fn default() -> Self { + RewriterConfig_CpuLayout::NO_CONVERSION_ON_CPU + } +} + +impl ::protobuf::reflect::ProtobufValue for RewriterConfig_CpuLayout { + fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { + ::protobuf::reflect::ReflectValueRef::Enum(::protobuf::ProtobufEnum::descriptor(self)) + } +} + +#[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 descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::EnumDescriptor> = ::protobuf::rt::LazyV2::INIT; + descriptor.get(|| { + ::protobuf::reflect::EnumDescriptor::new_pb_name::("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::ReflectValueRef { + ::protobuf::reflect::ReflectValueRef::Enum(::protobuf::ProtobufEnum::descriptor(self)) + } +} + +#[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 descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::EnumDescriptor> = ::protobuf::rt::LazyV2::INIT; + descriptor.get(|| { + ::protobuf::reflect::EnumDescriptor::new_pb_name::("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::ReflectValueRef { + ::protobuf::reflect::ReflectValueRef::Enum(::protobuf::ProtobufEnum::descriptor(self)) + } +} + +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\x1a.tensorflow/core/protobuf/ve\ + rifier_config.proto\"P\n\x13AutoParallelOptions\x12\x16\n\x06enable\x18\ + \x01\x20\x01(\x08R\x06enable\x12!\n\x0cnum_replicas\x18\x02\x20\x01(\x05\ + R\x0bnumReplicas\"5\n\x16ScopedAllocatorOptions\x12\x1b\n\tenable_op\x18\ + \x01\x20\x03(\tR\x08enableOp\"\xff\x19\n\x0eRewriterConfig\x12X\n\x15cpu\ + _layout_conversion\x182\x20\x01(\x0e2$.tensorflow.RewriterConfig.CpuLayo\ + utR\x13cpuLayoutConversion\x12L\n\x10layout_optimizer\x18\x01\x20\x01(\ + \x0e2!.tensorflow.RewriterConfig.ToggleR\x0flayoutOptimizer\x12L\n\x10co\ + nstant_folding\x18\x03\x20\x01(\x0e2!.tensorflow.RewriterConfig.ToggleR\ + \x0fconstantFolding\x12P\n\x12shape_optimization\x18\r\x20\x01(\x0e2!.te\ + nsorflow.RewriterConfig.ToggleR\x11shapeOptimization\x12?\n\tremapping\ + \x18\x0e\x20\x01(\x0e2!.tensorflow.RewriterConfig.ToggleR\tremapping\x12\ + a\n\x1bcommon_subgraph_elimination\x18\x18\x20\x01(\x0e2!.tensorflow.Rew\ + riterConfig.ToggleR\x19commonSubgraphElimination\x12Z\n\x17arithmetic_op\ + timization\x18\x07\x20\x01(\x0e2!.tensorflow.RewriterConfig.ToggleR\x16a\ + rithmeticOptimization\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\x12Z\n\x17implemen\ + tation_selector\x18\x16\x20\x01(\x0e2!.tensorflow.RewriterConfig.ToggleR\ + \x16implementationSelector\x12S\n\x14auto_mixed_precision\x18\x17\x20\ + \x01(\x0e2!.tensorflow.RewriterConfig.ToggleR\x12autoMixedPrecision\x12Z\ + \n\x18auto_mixed_precision_mkl\x18\x19\x20\x01(\x0e2!.tensorflow.Rewrite\ + rConfig.ToggleR\x15autoMixedPrecisionMkl\x124\n\x16disable_meta_optimize\ + r\x18\x13\x20\x01(\x08R\x14disableMetaOptimizer\x12U\n\x15use_plugin_opt\ + imizers\x18\x1c\x20\x01(\x0e2!.tensorflow.RewriterConfig.ToggleR\x13useP\ + luginOptimizers\x12h\n\x19meta_optimizer_iterations\x18\x0c\x20\x01(\x0e\ + 2,.tensorflow.RewriterConfig.NumIterationsTypeR\x17metaOptimizerIteratio\ + ns\x12&\n\x0fmin_graph_nodes\x18\x11\x20\x01(\x05R\rminGraphNodes\x12l\n\ + 3experimental_disable_compressed_tensor_optimization\x18\x1a\x20\x01(\ + \x08R/experimentalDisableCompressedTensorOptimization\x12l\n3experimenta\ + l_disable_folding_quantization_emulation\x18\x1b\x20\x01(\x08R/experimen\ + talDisableFoldingQuantizationEmulation\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\x12b\n\x1finter_optimizer_verifier_config\x18\xac\x02\ + \x20\x01(\x0b2\x1a.tensorflow.VerifierConfigR\x1cinterOptimizerVerifierC\ + onfig\x12f\n!post_optimization_verifier_config\x18\xad\x02\x20\x01(\x0b2\ + \x1a.tensorflow.VerifierConfigR\x1epostOptimizationVerifierConfig\x1a\ + \xea\x01\n\x14CustomGraphOptimizer\x12\x12\n\x04name\x18\x01\x20\x01(\tR\ + \x04name\x12f\n\rparameter_map\x18\x02\x20\x03(\x0b2A.tensorflow.Rewrite\ + rConfig.CustomGraphOptimizer.ParameterMapEntryR\x0cparameterMap\x1aV\n\ + \x11ParameterMapEntry\x12\x10\n\x03key\x18\x01\x20\x01(\tR\x03key\x12+\n\ + \x05value\x18\x02\x20\x01(\x0b2\x15.tensorflow.AttrValueR\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\"I\n\tCpuLayout\ + \x12\x18\n\x14NO_CONVERSION_ON_CPU\x10\0\x12\x10\n\x0cNCHW_TO_NHWC\x10\ + \x01\x12\x10\n\x0cNHWC_TO_NCHW\x10\x02\"<\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\x13SWAPPI\ + NG_HEURISTICS\x10\x04\x12\x1c\n\x18RECOMPUTATION_HEURISTICS\x10\x05\x12\ + \x19\n\x15SCHEDULING_HEURISTICS\x10\x06\x12\x0e\n\nHEURISTICS\x10\x03B\ + \x8c\x01\n\x18org.tensorflow.frameworkB\x14RewriterConfigProtosP\x01ZUgi\ + thub.com/tensorflow/tensorflow/tensorflow/go/core/protobuf/for_core_prot\ + os_go_proto\xf8\x01\x01b\x06proto3\ +"; + +static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT; + +fn parse_descriptor_proto() -> ::protobuf::descriptor::FileDescriptorProto { + ::protobuf::Message::parse_from_bytes(file_descriptor_proto_data).unwrap() +} + +pub fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto { + file_descriptor_proto_lazy.get(|| { + parse_descriptor_proto() + }) +} diff --git a/src/protos/step_stats.rs b/src/protos/step_stats.rs new file mode 100644 index 0000000000..777e05ea11 --- /dev/null +++ b/src/protos/step_stats.rs @@ -0,0 +1,2371 @@ +// This file is generated by rust-protobuf 2.25.1. Do not edit +// @generated + +// https://github.com/rust-lang/rust-clippy/issues/702 +#![allow(unknown_lints)] +#![allow(clippy::all)] + +#![allow(unused_attributes)] +#![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(unused_imports)] +#![allow(unused_results)] +//! Generated file from `tensorflow/core/framework/step_stats.proto` + +/// Generated files are compatible only with the same version +/// of protobuf runtime. +// const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_25_1; + +#[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: ::std::boxed::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 descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt64>( + "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_pb_name::( + "AllocationRecord", + fields, + file_descriptor_proto() + ) + }) + } + + fn default_instance() -> &'static AllocationRecord { + static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; + 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::ReflectValueRef { + ::protobuf::reflect::ReflectValueRef::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: ::std::boxed::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 descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "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_pb_name::( + "AllocatorMemoryUsed", + fields, + file_descriptor_proto() + ) + }) + } + + fn default_instance() -> &'static AllocatorMemoryUsed { + static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; + 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::ReflectValueRef { + ::protobuf::reflect::ReflectValueRef::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(|| ::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: ::std::boxed::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 descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt32>( + "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_pb_name::( + "NodeOutput", + fields, + file_descriptor_proto() + ) + }) + } + + fn default_instance() -> &'static NodeOutput { + static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; + 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::ReflectValueRef { + ::protobuf::reflect::ReflectValueRef::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: ::std::boxed::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 descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt64>( + "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_pb_name::( + "MemoryStats", + fields, + file_descriptor_proto() + ) + }) + } + + fn default_instance() -> &'static MemoryStats { + static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; + 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::ReflectValueRef { + ::protobuf::reflect::ReflectValueRef::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(|| ::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: ::std::boxed::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 descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "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_pb_name::( + "NodeExecStats", + fields, + file_descriptor_proto() + ) + }) + } + + fn default_instance() -> &'static NodeExecStats { + static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; + 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::ReflectValueRef { + ::protobuf::reflect::ReflectValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct DeviceStepStats { + // message fields + pub device: ::std::string::String, + pub node_stats: ::protobuf::RepeatedField, + pub thread_names: ::std::collections::HashMap, + // 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()) + } + + // repeated .tensorflow.DeviceStepStats.ThreadNamesEntry thread_names = 3; + + + pub fn get_thread_names(&self) -> &::std::collections::HashMap { + &self.thread_names + } + pub fn clear_thread_names(&mut self) { + self.thread_names.clear(); + } + + // Param is passed by value, moved + pub fn set_thread_names(&mut self, v: ::std::collections::HashMap) { + self.thread_names = v; + } + + // Mutable pointer to the field. + pub fn mut_thread_names(&mut self) -> &mut ::std::collections::HashMap { + &mut self.thread_names + } + + // Take field + pub fn take_thread_names(&mut self) -> ::std::collections::HashMap { + ::std::mem::replace(&mut self.thread_names, ::std::collections::HashMap::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)?; + }, + 3 => { + ::protobuf::rt::read_map_into::<::protobuf::types::ProtobufTypeUint32, ::protobuf::types::ProtobufTypeString>(wire_type, is, &mut self.thread_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; + 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::compute_map_size::<::protobuf::types::ProtobufTypeUint32, ::protobuf::types::ProtobufTypeString>(3, &self.thread_names); + 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)?; + }; + ::protobuf::rt::write_map_with_cached_sizes::<::protobuf::types::ProtobufTypeUint32, ::protobuf::types::ProtobufTypeString>(3, &self.thread_names, os)?; + os.write_unknown_fields(self.get_unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn get_cached_size(&self) -> u32 { + self.cached_size.get() + } + + fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { + &self.unknown_fields + } + + fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { + &mut self.unknown_fields + } + + fn as_any(&self) -> &dyn (::std::any::Any) { + self as &dyn (::std::any::Any) + } + fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { + self as &mut dyn (::std::any::Any) + } + fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> DeviceStepStats { + DeviceStepStats::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "device", + |m: &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 }, + )); + fields.push(::protobuf::reflect::accessor::make_map_accessor::<_, ::protobuf::types::ProtobufTypeUint32, ::protobuf::types::ProtobufTypeString>( + "thread_names", + |m: &DeviceStepStats| { &m.thread_names }, + |m: &mut DeviceStepStats| { &mut m.thread_names }, + )); + ::protobuf::reflect::MessageDescriptor::new_pb_name::( + "DeviceStepStats", + fields, + file_descriptor_proto() + ) + }) + } + + fn default_instance() -> &'static DeviceStepStats { + static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; + instance.get(DeviceStepStats::new) + } +} + +impl ::protobuf::Clear for DeviceStepStats { + fn clear(&mut self) { + self.device.clear(); + self.node_stats.clear(); + self.thread_names.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::ReflectValueRef { + ::protobuf::reflect::ReflectValueRef::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: ::std::boxed::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 descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( + "dev_stats", + |m: &StepStats| { &m.dev_stats }, + |m: &mut StepStats| { &mut m.dev_stats }, + )); + ::protobuf::reflect::MessageDescriptor::new_pb_name::( + "StepStats", + fields, + file_descriptor_proto() + ) + }) + } + + fn default_instance() -> &'static StepStats { + static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; + 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::ReflectValueRef { + ::protobuf::reflect::ReflectValueRef::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\"\xf4\x01\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\x12O\n\x0cthread_nam\ + es\x18\x03\x20\x03(\x0b2,.tensorflow.DeviceStepStats.ThreadNamesEntryR\ + \x0bthreadNames\x1a>\n\x10ThreadNamesEntry\x12\x10\n\x03key\x18\x01\x20\ + \x01(\rR\x03key\x12\x14\n\x05value\x18\x02\x20\x01(\tR\x05value:\x028\ + \x01\"E\n\tStepStats\x128\n\tdev_stats\x18\x01\x20\x03(\x0b2\x1b.tensorf\ + low.DeviceStepStatsR\x08devStatsB\x83\x01\n\x18org.tensorflow.frameworkB\ + \x0fStepStatsProtosP\x01ZQgithub.com/tensorflow/tensorflow/tensorflow/go\ + /core/framework/step_stats_go_proto\xf8\x01\x01b\x06proto3\ +"; + +static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT; + +fn parse_descriptor_proto() -> ::protobuf::descriptor::FileDescriptorProto { + ::protobuf::Message::parse_from_bytes(file_descriptor_proto_data).unwrap() +} + +pub fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto { + file_descriptor_proto_lazy.get(|| { + parse_descriptor_proto() + }) +} diff --git a/src/protos/tensor_description.rs b/src/protos/tensor_description.rs new file mode 100644 index 0000000000..96380d171c --- /dev/null +++ b/src/protos/tensor_description.rs @@ -0,0 +1,311 @@ +// This file is generated by rust-protobuf 2.25.1. Do not edit +// @generated + +// https://github.com/rust-lang/rust-clippy/issues/702 +#![allow(unknown_lints)] +#![allow(clippy::all)] + +#![allow(unused_attributes)] +#![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(unused_imports)] +#![allow(unused_results)] +//! Generated file from `tensorflow/core/framework/tensor_description.proto` + +/// Generated files are compatible only with the same version +/// of protobuf runtime. +// const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_25_1; + +#[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(|| ::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(|| ::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, ::protobuf::ProtobufEnum::value(&self.dtype))?; + } + if let Some(ref v) = self.shape.as_ref() { + os.write_tag(2, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; + } + if 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: ::std::boxed::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 descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeEnum>( + "dtype", + |m: &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_pb_name::( + "TensorDescription", + fields, + file_descriptor_proto() + ) + }) + } + + fn default_instance() -> &'static TensorDescription { + static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; + 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::ReflectValueRef { + ::protobuf::reflect::ReflectValueRef::Message(self) + } +} + +static file_descriptor_proto_data: &'static [u8] = b"\ + \n2tensorflow/core/framework/tensor_description.proto\x12\ntensorflow\ + \x1a6tensorflow/core/framework/allocation_description.proto\x1a,tensorfl\ + ow/core/framework/tensor_shape.proto\x1a%tensorflow/core/framework/types\ + .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\ + ocationDescriptionB\x93\x01\n\x18org.tensorflow.frameworkB\x17TensorDesc\ + riptionProtosP\x01ZYgithub.com/tensorflow/tensorflow/tensorflow/go/core/\ + framework/tensor_description_go_proto\xf8\x01\x01b\x06proto3\ +"; + +static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT; + +fn parse_descriptor_proto() -> ::protobuf::descriptor::FileDescriptorProto { + ::protobuf::Message::parse_from_bytes(file_descriptor_proto_data).unwrap() +} + +pub fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto { + file_descriptor_proto_lazy.get(|| { + parse_descriptor_proto() + }) +} diff --git a/src/protos/verifier_config.rs b/src/protos/verifier_config.rs new file mode 100644 index 0000000000..59ea391bc9 --- /dev/null +++ b/src/protos/verifier_config.rs @@ -0,0 +1,283 @@ +// This file is generated by rust-protobuf 2.25.1. Do not edit +// @generated + +// https://github.com/rust-lang/rust-clippy/issues/702 +#![allow(unknown_lints)] +#![allow(clippy::all)] + +#![allow(unused_attributes)] +#![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(unused_imports)] +#![allow(unused_results)] +//! Generated file from `tensorflow/core/protobuf/verifier_config.proto` + +/// Generated files are compatible only with the same version +/// of protobuf runtime. +// const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_25_1; + +#[derive(PartialEq,Clone,Default)] +pub struct VerifierConfig { + // message fields + pub verification_timeout_in_ms: i64, + pub structure_verifier: VerifierConfig_Toggle, + // special fields + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, +} + +impl<'a> ::std::default::Default for &'a VerifierConfig { + fn default() -> &'a VerifierConfig { + ::default_instance() + } +} + +impl VerifierConfig { + pub fn new() -> VerifierConfig { + ::std::default::Default::default() + } + + // int64 verification_timeout_in_ms = 1; + + + pub fn get_verification_timeout_in_ms(&self) -> i64 { + self.verification_timeout_in_ms + } + pub fn clear_verification_timeout_in_ms(&mut self) { + self.verification_timeout_in_ms = 0; + } + + // Param is passed by value, moved + pub fn set_verification_timeout_in_ms(&mut self, v: i64) { + self.verification_timeout_in_ms = v; + } + + // .tensorflow.VerifierConfig.Toggle structure_verifier = 2; + + + pub fn get_structure_verifier(&self) -> VerifierConfig_Toggle { + self.structure_verifier + } + pub fn clear_structure_verifier(&mut self) { + self.structure_verifier = VerifierConfig_Toggle::DEFAULT; + } + + // Param is passed by value, moved + pub fn set_structure_verifier(&mut self, v: VerifierConfig_Toggle) { + self.structure_verifier = v; + } +} + +impl ::protobuf::Message for VerifierConfig { + 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.verification_timeout_in_ms = tmp; + }, + 2 => { + ::protobuf::rt::read_proto3_enum_with_unknown_fields_into(wire_type, is, &mut self.structure_verifier, 2, &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.verification_timeout_in_ms != 0 { + my_size += ::protobuf::rt::value_size(1, self.verification_timeout_in_ms, ::protobuf::wire_format::WireTypeVarint); + } + if self.structure_verifier != VerifierConfig_Toggle::DEFAULT { + my_size += ::protobuf::rt::enum_size(2, self.structure_verifier); + } + 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.verification_timeout_in_ms != 0 { + os.write_int64(1, self.verification_timeout_in_ms)?; + } + if self.structure_verifier != VerifierConfig_Toggle::DEFAULT { + os.write_enum(2, ::protobuf::ProtobufEnum::value(&self.structure_verifier))?; + } + os.write_unknown_fields(self.get_unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn get_cached_size(&self) -> u32 { + self.cached_size.get() + } + + fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { + &self.unknown_fields + } + + fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { + &mut self.unknown_fields + } + + fn as_any(&self) -> &dyn (::std::any::Any) { + self as &dyn (::std::any::Any) + } + fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { + self as &mut dyn (::std::any::Any) + } + fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> VerifierConfig { + VerifierConfig::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt64>( + "verification_timeout_in_ms", + |m: &VerifierConfig| { &m.verification_timeout_in_ms }, + |m: &mut VerifierConfig| { &mut m.verification_timeout_in_ms }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeEnum>( + "structure_verifier", + |m: &VerifierConfig| { &m.structure_verifier }, + |m: &mut VerifierConfig| { &mut m.structure_verifier }, + )); + ::protobuf::reflect::MessageDescriptor::new_pb_name::( + "VerifierConfig", + fields, + file_descriptor_proto() + ) + }) + } + + fn default_instance() -> &'static VerifierConfig { + static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; + instance.get(VerifierConfig::new) + } +} + +impl ::protobuf::Clear for VerifierConfig { + fn clear(&mut self) { + self.verification_timeout_in_ms = 0; + self.structure_verifier = VerifierConfig_Toggle::DEFAULT; + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for VerifierConfig { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for VerifierConfig { + fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { + ::protobuf::reflect::ReflectValueRef::Message(self) + } +} + +#[derive(Clone,PartialEq,Eq,Debug,Hash)] +pub enum VerifierConfig_Toggle { + DEFAULT = 0, + ON = 1, + OFF = 2, +} + +impl ::protobuf::ProtobufEnum for VerifierConfig_Toggle { + fn value(&self) -> i32 { + *self as i32 + } + + fn from_i32(value: i32) -> ::std::option::Option { + match value { + 0 => ::std::option::Option::Some(VerifierConfig_Toggle::DEFAULT), + 1 => ::std::option::Option::Some(VerifierConfig_Toggle::ON), + 2 => ::std::option::Option::Some(VerifierConfig_Toggle::OFF), + _ => ::std::option::Option::None + } + } + + fn values() -> &'static [Self] { + static values: &'static [VerifierConfig_Toggle] = &[ + VerifierConfig_Toggle::DEFAULT, + VerifierConfig_Toggle::ON, + VerifierConfig_Toggle::OFF, + ]; + values + } + + fn enum_descriptor_static() -> &'static ::protobuf::reflect::EnumDescriptor { + static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::EnumDescriptor> = ::protobuf::rt::LazyV2::INIT; + descriptor.get(|| { + ::protobuf::reflect::EnumDescriptor::new_pb_name::("VerifierConfig.Toggle", file_descriptor_proto()) + }) + } +} + +impl ::std::marker::Copy for VerifierConfig_Toggle { +} + +impl ::std::default::Default for VerifierConfig_Toggle { + fn default() -> Self { + VerifierConfig_Toggle::DEFAULT + } +} + +impl ::protobuf::reflect::ProtobufValue for VerifierConfig_Toggle { + fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { + ::protobuf::reflect::ReflectValueRef::Enum(::protobuf::ProtobufEnum::descriptor(self)) + } +} + +static file_descriptor_proto_data: &'static [u8] = b"\ + \n.tensorflow/core/protobuf/verifier_config.proto\x12\ntensorflow\"\xc7\ + \x01\n\x0eVerifierConfig\x12;\n\x1averification_timeout_in_ms\x18\x01\ + \x20\x01(\x03R\x17verificationTimeoutInMs\x12P\n\x12structure_verifier\ + \x18\x02\x20\x01(\x0e2!.tensorflow.VerifierConfig.ToggleR\x11structureVe\ + rifier\"&\n\x06Toggle\x12\x0b\n\x07DEFAULT\x10\0\x12\x06\n\x02ON\x10\x01\ + \x12\x07\n\x03OFF\x10\x02B\x8c\x01\n\x18org.tensorflow.frameworkB\x14Ver\ + ifierConfigProtosP\x01ZUgithub.com/tensorflow/tensorflow/tensorflow/go/c\ + ore/protobuf/for_core_protos_go_proto\xf8\x01\x01b\x06proto3\ +"; + +static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT; + +fn parse_descriptor_proto() -> ::protobuf::descriptor::FileDescriptorProto { + ::protobuf::Message::parse_from_bytes(file_descriptor_proto_data).unwrap() +} + +pub fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto { + file_descriptor_proto_lazy.get(|| { + parse_descriptor_proto() + }) +} diff --git a/tensorflow-proto-codegen/src/main.rs b/tensorflow-proto-codegen/src/main.rs index ee4d4e3f79..7ae69883c4 100644 --- a/tensorflow-proto-codegen/src/main.rs +++ b/tensorflow-proto-codegen/src/main.rs @@ -15,10 +15,18 @@ fn main() -> Result<(), Box> { .to_str() .ok_or("Unable to format output path for main crate")?, input: &[ + &format!( + "{}/tensorflow/core/framework/allocation_description.proto", + tensorflow_folder + ), &format!( "{}/tensorflow/core/framework/attr_value.proto", tensorflow_folder ), + &format!( + "{}/tensorflow/core/framework/cost_graph.proto", + tensorflow_folder + ), &format!( "{}/tensorflow/core/framework/full_type.proto", tensorflow_folder @@ -51,6 +59,14 @@ fn main() -> Result<(), Box> { "{}/tensorflow/core/protobuf/saved_object_graph.proto", tensorflow_folder ), + &format!( + "{}/tensorflow/core/framework/step_stats.proto", + tensorflow_folder + ), + &format!( + "{}/tensorflow/core/framework/tensor_description.proto", + tensorflow_folder + ), &format!( "{}/tensorflow/core/protobuf/struct.proto", tensorflow_folder @@ -84,6 +100,23 @@ fn main() -> Result<(), Box> { tensorflow_folder ), &format!("{}/tensorflow/core/protobuf/saver.proto", tensorflow_folder), + &format!( + "{}/tensorflow/core/protobuf/cluster.proto", + tensorflow_folder + ), + &format!( + "{}/tensorflow/core/protobuf/config.proto", + tensorflow_folder + ), + &format!("{}/tensorflow/core/protobuf/debug.proto", tensorflow_folder), + &format!( + "{}/tensorflow/core/protobuf/rewriter_config.proto", + tensorflow_folder + ), + &format!( + "{}/tensorflow/core/protobuf/verifier_config.proto", + tensorflow_folder + ), ], includes: &[tensorflow_folder], customize: protoc_rust::Customize { diff --git a/test-all b/test-all index c40e5a0711..ad0c395f1b 100755 --- a/test-all +++ b/test-all @@ -46,6 +46,7 @@ fi run cargo fmt --all -- --check run cargo test -vv -j 2 +run cargo test -vv -j 2 --features eager run cargo test -vv -j 2 --features tensorflow_unstable run cargo test -vv -j 2 --features ndarray run cargo run --example regression