tensorflow-protos-rs 0.2.0

Protobuf codegen crate for tensorflow
Documentation
// This file is generated by rust-protobuf 2.17.0. Do not edit
// @generated

// https://github.com/rust-lang/rust-clippy/issues/702
#![allow(unknown_lints)]
#![allow(clippy::all)]

#![allow(unused_attributes)]
#![rustfmt::skip]

#![allow(box_pointers)]
#![allow(dead_code)]
#![allow(missing_docs)]
#![allow(non_camel_case_types)]
#![allow(non_snake_case)]
#![allow(non_upper_case_globals)]
#![allow(trivial_casts)]
#![allow(unused_imports)]
#![allow(unused_results)]
//! Generated file from `tensorflow/core/framework/device_attributes.proto`

/// Generated files are compatible only with the same version
/// of protobuf runtime.
// const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_17_0;

#[derive(PartialEq,Clone,Default)]
pub struct InterconnectLink {
    // message fields
    pub device_id: i32,
    pub field_type: ::std::string::String,
    pub strength: i32,
    // special fields
    pub unknown_fields: ::protobuf::UnknownFields,
    pub cached_size: ::protobuf::CachedSize,
}

impl<'a> ::std::default::Default for &'a InterconnectLink {
    fn default() -> &'a InterconnectLink {
        <InterconnectLink as ::protobuf::Message>::default_instance()
    }
}

impl InterconnectLink {
    pub fn new() -> InterconnectLink {
        ::std::default::Default::default()
    }

    // int32 device_id = 1;


    pub fn get_device_id(&self) -> i32 {
        self.device_id
    }
    pub fn clear_device_id(&mut self) {
        self.device_id = 0;
    }

    // Param is passed by value, moved
    pub fn set_device_id(&mut self, v: i32) {
        self.device_id = v;
    }

    // string type = 2;


    pub fn get_field_type(&self) -> &str {
        &self.field_type
    }
    pub fn clear_field_type(&mut self) {
        self.field_type.clear();
    }

    // Param is passed by value, moved
    pub fn set_field_type(&mut self, v: ::std::string::String) {
        self.field_type = v;
    }

    // Mutable pointer to the field.
    // If field is not initialized, it is initialized with default value first.
    pub fn mut_field_type(&mut self) -> &mut ::std::string::String {
        &mut self.field_type
    }

    // Take field
    pub fn take_field_type(&mut self) -> ::std::string::String {
        ::std::mem::replace(&mut self.field_type, ::std::string::String::new())
    }

    // int32 strength = 3;


    pub fn get_strength(&self) -> i32 {
        self.strength
    }
    pub fn clear_strength(&mut self) {
        self.strength = 0;
    }

    // Param is passed by value, moved
    pub fn set_strength(&mut self, v: i32) {
        self.strength = v;
    }
}

impl ::protobuf::Message for InterconnectLink {
    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.device_id = tmp;
                },
                2 => {
                    ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.field_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_int32()?;
                    self.strength = 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.device_id != 0 {
            my_size += ::protobuf::rt::value_size(1, self.device_id, ::protobuf::wire_format::WireTypeVarint);
        }
        if !self.field_type.is_empty() {
            my_size += ::protobuf::rt::string_size(2, &self.field_type);
        }
        if self.strength != 0 {
            my_size += ::protobuf::rt::value_size(3, self.strength, ::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.device_id != 0 {
            os.write_int32(1, self.device_id)?;
        }
        if !self.field_type.is_empty() {
            os.write_string(2, &self.field_type)?;
        }
        if self.strength != 0 {
            os.write_int32(3, self.strength)?;
        }
        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<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
        self
    }

    fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
        Self::descriptor_static()
    }

    fn new() -> InterconnectLink {
        InterconnectLink::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>(
                "device_id",
                |m: &InterconnectLink| { &m.device_id },
                |m: &mut InterconnectLink| { &mut m.device_id },
            ));
            fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
                "type",
                |m: &InterconnectLink| { &m.field_type },
                |m: &mut InterconnectLink| { &mut m.field_type },
            ));
            fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt32>(
                "strength",
                |m: &InterconnectLink| { &m.strength },
                |m: &mut InterconnectLink| { &mut m.strength },
            ));
            ::protobuf::reflect::MessageDescriptor::new_pb_name::<InterconnectLink>(
                "InterconnectLink",
                fields,
                file_descriptor_proto()
            )
        })
    }

    fn default_instance() -> &'static InterconnectLink {
        static instance: ::protobuf::rt::LazyV2<InterconnectLink> = ::protobuf::rt::LazyV2::INIT;
        instance.get(InterconnectLink::new)
    }
}

