#![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_results)]
#![allow(unused_mut)]
const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_3_2_0;
#[derive(PartialEq,Clone,Default,Debug)]
pub struct ResourceHandleProto {
pub device: ::std::string::String,
pub container: ::std::string::String,
pub name: ::std::string::String,
pub hash_code: u64,
pub maybe_type_name: ::std::string::String,
pub dtypes_and_shapes: ::std::vec::Vec<resource_handle_proto::DtypeAndShape>,
pub special_fields: ::protobuf::SpecialFields,
}
impl<'a> ::std::default::Default for &'a ResourceHandleProto {
fn default() -> &'a ResourceHandleProto {
<ResourceHandleProto as ::protobuf::Message>::default_instance()
}
}
impl ResourceHandleProto {
pub fn new() -> ResourceHandleProto {
::std::default::Default::default()
}
fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData {
let mut fields = ::std::vec::Vec::with_capacity(6);
let mut oneofs = ::std::vec::Vec::with_capacity(0);
fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>(
"device",
|m: &ResourceHandleProto| { &m.device },
|m: &mut ResourceHandleProto| { &mut m.device },
));
fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>(
"container",
|m: &ResourceHandleProto| { &m.container },
|m: &mut ResourceHandleProto| { &mut m.container },
));
fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>(
"name",
|m: &ResourceHandleProto| { &m.name },
|m: &mut ResourceHandleProto| { &mut m.name },
));
fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>(
"hash_code",
|m: &ResourceHandleProto| { &m.hash_code },
|m: &mut ResourceHandleProto| { &mut m.hash_code },
));
fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>(
"maybe_type_name",
|m: &ResourceHandleProto| { &m.maybe_type_name },
|m: &mut ResourceHandleProto| { &mut m.maybe_type_name },
));
fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>(
"dtypes_and_shapes",
|m: &ResourceHandleProto| { &m.dtypes_and_shapes },
|m: &mut ResourceHandleProto| { &mut m.dtypes_and_shapes },
));
::protobuf::reflect::GeneratedMessageDescriptorData::new_2::<ResourceHandleProto>(
"ResourceHandleProto",
fields,
oneofs,
)
}
}
impl ::protobuf::Message for ResourceHandleProto {
const NAME: &'static str = "ResourceHandleProto";
fn is_initialized(&self) -> bool {
true
}
fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> {
while let Some(tag) = is.read_raw_tag_or_eof()? {
match tag {
10 => {
self.device = is.read_string()?;
},
18 => {
self.container = is.read_string()?;
},
26 => {
self.name = is.read_string()?;
},
32 => {
self.hash_code = is.read_uint64()?;
},
42 => {
self.maybe_type_name = is.read_string()?;
},
50 => {
self.dtypes_and_shapes.push(is.read_message()?);
},
tag => {
::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?;
},
};
}
::std::result::Result::Ok(())
}
#[allow(unused_variables)]
fn compute_size(&self) -> u64 {
let mut my_size = 0;
if !self.device.is_empty() {
my_size += ::protobuf::rt::string_size(1, &self.device);
}
if !self.container.is_empty() {
my_size += ::protobuf::rt::string_size(2, &self.container);
}
if !self.name.is_empty() {
my_size += ::protobuf::rt::string_size(3, &self.name);
}
if self.hash_code != 0 {
my_size += ::protobuf::rt::uint64_size(4, self.hash_code);
}
if !self.maybe_type_name.is_empty() {
my_size += ::protobuf::rt::string_size(5, &self.maybe_type_name);
}
for value in &self.dtypes_and_shapes {
let len = value.compute_size();
my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len;
};
my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields());
self.special_fields.cached_size().set(my_size as u32);
my_size
}
fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> {
if !self.device.is_empty() {
os.write_string(1, &self.device)?;
}
if !self.container.is_empty() {
os.write_string(2, &self.container)?;
}
if !self.name.is_empty() {
os.write_string(3, &self.name)?;
}
if self.hash_code != 0 {
os.write_uint64(4, self.hash_code)?;
}
if !self.maybe_type_name.is_empty() {
os.write_string(5, &self.maybe_type_name)?;
}
for v in &self.dtypes_and_shapes {
::protobuf::rt::write_message_field_with_cached_size(6, v, os)?;
};
os.write_unknown_fields(self.special_fields.unknown_fields())?;
::std::result::Result::Ok(())
}
fn special_fields(&self) -> &::protobuf::SpecialFields {
&self.special_fields
}
fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields {
&mut self.special_fields
}
fn new() -> ResourceHandleProto {
ResourceHandleProto::new()
}
fn clear(&mut self) {
self.device.clear();
self.container.clear();
self.name.clear();
self.hash_code = 0;
self.maybe_type_name.clear();
self.dtypes_and_shapes.clear();
self.special_fields.clear();
}
fn default_instance() -> &'static ResourceHandleProto {
static instance: ResourceHandleProto = ResourceHandleProto {
device: ::std::string::String::new(),
container: ::std::string::String::new(),
name: ::std::string::String::new(),
hash_code: 0,
maybe_type_name: ::std::string::String::new(),
dtypes_and_shapes: ::std::vec::Vec::new(),
special_fields: ::protobuf::SpecialFields::new(),
};
&instance
}
}
impl ::protobuf::MessageFull for ResourceHandleProto {
fn descriptor() -> ::protobuf::reflect::MessageDescriptor {
static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new();
descriptor.get(|| file_descriptor().message_by_package_relative_name("ResourceHandleProto").unwrap()).clone()
}
}
impl ::std::fmt::Display for ResourceHandleProto {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
::protobuf::text_format::fmt(self, f)
}
}
impl ::protobuf::reflect::ProtobufValue for ResourceHandleProto {
type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage<Self>;
}
pub mod resource_handle_proto {
#[derive(PartialEq,Clone,Default,Debug)]
pub struct DtypeAndShape {
pub dtype: ::protobuf::EnumOrUnknown<super::super::types::DataType>,
pub shape: ::protobuf::MessageField<super::super::tensor_shape::TensorShapeProto>,
pub special_fields: ::protobuf::SpecialFields,
}
impl<'a> ::std::default::Default for &'a DtypeAndShape {
fn default() -> &'a DtypeAndShape {
<DtypeAndShape as ::protobuf::Message>::default_instance()
}
}
impl DtypeAndShape {
pub fn new() -> DtypeAndShape {
::std::default::Default::default()
}
pub(in super) fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData {
let mut fields = ::std::vec::Vec::with_capacity(2);
let mut oneofs = ::std::vec::Vec::with_capacity(0);
fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>(
"dtype",
|m: &DtypeAndShape| { &m.dtype },
|m: &mut DtypeAndShape| { &mut m.dtype },
));
fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, super::super::tensor_shape::TensorShapeProto>(
"shape",
|m: &DtypeAndShape| { &m.shape },
|m: &mut DtypeAndShape| { &mut m.shape },
));
::protobuf::reflect::GeneratedMessageDescriptorData::new_2::<DtypeAndShape>(
"ResourceHandleProto.DtypeAndShape",
fields,
oneofs,
)
}
}
impl ::protobuf::Message for DtypeAndShape {
const NAME: &'static str = "DtypeAndShape";
fn is_initialized(&self) -> bool {
true
}
fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> {
while let Some(tag) = is.read_raw_tag_or_eof()? {
match tag {
8 => {
self.dtype = is.read_enum_or_unknown()?;
},
18 => {
::protobuf::rt::read_singular_message_into_field(is, &mut self.shape)?;
},
tag => {
::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?;
},
};
}
::std::result::Result::Ok(())
}
#[allow(unused_variables)]
fn compute_size(&self) -> u64 {
let mut my_size = 0;
if self.dtype != ::protobuf::EnumOrUnknown::new(super::super::types::DataType::DT_INVALID) {
my_size += ::protobuf::rt::int32_size(1, self.dtype.value());
}
if let Some(v) = self.shape.as_ref() {
let len = v.compute_size();
my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len;
}
my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields());
self.special_fields.cached_size().set(my_size as u32);
my_size
}
fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> {
if self.dtype != ::protobuf::EnumOrUnknown::new(super::super::types::DataType::DT_INVALID) {
os.write_enum(1, ::protobuf::EnumOrUnknown::value(&self.dtype))?;
}
if let Some(v) = self.shape.as_ref() {
::protobuf::rt::write_message_field_with_cached_size(2, v, os)?;
}
os.write_unknown_fields(self.special_fields.unknown_fields())?;
::std::result::Result::Ok(())
}
fn special_fields(&self) -> &::protobuf::SpecialFields {
&self.special_fields
}
fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields {
&mut self.special_fields
}
fn new() -> DtypeAndShape {
DtypeAndShape::new()
}
fn clear(&mut self) {
self.dtype = ::protobuf::EnumOrUnknown::new(super::super::types::DataType::DT_INVALID);
self.shape.clear();
self.special_fields.clear();
}
fn default_instance() -> &'static DtypeAndShape {
static instance: DtypeAndShape = DtypeAndShape {
dtype: ::protobuf::EnumOrUnknown::from_i32(0),
shape: ::protobuf::MessageField::none(),
special_fields: ::protobuf::SpecialFields::new(),
};
&instance
}
}
impl ::protobuf::MessageFull for DtypeAndShape {
fn descriptor() -> ::protobuf::reflect::MessageDescriptor {
static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new();
descriptor.get(|| super::file_descriptor().message_by_package_relative_name("ResourceHandleProto.DtypeAndShape").unwrap()).clone()
}
}
impl ::std::fmt::Display for DtypeAndShape {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
::protobuf::text_format::fmt(self, f)
}
}
impl ::protobuf::reflect::ProtobufValue for DtypeAndShape {
type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage<Self>;
}
}
static file_descriptor_proto_data: &'static [u8] = b"\
\n/tensorflow/core/framework/resource_handle.proto\x12\ntensorflow\x1a,t\
ensorflow/core/framework/tensor_shape.proto\x1a%tensorflow/core/framewor\
k/types.proto\"\xf6\x02\n\x13ResourceHandleProto\x12\x16\n\x06device\x18\
\x01\x20\x01(\tR\x06device\x12\x1c\n\tcontainer\x18\x02\x20\x01(\tR\tcon\
tainer\x12\x12\n\x04name\x18\x03\x20\x01(\tR\x04name\x12\x1b\n\thash_cod\
e\x18\x04\x20\x01(\x04R\x08hashCode\x12&\n\x0fmaybe_type_name\x18\x05\
\x20\x01(\tR\rmaybeTypeName\x12Y\n\x11dtypes_and_shapes\x18\x06\x20\x03(\
\x0b2-.tensorflow.ResourceHandleProto.DtypeAndShapeR\x0fdtypesAndShapes\
\x1ao\n\rDtypeAndShape\x12*\n\x05dtype\x18\x01\x20\x01(\x0e2\x14.tensorf\
low.DataTypeR\x05dtype\x122\n\x05shape\x18\x02\x20\x01(\x0b2\x1c.tensorf\
low.TensorShapeProtoR\x05shapeJ\x04\x08\x07\x10\x08B\x87\x01\n\x18org.te\
nsorflow.frameworkB\x0eResourceHandleP\x01ZVgithub.com/tensorflow/tensor\
flow/tensorflow/go/core/framework/resource_handle_go_proto\xf8\x01\x01b\
\x06proto3\
";
fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto {
static file_descriptor_proto_lazy: ::protobuf::rt::Lazy<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::Lazy::new();
file_descriptor_proto_lazy.get(|| {
::protobuf::Message::parse_from_bytes(file_descriptor_proto_data).unwrap()
})
}
pub fn file_descriptor() -> &'static ::protobuf::reflect::FileDescriptor {
static generated_file_descriptor_lazy: ::protobuf::rt::Lazy<::protobuf::reflect::GeneratedFileDescriptor> = ::protobuf::rt::Lazy::new();
static file_descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::FileDescriptor> = ::protobuf::rt::Lazy::new();
file_descriptor.get(|| {
let generated_file_descriptor = generated_file_descriptor_lazy.get(|| {
let mut deps = ::std::vec::Vec::with_capacity(2);
deps.push(super::tensor_shape::file_descriptor().clone());
deps.push(super::types::file_descriptor().clone());
let mut messages = ::std::vec::Vec::with_capacity(2);
messages.push(ResourceHandleProto::generated_message_descriptor_data());
messages.push(resource_handle_proto::DtypeAndShape::generated_message_descriptor_data());
let mut enums = ::std::vec::Vec::with_capacity(0);
::protobuf::reflect::GeneratedFileDescriptor::new_generated(
file_descriptor_proto(),
deps,
messages,
enums,
)
});
::protobuf::reflect::FileDescriptor::new_generated_2(generated_file_descriptor)
})
}