#![allow(unknown_lints)]
#![allow(clippy::all)]
#![allow(unused_attributes)]
#![cfg_attr(rustfmt, rustfmt::skip)]
#![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_7_2;
#[derive(PartialEq,Clone,Default,Debug)]
pub struct AttributeProto {
pub name: ::std::string::String,
pub ref_attr_name: ::std::string::String,
pub doc_string: ::std::string::String,
pub type_: ::protobuf::EnumOrUnknown<attribute_proto::AttributeType>,
pub f: f32,
pub i: i64,
pub s: ::std::vec::Vec<u8>,
pub t: ::protobuf::MessageField<TensorProto>,
pub g: ::protobuf::MessageField<GraphProto>,
pub sparse_tensor: ::protobuf::MessageField<SparseTensorProto>,
pub tp: ::protobuf::MessageField<TypeProto>,
pub floats: ::std::vec::Vec<f32>,
pub ints: ::std::vec::Vec<i64>,
pub strings: ::std::vec::Vec<::std::vec::Vec<u8>>,
pub tensors: ::std::vec::Vec<TensorProto>,
pub graphs: ::std::vec::Vec<GraphProto>,
pub sparse_tensors: ::std::vec::Vec<SparseTensorProto>,
pub type_protos: ::std::vec::Vec<TypeProto>,
pub special_fields: ::protobuf::SpecialFields,
}
impl<'a> ::std::default::Default for &'a AttributeProto {
fn default() -> &'a AttributeProto {
<AttributeProto as ::protobuf::Message>::default_instance()
}
}
impl AttributeProto {
pub fn new() -> AttributeProto {
::std::default::Default::default()
}
}
impl ::protobuf::Message for AttributeProto {
const NAME: &'static str = "AttributeProto";
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.name = is.read_string()?;
},
170 => {
self.ref_attr_name = is.read_string()?;
},
106 => {
self.doc_string = is.read_string()?;
},
160 => {
self.type_ = is.read_enum_or_unknown()?;
},
21 => {
self.f = is.read_float()?;
},
24 => {
self.i = is.read_int64()?;
},
34 => {
self.s = is.read_bytes()?;
},
42 => {
::protobuf::rt::read_singular_message_into_field(is, &mut self.t)?;
},
50 => {
::protobuf::rt::read_singular_message_into_field(is, &mut self.g)?;
},
178 => {
::protobuf::rt::read_singular_message_into_field(is, &mut self.sparse_tensor)?;
},
114 => {
::protobuf::rt::read_singular_message_into_field(is, &mut self.tp)?;
},
58 => {
is.read_repeated_packed_float_into(&mut self.floats)?;
},
61 => {
self.floats.push(is.read_float()?);
},
66 => {
is.read_repeated_packed_int64_into(&mut self.ints)?;
},
64 => {
self.ints.push(is.read_int64()?);
},
74 => {
self.strings.push(is.read_bytes()?);
},
82 => {
self.tensors.push(is.read_message()?);
},
90 => {
self.graphs.push(is.read_message()?);
},
186 => {
self.sparse_tensors.push(is.read_message()?);
},
122 => {
self.type_protos.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.name.is_empty() {
my_size += ::protobuf::rt::string_size(1, &self.name);
}
if !self.ref_attr_name.is_empty() {
my_size += ::protobuf::rt::string_size(21, &self.ref_attr_name);
}
if !self.doc_string.is_empty() {
my_size += ::protobuf::rt::string_size(13, &self.doc_string);
}
if self.type_ != ::protobuf::EnumOrUnknown::new(attribute_proto::AttributeType::UNDEFINED) {
my_size += ::protobuf::rt::int32_size(20, self.type_.value());
}
if self.f != 0. {
my_size += 1 + 4;
}
if self.i != 0 {
my_size += ::protobuf::rt::int64_size(3, self.i);
}
if !self.s.is_empty() {
my_size += ::protobuf::rt::bytes_size(4, &self.s);
}
if let Some(v) = self.t.as_ref() {
let len = v.compute_size();
my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len;
}
if let Some(v) = self.g.as_ref() {
let len = v.compute_size();
my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len;
}
if let Some(v) = self.sparse_tensor.as_ref() {
let len = v.compute_size();
my_size += 2 + ::protobuf::rt::compute_raw_varint64_size(len) + len;
}
if let Some(v) = self.tp.as_ref() {
let len = v.compute_size();
my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len;
}
my_size += ::protobuf::rt::vec_packed_float_size(7, &self.floats);
my_size += ::protobuf::rt::vec_packed_int64_size(8, &self.ints);
for value in &self.strings {
my_size += ::protobuf::rt::bytes_size(9, &value);
};
for value in &self.tensors {
let len = value.compute_size();
my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len;
};
for value in &self.graphs {
let len = value.compute_size();
my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len;
};
for value in &self.sparse_tensors {
let len = value.compute_size();
my_size += 2 + ::protobuf::rt::compute_raw_varint64_size(len) + len;
};
for value in &self.type_protos {
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.name.is_empty() {
os.write_string(1, &self.name)?;
}
if !self.ref_attr_name.is_empty() {
os.write_string(21, &self.ref_attr_name)?;
}
if !self.doc_string.is_empty() {
os.write_string(13, &self.doc_string)?;
}
if self.type_ != ::protobuf::EnumOrUnknown::new(attribute_proto::AttributeType::UNDEFINED) {
os.write_enum(20, ::protobuf::EnumOrUnknown::value(&self.type_))?;
}
if self.f != 0. {
os.write_float(2, self.f)?;
}
if self.i != 0 {
os.write_int64(3, self.i)?;
}
if !self.s.is_empty() {
os.write_bytes(4, &self.s)?;
}
if let Some(v) = self.t.as_ref() {
::protobuf::rt::write_message_field_with_cached_size(5, v, os)?;
}
if let Some(v) = self.g.as_ref() {
::protobuf::rt::write_message_field_with_cached_size(6, v, os)?;
}
if let Some(v) = self.sparse_tensor.as_ref() {
::protobuf::rt::write_message_field_with_cached_size(22, v, os)?;
}
if let Some(v) = self.tp.as_ref() {
::protobuf::rt::write_message_field_with_cached_size(14, v, os)?;
}
os.write_repeated_packed_float(7, &self.floats)?;
os.write_repeated_packed_int64(8, &self.ints)?;
for v in &self.strings {
os.write_bytes(9, &v)?;
};
for v in &self.tensors {
::protobuf::rt::write_message_field_with_cached_size(10, v, os)?;
};
for v in &self.graphs {
::protobuf::rt::write_message_field_with_cached_size(11, v, os)?;
};
for v in &self.sparse_tensors {
::protobuf::rt::write_message_field_with_cached_size(23, v, os)?;
};
for v in &self.type_protos {
::protobuf::rt::write_message_field_with_cached_size(15, 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() -> AttributeProto {
AttributeProto::new()
}
fn clear(&mut self) {
self.name.clear();
self.ref_attr_name.clear();
self.doc_string.clear();
self.type_ = ::protobuf::EnumOrUnknown::new(attribute_proto::AttributeType::UNDEFINED);
self.f = 0.;
self.i = 0;
self.s.clear();
self.t.clear();
self.g.clear();
self.sparse_tensor.clear();
self.tp.clear();
self.floats.clear();
self.ints.clear();
self.strings.clear();
self.tensors.clear();
self.graphs.clear();
self.sparse_tensors.clear();
self.type_protos.clear();
self.special_fields.clear();
}
fn default_instance() -> &'static AttributeProto {
static instance: AttributeProto = AttributeProto {
name: ::std::string::String::new(),
ref_attr_name: ::std::string::String::new(),
doc_string: ::std::string::String::new(),
type_: ::protobuf::EnumOrUnknown::from_i32(0),
f: 0.,
i: 0,
s: ::std::vec::Vec::new(),
t: ::protobuf::MessageField::none(),
g: ::protobuf::MessageField::none(),
sparse_tensor: ::protobuf::MessageField::none(),
tp: ::protobuf::MessageField::none(),
floats: ::std::vec::Vec::new(),
ints: ::std::vec::Vec::new(),
strings: ::std::vec::Vec::new(),
tensors: ::std::vec::Vec::new(),
graphs: ::std::vec::Vec::new(),
sparse_tensors: ::std::vec::Vec::new(),
type_protos: ::std::vec::Vec::new(),
special_fields: ::protobuf::SpecialFields::new(),
};
&instance
}
}
pub mod attribute_proto {
#[derive(Clone,Copy,PartialEq,Eq,Debug,Hash)]
pub enum AttributeType {
UNDEFINED = 0,
FLOAT = 1,
INT = 2,
STRING = 3,
TENSOR = 4,
GRAPH = 5,
SPARSE_TENSOR = 11,
TYPE_PROTO = 13,
FLOATS = 6,
INTS = 7,
STRINGS = 8,
TENSORS = 9,
GRAPHS = 10,
SPARSE_TENSORS = 12,
TYPE_PROTOS = 14,
}
impl ::protobuf::Enum for AttributeType {
const NAME: &'static str = "AttributeType";
fn value(&self) -> i32 {
*self as i32
}
fn from_i32(value: i32) -> ::std::option::Option<AttributeType> {
match value {
0 => ::std::option::Option::Some(AttributeType::UNDEFINED),
1 => ::std::option::Option::Some(AttributeType::FLOAT),
2 => ::std::option::Option::Some(AttributeType::INT),
3 => ::std::option::Option::Some(AttributeType::STRING),
4 => ::std::option::Option::Some(AttributeType::TENSOR),
5 => ::std::option::Option::Some(AttributeType::GRAPH),
11 => ::std::option::Option::Some(AttributeType::SPARSE_TENSOR),
13 => ::std::option::Option::Some(AttributeType::TYPE_PROTO),
6 => ::std::option::Option::Some(AttributeType::FLOATS),
7 => ::std::option::Option::Some(AttributeType::INTS),
8 => ::std::option::Option::Some(AttributeType::STRINGS),
9 => ::std::option::Option::Some(AttributeType::TENSORS),
10 => ::std::option::Option::Some(AttributeType::GRAPHS),
12 => ::std::option::Option::Some(AttributeType::SPARSE_TENSORS),
14 => ::std::option::Option::Some(AttributeType::TYPE_PROTOS),
_ => ::std::option::Option::None
}
}
fn from_str(str: &str) -> ::std::option::Option<AttributeType> {
match str {
"UNDEFINED" => ::std::option::Option::Some(AttributeType::UNDEFINED),
"FLOAT" => ::std::option::Option::Some(AttributeType::FLOAT),
"INT" => ::std::option::Option::Some(AttributeType::INT),
"STRING" => ::std::option::Option::Some(AttributeType::STRING),
"TENSOR" => ::std::option::Option::Some(AttributeType::TENSOR),
"GRAPH" => ::std::option::Option::Some(AttributeType::GRAPH),
"SPARSE_TENSOR" => ::std::option::Option::Some(AttributeType::SPARSE_TENSOR),
"TYPE_PROTO" => ::std::option::Option::Some(AttributeType::TYPE_PROTO),
"FLOATS" => ::std::option::Option::Some(AttributeType::FLOATS),
"INTS" => ::std::option::Option::Some(AttributeType::INTS),
"STRINGS" => ::std::option::Option::Some(AttributeType::STRINGS),
"TENSORS" => ::std::option::Option::Some(AttributeType::TENSORS),
"GRAPHS" => ::std::option::Option::Some(AttributeType::GRAPHS),
"SPARSE_TENSORS" => ::std::option::Option::Some(AttributeType::SPARSE_TENSORS),
"TYPE_PROTOS" => ::std::option::Option::Some(AttributeType::TYPE_PROTOS),
_ => ::std::option::Option::None
}
}
const VALUES: &'static [AttributeType] = &[
AttributeType::UNDEFINED,
AttributeType::FLOAT,
AttributeType::INT,
AttributeType::STRING,
AttributeType::TENSOR,
AttributeType::GRAPH,
AttributeType::SPARSE_TENSOR,
AttributeType::TYPE_PROTO,
AttributeType::FLOATS,
AttributeType::INTS,
AttributeType::STRINGS,
AttributeType::TENSORS,
AttributeType::GRAPHS,
AttributeType::SPARSE_TENSORS,
AttributeType::TYPE_PROTOS,
];
}
impl ::std::default::Default for AttributeType {
fn default() -> Self {
AttributeType::UNDEFINED
}
}
}
#[derive(PartialEq,Clone,Default,Debug)]
pub struct ValueInfoProto {
pub name: ::std::string::String,
pub type_: ::protobuf::MessageField<TypeProto>,
pub doc_string: ::std::string::String,
pub metadata_props: ::std::vec::Vec<StringStringEntryProto>,
pub special_fields: ::protobuf::SpecialFields,
}
impl<'a> ::std::default::Default for &'a ValueInfoProto {
fn default() -> &'a ValueInfoProto {
<ValueInfoProto as ::protobuf::Message>::default_instance()
}
}
impl ValueInfoProto {
pub fn new() -> ValueInfoProto {
::std::default::Default::default()
}
}
impl ::protobuf::Message for ValueInfoProto {
const NAME: &'static str = "ValueInfoProto";
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.name = is.read_string()?;
},
18 => {
::protobuf::rt::read_singular_message_into_field(is, &mut self.type_)?;
},
26 => {
self.doc_string = is.read_string()?;
},
34 => {
self.metadata_props.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.name.is_empty() {
my_size += ::protobuf::rt::string_size(1, &self.name);
}
if let Some(v) = self.type_.as_ref() {
let len = v.compute_size();
my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len;
}
if !self.doc_string.is_empty() {
my_size += ::protobuf::rt::string_size(3, &self.doc_string);
}
for value in &self.metadata_props {
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.name.is_empty() {
os.write_string(1, &self.name)?;
}
if let Some(v) = self.type_.as_ref() {
::protobuf::rt::write_message_field_with_cached_size(2, v, os)?;
}
if !self.doc_string.is_empty() {
os.write_string(3, &self.doc_string)?;
}
for v in &self.metadata_props {
::protobuf::rt::write_message_field_with_cached_size(4, 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() -> ValueInfoProto {
ValueInfoProto::new()
}
fn clear(&mut self) {
self.name.clear();
self.type_.clear();
self.doc_string.clear();
self.metadata_props.clear();
self.special_fields.clear();
}
fn default_instance() -> &'static ValueInfoProto {
static instance: ValueInfoProto = ValueInfoProto {
name: ::std::string::String::new(),
type_: ::protobuf::MessageField::none(),
doc_string: ::std::string::String::new(),
metadata_props: ::std::vec::Vec::new(),
special_fields: ::protobuf::SpecialFields::new(),
};
&instance
}
}
#[derive(PartialEq,Clone,Default,Debug)]
pub struct NodeProto {
pub input: ::std::vec::Vec<::std::string::String>,
pub output: ::std::vec::Vec<::std::string::String>,
pub name: ::std::string::String,
pub op_type: ::std::string::String,
pub domain: ::std::string::String,
pub overload: ::std::string::String,
pub attribute: ::std::vec::Vec<AttributeProto>,
pub doc_string: ::std::string::String,
pub metadata_props: ::std::vec::Vec<StringStringEntryProto>,
pub special_fields: ::protobuf::SpecialFields,
}
impl<'a> ::std::default::Default for &'a NodeProto {
fn default() -> &'a NodeProto {
<NodeProto as ::protobuf::Message>::default_instance()
}
}
impl NodeProto {
pub fn new() -> NodeProto {
::std::default::Default::default()
}
}
impl ::protobuf::Message for NodeProto {
const NAME: &'static str = "NodeProto";
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.input.push(is.read_string()?);
},
18 => {
self.output.push(is.read_string()?);
},
26 => {
self.name = is.read_string()?;
},
34 => {
self.op_type = is.read_string()?;
},
58 => {
self.domain = is.read_string()?;
},
66 => {
self.overload = is.read_string()?;
},
42 => {
self.attribute.push(is.read_message()?);
},
50 => {
self.doc_string = is.read_string()?;
},
74 => {
self.metadata_props.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.input {
my_size += ::protobuf::rt::string_size(1, &value);
};
for value in &self.output {
my_size += ::protobuf::rt::string_size(2, &value);
};
if !self.name.is_empty() {
my_size += ::protobuf::rt::string_size(3, &self.name);
}
if !self.op_type.is_empty() {
my_size += ::protobuf::rt::string_size(4, &self.op_type);
}
if !self.domain.is_empty() {
my_size += ::protobuf::rt::string_size(7, &self.domain);
}
if !self.overload.is_empty() {
my_size += ::protobuf::rt::string_size(8, &self.overload);
}
for value in &self.attribute {
let len = value.compute_size();
my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len;
};
if !self.doc_string.is_empty() {
my_size += ::protobuf::rt::string_size(6, &self.doc_string);
}
for value in &self.metadata_props {
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.input {
os.write_string(1, &v)?;
};
for v in &self.output {
os.write_string(2, &v)?;
};
if !self.name.is_empty() {
os.write_string(3, &self.name)?;
}
if !self.op_type.is_empty() {
os.write_string(4, &self.op_type)?;
}
if !self.domain.is_empty() {
os.write_string(7, &self.domain)?;
}
if !self.overload.is_empty() {
os.write_string(8, &self.overload)?;
}
for v in &self.attribute {
::protobuf::rt::write_message_field_with_cached_size(5, v, os)?;
};
if !self.doc_string.is_empty() {
os.write_string(6, &self.doc_string)?;
}
for v in &self.metadata_props {
::protobuf::rt::write_message_field_with_cached_size(9, 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() -> NodeProto {
NodeProto::new()
}
fn clear(&mut self) {
self.input.clear();
self.output.clear();
self.name.clear();
self.op_type.clear();
self.domain.clear();
self.overload.clear();
self.attribute.clear();
self.doc_string.clear();
self.metadata_props.clear();
self.special_fields.clear();
}
fn default_instance() -> &'static NodeProto {
static instance: NodeProto = NodeProto {
input: ::std::vec::Vec::new(),
output: ::std::vec::Vec::new(),
name: ::std::string::String::new(),
op_type: ::std::string::String::new(),
domain: ::std::string::String::new(),
overload: ::std::string::String::new(),
attribute: ::std::vec::Vec::new(),
doc_string: ::std::string::String::new(),
metadata_props: ::std::vec::Vec::new(),
special_fields: ::protobuf::SpecialFields::new(),
};
&instance
}
}
#[derive(PartialEq,Clone,Default,Debug)]
pub struct TrainingInfoProto {
pub initialization: ::protobuf::MessageField<GraphProto>,
pub algorithm: ::protobuf::MessageField<GraphProto>,
pub initialization_binding: ::std::vec::Vec<StringStringEntryProto>,
pub update_binding: ::std::vec::Vec<StringStringEntryProto>,
pub special_fields: ::protobuf::SpecialFields,
}
impl<'a> ::std::default::Default for &'a TrainingInfoProto {
fn default() -> &'a TrainingInfoProto {
<TrainingInfoProto as ::protobuf::Message>::default_instance()
}
}
impl TrainingInfoProto {
pub fn new() -> TrainingInfoProto {
::std::default::Default::default()
}
}
impl ::protobuf::Message for TrainingInfoProto {
const NAME: &'static str = "TrainingInfoProto";
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.initialization)?;
},
18 => {
::protobuf::rt::read_singular_message_into_field(is, &mut self.algorithm)?;
},
26 => {
self.initialization_binding.push(is.read_message()?);
},
34 => {
self.update_binding.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 let Some(v) = self.initialization.as_ref() {
let len = v.compute_size();
my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len;
}
if let Some(v) = self.algorithm.as_ref() {
let len = v.compute_size();
my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len;
}
for value in &self.initialization_binding {
let len = value.compute_size();
my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len;
};
for value in &self.update_binding {
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 let Some(v) = self.initialization.as_ref() {
::protobuf::rt::write_message_field_with_cached_size(1, v, os)?;
}
if let Some(v) = self.algorithm.as_ref() {
::protobuf::rt::write_message_field_with_cached_size(2, v, os)?;
}
for v in &self.initialization_binding {
::protobuf::rt::write_message_field_with_cached_size(3, v, os)?;
};
for v in &self.update_binding {
::protobuf::rt::write_message_field_with_cached_size(4, 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() -> TrainingInfoProto {
TrainingInfoProto::new()
}
fn clear(&mut self) {
self.initialization.clear();
self.algorithm.clear();
self.initialization_binding.clear();
self.update_binding.clear();
self.special_fields.clear();
}
fn default_instance() -> &'static TrainingInfoProto {
static instance: TrainingInfoProto = TrainingInfoProto {
initialization: ::protobuf::MessageField::none(),
algorithm: ::protobuf::MessageField::none(),
initialization_binding: ::std::vec::Vec::new(),
update_binding: ::std::vec::Vec::new(),
special_fields: ::protobuf::SpecialFields::new(),
};
&instance
}
}
#[derive(PartialEq,Clone,Default,Debug)]
pub struct ModelProto {
pub ir_version: i64,
pub opset_import: ::std::vec::Vec<OperatorSetIdProto>,
pub producer_name: ::std::string::String,
pub producer_version: ::std::string::String,
pub domain: ::std::string::String,
pub model_version: i64,
pub doc_string: ::std::string::String,
pub graph: ::protobuf::MessageField<GraphProto>,
pub metadata_props: ::std::vec::Vec<StringStringEntryProto>,
pub training_info: ::std::vec::Vec<TrainingInfoProto>,
pub functions: ::std::vec::Vec<FunctionProto>,
pub special_fields: ::protobuf::SpecialFields,
}
impl<'a> ::std::default::Default for &'a ModelProto {
fn default() -> &'a ModelProto {
<ModelProto as ::protobuf::Message>::default_instance()
}
}
impl ModelProto {
pub fn new() -> ModelProto {
::std::default::Default::default()
}
}
impl ::protobuf::Message for ModelProto {
const NAME: &'static str = "ModelProto";
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.ir_version = is.read_int64()?;
},
66 => {
self.opset_import.push(is.read_message()?);
},
18 => {
self.producer_name = is.read_string()?;
},
26 => {
self.producer_version = is.read_string()?;
},
34 => {
self.domain = is.read_string()?;
},
40 => {
self.model_version = is.read_int64()?;
},
50 => {
self.doc_string = is.read_string()?;
},
58 => {
::protobuf::rt::read_singular_message_into_field(is, &mut self.graph)?;
},
114 => {
self.metadata_props.push(is.read_message()?);
},
162 => {
self.training_info.push(is.read_message()?);
},
202 => {
self.functions.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.ir_version != 0 {
my_size += ::protobuf::rt::int64_size(1, self.ir_version);
}
for value in &self.opset_import {
let len = value.compute_size();
my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len;
};
if !self.producer_name.is_empty() {
my_size += ::protobuf::rt::string_size(2, &self.producer_name);
}
if !self.producer_version.is_empty() {
my_size += ::protobuf::rt::string_size(3, &self.producer_version);
}
if !self.domain.is_empty() {
my_size += ::protobuf::rt::string_size(4, &self.domain);
}
if self.model_version != 0 {
my_size += ::protobuf::rt::int64_size(5, self.model_version);
}
if !self.doc_string.is_empty() {
my_size += ::protobuf::rt::string_size(6, &self.doc_string);
}
if let Some(v) = self.graph.as_ref() {
let len = v.compute_size();
my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len;
}
for value in &self.metadata_props {
let len = value.compute_size();
my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len;
};
for value in &self.training_info {
let len = value.compute_size();
my_size += 2 + ::protobuf::rt::compute_raw_varint64_size(len) + len;
};
for value in &self.functions {
let len = value.compute_size();
my_size += 2 + ::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.ir_version != 0 {
os.write_int64(1, self.ir_version)?;
}
for v in &self.opset_import {
::protobuf::rt::write_message_field_with_cached_size(8, v, os)?;
};
if !self.producer_name.is_empty() {
os.write_string(2, &self.producer_name)?;
}
if !self.producer_version.is_empty() {
os.write_string(3, &self.producer_version)?;
}
if !self.domain.is_empty() {
os.write_string(4, &self.domain)?;
}
if self.model_version != 0 {
os.write_int64(5, self.model_version)?;
}
if !self.doc_string.is_empty() {
os.write_string(6, &self.doc_string)?;
}
if let Some(v) = self.graph.as_ref() {
::protobuf::rt::write_message_field_with_cached_size(7, v, os)?;
}
for v in &self.metadata_props {
::protobuf::rt::write_message_field_with_cached_size(14, v, os)?;
};
for v in &self.training_info {
::protobuf::rt::write_message_field_with_cached_size(20, v, os)?;
};
for v in &self.functions {
::protobuf::rt::write_message_field_with_cached_size(25, 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() -> ModelProto {
ModelProto::new()
}
fn clear(&mut self) {
self.ir_version = 0;
self.opset_import.clear();
self.producer_name.clear();
self.producer_version.clear();
self.domain.clear();
self.model_version = 0;
self.doc_string.clear();
self.graph.clear();
self.metadata_props.clear();
self.training_info.clear();
self.functions.clear();
self.special_fields.clear();
}
fn default_instance() -> &'static ModelProto {
static instance: ModelProto = ModelProto {
ir_version: 0,
opset_import: ::std::vec::Vec::new(),
producer_name: ::std::string::String::new(),
producer_version: ::std::string::String::new(),
domain: ::std::string::String::new(),
model_version: 0,
doc_string: ::std::string::String::new(),
graph: ::protobuf::MessageField::none(),
metadata_props: ::std::vec::Vec::new(),
training_info: ::std::vec::Vec::new(),
functions: ::std::vec::Vec::new(),
special_fields: ::protobuf::SpecialFields::new(),
};
&instance
}
}
#[derive(PartialEq,Clone,Default,Debug)]
pub struct StringStringEntryProto {
pub key: ::std::string::String,
pub value: ::std::string::String,
pub special_fields: ::protobuf::SpecialFields,
}
impl<'a> ::std::default::Default for &'a StringStringEntryProto {
fn default() -> &'a StringStringEntryProto {
<StringStringEntryProto as ::protobuf::Message>::default_instance()
}
}
impl StringStringEntryProto {
pub fn new() -> StringStringEntryProto {
::std::default::Default::default()
}
}
impl ::protobuf::Message for StringStringEntryProto {
const NAME: &'static str = "StringStringEntryProto";
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.key = is.read_string()?;
},
18 => {
self.value = 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.key.is_empty() {
my_size += ::protobuf::rt::string_size(1, &self.key);
}
if !self.value.is_empty() {
my_size += ::protobuf::rt::string_size(2, &self.value);
}
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.key.is_empty() {
os.write_string(1, &self.key)?;
}
if !self.value.is_empty() {
os.write_string(2, &self.value)?;
}
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() -> StringStringEntryProto {
StringStringEntryProto::new()
}
fn clear(&mut self) {
self.key.clear();
self.value.clear();
self.special_fields.clear();
}
fn default_instance() -> &'static StringStringEntryProto {
static instance: StringStringEntryProto = StringStringEntryProto {
key: ::std::string::String::new(),
value: ::std::string::String::new(),
special_fields: ::protobuf::SpecialFields::new(),
};
&instance
}
}
#[derive(PartialEq,Clone,Default,Debug)]
pub struct TensorAnnotation {
pub tensor_name: ::std::string::String,
pub quant_parameter_tensor_names: ::std::vec::Vec<StringStringEntryProto>,
pub special_fields: ::protobuf::SpecialFields,
}
impl<'a> ::std::default::Default for &'a TensorAnnotation {
fn default() -> &'a TensorAnnotation {
<TensorAnnotation as ::protobuf::Message>::default_instance()
}
}
impl TensorAnnotation {
pub fn new() -> TensorAnnotation {
::std::default::Default::default()
}
}
impl ::protobuf::Message for TensorAnnotation {
const NAME: &'static str = "TensorAnnotation";
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.tensor_name = is.read_string()?;
},
18 => {
self.quant_parameter_tensor_names.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.tensor_name.is_empty() {
my_size += ::protobuf::rt::string_size(1, &self.tensor_name);
}
for value in &self.quant_parameter_tensor_names {
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.tensor_name.is_empty() {
os.write_string(1, &self.tensor_name)?;
}
for v in &self.quant_parameter_tensor_names {
::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() -> TensorAnnotation {
TensorAnnotation::new()
}
fn clear(&mut self) {
self.tensor_name.clear();
self.quant_parameter_tensor_names.clear();
self.special_fields.clear();
}
fn default_instance() -> &'static TensorAnnotation {
static instance: TensorAnnotation = TensorAnnotation {
tensor_name: ::std::string::String::new(),
quant_parameter_tensor_names: ::std::vec::Vec::new(),
special_fields: ::protobuf::SpecialFields::new(),
};
&instance
}
}
#[derive(PartialEq,Clone,Default,Debug)]
pub struct GraphProto {
pub node: ::std::vec::Vec<NodeProto>,
pub name: ::std::string::String,
pub initializer: ::std::vec::Vec<TensorProto>,
pub sparse_initializer: ::std::vec::Vec<SparseTensorProto>,
pub doc_string: ::std::string::String,
pub input: ::std::vec::Vec<ValueInfoProto>,
pub output: ::std::vec::Vec<ValueInfoProto>,
pub value_info: ::std::vec::Vec<ValueInfoProto>,
pub quantization_annotation: ::std::vec::Vec<TensorAnnotation>,
pub metadata_props: ::std::vec::Vec<StringStringEntryProto>,
pub special_fields: ::protobuf::SpecialFields,
}
impl<'a> ::std::default::Default for &'a GraphProto {
fn default() -> &'a GraphProto {
<GraphProto as ::protobuf::Message>::default_instance()
}
}
impl GraphProto {
pub fn new() -> GraphProto {
::std::default::Default::default()
}
}
impl ::protobuf::Message for GraphProto {
const NAME: &'static str = "GraphProto";
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.node.push(is.read_message()?);
},
18 => {
self.name = is.read_string()?;
},
42 => {
self.initializer.push(is.read_message()?);
},
122 => {
self.sparse_initializer.push(is.read_message()?);
},
82 => {
self.doc_string = is.read_string()?;
},
90 => {
self.input.push(is.read_message()?);
},
98 => {
self.output.push(is.read_message()?);
},
106 => {
self.value_info.push(is.read_message()?);
},
114 => {
self.quantization_annotation.push(is.read_message()?);
},
130 => {
self.metadata_props.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.node {
let len = value.compute_size();
my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len;
};
if !self.name.is_empty() {
my_size += ::protobuf::rt::string_size(2, &self.name);
}
for value in &self.initializer {
let len = value.compute_size();
my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len;
};
for value in &self.sparse_initializer {
let len = value.compute_size();
my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len;
};
if !self.doc_string.is_empty() {
my_size += ::protobuf::rt::string_size(10, &self.doc_string);
}
for value in &self.input {
let len = value.compute_size();
my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len;
};
for value in &self.output {
let len = value.compute_size();
my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len;
};
for value in &self.value_info {
let len = value.compute_size();
my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len;
};
for value in &self.quantization_annotation {
let len = value.compute_size();
my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len;
};
for value in &self.metadata_props {
let len = value.compute_size();
my_size += 2 + ::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.node {
::protobuf::rt::write_message_field_with_cached_size(1, v, os)?;
};
if !self.name.is_empty() {
os.write_string(2, &self.name)?;
}
for v in &self.initializer {
::protobuf::rt::write_message_field_with_cached_size(5, v, os)?;
};
for v in &self.sparse_initializer {
::protobuf::rt::write_message_field_with_cached_size(15, v, os)?;
};
if !self.doc_string.is_empty() {
os.write_string(10, &self.doc_string)?;
}
for v in &self.input {
::protobuf::rt::write_message_field_with_cached_size(11, v, os)?;
};
for v in &self.output {
::protobuf::rt::write_message_field_with_cached_size(12, v, os)?;
};
for v in &self.value_info {
::protobuf::rt::write_message_field_with_cached_size(13, v, os)?;
};
for v in &self.quantization_annotation {
::protobuf::rt::write_message_field_with_cached_size(14, v, os)?;
};
for v in &self.metadata_props {
::protobuf::rt::write_message_field_with_cached_size(16, 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() -> GraphProto {
GraphProto::new()
}
fn clear(&mut self) {
self.node.clear();
self.name.clear();
self.initializer.clear();
self.sparse_initializer.clear();
self.doc_string.clear();
self.input.clear();
self.output.clear();
self.value_info.clear();
self.quantization_annotation.clear();
self.metadata_props.clear();
self.special_fields.clear();
}
fn default_instance() -> &'static GraphProto {
static instance: GraphProto = GraphProto {
node: ::std::vec::Vec::new(),
name: ::std::string::String::new(),
initializer: ::std::vec::Vec::new(),
sparse_initializer: ::std::vec::Vec::new(),
doc_string: ::std::string::String::new(),
input: ::std::vec::Vec::new(),
output: ::std::vec::Vec::new(),
value_info: ::std::vec::Vec::new(),
quantization_annotation: ::std::vec::Vec::new(),
metadata_props: ::std::vec::Vec::new(),
special_fields: ::protobuf::SpecialFields::new(),
};
&instance
}
}
#[derive(PartialEq,Clone,Default,Debug)]
pub struct TensorProto {
pub dims: ::std::vec::Vec<i64>,
pub data_type: i32,
pub segment: ::protobuf::MessageField<tensor_proto::Segment>,
pub float_data: ::std::vec::Vec<f32>,
pub int32_data: ::std::vec::Vec<i32>,
pub string_data: ::std::vec::Vec<::std::vec::Vec<u8>>,
pub int64_data: ::std::vec::Vec<i64>,
pub name: ::std::string::String,
pub doc_string: ::std::string::String,
pub raw_data: ::std::vec::Vec<u8>,
pub external_data: ::std::vec::Vec<StringStringEntryProto>,
pub data_location: ::protobuf::EnumOrUnknown<tensor_proto::DataLocation>,
pub double_data: ::std::vec::Vec<f64>,
pub uint64_data: ::std::vec::Vec<u64>,
pub metadata_props: ::std::vec::Vec<StringStringEntryProto>,
pub special_fields: ::protobuf::SpecialFields,
}
impl<'a> ::std::default::Default for &'a TensorProto {
fn default() -> &'a TensorProto {
<TensorProto as ::protobuf::Message>::default_instance()
}
}
impl TensorProto {
pub fn new() -> TensorProto {
::std::default::Default::default()
}
}
impl ::protobuf::Message for TensorProto {
const NAME: &'static str = "TensorProto";
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 => {
is.read_repeated_packed_int64_into(&mut self.dims)?;
},
8 => {
self.dims.push(is.read_int64()?);
},
16 => {
self.data_type = is.read_int32()?;
},
26 => {
::protobuf::rt::read_singular_message_into_field(is, &mut self.segment)?;
},
34 => {
is.read_repeated_packed_float_into(&mut self.float_data)?;
},
37 => {
self.float_data.push(is.read_float()?);
},
42 => {
is.read_repeated_packed_int32_into(&mut self.int32_data)?;
},
40 => {
self.int32_data.push(is.read_int32()?);
},
50 => {
self.string_data.push(is.read_bytes()?);
},
58 => {
is.read_repeated_packed_int64_into(&mut self.int64_data)?;
},
56 => {
self.int64_data.push(is.read_int64()?);
},
66 => {
self.name = is.read_string()?;
},
98 => {
self.doc_string = is.read_string()?;
},
74 => {
self.raw_data = is.read_bytes()?;
},
106 => {
self.external_data.push(is.read_message()?);
},
112 => {
self.data_location = is.read_enum_or_unknown()?;
},
82 => {
is.read_repeated_packed_double_into(&mut self.double_data)?;
},
81 => {
self.double_data.push(is.read_double()?);
},
90 => {
is.read_repeated_packed_uint64_into(&mut self.uint64_data)?;
},
88 => {
self.uint64_data.push(is.read_uint64()?);
},
130 => {
self.metadata_props.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;
my_size += ::protobuf::rt::vec_packed_int64_size(1, &self.dims);
if self.data_type != 0 {
my_size += ::protobuf::rt::int32_size(2, self.data_type);
}
if let Some(v) = self.segment.as_ref() {
let len = v.compute_size();
my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len;
}
my_size += ::protobuf::rt::vec_packed_float_size(4, &self.float_data);
my_size += ::protobuf::rt::vec_packed_int32_size(5, &self.int32_data);
for value in &self.string_data {
my_size += ::protobuf::rt::bytes_size(6, &value);
};
my_size += ::protobuf::rt::vec_packed_int64_size(7, &self.int64_data);
if !self.name.is_empty() {
my_size += ::protobuf::rt::string_size(8, &self.name);
}
if !self.doc_string.is_empty() {
my_size += ::protobuf::rt::string_size(12, &self.doc_string);
}
if !self.raw_data.is_empty() {
my_size += ::protobuf::rt::bytes_size(9, &self.raw_data);
}
for value in &self.external_data {
let len = value.compute_size();
my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len;
};
if self.data_location != ::protobuf::EnumOrUnknown::new(tensor_proto::DataLocation::DEFAULT) {
my_size += ::protobuf::rt::int32_size(14, self.data_location.value());
}
my_size += ::protobuf::rt::vec_packed_double_size(10, &self.double_data);
my_size += ::protobuf::rt::vec_packed_uint64_size(11, &self.uint64_data);
for value in &self.metadata_props {
let len = value.compute_size();
my_size += 2 + ::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<()> {
os.write_repeated_packed_int64(1, &self.dims)?;
if self.data_type != 0 {
os.write_int32(2, self.data_type)?;
}
if let Some(v) = self.segment.as_ref() {
::protobuf::rt::write_message_field_with_cached_size(3, v, os)?;
}
os.write_repeated_packed_float(4, &self.float_data)?;
os.write_repeated_packed_int32(5, &self.int32_data)?;
for v in &self.string_data {
os.write_bytes(6, &v)?;
};
os.write_repeated_packed_int64(7, &self.int64_data)?;
if !self.name.is_empty() {
os.write_string(8, &self.name)?;
}
if !self.doc_string.is_empty() {
os.write_string(12, &self.doc_string)?;
}
if !self.raw_data.is_empty() {
os.write_bytes(9, &self.raw_data)?;
}
for v in &self.external_data {
::protobuf::rt::write_message_field_with_cached_size(13, v, os)?;
};
if self.data_location != ::protobuf::EnumOrUnknown::new(tensor_proto::DataLocation::DEFAULT) {
os.write_enum(14, ::protobuf::EnumOrUnknown::value(&self.data_location))?;
}
os.write_repeated_packed_double(10, &self.double_data)?;
os.write_repeated_packed_uint64(11, &self.uint64_data)?;
for v in &self.metadata_props {
::protobuf::rt::write_message_field_with_cached_size(16, 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() -> TensorProto {
TensorProto::new()
}
fn clear(&mut self) {
self.dims.clear();
self.data_type = 0;
self.segment.clear();
self.float_data.clear();
self.int32_data.clear();
self.string_data.clear();
self.int64_data.clear();
self.name.clear();
self.doc_string.clear();
self.raw_data.clear();
self.external_data.clear();
self.data_location = ::protobuf::EnumOrUnknown::new(tensor_proto::DataLocation::DEFAULT);
self.double_data.clear();
self.uint64_data.clear();
self.metadata_props.clear();
self.special_fields.clear();
}
fn default_instance() -> &'static TensorProto {
static instance: TensorProto = TensorProto {
dims: ::std::vec::Vec::new(),
data_type: 0,
segment: ::protobuf::MessageField::none(),
float_data: ::std::vec::Vec::new(),
int32_data: ::std::vec::Vec::new(),
string_data: ::std::vec::Vec::new(),
int64_data: ::std::vec::Vec::new(),
name: ::std::string::String::new(),
doc_string: ::std::string::String::new(),
raw_data: ::std::vec::Vec::new(),
external_data: ::std::vec::Vec::new(),
data_location: ::protobuf::EnumOrUnknown::from_i32(0),
double_data: ::std::vec::Vec::new(),
uint64_data: ::std::vec::Vec::new(),
metadata_props: ::std::vec::Vec::new(),
special_fields: ::protobuf::SpecialFields::new(),
};
&instance
}
}
pub mod tensor_proto {
#[derive(PartialEq,Clone,Default,Debug)]
pub struct Segment {
pub begin: i64,
pub end: i64,
pub special_fields: ::protobuf::SpecialFields,
}
impl<'a> ::std::default::Default for &'a Segment {
fn default() -> &'a Segment {
<Segment as ::protobuf::Message>::default_instance()
}
}
impl Segment {
pub fn new() -> Segment {
::std::default::Default::default()
}
}
impl ::protobuf::Message for Segment {
const NAME: &'static str = "Segment";
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.begin = is.read_int64()?;
},
16 => {
self.end = is.read_int64()?;
},
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.begin != 0 {
my_size += ::protobuf::rt::int64_size(1, self.begin);
}
if self.end != 0 {
my_size += ::protobuf::rt::int64_size(2, self.end);
}
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.begin != 0 {
os.write_int64(1, self.begin)?;
}
if self.end != 0 {
os.write_int64(2, self.end)?;
}
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() -> Segment {
Segment::new()
}
fn clear(&mut self) {
self.begin = 0;
self.end = 0;
self.special_fields.clear();
}
fn default_instance() -> &'static Segment {
static instance: Segment = Segment {
begin: 0,
end: 0,
special_fields: ::protobuf::SpecialFields::new(),
};
&instance
}
}
#[derive(Clone,Copy,PartialEq,Eq,Debug,Hash)]
pub enum DataType {
UNDEFINED = 0,
FLOAT = 1,
UINT8 = 2,
INT8 = 3,
UINT16 = 4,
INT16 = 5,
INT32 = 6,
INT64 = 7,
STRING = 8,
BOOL = 9,
FLOAT16 = 10,
DOUBLE = 11,
UINT32 = 12,
UINT64 = 13,
COMPLEX64 = 14,
COMPLEX128 = 15,
BFLOAT16 = 16,
FLOAT8E4M3FN = 17,
FLOAT8E4M3FNUZ = 18,
FLOAT8E5M2 = 19,
FLOAT8E5M2FNUZ = 20,
UINT4 = 21,
INT4 = 22,
}
impl ::protobuf::Enum for DataType {
const NAME: &'static str = "DataType";
fn value(&self) -> i32 {
*self as i32
}
fn from_i32(value: i32) -> ::std::option::Option<DataType> {
match value {
0 => ::std::option::Option::Some(DataType::UNDEFINED),
1 => ::std::option::Option::Some(DataType::FLOAT),
2 => ::std::option::Option::Some(DataType::UINT8),
3 => ::std::option::Option::Some(DataType::INT8),
4 => ::std::option::Option::Some(DataType::UINT16),
5 => ::std::option::Option::Some(DataType::INT16),
6 => ::std::option::Option::Some(DataType::INT32),
7 => ::std::option::Option::Some(DataType::INT64),
8 => ::std::option::Option::Some(DataType::STRING),
9 => ::std::option::Option::Some(DataType::BOOL),
10 => ::std::option::Option::Some(DataType::FLOAT16),
11 => ::std::option::Option::Some(DataType::DOUBLE),
12 => ::std::option::Option::Some(DataType::UINT32),
13 => ::std::option::Option::Some(DataType::UINT64),
14 => ::std::option::Option::Some(DataType::COMPLEX64),
15 => ::std::option::Option::Some(DataType::COMPLEX128),
16 => ::std::option::Option::Some(DataType::BFLOAT16),
17 => ::std::option::Option::Some(DataType::FLOAT8E4M3FN),
18 => ::std::option::Option::Some(DataType::FLOAT8E4M3FNUZ),
19 => ::std::option::Option::Some(DataType::FLOAT8E5M2),
20 => ::std::option::Option::Some(DataType::FLOAT8E5M2FNUZ),
21 => ::std::option::Option::Some(DataType::UINT4),
22 => ::std::option::Option::Some(DataType::INT4),
_ => ::std::option::Option::None
}
}
fn from_str(str: &str) -> ::std::option::Option<DataType> {
match str {
"UNDEFINED" => ::std::option::Option::Some(DataType::UNDEFINED),
"FLOAT" => ::std::option::Option::Some(DataType::FLOAT),
"UINT8" => ::std::option::Option::Some(DataType::UINT8),
"INT8" => ::std::option::Option::Some(DataType::INT8),
"UINT16" => ::std::option::Option::Some(DataType::UINT16),
"INT16" => ::std::option::Option::Some(DataType::INT16),
"INT32" => ::std::option::Option::Some(DataType::INT32),
"INT64" => ::std::option::Option::Some(DataType::INT64),
"STRING" => ::std::option::Option::Some(DataType::STRING),
"BOOL" => ::std::option::Option::Some(DataType::BOOL),
"FLOAT16" => ::std::option::Option::Some(DataType::FLOAT16),
"DOUBLE" => ::std::option::Option::Some(DataType::DOUBLE),
"UINT32" => ::std::option::Option::Some(DataType::UINT32),
"UINT64" => ::std::option::Option::Some(DataType::UINT64),
"COMPLEX64" => ::std::option::Option::Some(DataType::COMPLEX64),
"COMPLEX128" => ::std::option::Option::Some(DataType::COMPLEX128),
"BFLOAT16" => ::std::option::Option::Some(DataType::BFLOAT16),
"FLOAT8E4M3FN" => ::std::option::Option::Some(DataType::FLOAT8E4M3FN),
"FLOAT8E4M3FNUZ" => ::std::option::Option::Some(DataType::FLOAT8E4M3FNUZ),
"FLOAT8E5M2" => ::std::option::Option::Some(DataType::FLOAT8E5M2),
"FLOAT8E5M2FNUZ" => ::std::option::Option::Some(DataType::FLOAT8E5M2FNUZ),
"UINT4" => ::std::option::Option::Some(DataType::UINT4),
"INT4" => ::std::option::Option::Some(DataType::INT4),
_ => ::std::option::Option::None
}
}
const VALUES: &'static [DataType] = &[
DataType::UNDEFINED,
DataType::FLOAT,
DataType::UINT8,
DataType::INT8,
DataType::UINT16,
DataType::INT16,
DataType::INT32,
DataType::INT64,
DataType::STRING,
DataType::BOOL,
DataType::FLOAT16,
DataType::DOUBLE,
DataType::UINT32,
DataType::UINT64,
DataType::COMPLEX64,
DataType::COMPLEX128,
DataType::BFLOAT16,
DataType::FLOAT8E4M3FN,
DataType::FLOAT8E4M3FNUZ,
DataType::FLOAT8E5M2,
DataType::FLOAT8E5M2FNUZ,
DataType::UINT4,
DataType::INT4,
];
}
impl ::std::default::Default for DataType {
fn default() -> Self {
DataType::UNDEFINED
}
}
#[derive(Clone,Copy,PartialEq,Eq,Debug,Hash)]
pub enum DataLocation {
DEFAULT = 0,
EXTERNAL = 1,
}
impl ::protobuf::Enum for DataLocation {
const NAME: &'static str = "DataLocation";
fn value(&self) -> i32 {
*self as i32
}
fn from_i32(value: i32) -> ::std::option::Option<DataLocation> {
match value {
0 => ::std::option::Option::Some(DataLocation::DEFAULT),
1 => ::std::option::Option::Some(DataLocation::EXTERNAL),
_ => ::std::option::Option::None
}
}
fn from_str(str: &str) -> ::std::option::Option<DataLocation> {
match str {
"DEFAULT" => ::std::option::Option::Some(DataLocation::DEFAULT),
"EXTERNAL" => ::std::option::Option::Some(DataLocation::EXTERNAL),
_ => ::std::option::Option::None
}
}
const VALUES: &'static [DataLocation] = &[
DataLocation::DEFAULT,
DataLocation::EXTERNAL,
];
}
impl ::std::default::Default for DataLocation {
fn default() -> Self {
DataLocation::DEFAULT
}
}
}
#[derive(PartialEq,Clone,Default,Debug)]
pub struct SparseTensorProto {
pub values: ::protobuf::MessageField<TensorProto>,
pub indices: ::protobuf::MessageField<TensorProto>,
pub dims: ::std::vec::Vec<i64>,
pub special_fields: ::protobuf::SpecialFields,
}
impl<'a> ::std::default::Default for &'a SparseTensorProto {
fn default() -> &'a SparseTensorProto {
<SparseTensorProto as ::protobuf::Message>::default_instance()
}
}
impl SparseTensorProto {
pub fn new() -> SparseTensorProto {
::std::default::Default::default()
}
}
impl ::protobuf::Message for SparseTensorProto {
const NAME: &'static str = "SparseTensorProto";
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.values)?;
},
18 => {
::protobuf::rt::read_singular_message_into_field(is, &mut self.indices)?;
},
26 => {
is.read_repeated_packed_int64_into(&mut self.dims)?;
},
24 => {
self.dims.push(is.read_int64()?);
},
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.values.as_ref() {
let len = v.compute_size();
my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len;
}
if let Some(v) = self.indices.as_ref() {
let len = v.compute_size();
my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len;
}
my_size += ::protobuf::rt::vec_packed_int64_size(3, &self.dims);
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.values.as_ref() {
::protobuf::rt::write_message_field_with_cached_size(1, v, os)?;
}
if let Some(v) = self.indices.as_ref() {
::protobuf::rt::write_message_field_with_cached_size(2, v, os)?;
}
os.write_repeated_packed_int64(3, &self.dims)?;
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() -> SparseTensorProto {
SparseTensorProto::new()
}
fn clear(&mut self) {
self.values.clear();
self.indices.clear();
self.dims.clear();
self.special_fields.clear();
}
fn default_instance() -> &'static SparseTensorProto {
static instance: SparseTensorProto = SparseTensorProto {
values: ::protobuf::MessageField::none(),
indices: ::protobuf::MessageField::none(),
dims: ::std::vec::Vec::new(),
special_fields: ::protobuf::SpecialFields::new(),
};
&instance
}
}
#[derive(PartialEq,Clone,Default,Debug)]
pub struct TensorShapeProto {
pub dim: ::std::vec::Vec<tensor_shape_proto::Dimension>,
pub special_fields: ::protobuf::SpecialFields,
}
impl<'a> ::std::default::Default for &'a TensorShapeProto {
fn default() -> &'a TensorShapeProto {
<TensorShapeProto as ::protobuf::Message>::default_instance()
}
}
impl TensorShapeProto {
pub fn new() -> TensorShapeProto {
::std::default::Default::default()
}
}
impl ::protobuf::Message for TensorShapeProto {
const NAME: &'static str = "TensorShapeProto";
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.dim.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.dim {
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.dim {
::protobuf::rt::write_message_field_with_cached_size(1, 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() -> TensorShapeProto {
TensorShapeProto::new()
}
fn clear(&mut self) {
self.dim.clear();
self.special_fields.clear();
}
fn default_instance() -> &'static TensorShapeProto {
static instance: TensorShapeProto = TensorShapeProto {
dim: ::std::vec::Vec::new(),
special_fields: ::protobuf::SpecialFields::new(),
};
&instance
}
}
pub mod tensor_shape_proto {
#[derive(PartialEq,Clone,Default,Debug)]
pub struct Dimension {
pub denotation: ::std::string::String,
pub value: ::std::option::Option<dimension::Value>,
pub special_fields: ::protobuf::SpecialFields,
}
impl<'a> ::std::default::Default for &'a Dimension {
fn default() -> &'a Dimension {
<Dimension as ::protobuf::Message>::default_instance()
}
}
impl Dimension {
pub fn new() -> Dimension {
::std::default::Default::default()
}
pub fn dim_value(&self) -> i64 {
match self.value {
::std::option::Option::Some(dimension::Value::DimValue(v)) => v,
_ => 0,
}
}
pub fn clear_dim_value(&mut self) {
self.value = ::std::option::Option::None;
}
pub fn has_dim_value(&self) -> bool {
match self.value {
::std::option::Option::Some(dimension::Value::DimValue(..)) => true,
_ => false,
}
}
pub fn set_dim_value(&mut self, v: i64) {
self.value = ::std::option::Option::Some(dimension::Value::DimValue(v))
}
pub fn dim_param(&self) -> &str {
match self.value {
::std::option::Option::Some(dimension::Value::DimParam(ref v)) => v,
_ => "",
}
}
pub fn clear_dim_param(&mut self) {
self.value = ::std::option::Option::None;
}
pub fn has_dim_param(&self) -> bool {
match self.value {
::std::option::Option::Some(dimension::Value::DimParam(..)) => true,
_ => false,
}
}
pub fn set_dim_param(&mut self, v: ::std::string::String) {
self.value = ::std::option::Option::Some(dimension::Value::DimParam(v))
}
pub fn mut_dim_param(&mut self) -> &mut ::std::string::String {
if let ::std::option::Option::Some(dimension::Value::DimParam(_)) = self.value {
} else {
self.value = ::std::option::Option::Some(dimension::Value::DimParam(::std::string::String::new()));
}
match self.value {
::std::option::Option::Some(dimension::Value::DimParam(ref mut v)) => v,
_ => panic!(),
}
}
pub fn take_dim_param(&mut self) -> ::std::string::String {
if self.has_dim_param() {
match self.value.take() {
::std::option::Option::Some(dimension::Value::DimParam(v)) => v,
_ => panic!(),
}
} else {
::std::string::String::new()
}
}
}
impl ::protobuf::Message for Dimension {
const NAME: &'static str = "Dimension";
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.value = ::std::option::Option::Some(dimension::Value::DimValue(is.read_int64()?));
},
18 => {
self.value = ::std::option::Option::Some(dimension::Value::DimParam(is.read_string()?));
},
26 => {
self.denotation = 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.denotation.is_empty() {
my_size += ::protobuf::rt::string_size(3, &self.denotation);
}
if let ::std::option::Option::Some(ref v) = self.value {
match v {
&dimension::Value::DimValue(v) => {
my_size += ::protobuf::rt::int64_size(1, v);
},
&dimension::Value::DimParam(ref v) => {
my_size += ::protobuf::rt::string_size(2, &v);
},
};
}
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.denotation.is_empty() {
os.write_string(3, &self.denotation)?;
}
if let ::std::option::Option::Some(ref v) = self.value {
match v {
&dimension::Value::DimValue(v) => {
os.write_int64(1, v)?;
},
&dimension::Value::DimParam(ref v) => {
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() -> Dimension {
Dimension::new()
}
fn clear(&mut self) {
self.value = ::std::option::Option::None;
self.value = ::std::option::Option::None;
self.denotation.clear();
self.special_fields.clear();
}
fn default_instance() -> &'static Dimension {
static instance: Dimension = Dimension {
denotation: ::std::string::String::new(),
value: ::std::option::Option::None,
special_fields: ::protobuf::SpecialFields::new(),
};
&instance
}
}
pub mod dimension {
#[derive(Clone,PartialEq,Debug)]
#[non_exhaustive]
pub enum Value {
DimValue(i64),
DimParam(::std::string::String),
}
impl ::protobuf::Oneof for Value {
}
impl Value {
}
}
}
#[derive(PartialEq,Clone,Default,Debug)]
pub struct TypeProto {
pub denotation: ::std::string::String,
pub value: ::std::option::Option<type_proto::Value>,
pub special_fields: ::protobuf::SpecialFields,
}
impl<'a> ::std::default::Default for &'a TypeProto {
fn default() -> &'a TypeProto {
<TypeProto as ::protobuf::Message>::default_instance()
}
}
impl TypeProto {
pub fn new() -> TypeProto {
::std::default::Default::default()
}
pub fn tensor_type(&self) -> &type_proto::Tensor {
match self.value {
::std::option::Option::Some(type_proto::Value::TensorType(ref v)) => v,
_ => <type_proto::Tensor as ::protobuf::Message>::default_instance(),
}
}
pub fn clear_tensor_type(&mut self) {
self.value = ::std::option::Option::None;
}
pub fn has_tensor_type(&self) -> bool {
match self.value {
::std::option::Option::Some(type_proto::Value::TensorType(..)) => true,
_ => false,
}
}
pub fn set_tensor_type(&mut self, v: type_proto::Tensor) {
self.value = ::std::option::Option::Some(type_proto::Value::TensorType(v))
}
pub fn mut_tensor_type(&mut self) -> &mut type_proto::Tensor {
if let ::std::option::Option::Some(type_proto::Value::TensorType(_)) = self.value {
} else {
self.value = ::std::option::Option::Some(type_proto::Value::TensorType(type_proto::Tensor::new()));
}
match self.value {
::std::option::Option::Some(type_proto::Value::TensorType(ref mut v)) => v,
_ => panic!(),
}
}
pub fn take_tensor_type(&mut self) -> type_proto::Tensor {
if self.has_tensor_type() {
match self.value.take() {
::std::option::Option::Some(type_proto::Value::TensorType(v)) => v,
_ => panic!(),
}
} else {
type_proto::Tensor::new()
}
}
pub fn sequence_type(&self) -> &type_proto::Sequence {
match self.value {
::std::option::Option::Some(type_proto::Value::SequenceType(ref v)) => v,
_ => <type_proto::Sequence as ::protobuf::Message>::default_instance(),
}
}
pub fn clear_sequence_type(&mut self) {
self.value = ::std::option::Option::None;
}
pub fn has_sequence_type(&self) -> bool {
match self.value {
::std::option::Option::Some(type_proto::Value::SequenceType(..)) => true,
_ => false,
}
}
pub fn set_sequence_type(&mut self, v: type_proto::Sequence) {
self.value = ::std::option::Option::Some(type_proto::Value::SequenceType(v))
}
pub fn mut_sequence_type(&mut self) -> &mut type_proto::Sequence {
if let ::std::option::Option::Some(type_proto::Value::SequenceType(_)) = self.value {
} else {
self.value = ::std::option::Option::Some(type_proto::Value::SequenceType(type_proto::Sequence::new()));
}
match self.value {
::std::option::Option::Some(type_proto::Value::SequenceType(ref mut v)) => v,
_ => panic!(),
}
}
pub fn take_sequence_type(&mut self) -> type_proto::Sequence {
if self.has_sequence_type() {
match self.value.take() {
::std::option::Option::Some(type_proto::Value::SequenceType(v)) => v,
_ => panic!(),
}
} else {
type_proto::Sequence::new()
}
}
pub fn map_type(&self) -> &type_proto::Map {
match self.value {
::std::option::Option::Some(type_proto::Value::MapType(ref v)) => v,
_ => <type_proto::Map as ::protobuf::Message>::default_instance(),
}
}
pub fn clear_map_type(&mut self) {
self.value = ::std::option::Option::None;
}
pub fn has_map_type(&self) -> bool {
match self.value {
::std::option::Option::Some(type_proto::Value::MapType(..)) => true,
_ => false,
}
}
pub fn set_map_type(&mut self, v: type_proto::Map) {
self.value = ::std::option::Option::Some(type_proto::Value::MapType(v))
}
pub fn mut_map_type(&mut self) -> &mut type_proto::Map {
if let ::std::option::Option::Some(type_proto::Value::MapType(_)) = self.value {
} else {
self.value = ::std::option::Option::Some(type_proto::Value::MapType(type_proto::Map::new()));
}
match self.value {
::std::option::Option::Some(type_proto::Value::MapType(ref mut v)) => v,
_ => panic!(),
}
}
pub fn take_map_type(&mut self) -> type_proto::Map {
if self.has_map_type() {
match self.value.take() {
::std::option::Option::Some(type_proto::Value::MapType(v)) => v,
_ => panic!(),
}
} else {
type_proto::Map::new()
}
}
pub fn optional_type(&self) -> &type_proto::Optional {
match self.value {
::std::option::Option::Some(type_proto::Value::OptionalType(ref v)) => v,
_ => <type_proto::Optional as ::protobuf::Message>::default_instance(),
}
}
pub fn clear_optional_type(&mut self) {
self.value = ::std::option::Option::None;
}
pub fn has_optional_type(&self) -> bool {
match self.value {
::std::option::Option::Some(type_proto::Value::OptionalType(..)) => true,
_ => false,
}
}
pub fn set_optional_type(&mut self, v: type_proto::Optional) {
self.value = ::std::option::Option::Some(type_proto::Value::OptionalType(v))
}
pub fn mut_optional_type(&mut self) -> &mut type_proto::Optional {
if let ::std::option::Option::Some(type_proto::Value::OptionalType(_)) = self.value {
} else {
self.value = ::std::option::Option::Some(type_proto::Value::OptionalType(type_proto::Optional::new()));
}
match self.value {
::std::option::Option::Some(type_proto::Value::OptionalType(ref mut v)) => v,
_ => panic!(),
}
}
pub fn take_optional_type(&mut self) -> type_proto::Optional {
if self.has_optional_type() {
match self.value.take() {
::std::option::Option::Some(type_proto::Value::OptionalType(v)) => v,
_ => panic!(),
}
} else {
type_proto::Optional::new()
}
}
pub fn sparse_tensor_type(&self) -> &type_proto::SparseTensor {
match self.value {
::std::option::Option::Some(type_proto::Value::SparseTensorType(ref v)) => v,
_ => <type_proto::SparseTensor as ::protobuf::Message>::default_instance(),
}
}
pub fn clear_sparse_tensor_type(&mut self) {
self.value = ::std::option::Option::None;
}
pub fn has_sparse_tensor_type(&self) -> bool {
match self.value {
::std::option::Option::Some(type_proto::Value::SparseTensorType(..)) => true,
_ => false,
}
}
pub fn set_sparse_tensor_type(&mut self, v: type_proto::SparseTensor) {
self.value = ::std::option::Option::Some(type_proto::Value::SparseTensorType(v))
}
pub fn mut_sparse_tensor_type(&mut self) -> &mut type_proto::SparseTensor {
if let ::std::option::Option::Some(type_proto::Value::SparseTensorType(_)) = self.value {
} else {
self.value = ::std::option::Option::Some(type_proto::Value::SparseTensorType(type_proto::SparseTensor::new()));
}
match self.value {
::std::option::Option::Some(type_proto::Value::SparseTensorType(ref mut v)) => v,
_ => panic!(),
}
}
pub fn take_sparse_tensor_type(&mut self) -> type_proto::SparseTensor {
if self.has_sparse_tensor_type() {
match self.value.take() {
::std::option::Option::Some(type_proto::Value::SparseTensorType(v)) => v,
_ => panic!(),
}
} else {
type_proto::SparseTensor::new()
}
}
}
impl ::protobuf::Message for TypeProto {
const NAME: &'static str = "TypeProto";
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.value = ::std::option::Option::Some(type_proto::Value::TensorType(is.read_message()?));
},
34 => {
self.value = ::std::option::Option::Some(type_proto::Value::SequenceType(is.read_message()?));
},
42 => {
self.value = ::std::option::Option::Some(type_proto::Value::MapType(is.read_message()?));
},
74 => {
self.value = ::std::option::Option::Some(type_proto::Value::OptionalType(is.read_message()?));
},
66 => {
self.value = ::std::option::Option::Some(type_proto::Value::SparseTensorType(is.read_message()?));
},
50 => {
self.denotation = 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.denotation.is_empty() {
my_size += ::protobuf::rt::string_size(6, &self.denotation);
}
if let ::std::option::Option::Some(ref v) = self.value {
match v {
&type_proto::Value::TensorType(ref v) => {
let len = v.compute_size();
my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len;
},
&type_proto::Value::SequenceType(ref v) => {
let len = v.compute_size();
my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len;
},
&type_proto::Value::MapType(ref v) => {
let len = v.compute_size();
my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len;
},
&type_proto::Value::OptionalType(ref v) => {
let len = v.compute_size();
my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len;
},
&type_proto::Value::SparseTensorType(ref v) => {
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.denotation.is_empty() {
os.write_string(6, &self.denotation)?;
}
if let ::std::option::Option::Some(ref v) = self.value {
match v {
&type_proto::Value::TensorType(ref v) => {
::protobuf::rt::write_message_field_with_cached_size(1, v, os)?;
},
&type_proto::Value::SequenceType(ref v) => {
::protobuf::rt::write_message_field_with_cached_size(4, v, os)?;
},
&type_proto::Value::MapType(ref v) => {
::protobuf::rt::write_message_field_with_cached_size(5, v, os)?;
},
&type_proto::Value::OptionalType(ref v) => {
::protobuf::rt::write_message_field_with_cached_size(9, v, os)?;
},
&type_proto::Value::SparseTensorType(ref v) => {
::protobuf::rt::write_message_field_with_cached_size(8, 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() -> TypeProto {
TypeProto::new()
}
fn clear(&mut self) {
self.value = ::std::option::Option::None;
self.value = ::std::option::Option::None;
self.value = ::std::option::Option::None;
self.value = ::std::option::Option::None;
self.value = ::std::option::Option::None;
self.denotation.clear();
self.special_fields.clear();
}
fn default_instance() -> &'static TypeProto {
static instance: TypeProto = TypeProto {
denotation: ::std::string::String::new(),
value: ::std::option::Option::None,
special_fields: ::protobuf::SpecialFields::new(),
};
&instance
}
}
pub mod type_proto {
#[derive(Clone,PartialEq,Debug)]
#[non_exhaustive]
pub enum Value {
TensorType(Tensor),
SequenceType(Sequence),
MapType(Map),
OptionalType(Optional),
SparseTensorType(SparseTensor),
}
impl ::protobuf::Oneof for Value {
}
impl Value {
}
#[derive(PartialEq,Clone,Default,Debug)]
pub struct Tensor {
pub elem_type: i32,
pub shape: ::protobuf::MessageField<super::TensorShapeProto>,
pub special_fields: ::protobuf::SpecialFields,
}
impl<'a> ::std::default::Default for &'a Tensor {
fn default() -> &'a Tensor {
<Tensor as ::protobuf::Message>::default_instance()
}
}
impl Tensor {
pub fn new() -> Tensor {
::std::default::Default::default()
}
}
impl ::protobuf::Message for Tensor {
const NAME: &'static str = "Tensor";
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.elem_type = is.read_int32()?;
},
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.elem_type != 0 {
my_size += ::protobuf::rt::int32_size(1, self.elem_type);
}
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.elem_type != 0 {
os.write_int32(1, self.elem_type)?;
}
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() -> Tensor {
Tensor::new()
}
fn clear(&mut self) {
self.elem_type = 0;
self.shape.clear();
self.special_fields.clear();
}
fn default_instance() -> &'static Tensor {
static instance: Tensor = Tensor {
elem_type: 0,
shape: ::protobuf::MessageField::none(),
special_fields: ::protobuf::SpecialFields::new(),
};
&instance
}
}
#[derive(PartialEq,Clone,Default,Debug)]
pub struct Sequence {
pub elem_type: ::protobuf::MessageField<super::TypeProto>,
pub special_fields: ::protobuf::SpecialFields,
}
impl<'a> ::std::default::Default for &'a Sequence {
fn default() -> &'a Sequence {
<Sequence as ::protobuf::Message>::default_instance()
}
}
impl Sequence {
pub fn new() -> Sequence {
::std::default::Default::default()
}
}
impl ::protobuf::Message for Sequence {
const NAME: &'static str = "Sequence";
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.elem_type)?;
},
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.elem_type.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 let Some(v) = self.elem_type.as_ref() {
::protobuf::rt::write_message_field_with_cached_size(1, 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() -> Sequence {
Sequence::new()
}
fn clear(&mut self) {
self.elem_type.clear();
self.special_fields.clear();
}
fn default_instance() -> &'static Sequence {
static instance: Sequence = Sequence {
elem_type: ::protobuf::MessageField::none(),
special_fields: ::protobuf::SpecialFields::new(),
};
&instance
}
}
#[derive(PartialEq,Clone,Default,Debug)]
pub struct Map {
pub key_type: i32,
pub value_type: ::protobuf::MessageField<super::TypeProto>,
pub special_fields: ::protobuf::SpecialFields,
}
impl<'a> ::std::default::Default for &'a Map {
fn default() -> &'a Map {
<Map as ::protobuf::Message>::default_instance()
}
}
impl Map {
pub fn new() -> Map {
::std::default::Default::default()
}
}
impl ::protobuf::Message for Map {
const NAME: &'static str = "Map";
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.key_type = is.read_int32()?;
},
18 => {
::protobuf::rt::read_singular_message_into_field(is, &mut self.value_type)?;
},
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.key_type != 0 {
my_size += ::protobuf::rt::int32_size(1, self.key_type);
}
if let Some(v) = self.value_type.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.key_type != 0 {
os.write_int32(1, self.key_type)?;
}
if let Some(v) = self.value_type.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() -> Map {
Map::new()
}
fn clear(&mut self) {
self.key_type = 0;
self.value_type.clear();
self.special_fields.clear();
}
fn default_instance() -> &'static Map {
static instance: Map = Map {
key_type: 0,
value_type: ::protobuf::MessageField::none(),
special_fields: ::protobuf::SpecialFields::new(),
};
&instance
}
}
#[derive(PartialEq,Clone,Default,Debug)]
pub struct Optional {
pub elem_type: ::protobuf::MessageField<super::TypeProto>,
pub special_fields: ::protobuf::SpecialFields,
}
impl<'a> ::std::default::Default for &'a Optional {
fn default() -> &'a Optional {
<Optional as ::protobuf::Message>::default_instance()
}
}
impl Optional {
pub fn new() -> Optional {
::std::default::Default::default()
}
}
impl ::protobuf::Message for Optional {
const NAME: &'static str = "Optional";
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.elem_type)?;
},
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.elem_type.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 let Some(v) = self.elem_type.as_ref() {
::protobuf::rt::write_message_field_with_cached_size(1, 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() -> Optional {
Optional::new()
}
fn clear(&mut self) {
self.elem_type.clear();
self.special_fields.clear();
}
fn default_instance() -> &'static Optional {
static instance: Optional = Optional {
elem_type: ::protobuf::MessageField::none(),
special_fields: ::protobuf::SpecialFields::new(),
};
&instance
}
}
#[derive(PartialEq,Clone,Default,Debug)]
pub struct SparseTensor {
pub elem_type: i32,
pub shape: ::protobuf::MessageField<super::TensorShapeProto>,
pub special_fields: ::protobuf::SpecialFields,
}
impl<'a> ::std::default::Default for &'a SparseTensor {
fn default() -> &'a SparseTensor {
<SparseTensor as ::protobuf::Message>::default_instance()
}
}
impl SparseTensor {
pub fn new() -> SparseTensor {
::std::default::Default::default()
}
}
impl ::protobuf::Message for SparseTensor {
const NAME: &'static str = "SparseTensor";
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.elem_type = is.read_int32()?;
},
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.elem_type != 0 {
my_size += ::protobuf::rt::int32_size(1, self.elem_type);
}
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.elem_type != 0 {
os.write_int32(1, self.elem_type)?;
}
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() -> SparseTensor {
SparseTensor::new()
}
fn clear(&mut self) {
self.elem_type = 0;
self.shape.clear();
self.special_fields.clear();
}
fn default_instance() -> &'static SparseTensor {
static instance: SparseTensor = SparseTensor {
elem_type: 0,
shape: ::protobuf::MessageField::none(),
special_fields: ::protobuf::SpecialFields::new(),
};
&instance
}
}
}
#[derive(PartialEq,Clone,Default,Debug)]
pub struct OperatorSetIdProto {
pub domain: ::std::string::String,
pub version: i64,
pub special_fields: ::protobuf::SpecialFields,
}
impl<'a> ::std::default::Default for &'a OperatorSetIdProto {
fn default() -> &'a OperatorSetIdProto {
<OperatorSetIdProto as ::protobuf::Message>::default_instance()
}
}
impl OperatorSetIdProto {
pub fn new() -> OperatorSetIdProto {
::std::default::Default::default()
}
}
impl ::protobuf::Message for OperatorSetIdProto {
const NAME: &'static str = "OperatorSetIdProto";
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.domain = is.read_string()?;
},
16 => {
self.version = is.read_int64()?;
},
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.domain.is_empty() {
my_size += ::protobuf::rt::string_size(1, &self.domain);
}
if self.version != 0 {
my_size += ::protobuf::rt::int64_size(2, self.version);
}
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.domain.is_empty() {
os.write_string(1, &self.domain)?;
}
if self.version != 0 {
os.write_int64(2, self.version)?;
}
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() -> OperatorSetIdProto {
OperatorSetIdProto::new()
}
fn clear(&mut self) {
self.domain.clear();
self.version = 0;
self.special_fields.clear();
}
fn default_instance() -> &'static OperatorSetIdProto {
static instance: OperatorSetIdProto = OperatorSetIdProto {
domain: ::std::string::String::new(),
version: 0,
special_fields: ::protobuf::SpecialFields::new(),
};
&instance
}
}
#[derive(PartialEq,Clone,Default,Debug)]
pub struct FunctionProto {
pub name: ::std::string::String,
pub input: ::std::vec::Vec<::std::string::String>,
pub output: ::std::vec::Vec<::std::string::String>,
pub attribute: ::std::vec::Vec<::std::string::String>,
pub attribute_proto: ::std::vec::Vec<AttributeProto>,
pub node: ::std::vec::Vec<NodeProto>,
pub doc_string: ::std::string::String,
pub opset_import: ::std::vec::Vec<OperatorSetIdProto>,
pub domain: ::std::string::String,
pub overload: ::std::string::String,
pub value_info: ::std::vec::Vec<ValueInfoProto>,
pub metadata_props: ::std::vec::Vec<StringStringEntryProto>,
pub special_fields: ::protobuf::SpecialFields,
}
impl<'a> ::std::default::Default for &'a FunctionProto {
fn default() -> &'a FunctionProto {
<FunctionProto as ::protobuf::Message>::default_instance()
}
}
impl FunctionProto {
pub fn new() -> FunctionProto {
::std::default::Default::default()
}
}
impl ::protobuf::Message for FunctionProto {
const NAME: &'static str = "FunctionProto";
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.name = is.read_string()?;
},
34 => {
self.input.push(is.read_string()?);
},
42 => {
self.output.push(is.read_string()?);
},
50 => {
self.attribute.push(is.read_string()?);
},
90 => {
self.attribute_proto.push(is.read_message()?);
},
58 => {
self.node.push(is.read_message()?);
},
66 => {
self.doc_string = is.read_string()?;
},
74 => {
self.opset_import.push(is.read_message()?);
},
82 => {
self.domain = is.read_string()?;
},
106 => {
self.overload = is.read_string()?;
},
98 => {
self.value_info.push(is.read_message()?);
},
114 => {
self.metadata_props.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.name.is_empty() {
my_size += ::protobuf::rt::string_size(1, &self.name);
}
for value in &self.input {
my_size += ::protobuf::rt::string_size(4, &value);
};
for value in &self.output {
my_size += ::protobuf::rt::string_size(5, &value);
};
for value in &self.attribute {
my_size += ::protobuf::rt::string_size(6, &value);
};
for value in &self.attribute_proto {
let len = value.compute_size();
my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len;
};
for value in &self.node {
let len = value.compute_size();
my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len;
};
if !self.doc_string.is_empty() {
my_size += ::protobuf::rt::string_size(8, &self.doc_string);
}
for value in &self.opset_import {
let len = value.compute_size();
my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len;
};
if !self.domain.is_empty() {
my_size += ::protobuf::rt::string_size(10, &self.domain);
}
if !self.overload.is_empty() {
my_size += ::protobuf::rt::string_size(13, &self.overload);
}
for value in &self.value_info {
let len = value.compute_size();
my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len;
};
for value in &self.metadata_props {
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.name.is_empty() {
os.write_string(1, &self.name)?;
}
for v in &self.input {
os.write_string(4, &v)?;
};
for v in &self.output {
os.write_string(5, &v)?;
};
for v in &self.attribute {
os.write_string(6, &v)?;
};
for v in &self.attribute_proto {
::protobuf::rt::write_message_field_with_cached_size(11, v, os)?;
};
for v in &self.node {
::protobuf::rt::write_message_field_with_cached_size(7, v, os)?;
};
if !self.doc_string.is_empty() {
os.write_string(8, &self.doc_string)?;
}
for v in &self.opset_import {
::protobuf::rt::write_message_field_with_cached_size(9, v, os)?;
};
if !self.domain.is_empty() {
os.write_string(10, &self.domain)?;
}
if !self.overload.is_empty() {
os.write_string(13, &self.overload)?;
}
for v in &self.value_info {
::protobuf::rt::write_message_field_with_cached_size(12, v, os)?;
};
for v in &self.metadata_props {
::protobuf::rt::write_message_field_with_cached_size(14, 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() -> FunctionProto {
FunctionProto::new()
}
fn clear(&mut self) {
self.name.clear();
self.input.clear();
self.output.clear();
self.attribute.clear();
self.attribute_proto.clear();
self.node.clear();
self.doc_string.clear();
self.opset_import.clear();
self.domain.clear();
self.overload.clear();
self.value_info.clear();
self.metadata_props.clear();
self.special_fields.clear();
}
fn default_instance() -> &'static FunctionProto {
static instance: FunctionProto = FunctionProto {
name: ::std::string::String::new(),
input: ::std::vec::Vec::new(),
output: ::std::vec::Vec::new(),
attribute: ::std::vec::Vec::new(),
attribute_proto: ::std::vec::Vec::new(),
node: ::std::vec::Vec::new(),
doc_string: ::std::string::String::new(),
opset_import: ::std::vec::Vec::new(),
domain: ::std::string::String::new(),
overload: ::std::string::String::new(),
value_info: ::std::vec::Vec::new(),
metadata_props: ::std::vec::Vec::new(),
special_fields: ::protobuf::SpecialFields::new(),
};
&instance
}
}
#[derive(Clone,Copy,PartialEq,Eq,Debug,Hash)]
pub enum Version {
_START_VERSION = 0,
IR_VERSION_2017_10_10 = 1,
IR_VERSION_2017_10_30 = 2,
IR_VERSION_2017_11_3 = 3,
IR_VERSION_2019_1_22 = 4,
IR_VERSION_2019_3_18 = 5,
IR_VERSION_2019_9_19 = 6,
IR_VERSION_2020_5_8 = 7,
IR_VERSION_2021_7_30 = 8,
IR_VERSION_2023_5_5 = 9,
IR_VERSION = 10,
}
impl ::protobuf::Enum for Version {
const NAME: &'static str = "Version";
fn value(&self) -> i32 {
*self as i32
}
fn from_i32(value: i32) -> ::std::option::Option<Version> {
match value {
0 => ::std::option::Option::Some(Version::_START_VERSION),
1 => ::std::option::Option::Some(Version::IR_VERSION_2017_10_10),
2 => ::std::option::Option::Some(Version::IR_VERSION_2017_10_30),
3 => ::std::option::Option::Some(Version::IR_VERSION_2017_11_3),
4 => ::std::option::Option::Some(Version::IR_VERSION_2019_1_22),
5 => ::std::option::Option::Some(Version::IR_VERSION_2019_3_18),
6 => ::std::option::Option::Some(Version::IR_VERSION_2019_9_19),
7 => ::std::option::Option::Some(Version::IR_VERSION_2020_5_8),
8 => ::std::option::Option::Some(Version::IR_VERSION_2021_7_30),
9 => ::std::option::Option::Some(Version::IR_VERSION_2023_5_5),
10 => ::std::option::Option::Some(Version::IR_VERSION),
_ => ::std::option::Option::None
}
}
fn from_str(str: &str) -> ::std::option::Option<Version> {
match str {
"_START_VERSION" => ::std::option::Option::Some(Version::_START_VERSION),
"IR_VERSION_2017_10_10" => ::std::option::Option::Some(Version::IR_VERSION_2017_10_10),
"IR_VERSION_2017_10_30" => ::std::option::Option::Some(Version::IR_VERSION_2017_10_30),
"IR_VERSION_2017_11_3" => ::std::option::Option::Some(Version::IR_VERSION_2017_11_3),
"IR_VERSION_2019_1_22" => ::std::option::Option::Some(Version::IR_VERSION_2019_1_22),
"IR_VERSION_2019_3_18" => ::std::option::Option::Some(Version::IR_VERSION_2019_3_18),
"IR_VERSION_2019_9_19" => ::std::option::Option::Some(Version::IR_VERSION_2019_9_19),
"IR_VERSION_2020_5_8" => ::std::option::Option::Some(Version::IR_VERSION_2020_5_8),
"IR_VERSION_2021_7_30" => ::std::option::Option::Some(Version::IR_VERSION_2021_7_30),
"IR_VERSION_2023_5_5" => ::std::option::Option::Some(Version::IR_VERSION_2023_5_5),
"IR_VERSION" => ::std::option::Option::Some(Version::IR_VERSION),
_ => ::std::option::Option::None
}
}
const VALUES: &'static [Version] = &[
Version::_START_VERSION,
Version::IR_VERSION_2017_10_10,
Version::IR_VERSION_2017_10_30,
Version::IR_VERSION_2017_11_3,
Version::IR_VERSION_2019_1_22,
Version::IR_VERSION_2019_3_18,
Version::IR_VERSION_2019_9_19,
Version::IR_VERSION_2020_5_8,
Version::IR_VERSION_2021_7_30,
Version::IR_VERSION_2023_5_5,
Version::IR_VERSION,
];
}
impl ::std::default::Default for Version {
fn default() -> Self {
Version::_START_VERSION
}
}
#[derive(Clone,Copy,PartialEq,Eq,Debug,Hash)]
pub enum OperatorStatus {
EXPERIMENTAL = 0,
STABLE = 1,
}
impl ::protobuf::Enum for OperatorStatus {
const NAME: &'static str = "OperatorStatus";
fn value(&self) -> i32 {
*self as i32
}
fn from_i32(value: i32) -> ::std::option::Option<OperatorStatus> {
match value {
0 => ::std::option::Option::Some(OperatorStatus::EXPERIMENTAL),
1 => ::std::option::Option::Some(OperatorStatus::STABLE),
_ => ::std::option::Option::None
}
}
fn from_str(str: &str) -> ::std::option::Option<OperatorStatus> {
match str {
"EXPERIMENTAL" => ::std::option::Option::Some(OperatorStatus::EXPERIMENTAL),
"STABLE" => ::std::option::Option::Some(OperatorStatus::STABLE),
_ => ::std::option::Option::None
}
}
const VALUES: &'static [OperatorStatus] = &[
OperatorStatus::EXPERIMENTAL,
OperatorStatus::STABLE,
];
}
impl ::std::default::Default for OperatorStatus {
fn default() -> Self {
OperatorStatus::EXPERIMENTAL
}
}