impl ::protobuf::Clear for InterconnectLink {
    fn clear(&mut self) {
        self.device_id = 0;
        self.field_type.clear();
        self.strength = 0;
        self.unknown_fields.clear();
    }
}

impl ::std::fmt::Debug for InterconnectLink {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        ::protobuf::text_format::fmt(self, f)
    }
}

impl ::protobuf::reflect::ProtobufValue for InterconnectLink {
    fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
        ::protobuf::reflect::ReflectValueRef::Message(self)
    }
}

#[derive(PartialEq,Clone,Default)]
pub struct LocalLinks {
    // message fields
    pub link: ::protobuf::RepeatedField<InterconnectLink>,
    // special fields
    pub unknown_fields: ::protobuf::UnknownFields,
    pub cached_size: ::protobuf::CachedSize,
}

impl<'a> ::std::default::Default for &'a LocalLinks {
    fn default() -> &'a LocalLinks {
        <LocalLinks as ::protobuf::Message>::default_instance()
    }
}

impl LocalLinks {
    pub fn new() -> LocalLinks {
        ::std::default::Default::default()
    }

    // repeated .tensorflow.InterconnectLink link = 1;


    pub fn get_link(&self) -> &[InterconnectLink] {
        &self.link
    }
    pub fn clear_link(&mut self) {
        self.link.clear();
    }

    // Param is passed by value, moved
    pub fn set_link(&mut self, v: ::protobuf::RepeatedField<InterconnectLink>) {
        self.link = v;
    }

    // Mutable pointer to the field.
    pub fn mut_link(&mut self) -> &mut ::protobuf::RepeatedField<InterconnectLink> {
        &mut self.link
    }

    // Take field
    pub fn take_link(&mut self) -> ::protobuf::RepeatedField<InterconnectLink> {
        ::std::mem::replace(&mut self.link, ::protobuf::RepeatedField::new())
    }
}

impl ::protobuf::Message for LocalLinks {
    fn is_initialized(&self) -> bool {
        for v in &self.link {
            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.link)?;
                },
                _ => {
                    ::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.link {
            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.link {
            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<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
        self
    }

    fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
        Self::descriptor_static()
    }

    fn new() -> LocalLinks {
        LocalLinks::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<InterconnectLink>>(
                "link",
                |m: &LocalLinks| { &m.link },
                |m: &mut LocalLinks| { &mut m.link },
            ));
            ::protobuf::reflect::MessageDescriptor::new_pb_name::<LocalLinks>(
                "LocalLinks",
                fields,
                file_descriptor_proto()
            )
        })
    }

    fn default_instance() -> &'static LocalLinks {
        static instance: ::protobuf::rt::LazyV2<LocalLinks> = ::protobuf::rt::LazyV2::INIT;
        instance.get(LocalLinks::new)
    }
}

impl ::protobuf::Clear for LocalLinks {
    fn clear(&mut self) {
        self.link.clear();
        self.unknown_fields.clear();
    }
}

impl ::std::fmt::Debug for LocalLinks {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        ::protobuf::text_format::fmt(self, f)
    }
}

impl ::protobuf::reflect::ProtobufValue for LocalLinks {
    fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
        ::protobuf::reflect::ReflectValueRef::Message(self)
    }
}

#[derive(PartialEq,Clone,Default)]
pub struct DeviceLocality {
    // message fields
    pub bus_id: i32,
    pub numa_node: i32,
    pub links: ::protobuf::SingularPtrField<LocalLinks>,
    // special fields
    pub unknown_fields: ::protobuf::UnknownFields,
    pub cached_size: ::protobuf::CachedSize,
}

impl<'a> ::std::default::Default for &'a DeviceLocality {
    fn default() -> &'a DeviceLocality {
        <DeviceLocality as ::protobuf::Message>::default_instance()
    }
}

impl DeviceLocality {
    pub fn new() -> DeviceLocality {
        ::std::default::Default::default()
    }

    // int32 bus_id = 1;


    pub fn get_bus_id(&self) -> i32 {
        self.bus_id
    }
    pub fn clear_bus_id(&mut self) {
        self.bus_id = 0;
    }

    // Param is passed by value, moved
    pub fn set_bus_id(&mut self, v: i32) {
        self.bus_id = v;
    }

    // int32 numa_node = 2;


    pub fn get_numa_node(&self) -> i32 {
        self.numa_node
    }
    pub fn clear_numa_node(&mut self) {
        self.numa_node = 0;
    }

