#![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 FunctionDefLibrary {
pub function: ::std::vec::Vec<FunctionDef>,
pub gradient: ::std::vec::Vec<GradientDef>,
pub registered_gradients: ::std::vec::Vec<RegisteredGradient>,
pub special_fields: ::protobuf::SpecialFields,
}
impl<'a> ::std::default::Default for &'a FunctionDefLibrary {
fn default() -> &'a FunctionDefLibrary {
<FunctionDefLibrary as ::protobuf::Message>::default_instance()
}
}
impl FunctionDefLibrary {
pub fn new() -> FunctionDefLibrary {
::std::default::Default::default()
}
fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData {
let mut fields = ::std::vec::Vec::with_capacity(3);
let mut oneofs = ::std::vec::Vec::with_capacity(0);
fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>(
"function",
|m: &FunctionDefLibrary| { &m.function },
|m: &mut FunctionDefLibrary| { &mut m.function },
));
fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>(
"gradient",
|m: &FunctionDefLibrary| { &m.gradient },
|m: &mut FunctionDefLibrary| { &mut m.gradient },
));
fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>(
"registered_gradients",
|m: &FunctionDefLibrary| { &m.registered_gradients },
|m: &mut FunctionDefLibrary| { &mut m.registered_gradients },
));
::protobuf::reflect::GeneratedMessageDescriptorData::new_2::<FunctionDefLibrary>(
"FunctionDefLibrary",
fields,
oneofs,
)
}
}
impl ::protobuf::Message for FunctionDefLibrary {
const NAME: &'static str = "FunctionDefLibrary";
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.function.push(is.read_message()?);
},
18 => {
self.gradient.push(is.read_message()?);
},
26 => {
self.registered_gradients.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;
for value in &self.function {
let len = value.compute_size();
my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len;
};
for value in &self.gradient {
let len = value.compute_size();
my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len;
};
for value in &self.registered_gradients {
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<()> {
for v in &self.function {
::protobuf::rt::write_message_field_with_cached_size(1, v, os)?;
};
for v in &self.gradient {
::protobuf::rt::write_message_field_with_cached_size(2, v, os)?;
};
for v in &self.registered_gradients {
::protobuf::rt::write_message_field_with_cached_size(3, 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() -> FunctionDefLibrary {
FunctionDefLibrary::new()
}
fn clear(&mut self) {
self.function.clear();
self.gradient.clear();
self.registered_gradients.clear();
self.special_fields.clear();
}
fn default_instance() -> &'static FunctionDefLibrary {
static instance: FunctionDefLibrary = FunctionDefLibrary {
function: ::std::vec::Vec::new(),
gradient: ::std::vec::Vec::new(),
registered_gradients: ::std::vec::Vec::new(),
special_fields: ::protobuf::SpecialFields::new(),
};
&instance
}
}
impl ::protobuf::MessageFull for FunctionDefLibrary {
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("FunctionDefLibrary").unwrap()).clone()
}
}
impl ::std::fmt::Display for FunctionDefLibrary {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
::protobuf::text_format::fmt(self, f)
}
}
impl ::protobuf::reflect::ProtobufValue for FunctionDefLibrary {
type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage<Self>;
}
#[derive(PartialEq,Clone,Default,Debug)]
pub struct FunctionDef {
pub signature: ::protobuf::MessageField<super::op_def::OpDef>,
pub attr: ::std::collections::HashMap<::std::string::String, super::attr_value::AttrValue>,
pub arg_attr: ::std::collections::HashMap<u32, function_def::ArgAttrs>,
pub resource_arg_unique_id: ::std::collections::HashMap<u32, u32>,
pub node_def: ::std::vec::Vec<super::node_def::NodeDef>,
pub ret: ::std::collections::HashMap<::std::string::String, ::std::string::String>,
pub control_ret: ::std::collections::HashMap<::std::string::String, ::std::string::String>,
pub special_fields: ::protobuf::SpecialFields,
}
impl<'a> ::std::default::Default for &'a FunctionDef {
fn default() -> &'a FunctionDef {
<FunctionDef as ::protobuf::Message>::default_instance()
}
}
impl FunctionDef {
pub fn new() -> FunctionDef {
::std::default::Default::default()
}
fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData {
let mut fields = ::std::vec::Vec::with_capacity(7);
let mut oneofs = ::std::vec::Vec::with_capacity(0);
fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, super::op_def::OpDef>(
"signature",
|m: &FunctionDef| { &m.signature },
|m: &mut FunctionDef| { &mut m.signature },
));
fields.push(::protobuf::reflect::rt::v2::make_map_simpler_accessor::<_, _, _>(
"attr",
|m: &FunctionDef| { &m.attr },
|m: &mut FunctionDef| { &mut m.attr },
));
fields.push(::protobuf::reflect::rt::v2::make_map_simpler_accessor::<_, _, _>(
"arg_attr",
|m: &FunctionDef| { &m.arg_attr },
|m: &mut FunctionDef| { &mut m.arg_attr },
));
fields.push(::protobuf::reflect::rt::v2::make_map_simpler_accessor::<_, _, _>(
"resource_arg_unique_id",
|m: &FunctionDef| { &m.resource_arg_unique_id },
|m: &mut FunctionDef| { &mut m.resource_arg_unique_id },
));
fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>(
"node_def",
|m: &FunctionDef| { &m.node_def },
|m: &mut FunctionDef| { &mut m.node_def },
));
fields.push(::protobuf::reflect::rt::v2::make_map_simpler_accessor::<_, _, _>(
"ret",
|m: &FunctionDef| { &m.ret },
|m: &mut FunctionDef| { &mut m.ret },
));
fields.push(::protobuf::reflect::rt::v2::make_map_simpler_accessor::<_, _, _>(
"control_ret",
|m: &FunctionDef| { &m.control_ret },
|m: &mut FunctionDef| { &mut m.control_ret },
));
::protobuf::reflect::GeneratedMessageDescriptorData::new_2::<FunctionDef>(
"FunctionDef",
fields,
oneofs,
)
}
}
impl ::protobuf::Message for FunctionDef {
const NAME: &'static str = "FunctionDef";
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 => {
::protobuf::rt::read_singular_message_into_field(is, &mut self.signature)?;
},
42 => {
let len = is.read_raw_varint32()?;
let old_limit = is.push_limit(len as u64)?;
let mut key = ::std::default::Default::default();
let mut value = ::std::default::Default::default();
while let Some(tag) = is.read_raw_tag_or_eof()? {
match tag {
10 => key = is.read_string()?,
18 => value = is.read_message()?,
_ => ::protobuf::rt::skip_field_for_tag(tag, is)?,
};
}
is.pop_limit(old_limit);
self.attr.insert(key, value);
},
58 => {
let len = is.read_raw_varint32()?;
let old_limit = is.push_limit(len as u64)?;
let mut key = ::std::default::Default::default();
let mut value = ::std::default::Default::default();
while let Some(tag) = is.read_raw_tag_or_eof()? {
match tag {
8 => key = is.read_uint32()?,
18 => value = is.read_message()?,
_ => ::protobuf::rt::skip_field_for_tag(tag, is)?,
};
}
is.pop_limit(old_limit);
self.arg_attr.insert(key, value);
},
66 => {
let len = is.read_raw_varint32()?;
let old_limit = is.push_limit(len as u64)?;
let mut key = ::std::default::Default::default();
let mut value = ::std::default::Default::default();
while let Some(tag) = is.read_raw_tag_or_eof()? {
match tag {
8 => key = is.read_uint32()?,
16 => value = is.read_uint32()?,
_ => ::protobuf::rt::skip_field_for_tag(tag, is)?,
};
}
is.pop_limit(old_limit);
self.resource_arg_unique_id.insert(key, value);
},
26 => {
self.node_def.push(is.read_message()?);
},
34 => {
let len = is.read_raw_varint32()?;
let old_limit = is.push_limit(len as u64)?;
let mut key = ::std::default::Default::default();
let mut value = ::std::default::Default::default();
while let Some(tag) = is.read_raw_tag_or_eof()? {
match tag {
10 => key = is.read_string()?,
18 => value = is.read_string()?,
_ => ::protobuf::rt::skip_field_for_tag(tag, is)?,
};
}
is.pop_limit(old_limit);
self.ret.insert(key, value);
},
50 => {
let len = is.read_raw_varint32()?;
let old_limit = is.push_limit(len as u64)?;
let mut key = ::std::default::Default::default();
let mut value = ::std::default::Default::default();
while let Some(tag) = is.read_raw_tag_or_eof()? {
match tag {
10 => key = is.read_string()?,
18 => value = is.read_string()?,
_ => ::protobuf::rt::skip_field_for_tag(tag, is)?,
};
}
is.pop_limit(old_limit);
self.control_ret.insert(key, value);
},
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 let Some(v) = self.signature.as_ref() {
let len = v.compute_size();
my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len;
}
for (k, v) in &self.attr {
let mut entry_size = 0;
entry_size += ::protobuf::rt::string_size(1, &k);
let len = v.compute_size();
entry_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len;
my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(entry_size) + entry_size
};
for (k, v) in &self.arg_attr {
let mut entry_size = 0;
entry_size += ::protobuf::rt::uint32_size(1, *k);
let len = v.compute_size();
entry_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len;
my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(entry_size) + entry_size
};
for (k, v) in &self.resource_arg_unique_id {
let mut entry_size = 0;
entry_size += ::protobuf::rt::uint32_size(1, *k);
entry_size += ::protobuf::rt::uint32_size(2, *v);
my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(entry_size) + entry_size
};
for value in &self.node_def {
let len = value.compute_size();
my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len;
};
for (k, v) in &self.ret {
let mut entry_size = 0;
entry_size += ::protobuf::rt::string_size(1, &k);
entry_size += ::protobuf::rt::string_size(2, &v);
my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(entry_size) + entry_size
};
for (k, v) in &self.control_ret {
let mut entry_size = 0;
entry_size += ::protobuf::rt::string_size(1, &k);
entry_size += ::protobuf::rt::string_size(2, &v);
my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(entry_size) + entry_size
};
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 let Some(v) = self.signature.as_ref() {
::protobuf::rt::write_message_field_with_cached_size(1, v, os)?;
}
for (k, v) in &self.attr {
let mut entry_size = 0;
entry_size += ::protobuf::rt::string_size(1, &k);
let len = v.cached_size() as u64;
entry_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len;
os.write_raw_varint32(42)?; os.write_raw_varint32(entry_size as u32)?;
os.write_string(1, &k)?;
::protobuf::rt::write_message_field_with_cached_size(2, v, os)?;
};
for (k, v) in &self.arg_attr {
let mut entry_size = 0;
entry_size += ::protobuf::rt::uint32_size(1, *k);
let len = v.cached_size() as u64;
entry_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len;
os.write_raw_varint32(58)?; os.write_raw_varint32(entry_size as u32)?;
os.write_uint32(1, *k)?;
::protobuf::rt::write_message_field_with_cached_size(2, v, os)?;
};
for (k, v) in &self.resource_arg_unique_id {
let mut entry_size = 0;
entry_size += ::protobuf::rt::uint32_size(1, *k);
entry_size += ::protobuf::rt::uint32_size(2, *v);
os.write_raw_varint32(66)?; os.write_raw_varint32(entry_size as u32)?;
os.write_uint32(1, *k)?;
os.write_uint32(2, *v)?;
};
for v in &self.node_def {
::protobuf::rt::write_message_field_with_cached_size(3, v, os)?;
};
for (k, v) in &self.ret {
let mut entry_size = 0;
entry_size += ::protobuf::rt::string_size(1, &k);
entry_size += ::protobuf::rt::string_size(2, &v);
os.write_raw_varint32(34)?; os.write_raw_varint32(entry_size as u32)?;
os.write_string(1, &k)?;
os.write_string(2, &v)?;
};
for (k, v) in &self.control_ret {
let mut entry_size = 0;
entry_size += ::protobuf::rt::string_size(1, &k);
entry_size += ::protobuf::rt::string_size(2, &v);
os.write_raw_varint32(50)?; os.write_raw_varint32(entry_size as u32)?;
os.write_string(1, &k)?;
os.write_string(2, &v)?;
};
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() -> FunctionDef {
FunctionDef::new()
}
fn clear(&mut self) {
self.signature.clear();
self.attr.clear();
self.arg_attr.clear();
self.resource_arg_unique_id.clear();
self.node_def.clear();
self.ret.clear();
self.control_ret.clear();
self.special_fields.clear();
}
fn default_instance() -> &'static FunctionDef {
static instance: ::protobuf::rt::Lazy<FunctionDef> = ::protobuf::rt::Lazy::new();
instance.get(FunctionDef::new)
}
}
impl ::protobuf::MessageFull for FunctionDef {
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("FunctionDef").unwrap()).clone()
}
}
impl ::std::fmt::Display for FunctionDef {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
::protobuf::text_format::fmt(self, f)
}
}
impl ::protobuf::reflect::ProtobufValue for FunctionDef {
type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage<Self>;
}
pub mod function_def {
#[derive(PartialEq,Clone,Default,Debug)]
pub struct ArgAttrs {
pub attr: ::std::collections::HashMap<::std::string::String, super::super::attr_value::AttrValue>,
pub special_fields: ::protobuf::SpecialFields,
}
impl<'a> ::std::default::Default for &'a ArgAttrs {
fn default() -> &'a ArgAttrs {
<ArgAttrs as ::protobuf::Message>::default_instance()
}
}
impl ArgAttrs {
pub fn new() -> ArgAttrs {
::std::default::Default::default()
}
pub(in super) fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData {
let mut fields = ::std::vec::Vec::with_capacity(1);
let mut oneofs = ::std::vec::Vec::with_capacity(0);
fields.push(::protobuf::reflect::rt::v2::make_map_simpler_accessor::<_, _, _>(
"attr",
|m: &ArgAttrs| { &m.attr },
|m: &mut ArgAttrs| { &mut m.attr },
));
::protobuf::reflect::GeneratedMessageDescriptorData::new_2::<ArgAttrs>(
"FunctionDef.ArgAttrs",
fields,
oneofs,
)
}
}
impl ::protobuf::Message for ArgAttrs {
const NAME: &'static str = "ArgAttrs";
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 => {
let len = is.read_raw_varint32()?;
let old_limit = is.push_limit(len as u64)?;
let mut key = ::std::default::Default::default();
let mut value = ::std::default::Default::default();
while let Some(tag) = is.read_raw_tag_or_eof()? {
match tag {
10 => key = is.read_string()?,
18 => value = is.read_message()?,
_ => ::protobuf::rt::skip_field_for_tag(tag, is)?,
};
}
is.pop_limit(old_limit);
self.attr.insert(key, value);
},
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;
for (k, v) in &self.attr {
let mut entry_size = 0;
entry_size += ::protobuf::rt::string_size(1, &k);
let len = v.compute_size();
entry_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len;
my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(entry_size) + entry_size
};
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<()> {
for (k, v) in &self.attr {
let mut entry_size = 0;
entry_size += ::protobuf::rt::string_size(1, &k);
let len = v.cached_size() as u64;
entry_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len;
os.write_raw_varint32(10)?; os.write_raw_varint32(entry_size as u32)?;
os.write_string(1, &k)?;
::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() -> ArgAttrs {
ArgAttrs::new()
}
fn clear(&mut self) {
self.attr.clear();
self.special_fields.clear();
}
fn default_instance() -> &'static ArgAttrs {
static instance: ::protobuf::rt::Lazy<ArgAttrs> = ::protobuf::rt::Lazy::new();
instance.get(ArgAttrs::new)
}
}
impl ::protobuf::MessageFull for ArgAttrs {
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("FunctionDef.ArgAttrs").unwrap()).clone()
}
}
impl ::std::fmt::Display for ArgAttrs {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
::protobuf::text_format::fmt(self, f)
}
}
impl ::protobuf::reflect::ProtobufValue for ArgAttrs {
type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage<Self>;
}
}
#[derive(PartialEq,Clone,Default,Debug)]
pub struct GradientDef {
pub function_name: ::std::string::String,
pub gradient_func: ::std::string::String,
pub special_fields: ::protobuf::SpecialFields,
}
impl<'a> ::std::default::Default for &'a GradientDef {
fn default() -> &'a GradientDef {
<GradientDef as ::protobuf::Message>::default_instance()
}
}
impl GradientDef {
pub fn new() -> GradientDef {
::std::default::Default::default()
}
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::<_, _>(
"function_name",
|m: &GradientDef| { &m.function_name },
|m: &mut GradientDef| { &mut m.function_name },
));
fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>(
"gradient_func",
|m: &GradientDef| { &m.gradient_func },
|m: &mut GradientDef| { &mut m.gradient_func },
));
::protobuf::reflect::GeneratedMessageDescriptorData::new_2::<GradientDef>(
"GradientDef",
fields,
oneofs,
)
}
}
impl ::protobuf::Message for GradientDef {
const NAME: &'static str = "GradientDef";
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.function_name = is.read_string()?;
},
18 => {
self.gradient_func = is.read_string()?;
},
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.function_name.is_empty() {
my_size += ::protobuf::rt::string_size(1, &self.function_name);
}
if !self.gradient_func.is_empty() {
my_size += ::protobuf::rt::string_size(2, &self.gradient_func);
}
my_size += ::protobuf::rt::unknown_fields_size(self.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.function_name.is_empty() {
os.write_string(1, &self.function_name)?;
}
if !self.gradient_func.is_empty() {
os.write_string(2, &self.gradient_func)?;
}
os.write_unknown_fields(self.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() -> GradientDef {
GradientDef::new()
}
fn clear(&mut self) {
self.function_name.clear();
self.gradient_func.clear();
self.special_fields.clear();
}
fn default_instance() -> &'static GradientDef {
static instance: GradientDef = GradientDef {
function_name: ::std::string::String::new(),
gradient_func: ::std::string::String::new(),
special_fields: ::protobuf::SpecialFields::new(),
};
&instance
}
}
impl ::protobuf::MessageFull for GradientDef {
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("GradientDef").unwrap()).clone()
}
}
impl ::std::fmt::Display for GradientDef {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
::protobuf::text_format::fmt(self, f)
}
}
impl ::protobuf::reflect::ProtobufValue for GradientDef {
type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage<Self>;
}
#[derive(PartialEq,Clone,Default,Debug)]
pub struct RegisteredGradient {
pub gradient_func: ::std::string::String,
pub registered_op_type: ::std::string::String,
pub special_fields: ::protobuf::SpecialFields,
}
impl<'a> ::std::default::Default for &'a RegisteredGradient {
fn default() -> &'a RegisteredGradient {
<RegisteredGradient as ::protobuf::Message>::default_instance()
}
}
impl RegisteredGradient {
pub fn new() -> RegisteredGradient {
::std::default::Default::default()
}
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::<_, _>(
"gradient_func",
|m: &RegisteredGradient| { &m.gradient_func },
|m: &mut RegisteredGradient| { &mut m.gradient_func },
));
fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>(
"registered_op_type",
|m: &RegisteredGradient| { &m.registered_op_type },
|m: &mut RegisteredGradient| { &mut m.registered_op_type },
));
::protobuf::reflect::GeneratedMessageDescriptorData::new_2::<RegisteredGradient>(
"RegisteredGradient",
fields,
oneofs,
)
}
}
impl ::protobuf::Message for RegisteredGradient {
const NAME: &'static str = "RegisteredGradient";
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.gradient_func = is.read_string()?;
},
18 => {
self.registered_op_type = is.read_string()?;
},
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.gradient_func.is_empty() {
my_size += ::protobuf::rt::string_size(1, &self.gradient_func);
}
if !self.registered_op_type.is_empty() {
my_size += ::protobuf::rt::string_size(2, &self.registered_op_type);
}
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.gradient_func.is_empty() {
os.write_string(1, &self.gradient_func)?;
}
if !self.registered_op_type.is_empty() {
os.write_string(2, &self.registered_op_type)?;
}
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() -> RegisteredGradient {
RegisteredGradient::new()
}
fn clear(&mut self) {
self.gradient_func.clear();
self.registered_op_type.clear();
self.special_fields.clear();
}
fn default_instance() -> &'static RegisteredGradient {
static instance: RegisteredGradient = RegisteredGradient {
gradient_func: ::std::string::String::new(),
registered_op_type: ::std::string::String::new(),
special_fields: ::protobuf::SpecialFields::new(),
};
&instance
}
}
impl ::protobuf::MessageFull for RegisteredGradient {
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("RegisteredGradient").unwrap()).clone()
}
}
impl ::std::fmt::Display for RegisteredGradient {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
::protobuf::text_format::fmt(self, f)
}
}
impl ::protobuf::reflect::ProtobufValue for RegisteredGradient {
type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage<Self>;
}
static file_descriptor_proto_data: &'static [u8] = b"\
\n(tensorflow/core/framework/function.proto\x12\ntensorflow\x1a*tensorfl\
ow/core/framework/attr_value.proto\x1a(tensorflow/core/framework/node_de\
f.proto\x1a&tensorflow/core/framework/op_def.proto\"\xd1\x01\n\x12Functi\
onDefLibrary\x123\n\x08function\x18\x01\x20\x03(\x0b2\x17.tensorflow.Fun\
ctionDefR\x08function\x123\n\x08gradient\x18\x02\x20\x03(\x0b2\x17.tenso\
rflow.GradientDefR\x08gradient\x12Q\n\x14registered_gradients\x18\x03\
\x20\x03(\x0b2\x1e.tensorflow.RegisteredGradientR\x13registeredGradients\
\"\xdb\x07\n\x0bFunctionDef\x12/\n\tsignature\x18\x01\x20\x01(\x0b2\x11.\
tensorflow.OpDefR\tsignature\x125\n\x04attr\x18\x05\x20\x03(\x0b2!.tenso\
rflow.FunctionDef.AttrEntryR\x04attr\x12?\n\x08arg_attr\x18\x07\x20\x03(\
\x0b2$.tensorflow.FunctionDef.ArgAttrEntryR\x07argAttr\x12e\n\x16resourc\
e_arg_unique_id\x18\x08\x20\x03(\x0b20.tensorflow.FunctionDef.ResourceAr\
gUniqueIdEntryR\x13resourceArgUniqueId\x12.\n\x08node_def\x18\x03\x20\
\x03(\x0b2\x13.tensorflow.NodeDefR\x07nodeDef\x122\n\x03ret\x18\x04\x20\
\x03(\x0b2\x20.tensorflow.FunctionDef.RetEntryR\x03ret\x12H\n\x0bcontrol\
_ret\x18\x06\x20\x03(\x0b2'.tensorflow.FunctionDef.ControlRetEntryR\ncon\
trolRet\x1aN\n\tAttrEntry\x12\x10\n\x03key\x18\x01\x20\x01(\tR\x03key\
\x12+\n\x05value\x18\x02\x20\x01(\x0b2\x15.tensorflow.AttrValueR\x05valu\
e:\x028\x01\x1a\x9a\x01\n\x08ArgAttrs\x12>\n\x04attr\x18\x01\x20\x03(\
\x0b2*.tensorflow.FunctionDef.ArgAttrs.AttrEntryR\x04attr\x1aN\n\tAttrEn\
try\x12\x10\n\x03key\x18\x01\x20\x01(\tR\x03key\x12+\n\x05value\x18\x02\
\x20\x01(\x0b2\x15.tensorflow.AttrValueR\x05value:\x028\x01\x1a\\\n\x0cA\
rgAttrEntry\x12\x10\n\x03key\x18\x01\x20\x01(\rR\x03key\x126\n\x05value\
\x18\x02\x20\x01(\x0b2\x20.tensorflow.FunctionDef.ArgAttrsR\x05value:\
\x028\x01\x1aF\n\x18ResourceArgUniqueIdEntry\x12\x10\n\x03key\x18\x01\
\x20\x01(\rR\x03key\x12\x14\n\x05value\x18\x02\x20\x01(\rR\x05value:\x02\
8\x01\x1a6\n\x08RetEntry\x12\x10\n\x03key\x18\x01\x20\x01(\tR\x03key\x12\
\x14\n\x05value\x18\x02\x20\x01(\tR\x05value:\x028\x01\x1a=\n\x0fControl\
RetEntry\x12\x10\n\x03key\x18\x01\x20\x01(\tR\x03key\x12\x14\n\x05value\
\x18\x02\x20\x01(\tR\x05value:\x028\x01J\x04\x08\x02\x10\x03\"W\n\x0bGra\
dientDef\x12#\n\rfunction_name\x18\x01\x20\x01(\tR\x0cfunctionName\x12#\
\n\rgradient_func\x18\x02\x20\x01(\tR\x0cgradientFunc\"g\n\x12Registered\
Gradient\x12#\n\rgradient_func\x18\x01\x20\x01(\tR\x0cgradientFunc\x12,\
\n\x12registered_op_type\x18\x02\x20\x01(\tR\x10registeredOpTypeB\x80\
\x01\n\x18org.tensorflow.frameworkB\x0eFunctionProtosP\x01ZOgithub.com/t\
ensorflow/tensorflow/tensorflow/go/core/framework/function_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(3);
deps.push(super::attr_value::file_descriptor().clone());
deps.push(super::node_def::file_descriptor().clone());
deps.push(super::op_def::file_descriptor().clone());
let mut messages = ::std::vec::Vec::with_capacity(5);
messages.push(FunctionDefLibrary::generated_message_descriptor_data());
messages.push(FunctionDef::generated_message_descriptor_data());
messages.push(GradientDef::generated_message_descriptor_data());
messages.push(RegisteredGradient::generated_message_descriptor_data());
messages.push(function_def::ArgAttrs::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)
})
}