#![allow(unknown_lints)]
#![allow(clippy::all)]
#![allow(unused_attributes)]
#![cfg_attr(rustfmt, rustfmt::skip)]
#![allow(box_pointers)]
#![allow(dead_code)]
#![allow(missing_docs)]
#![allow(non_camel_case_types)]
#![allow(non_snake_case)]
#![allow(non_upper_case_globals)]
#![allow(trivial_casts)]
#![allow(unused_results)]
#![allow(unused_mut)]
const _PROTOBUF_VERSION_CHECK: () = protobuf::VERSION_3_4_0;
#[derive(PartialEq, Clone, Default, Debug)]
pub struct AttributeProto {
pub name: String,
pub ref_attr_name: String,
pub doc_string: String,
pub type_: protobuf::EnumOrUnknown<attribute_proto::AttributeType>,
pub f: f32,
pub i: i64,
pub s: 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: Vec<f32>,
pub ints: Vec<i64>,
pub strings: Vec<Vec<u8>>,
pub tensors: Vec<TensorProto>,
pub graphs: Vec<GraphProto>,
pub sparse_tensors: Vec<SparseTensorProto>,
pub type_protos: Vec<TypeProto>,
pub special_fields: protobuf::SpecialFields,
}
impl<'a> Default for &'a AttributeProto {
fn default() -> &'a AttributeProto {
<AttributeProto as protobuf::Message>::default_instance()
}
}
impl AttributeProto {
pub fn new() -> AttributeProto {
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())?;
}
};
}
Ok(())
}
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)?;
}
for v in &self.floats {
os.write_float(7, *v)?;
};
for v in &self.ints {
os.write_int64(8, *v)?;
};
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())?;
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 += 5 * self.floats.len() as u64;
for value in &self.ints {
my_size += protobuf::rt::int64_size(8, *value);
};
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 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: String::new(),
ref_attr_name: String::new(),
doc_string: String::new(),
type_: protobuf::EnumOrUnknown::from_i32(0),
f: 0.,
i: 0,
s: Vec::new(),
t: protobuf::MessageField::none(),
g: protobuf::MessageField::none(),
sparse_tensor: protobuf::MessageField::none(),
tp: protobuf::MessageField::none(),
floats: Vec::new(),
ints: Vec::new(),
strings: Vec::new(),
tensors: Vec::new(),
graphs: Vec::new(),
sparse_tensors: Vec::new(),
type_protos: 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) -> Option<AttributeType> {
match value {
0 => Some(AttributeType::UNDEFINED),
1 => Some(AttributeType::FLOAT),
2 => Some(AttributeType::INT),
3 => Some(AttributeType::STRING),
4 => Some(AttributeType::TENSOR),
5 => Some(AttributeType::GRAPH),
11 => Some(AttributeType::SPARSE_TENSOR),
13 => Some(AttributeType::TYPE_PROTO),
6 => Some(AttributeType::FLOATS),
7 => Some(AttributeType::INTS),
8 => Some(AttributeType::STRINGS),
9 => Some(AttributeType::TENSORS),
10 => Some(AttributeType::GRAPHS),
12 => Some(AttributeType::SPARSE_TENSORS),
14 => Some(AttributeType::TYPE_PROTOS),
_ => None
}
}
fn from_str(str: &str) -> Option<AttributeType> {
match str {
"UNDEFINED" => Some(AttributeType::UNDEFINED),
"FLOAT" => Some(AttributeType::FLOAT),
"INT" => Some(AttributeType::INT),
"STRING" => Some(AttributeType::STRING),
"TENSOR" => Some(AttributeType::TENSOR),
"GRAPH" => Some(AttributeType::GRAPH),
"SPARSE_TENSOR" => Some(AttributeType::SPARSE_TENSOR),
"TYPE_PROTO" => Some(AttributeType::TYPE_PROTO),
"FLOATS" => Some(AttributeType::FLOATS),
"INTS" => Some(AttributeType::INTS),
"STRINGS" => Some(AttributeType::STRINGS),
"TENSORS" => Some(AttributeType::TENSORS),
"GRAPHS" => Some(AttributeType::GRAPHS),
"SPARSE_TENSORS" => Some(AttributeType::SPARSE_TENSORS),
"TYPE_PROTOS" => Some(AttributeType::TYPE_PROTOS),
_ => 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 Default for AttributeType {
fn default() -> Self {
AttributeType::UNDEFINED
}
}
}
#[derive(PartialEq, Clone, Default, Debug)]
pub struct ValueInfoProto {
pub name: String,
pub type_: protobuf::MessageField<TypeProto>,
pub doc_string: String,
pub metadata_props: Vec<StringStringEntryProto>,
pub special_fields: protobuf::SpecialFields,
}
impl<'a> Default for &'a ValueInfoProto {
fn default() -> &'a ValueInfoProto {
<ValueInfoProto as protobuf::Message>::default_instance()
}
}
impl ValueInfoProto {
pub fn new() -> ValueInfoProto {
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())?;
}
};
}
Ok(())
}
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())?;
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 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: String::new(),
type_: protobuf::MessageField::none(),
doc_string: String::new(),
metadata_props: Vec::new(),
special_fields: protobuf::SpecialFields::new(),
};
&instance
}
}
#[derive(PartialEq, Clone, Default, Debug)]
pub struct NodeProto {
pub input: Vec<String>,
pub output: Vec<String>,
pub name: String,
pub op_type: String,
pub domain: String,
pub overload: String,
pub attribute: Vec<AttributeProto>,
pub doc_string: String,
pub metadata_props: Vec<StringStringEntryProto>,
pub special_fields: protobuf::SpecialFields,
}
impl<'a> Default for &'a NodeProto {
fn default() -> &'a NodeProto {
<NodeProto as protobuf::Message>::default_instance()
}
}
impl NodeProto {
pub fn new() -> NodeProto {
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())?;
}
};
}
Ok(())
}
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())?;
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 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: Vec::new(),
output: Vec::new(),
name: String::new(),
op_type: String::new(),
domain: String::new(),
overload: String::new(),
attribute: Vec::new(),
doc_string: String::new(),
metadata_props: 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: Vec<StringStringEntryProto>,
pub update_binding: Vec<StringStringEntryProto>,
pub special_fields: protobuf::SpecialFields,
}
impl<'a> Default for &'a TrainingInfoProto {
fn default() -> &'a TrainingInfoProto {
<TrainingInfoProto as protobuf::Message>::default_instance()
}
}
impl TrainingInfoProto {
pub fn new() -> TrainingInfoProto {
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())?;
}
};
}
Ok(())
}
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())?;
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 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: Vec::new(),
update_binding: Vec::new(),
special_fields: protobuf::SpecialFields::new(),
};
&instance
}
}
#[derive(PartialEq, Clone, Default, Debug)]
pub struct ModelProto {
pub ir_version: i64,
pub opset_import: Vec<OperatorSetIdProto>,
pub producer_name: String,
pub producer_version: String,
pub domain: String,
pub model_version: i64,
pub doc_string: String,
pub graph: protobuf::MessageField<GraphProto>,
pub metadata_props: Vec<StringStringEntryProto>,
pub training_info: Vec<TrainingInfoProto>,
pub functions: Vec<FunctionProto>,
pub special_fields: protobuf::SpecialFields,
}
impl<'a> Default for &'a ModelProto {
fn default() -> &'a ModelProto {
<ModelProto as protobuf::Message>::default_instance()
}
}
impl ModelProto {
pub fn new() -> ModelProto {
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())?;
}
};
}
Ok(())
}
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())?;
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 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: Vec::new(),
producer_name: String::new(),
producer_version: String::new(),
domain: String::new(),
model_version: 0,
doc_string: String::new(),
graph: protobuf::MessageField::none(),
metadata_props: Vec::new(),
training_info: Vec::new(),
functions: Vec::new(),
special_fields: protobuf::SpecialFields::new(),
};
&instance
}
}
#[derive(PartialEq, Clone, Default, Debug)]
pub struct StringStringEntryProto {
pub key: String,
pub value: String,
pub special_fields: protobuf::SpecialFields,
}
impl<'a> Default for &'a StringStringEntryProto {
fn default() -> &'a StringStringEntryProto {
<StringStringEntryProto as protobuf::Message>::default_instance()
}
}
impl StringStringEntryProto {
pub fn new() -> StringStringEntryProto {
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())?;
}
};
}
Ok(())
}
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())?;
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 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: String::new(),
value: String::new(),
special_fields: protobuf::SpecialFields::new(),
};
&instance
}
}
#[derive(PartialEq, Clone, Default, Debug)]
pub struct TensorAnnotation {
pub tensor_name: String,
pub quant_parameter_tensor_names: Vec<StringStringEntryProto>,
pub special_fields: protobuf::SpecialFields,
}
impl<'a> Default for &'a TensorAnnotation {
fn default() -> &'a TensorAnnotation {
<TensorAnnotation as protobuf::Message>::default_instance()
}
}
impl TensorAnnotation {
pub fn new() -> TensorAnnotation {
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())?;
}
};
}
Ok(())
}
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())?;
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 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: String::new(),
quant_parameter_tensor_names: Vec::new(),
special_fields: protobuf::SpecialFields::new(),
};
&instance
}
}
#[derive(PartialEq, Clone, Default, Debug)]
pub struct GraphProto {
pub node: Vec<NodeProto>,
pub name: String,
pub initializer: Vec<TensorProto>,
pub sparse_initializer: Vec<SparseTensorProto>,
pub doc_string: String,
pub input: Vec<ValueInfoProto>,
pub output: Vec<ValueInfoProto>,
pub value_info: Vec<ValueInfoProto>,
pub quantization_annotation: Vec<TensorAnnotation>,
pub metadata_props: Vec<StringStringEntryProto>,
pub special_fields: protobuf::SpecialFields,
}
impl<'a> Default for &'a GraphProto {
fn default() -> &'a GraphProto {
<GraphProto as protobuf::Message>::default_instance()
}
}
impl GraphProto {
pub fn new() -> GraphProto {
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())?;
}
};
}
Ok(())
}
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())?;
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 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: Vec::new(),
name: String::new(),
initializer: Vec::new(),
sparse_initializer: Vec::new(),
doc_string: String::new(),
input: Vec::new(),
output: Vec::new(),
value_info: Vec::new(),
quantization_annotation: Vec::new(),
metadata_props: Vec::new(),
special_fields: protobuf::SpecialFields::new(),
};
&instance
}
}
#[derive(PartialEq, Clone, Default, Debug)]
pub struct TensorProto {
pub dims: Vec<i64>,
pub data_type: i32,
pub segment: protobuf::MessageField<tensor_proto::Segment>,
pub float_data: Vec<f32>,
pub int32_data: Vec<i32>,
pub string_data: Vec<Vec<u8>>,
pub int64_data: Vec<i64>,
pub name: String,
pub doc_string: String,
pub raw_data: Vec<u8>,
pub external_data: Vec<StringStringEntryProto>,
pub data_location: protobuf::EnumOrUnknown<tensor_proto::DataLocation>,
pub double_data: Vec<f64>,
pub uint64_data: Vec<u64>,
pub metadata_props: Vec<StringStringEntryProto>,
pub special_fields: protobuf::SpecialFields,
}
impl<'a> Default for &'a TensorProto {
fn default() -> &'a TensorProto {
<TensorProto as protobuf::Message>::default_instance()
}
}
impl TensorProto {
pub fn new() -> TensorProto {
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())?;
}
};
}
Ok(())
}
fn write_to_with_cached_sizes(&self, os: &mut protobuf::CodedOutputStream<'_>) -> protobuf::Result<()> {
for v in &self.dims {
os.write_int64(1, *v)?;
};
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())?;
Ok(())
}
#[allow(unused_variables)]
fn compute_size(&self) -> u64 {
let mut my_size = 0;
for value in &self.dims {
my_size += protobuf::rt::int64_size(1, *value);
};
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 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: Vec::new(),
data_type: 0,
segment: protobuf::MessageField::none(),
float_data: Vec::new(),
int32_data: Vec::new(),
string_data: Vec::new(),
int64_data: Vec::new(),
name: String::new(),
doc_string: String::new(),
raw_data: Vec::new(),
external_data: Vec::new(),
data_location: protobuf::EnumOrUnknown::from_i32(0),
double_data: Vec::new(),
uint64_data: Vec::new(),
metadata_props: 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> Default for &'a Segment {
fn default() -> &'a Segment {
<Segment as protobuf::Message>::default_instance()
}
}
impl Segment {
pub fn new() -> Segment {
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())?;
}
};
}
Ok(())
}
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())?;
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 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) -> Option<DataType> {
match value {
0 => Some(DataType::UNDEFINED),
1 => Some(DataType::FLOAT),
2 => Some(DataType::UINT8),
3 => Some(DataType::INT8),
4 => Some(DataType::UINT16),
5 => Some(DataType::INT16),
6 => Some(DataType::INT32),
7 => Some(DataType::INT64),
8 => Some(DataType::STRING),
9 => Some(DataType::BOOL),
10 => Some(DataType::FLOAT16),
11 => Some(DataType::DOUBLE),
12 => Some(DataType::UINT32),
13 => Some(DataType::UINT64),
14 => Some(DataType::COMPLEX64),
15 => Some(DataType::COMPLEX128),
16 => Some(DataType::BFLOAT16),
17 => Some(DataType::FLOAT8E4M3FN),
18 => Some(DataType::FLOAT8E4M3FNUZ),
19 => Some(DataType::FLOAT8E5M2),
20 => Some(DataType::FLOAT8E5M2FNUZ),
21 => Some(DataType::UINT4),
22 => Some(DataType::INT4),
_ => None
}
}
fn from_str(str: &str) -> Option<DataType> {
match str {
"UNDEFINED" => Some(DataType::UNDEFINED),
"FLOAT" => Some(DataType::FLOAT),
"UINT8" => Some(DataType::UINT8),
"INT8" => Some(DataType::INT8),
"UINT16" => Some(DataType::UINT16),
"INT16" => Some(DataType::INT16),
"INT32" => Some(DataType::INT32),
"INT64" => Some(DataType::INT64),
"STRING" => Some(DataType::STRING),
"BOOL" => Some(DataType::BOOL),
"FLOAT16" => Some(DataType::FLOAT16),
"DOUBLE" => Some(DataType::DOUBLE),
"UINT32" => Some(DataType::UINT32),
"UINT64" => Some(DataType::UINT64),
"COMPLEX64" => Some(DataType::COMPLEX64),
"COMPLEX128" => Some(DataType::COMPLEX128),
"BFLOAT16" => Some(DataType::BFLOAT16),
"FLOAT8E4M3FN" => Some(DataType::FLOAT8E4M3FN),
"FLOAT8E4M3FNUZ" => Some(DataType::FLOAT8E4M3FNUZ),
"FLOAT8E5M2" => Some(DataType::FLOAT8E5M2),
"FLOAT8E5M2FNUZ" => Some(DataType::FLOAT8E5M2FNUZ),
"UINT4" => Some(DataType::UINT4),
"INT4" => Some(DataType::INT4),
_ => 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 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) -> Option<DataLocation> {
match value {
0 => Some(DataLocation::DEFAULT),
1 => Some(DataLocation::EXTERNAL),
_ => None
}
}
fn from_str(str: &str) -> Option<DataLocation> {
match str {
"DEFAULT" => Some(DataLocation::DEFAULT),
"EXTERNAL" => Some(DataLocation::EXTERNAL),
_ => None
}
}
const VALUES: &'static [DataLocation] = &[
DataLocation::DEFAULT,
DataLocation::EXTERNAL,
];
}
impl 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: Vec<i64>,
pub special_fields: protobuf::SpecialFields,
}
impl<'a> Default for &'a SparseTensorProto {
fn default() -> &'a SparseTensorProto {
<SparseTensorProto as protobuf::Message>::default_instance()
}
}
impl SparseTensorProto {
pub fn new() -> SparseTensorProto {
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())?;
}
};
}
Ok(())
}
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)?;
}
for v in &self.dims {
os.write_int64(3, *v)?;
};
os.write_unknown_fields(self.special_fields.unknown_fields())?;
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;
}
for value in &self.dims {
my_size += protobuf::rt::int64_size(3, *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 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: Vec::new(),
special_fields: protobuf::SpecialFields::new(),
};
&instance
}
}
#[derive(PartialEq, Clone, Default, Debug)]
pub struct TensorShapeProto {
pub dim: Vec<tensor_shape_proto::Dimension>,
pub special_fields: protobuf::SpecialFields,
}
impl<'a> Default for &'a TensorShapeProto {
fn default() -> &'a TensorShapeProto {
<TensorShapeProto as protobuf::Message>::default_instance()
}
}
impl TensorShapeProto {
pub fn new() -> TensorShapeProto {
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())?;
}
};
}
Ok(())
}
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())?;
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 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: Vec::new(),
special_fields: protobuf::SpecialFields::new(),
};
&instance
}
}
pub mod tensor_shape_proto {
#[derive(PartialEq, Clone, Default, Debug)]
pub struct Dimension {
pub denotation: String,
pub value: Option<dimension::Value>,
pub special_fields: protobuf::SpecialFields,
}
impl<'a> Default for &'a Dimension {
fn default() -> &'a Dimension {
<Dimension as protobuf::Message>::default_instance()
}
}
impl Dimension {
pub fn new() -> Dimension {
Default::default()
}
pub fn dim_value(&self) -> i64 {
match self.value {
Some(dimension::Value::DimValue(v)) => v,
_ => 0,
}
}
pub fn clear_dim_value(&mut self) {
self.value = None;
}
pub fn has_dim_value(&self) -> bool {
match self.value {
Some(dimension::Value::DimValue(..)) => true,
_ => false,
}
}
pub fn set_dim_value(&mut self, v: i64) {
self.value = Some(dimension::Value::DimValue(v))
}
pub fn dim_param(&self) -> &str {
match self.value {
Some(dimension::Value::DimParam(ref v)) => v,
_ => "",
}
}
pub fn clear_dim_param(&mut self) {
self.value = None;
}
pub fn has_dim_param(&self) -> bool {
match self.value {
Some(dimension::Value::DimParam(..)) => true,
_ => false,
}
}
pub fn set_dim_param(&mut self, v: String) {
self.value = Some(dimension::Value::DimParam(v))
}
pub fn mut_dim_param(&mut self) -> &mut String {
if let Some(dimension::Value::DimParam(_)) = self.value {} else {
self.value = Some(dimension::Value::DimParam(String::new()));
}
match self.value {
Some(dimension::Value::DimParam(ref mut v)) => v,
_ => panic!(),
}
}
pub fn take_dim_param(&mut self) -> String {
if self.has_dim_param() {
match self.value.take() {
Some(dimension::Value::DimParam(v)) => v,
_ => panic!(),
}
} else {
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 = Some(dimension::Value::DimValue(is.read_int64()?));
}
18 => {
self.value = 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())?;
}
};
}
Ok(())
}
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 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())?;
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 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 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 = None;
self.value = None;
self.denotation.clear();
self.special_fields.clear();
}
fn default_instance() -> &'static Dimension {
static instance: Dimension = Dimension {
denotation: String::new(),
value: None,
special_fields: protobuf::SpecialFields::new(),
};
&instance
}
}
pub mod dimension {
#[derive(Clone, PartialEq, Debug)]
#[non_exhaustive]
pub enum Value {
DimValue(i64),
DimParam(String),
}
impl protobuf::Oneof for Value {}
impl Value {}
}
}
#[derive(PartialEq, Clone, Default, Debug)]
pub struct TypeProto {
pub denotation: String,
pub value: Option<type_proto::Value>,
pub special_fields: protobuf::SpecialFields,
}
impl<'a> Default for &'a TypeProto {
fn default() -> &'a TypeProto {
<TypeProto as protobuf::Message>::default_instance()
}
}
impl TypeProto {
pub fn new() -> TypeProto {
Default::default()
}
pub fn tensor_type(&self) -> &type_proto::Tensor {
match self.value {
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 = None;
}
pub fn has_tensor_type(&self) -> bool {
match self.value {
Some(type_proto::Value::TensorType(..)) => true,
_ => false,
}
}
pub fn set_tensor_type(&mut self, v: type_proto::Tensor) {
self.value = Some(type_proto::Value::TensorType(v))
}
pub fn mut_tensor_type(&mut self) -> &mut type_proto::Tensor {
if let Some(type_proto::Value::TensorType(_)) = self.value {} else {
self.value = Some(type_proto::Value::TensorType(type_proto::Tensor::new()));
}
match self.value {
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() {
Some(type_proto::Value::TensorType(v)) => v,
_ => panic!(),
}
} else {
type_proto::Tensor::new()
}
}
pub fn sequence_type(&self) -> &type_proto::Sequence {
match self.value {
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 = None;
}
pub fn has_sequence_type(&self) -> bool {
match self.value {
Some(type_proto::Value::SequenceType(..)) => true,
_ => false,
}
}
pub fn set_sequence_type(&mut self, v: type_proto::Sequence) {
self.value = Some(type_proto::Value::SequenceType(v))
}
pub fn mut_sequence_type(&mut self) -> &mut type_proto::Sequence {
if let Some(type_proto::Value::SequenceType(_)) = self.value {} else {
self.value = Some(type_proto::Value::SequenceType(type_proto::Sequence::new()));
}
match self.value {
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() {
Some(type_proto::Value::SequenceType(v)) => v,
_ => panic!(),
}
} else {
type_proto::Sequence::new()
}
}
pub fn map_type(&self) -> &type_proto::Map {
match self.value {
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 = None;
}
pub fn has_map_type(&self) -> bool {
match self.value {
Some(type_proto::Value::MapType(..)) => true,
_ => false,
}
}
pub fn set_map_type(&mut self, v: type_proto::Map) {
self.value = Some(type_proto::Value::MapType(v))
}
pub fn mut_map_type(&mut self) -> &mut type_proto::Map {
if let Some(type_proto::Value::MapType(_)) = self.value {} else {
self.value = Some(type_proto::Value::MapType(type_proto::Map::new()));
}
match self.value {
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() {
Some(type_proto::Value::MapType(v)) => v,
_ => panic!(),
}
} else {
type_proto::Map::new()
}
}
pub fn optional_type(&self) -> &type_proto::Optional {
match self.value {
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 = None;
}
pub fn has_optional_type(&self) -> bool {
match self.value {
Some(type_proto::Value::OptionalType(..)) => true,
_ => false,
}
}
pub fn set_optional_type(&mut self, v: type_proto::Optional) {
self.value = Some(type_proto::Value::OptionalType(v))
}
pub fn mut_optional_type(&mut self) -> &mut type_proto::Optional {
if let Some(type_proto::Value::OptionalType(_)) = self.value {} else {
self.value = Some(type_proto::Value::OptionalType(type_proto::Optional::new()));
}
match self.value {
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() {
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 {
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 = None;
}
pub fn has_sparse_tensor_type(&self) -> bool {
match self.value {
Some(type_proto::Value::SparseTensorType(..)) => true,
_ => false,
}
}
pub fn set_sparse_tensor_type(&mut self, v: type_proto::SparseTensor) {
self.value = Some(type_proto::Value::SparseTensorType(v))
}
pub fn mut_sparse_tensor_type(&mut self) -> &mut type_proto::SparseTensor {
if let Some(type_proto::Value::SparseTensorType(_)) = self.value {} else {
self.value = Some(type_proto::Value::SparseTensorType(type_proto::SparseTensor::new()));
}
match self.value {
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() {
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 = Some(type_proto::Value::TensorType(is.read_message()?));
}
34 => {
self.value = Some(type_proto::Value::SequenceType(is.read_message()?));
}
42 => {
self.value = Some(type_proto::Value::MapType(is.read_message()?));
}
74 => {
self.value = Some(type_proto::Value::OptionalType(is.read_message()?));
}
66 => {
self.value = 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())?;
}
};
}
Ok(())
}
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 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())?;
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 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 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 = None;
self.value = None;
self.value = None;
self.value = None;
self.value = None;
self.denotation.clear();
self.special_fields.clear();
}
fn default_instance() -> &'static TypeProto {
static instance: TypeProto = TypeProto {
denotation: String::new(),
value: 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> Default for &'a Tensor {
fn default() -> &'a Tensor {
<Tensor as protobuf::Message>::default_instance()
}
}
impl Tensor {
pub fn new() -> Tensor {
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())?;
}
};
}
Ok(())
}
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())?;
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 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> Default for &'a Sequence {
fn default() -> &'a Sequence {
<Sequence as protobuf::Message>::default_instance()
}
}
impl Sequence {
pub fn new() -> Sequence {
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())?;
}
};
}
Ok(())
}
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())?;
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 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> Default for &'a Map {
fn default() -> &'a Map {
<Map as protobuf::Message>::default_instance()
}
}
impl Map {
pub fn new() -> Map {
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())?;
}
};
}
Ok(())
}
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())?;
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 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> Default for &'a Optional {
fn default() -> &'a Optional {
<Optional as protobuf::Message>::default_instance()
}
}
impl Optional {
pub fn new() -> Optional {
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())?;
}
};
}
Ok(())
}
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())?;
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 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> Default for &'a SparseTensor {
fn default() -> &'a SparseTensor {
<SparseTensor as protobuf::Message>::default_instance()
}
}
impl SparseTensor {
pub fn new() -> SparseTensor {
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())?;
}
};
}
Ok(())
}
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())?;
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 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: String,
pub version: i64,
pub special_fields: protobuf::SpecialFields,
}
impl<'a> Default for &'a OperatorSetIdProto {
fn default() -> &'a OperatorSetIdProto {
<OperatorSetIdProto as protobuf::Message>::default_instance()
}
}
impl OperatorSetIdProto {
pub fn new() -> OperatorSetIdProto {
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())?;
}
};
}
Ok(())
}
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())?;
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 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: String::new(),
version: 0,
special_fields: protobuf::SpecialFields::new(),
};
&instance
}
}
#[derive(PartialEq, Clone, Default, Debug)]
pub struct FunctionProto {
pub name: String,
pub input: Vec<String>,
pub output: Vec<String>,
pub attribute: Vec<String>,
pub attribute_proto: Vec<AttributeProto>,
pub node: Vec<NodeProto>,
pub doc_string: String,
pub opset_import: Vec<OperatorSetIdProto>,
pub domain: String,
pub overload: String,
pub value_info: Vec<ValueInfoProto>,
pub metadata_props: Vec<StringStringEntryProto>,
pub special_fields: protobuf::SpecialFields,
}
impl<'a> Default for &'a FunctionProto {
fn default() -> &'a FunctionProto {
<FunctionProto as protobuf::Message>::default_instance()
}
}
impl FunctionProto {
pub fn new() -> FunctionProto {
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())?;
}
};
}
Ok(())
}
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())?;
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 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: String::new(),
input: Vec::new(),
output: Vec::new(),
attribute: Vec::new(),
attribute_proto: Vec::new(),
node: Vec::new(),
doc_string: String::new(),
opset_import: Vec::new(),
domain: String::new(),
overload: String::new(),
value_info: Vec::new(),
metadata_props: 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) -> Option<Version> {
match value {
0 => Some(Version::_START_VERSION),
1 => Some(Version::IR_VERSION_2017_10_10),
2 => Some(Version::IR_VERSION_2017_10_30),
3 => Some(Version::IR_VERSION_2017_11_3),
4 => Some(Version::IR_VERSION_2019_1_22),
5 => Some(Version::IR_VERSION_2019_3_18),
6 => Some(Version::IR_VERSION_2019_9_19),
7 => Some(Version::IR_VERSION_2020_5_8),
8 => Some(Version::IR_VERSION_2021_7_30),
9 => Some(Version::IR_VERSION_2023_5_5),
10 => Some(Version::IR_VERSION),
_ => None
}
}
fn from_str(str: &str) -> Option<Version> {
match str {
"_START_VERSION" => Some(Version::_START_VERSION),
"IR_VERSION_2017_10_10" => Some(Version::IR_VERSION_2017_10_10),
"IR_VERSION_2017_10_30" => Some(Version::IR_VERSION_2017_10_30),
"IR_VERSION_2017_11_3" => Some(Version::IR_VERSION_2017_11_3),
"IR_VERSION_2019_1_22" => Some(Version::IR_VERSION_2019_1_22),
"IR_VERSION_2019_3_18" => Some(Version::IR_VERSION_2019_3_18),
"IR_VERSION_2019_9_19" => Some(Version::IR_VERSION_2019_9_19),
"IR_VERSION_2020_5_8" => Some(Version::IR_VERSION_2020_5_8),
"IR_VERSION_2021_7_30" => Some(Version::IR_VERSION_2021_7_30),
"IR_VERSION_2023_5_5" => Some(Version::IR_VERSION_2023_5_5),
"IR_VERSION" => Some(Version::IR_VERSION),
_ => 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 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) -> Option<OperatorStatus> {
match value {
0 => Some(OperatorStatus::EXPERIMENTAL),
1 => Some(OperatorStatus::STABLE),
_ => None
}
}
fn from_str(str: &str) -> Option<OperatorStatus> {
match str {
"EXPERIMENTAL" => Some(OperatorStatus::EXPERIMENTAL),
"STABLE" => Some(OperatorStatus::STABLE),
_ => None
}
}
const VALUES: &'static [OperatorStatus] = &[
OperatorStatus::EXPERIMENTAL,
OperatorStatus::STABLE,
];
}
impl Default for OperatorStatus {
fn default() -> Self {
OperatorStatus::EXPERIMENTAL
}
}