    // Param is passed by value, moved
    pub fn set_numa_node(&mut self, v: i32) {
        self.numa_node = v;
    }

    // .tensorflow.LocalLinks links = 3;


    pub fn get_links(&self) -> &LocalLinks {
        self.links.as_ref().unwrap_or_else(|| <LocalLinks as ::protobuf::Message>::default_instance())
    }
    pub fn clear_links(&mut self) {
        self.links.clear();
    }

    pub fn has_links(&self) -> bool {
        self.links.is_some()
    }

    // Param is passed by value, moved
    pub fn set_links(&mut self, v: LocalLinks) {
        self.links = ::protobuf::SingularPtrField::some(v);
    }

    // Mutable pointer to the field.
    // If field is not initialized, it is initialized with default value first.
    pub fn mut_links(&mut self) -> &mut LocalLinks {
        if self.links.is_none() {
            self.links.set_default();
        }
        self.links.as_mut().unwrap()
    }

    // Take field
    pub fn take_links(&mut self) -> LocalLinks {
        self.links.take().unwrap_or_else(|| LocalLinks::new())
    }
}

impl ::protobuf::Message for DeviceLocality {
    fn is_initialized(&self) -> bool {
        for v in &self.links {
            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.bus_id = 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.numa_node = tmp;
                },
                3 => {
                    ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.links)?;
                },
                _ => {
                    ::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.bus_id != 0 {
            my_size += ::protobuf::rt::value_size(1, self.bus_id, ::protobuf::wire_format::WireTypeVarint);
        }
        if self.numa_node != 0 {
            my_size += ::protobuf::rt::value_size(2, self.numa_node, ::protobuf::wire_format::WireTypeVarint);
        }
        if let Some(ref v) = self.links.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.bus_id != 0 {
            os.write_int32(1, self.bus_id)?;
        }
        if self.numa_node != 0 {
            os.write_int32(2, self.numa_node)?;
        }
        if let Some(ref v) = self.links.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<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
        self
    }

    fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
        Self::descriptor_static()
    }

    fn new() -> DeviceLocality {
        DeviceLocality::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>(
                "bus_id",
                |m: &DeviceLocality| { &m.bus_id },
                |m: &mut DeviceLocality| { &mut m.bus_id },
            ));
            fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt32>(
                "numa_node",
                |m: &DeviceLocality| { &m.numa_node },
                |m: &mut DeviceLocality| { &mut m.numa_node },
            ));
            fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage<LocalLinks>>(
                "links",
                |m: &DeviceLocality| { &m.links },
                |m: &mut DeviceLocality| { &mut m.links },
            ));
            ::protobuf::reflect::MessageDescriptor::new_pb_name::<DeviceLocality>(
                "DeviceLocality",
                fields,
                file_descriptor_proto()
            )
        })
    }

    fn default_instance() -> &'static DeviceLocality {
        static instance: ::protobuf::rt::LazyV2<DeviceLocality> = ::protobuf::rt::LazyV2::INIT;
        instance.get(DeviceLocality::new)
    }
}

impl ::protobuf::Clear for DeviceLocality {
    fn clear(&mut self) {
        self.bus_id = 0;
        self.numa_node = 0;
        self.links.clear();
        self.unknown_fields.clear();
    }
}

impl ::std::fmt::Debug for DeviceLocality {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        ::protobuf::text_format::fmt(self, f)
    }
}

impl ::protobuf::reflect::ProtobufValue for DeviceLocality {
    fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
        ::protobuf::reflect::ReflectValueRef::Message(self)
    }
}

#[derive(PartialEq,Clone,Default)]
pub struct DeviceAttributes {
    // message fields
    pub name: ::std::string::String,
    pub device_type: ::std::string::String,
    pub memory_limit: i64,
    pub locality: ::protobuf::SingularPtrField<DeviceLocality>,
    pub incarnation: u64,
    pub physical_device_desc: ::std::string::String,
    // special fields
    pub unknown_fields: ::protobuf::UnknownFields,
    pub cached_size: ::protobuf::CachedSize,
}

impl<'a> ::std::default::Default for &'a DeviceAttributes {
    fn default() -> &'a DeviceAttributes {
        <DeviceAttributes as ::protobuf::Message>::default_instance()
    }
}

impl DeviceAttributes {
    pub fn new() -> DeviceAttributes {
        ::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_type = 2;


    pub fn get_device_type(&self) -> &str {
        &self.device_type
    }
    pub fn clear_device_type(&mut self) {
        self.device_type.clear();
    }

    // Param is passed by value, moved
    pub fn set_device_type(&mut self, v: ::std::string::String) {
        self.device_type = v;
    }

    // Mutable pointer to the field.
    // If field is not initialized, it is initialized with default value first.
    pub fn mut_device_type(&mut self) -> &mut ::std::string::String {
        &mut self.device_type
    }

    // Take field
    pub fn take_device_type(&mut self) -> ::std::string::String {
        ::std::mem::replace(&mut self.device_type, ::std::string::String::new())
    }

    // int64 memory_limit = 4;


    pub fn get_memory_limit(&self) -> i64 {
        self.memory_limit
    }
    pub fn clear_memory_limit(&mut self) {
        self.memory_limit = 0;
    }

    // Param is passed by value, moved
    pub fn set_memory_limit(&mut self, v: i64) {
        self.memory_limit = v;
    }

    // .tensorflow.DeviceLocality locality = 5;


    pub fn get_locality(&self) -> &DeviceLocality {
        self.locality.as_ref().unwrap_or_else(|| <DeviceLocality as ::protobuf::Message>::default_instance())
    }
    pub fn clear_locality(&mut self) {
        self.locality.clear();
    }

    pub fn has_locality(&self) -> bool {
        self.locality.is_some()
    }

    // Param is passed by value, moved
    pub fn set_locality(&mut self, v: DeviceLocality) {
        self.locality = ::protobuf::SingularPtrField::some(v);
    }

    // Mutable pointer to the field.
    // If field is not initialized, it is initialized with default value first.
    pub fn mut_locality(&mut self) -> &mut DeviceLocality {
        if self.locality.is_none() {
            self.locality.set_default();
        }
        self.locality.as_mut().unwrap()
    }

    // Take field
    pub fn take_locality(&mut self) -> DeviceLocality {
        self.locality.take().unwrap_or_else(|| DeviceLocality::new())
    }

    // fixed64 incarnation = 6;


    pub fn get_incarnation(&self) -> u64 {
        self.incarnation
    }
    pub fn clear_incarnation(&mut self) {
        self.incarnation = 0;
    }

    // Param is passed by value, moved
    pub fn set_incarnation(&mut self, v: u64) {
        self.incarnation = v;
    }

    // string physical_device_desc = 7;


    pub fn get_physical_device_desc(&self) -> &str {
        &self.physical_device_desc
    }
    pub fn clear_physical_device_desc(&mut self) {
        self.physical_device_desc.clear();
    }

    // Param is passed by value, moved
    pub fn set_physical_device_desc(&mut self, v: ::std::string::String) {
        self.physical_device_desc = v;
    }

    // Mutable pointer to the field.
    // If field is not initialized, it is initialized with default value first.
    pub fn mut_physical_device_desc(&mut self) -> &mut ::std::string::String {
        &mut self.physical_device_desc
    }

    // Take field
    pub fn take_physical_device_desc(&mut self) -> ::std::string::String {
        ::std::mem::replace(&mut self.physical_device_desc, ::std::string::String::new())
    }
}

impl ::protobuf::Message for DeviceAttributes {
    fn is_initialized(&self) -> bool {
        for v in &self.locality {
            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_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_int64()?;
                    self.memory_limit = tmp;
                },
                5 => {
                    ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.locality)?;
                },
                6 => {
                    if wire_type != ::protobuf::wire_format::WireTypeFixed64 {
                        return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
                    }
                    let tmp = is.read_fixed64()?;
                    self.incarnation = tmp;
                },
                7 => {
                    ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.physical_device_desc)?;
                },
                _ => {
                    ::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_type.is_empty() {
            my_size += ::protobuf::rt::string_size(2, &self.device_type);
        }
        if self.memory_limit != 0 {
            my_size += ::protobuf::rt::value_size(4, self.memory_limit, ::protobuf::wire_format::WireTypeVarint);
        }
        if let Some(ref v) = self.locality.as_ref() {
            let len = v.compute_size();
            my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len;
        }
        if self.incarnation != 0 {
            my_size += 9;
        }
        if !self.physical_device_desc.is_empty() {
            my_size += ::protobuf::rt::string_size(7, &self.physical_device_desc);
        }
        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_type.is_empty() {
            os.write_string(2, &self.device_type)?;
        }
        if self.memory_limit != 0 {
            os.write_int64(4, self.memory_limit)?;
        }
        if let Some(ref v) = self.locality.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.incarnation != 0 {
            os.write_fixed64(6, self.incarnation)?;
        }
        if !self.physical_device_desc.is_empty() {
            os.write_string(7, &self.physical_device_desc)?;
        }
        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<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
        self
    }

    fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
        Self::descriptor_static()
    }

    fn new() -> DeviceAttributes {
        DeviceAttributes::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: &DeviceAttributes| { &m.name },
                |m: &mut DeviceAttributes| { &mut m.name },
            ));
            fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
                "device_type",
                |m: &DeviceAttributes| { &m.device_type },
                |m: &mut DeviceAttributes| { &mut m.device_type },
            ));
            fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt64>(
                "memory_limit",
                |m: &DeviceAttributes| { &m.memory_limit },
                |m: &mut DeviceAttributes| { &mut m.memory_limit },
            ));
            fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage<DeviceLocality>>(
                "locality",
                |m: &DeviceAttributes| { &m.locality },
                |m: &mut DeviceAttributes| { &mut m.locality },
            ));
            fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeFixed64>(
                "incarnation",
                |m: &DeviceAttributes| { &m.incarnation },
                |m: &mut DeviceAttributes| { &mut m.incarnation },
            ));
            fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
                "physical_device_desc",
                |m: &DeviceAttributes| { &m.physical_device_desc },
                |m: &mut DeviceAttributes| { &mut m.physical_device_desc },
            ));
            ::protobuf::reflect::MessageDescriptor::new_pb_name::<DeviceAttributes>(
                "DeviceAttributes",
                fields,
                file_descriptor_proto()
            )
        })
    }

    fn default_instance() -> &'static DeviceAttributes {
        static instance: ::protobuf::rt::LazyV2<DeviceAttributes> = ::protobuf::rt::LazyV2::INIT;
        instance.get(DeviceAttributes::new)
    }
}

impl ::protobuf::Clear for DeviceAttributes {
    fn clear(&mut self) {
        self.name.clear();
        self.device_type.clear();
        self.memory_limit = 0;
        self.locality.clear();
        self.incarnation = 0;
        self.physical_device_desc.clear();
        self.unknown_fields.clear();
    }
}

impl ::std::fmt::Debug for DeviceAttributes {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        ::protobuf::text_format::fmt(self, f)
    }
}

impl ::protobuf::reflect::ProtobufValue for DeviceAttributes {
    fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
        ::protobuf::reflect::ReflectValueRef::Message(self)
    }
}

static file_descriptor_proto_data: &'static [u8] = b"\
    \n1tensorflow/core/framework/device_attributes.proto\x12\ntensorflow\"_\
    \n\x10InterconnectLink\x12\x1b\n\tdevice_id\x18\x01\x20\x01(\x05R\x08dev\
    iceId\x12\x12\n\x04type\x18\x02\x20\x01(\tR\x04type\x12\x1a\n\x08strengt\
    h\x18\x03\x20\x01(\x05R\x08strength\">\n\nLocalLinks\x120\n\x04link\x18\
    \x01\x20\x03(\x0b2\x1c.tensorflow.InterconnectLinkR\x04link\"r\n\x0eDevi\
    ceLocality\x12\x15\n\x06bus_id\x18\x01\x20\x01(\x05R\x05busId\x12\x1b\n\
    \tnuma_node\x18\x02\x20\x01(\x05R\x08numaNode\x12,\n\x05links\x18\x03\
    \x20\x01(\x0b2\x16.tensorflow.LocalLinksR\x05links\"\xf6\x01\n\x10Device\
    Attributes\x12\x12\n\x04name\x18\x01\x20\x01(\tR\x04name\x12\x1f\n\x0bde\
    vice_type\x18\x02\x20\x01(\tR\ndeviceType\x12!\n\x0cmemory_limit\x18\x04\
    \x20\x01(\x03R\x0bmemoryLimit\x126\n\x08locality\x18\x05\x20\x01(\x0b2\
    \x1a.tensorflow.DeviceLocalityR\x08locality\x12\x20\n\x0bincarnation\x18\
    \x06\x20\x01(\x06R\x0bincarnation\x120\n\x14physical_device_desc\x18\x07\
    \x20\x01(\tR\x12physicalDeviceDescBv\n\x18org.tensorflow.frameworkB\x16D\
    eviceAttributesProtosP\x01Z=github.com/tensorflow/tensorflow/tensorflow/\
    go/core/framework\xf8\x01\x01b\x06proto3\
";

static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT;

fn parse_descriptor_proto() -> ::protobuf::descriptor::FileDescriptorProto {
    ::protobuf::parse_from_bytes(file_descriptor_proto_data).unwrap()
}

pub fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto {
    file_descriptor_proto_lazy.get(|| {
        parse_descriptor_proto()
    })
}