#[allow(clippy::all)]
#[allow(clippy::pedantic)]
#[allow(clippy::nursery)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Program {
#[prost(int64, tag = "1")]
pub version: i64,
#[prost(map = "string, message", tag = "2")]
pub functions: ::std::collections::HashMap<::prost::alloc::string::String, Function>,
#[prost(string, tag = "3")]
pub doc_string: ::prost::alloc::string::String,
#[prost(map = "string, message", tag = "4")]
pub attributes: ::std::collections::HashMap<::prost::alloc::string::String, Value>,
}
#[allow(clippy::all)]
#[allow(clippy::pedantic)]
#[allow(clippy::nursery)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Function {
#[prost(message, repeated, tag = "1")]
pub inputs: ::prost::alloc::vec::Vec<NamedValueType>,
#[prost(string, tag = "2")]
pub opset: ::prost::alloc::string::String,
#[prost(map = "string, message", tag = "3")]
pub block_specializations: ::std::collections::HashMap<
::prost::alloc::string::String,
Block,
>,
#[prost(map = "string, message", tag = "4")]
pub attributes: ::std::collections::HashMap<::prost::alloc::string::String, Value>,
}
#[allow(clippy::all)]
#[allow(clippy::pedantic)]
#[allow(clippy::nursery)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Block {
#[prost(message, repeated, tag = "1")]
pub inputs: ::prost::alloc::vec::Vec<NamedValueType>,
#[prost(string, repeated, tag = "2")]
pub outputs: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(message, repeated, tag = "3")]
pub operations: ::prost::alloc::vec::Vec<Operation>,
#[prost(map = "string, message", tag = "4")]
pub attributes: ::std::collections::HashMap<::prost::alloc::string::String, Value>,
}
#[allow(clippy::all)]
#[allow(clippy::pedantic)]
#[allow(clippy::nursery)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Argument {
#[prost(message, repeated, tag = "1")]
pub arguments: ::prost::alloc::vec::Vec<argument::Binding>,
}
pub mod argument {
#[allow(clippy::all)]
#[allow(clippy::pedantic)]
#[allow(clippy::nursery)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Binding {
#[prost(oneof = "binding::Binding", tags = "1, 2")]
pub binding: ::core::option::Option<binding::Binding>,
}
pub mod binding {
#[allow(clippy::all)]
#[allow(clippy::pedantic)]
#[allow(clippy::nursery)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Binding {
#[prost(string, tag = "1")]
Name(::prost::alloc::string::String),
#[prost(message, tag = "2")]
Value(super::super::Value),
}
}
}
#[allow(clippy::all)]
#[allow(clippy::pedantic)]
#[allow(clippy::nursery)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Operation {
#[prost(string, tag = "1")]
pub r#type: ::prost::alloc::string::String,
#[prost(map = "string, message", tag = "2")]
pub inputs: ::std::collections::HashMap<::prost::alloc::string::String, Argument>,
#[prost(message, repeated, tag = "3")]
pub outputs: ::prost::alloc::vec::Vec<NamedValueType>,
#[prost(message, repeated, tag = "4")]
pub blocks: ::prost::alloc::vec::Vec<Block>,
#[prost(map = "string, message", tag = "5")]
pub attributes: ::std::collections::HashMap<::prost::alloc::string::String, Value>,
}
#[allow(clippy::all)]
#[allow(clippy::pedantic)]
#[allow(clippy::nursery)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct NamedValueType {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub r#type: ::core::option::Option<ValueType>,
}
#[allow(clippy::all)]
#[allow(clippy::pedantic)]
#[allow(clippy::nursery)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ValueType {
#[prost(oneof = "value_type::Type", tags = "1, 2, 3, 4, 5")]
pub r#type: ::core::option::Option<value_type::Type>,
}
pub mod value_type {
#[allow(clippy::all)]
#[allow(clippy::pedantic)]
#[allow(clippy::nursery)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Type {
#[prost(message, tag = "1")]
TensorType(super::TensorType),
#[prost(message, tag = "2")]
ListType(::prost::alloc::boxed::Box<super::ListType>),
#[prost(message, tag = "3")]
TupleType(super::TupleType),
#[prost(message, tag = "4")]
DictionaryType(::prost::alloc::boxed::Box<super::DictionaryType>),
#[prost(message, tag = "5")]
StateType(::prost::alloc::boxed::Box<super::StateType>),
}
}
#[allow(clippy::all)]
#[allow(clippy::pedantic)]
#[allow(clippy::nursery)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TensorType {
#[prost(enumeration = "DataType", tag = "1")]
pub data_type: i32,
#[prost(int64, tag = "2")]
pub rank: i64,
#[prost(message, repeated, tag = "3")]
pub dimensions: ::prost::alloc::vec::Vec<Dimension>,
#[prost(map = "string, message", tag = "4")]
pub attributes: ::std::collections::HashMap<::prost::alloc::string::String, Value>,
}
#[allow(clippy::all)]
#[allow(clippy::pedantic)]
#[allow(clippy::nursery)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TupleType {
#[prost(message, repeated, tag = "1")]
pub types: ::prost::alloc::vec::Vec<ValueType>,
}
#[allow(clippy::all)]
#[allow(clippy::pedantic)]
#[allow(clippy::nursery)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListType {
#[prost(message, optional, boxed, tag = "1")]
pub r#type: ::core::option::Option<::prost::alloc::boxed::Box<ValueType>>,
#[prost(message, optional, tag = "2")]
pub length: ::core::option::Option<Dimension>,
}
#[allow(clippy::all)]
#[allow(clippy::pedantic)]
#[allow(clippy::nursery)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DictionaryType {
#[prost(message, optional, boxed, tag = "1")]
pub key_type: ::core::option::Option<::prost::alloc::boxed::Box<ValueType>>,
#[prost(message, optional, boxed, tag = "2")]
pub value_type: ::core::option::Option<::prost::alloc::boxed::Box<ValueType>>,
}
#[allow(clippy::all)]
#[allow(clippy::pedantic)]
#[allow(clippy::nursery)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StateType {
#[prost(message, optional, boxed, tag = "1")]
pub wrapped_type: ::core::option::Option<::prost::alloc::boxed::Box<ValueType>>,
}
#[allow(clippy::all)]
#[allow(clippy::pedantic)]
#[allow(clippy::nursery)]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Dimension {
#[prost(oneof = "dimension::Dimension", tags = "1, 2")]
pub dimension: ::core::option::Option<dimension::Dimension>,
}
pub mod dimension {
#[allow(clippy::all)]
#[allow(clippy::pedantic)]
#[allow(clippy::nursery)]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ConstantDimension {
#[prost(uint64, tag = "1")]
pub size: u64,
}
#[allow(clippy::all)]
#[allow(clippy::pedantic)]
#[allow(clippy::nursery)]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct UnknownDimension {
#[prost(bool, tag = "1")]
pub variadic: bool,
}
#[allow(clippy::all)]
#[allow(clippy::pedantic)]
#[allow(clippy::nursery)]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Oneof)]
pub enum Dimension {
#[prost(message, tag = "1")]
Constant(ConstantDimension),
#[prost(message, tag = "2")]
Unknown(UnknownDimension),
}
}
#[allow(clippy::all)]
#[allow(clippy::pedantic)]
#[allow(clippy::nursery)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Value {
#[prost(string, tag = "1")]
pub doc_string: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub r#type: ::core::option::Option<ValueType>,
#[prost(oneof = "value::Value", tags = "3, 5")]
pub value: ::core::option::Option<value::Value>,
}
pub mod value {
#[allow(clippy::all)]
#[allow(clippy::pedantic)]
#[allow(clippy::nursery)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ImmediateValue {
#[prost(oneof = "immediate_value::Value", tags = "1, 2, 3, 4")]
pub value: ::core::option::Option<immediate_value::Value>,
}
pub mod immediate_value {
#[allow(clippy::all)]
#[allow(clippy::pedantic)]
#[allow(clippy::nursery)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Value {
#[prost(message, tag = "1")]
Tensor(super::super::TensorValue),
#[prost(message, tag = "2")]
Tuple(super::super::TupleValue),
#[prost(message, tag = "3")]
List(super::super::ListValue),
#[prost(message, tag = "4")]
Dictionary(super::super::DictionaryValue),
}
}
#[allow(clippy::all)]
#[allow(clippy::pedantic)]
#[allow(clippy::nursery)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct BlobFileValue {
#[prost(string, tag = "1")]
pub file_name: ::prost::alloc::string::String,
#[prost(uint64, tag = "2")]
pub offset: u64,
}
#[allow(clippy::all)]
#[allow(clippy::pedantic)]
#[allow(clippy::nursery)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Value {
#[prost(message, tag = "3")]
ImmediateValue(ImmediateValue),
#[prost(message, tag = "5")]
BlobFileValue(BlobFileValue),
}
}
#[allow(clippy::all)]
#[allow(clippy::pedantic)]
#[allow(clippy::nursery)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TensorValue {
#[prost(oneof = "tensor_value::Value", tags = "1, 2, 3, 4, 5, 6, 7")]
pub value: ::core::option::Option<tensor_value::Value>,
}
pub mod tensor_value {
#[allow(clippy::all)]
#[allow(clippy::pedantic)]
#[allow(clippy::nursery)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RepeatedFloats {
#[prost(float, repeated, tag = "1")]
pub values: ::prost::alloc::vec::Vec<f32>,
}
#[allow(clippy::all)]
#[allow(clippy::pedantic)]
#[allow(clippy::nursery)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RepeatedDoubles {
#[prost(double, repeated, tag = "1")]
pub values: ::prost::alloc::vec::Vec<f64>,
}
#[allow(clippy::all)]
#[allow(clippy::pedantic)]
#[allow(clippy::nursery)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct RepeatedInts {
#[prost(int32, repeated, tag = "1")]
pub values: ::prost::alloc::vec::Vec<i32>,
}
#[allow(clippy::all)]
#[allow(clippy::pedantic)]
#[allow(clippy::nursery)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct RepeatedLongInts {
#[prost(int64, repeated, tag = "1")]
pub values: ::prost::alloc::vec::Vec<i64>,
}
#[allow(clippy::all)]
#[allow(clippy::pedantic)]
#[allow(clippy::nursery)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct RepeatedBools {
#[prost(bool, repeated, tag = "1")]
pub values: ::prost::alloc::vec::Vec<bool>,
}
#[allow(clippy::all)]
#[allow(clippy::pedantic)]
#[allow(clippy::nursery)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct RepeatedStrings {
#[prost(string, repeated, tag = "1")]
pub values: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[allow(clippy::all)]
#[allow(clippy::pedantic)]
#[allow(clippy::nursery)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct RepeatedBytes {
#[prost(bytes = "vec", tag = "1")]
pub values: ::prost::alloc::vec::Vec<u8>,
}
#[allow(clippy::all)]
#[allow(clippy::pedantic)]
#[allow(clippy::nursery)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Value {
#[prost(message, tag = "1")]
Floats(RepeatedFloats),
#[prost(message, tag = "2")]
Ints(RepeatedInts),
#[prost(message, tag = "3")]
Bools(RepeatedBools),
#[prost(message, tag = "4")]
Strings(RepeatedStrings),
#[prost(message, tag = "5")]
LongInts(RepeatedLongInts),
#[prost(message, tag = "6")]
Doubles(RepeatedDoubles),
#[prost(message, tag = "7")]
Bytes(RepeatedBytes),
}
}
#[allow(clippy::all)]
#[allow(clippy::pedantic)]
#[allow(clippy::nursery)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TupleValue {
#[prost(message, repeated, tag = "1")]
pub values: ::prost::alloc::vec::Vec<Value>,
}
#[allow(clippy::all)]
#[allow(clippy::pedantic)]
#[allow(clippy::nursery)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListValue {
#[prost(message, repeated, tag = "1")]
pub values: ::prost::alloc::vec::Vec<Value>,
}
#[allow(clippy::all)]
#[allow(clippy::pedantic)]
#[allow(clippy::nursery)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DictionaryValue {
#[prost(message, repeated, tag = "1")]
pub values: ::prost::alloc::vec::Vec<dictionary_value::KeyValuePair>,
}
pub mod dictionary_value {
#[allow(clippy::all)]
#[allow(clippy::pedantic)]
#[allow(clippy::nursery)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct KeyValuePair {
#[prost(message, optional, tag = "1")]
pub key: ::core::option::Option<super::Value>,
#[prost(message, optional, tag = "2")]
pub value: ::core::option::Option<super::Value>,
}
}
#[allow(clippy::all)]
#[allow(clippy::pedantic)]
#[allow(clippy::nursery)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum DataType {
UnusedType = 0,
Bool = 1,
String = 2,
Float8e4m3fn = 40,
Float8e5m2 = 41,
Float16 = 10,
Float32 = 11,
Float64 = 12,
Bfloat16 = 13,
Int8 = 21,
Int16 = 22,
Int32 = 23,
Int64 = 24,
Int4 = 25,
Uint8 = 31,
Uint16 = 32,
Uint32 = 33,
Uint64 = 34,
Uint4 = 35,
Uint2 = 36,
Uint1 = 37,
Uint6 = 38,
Uint3 = 39,
}
impl DataType {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::UnusedType => "UNUSED_TYPE",
Self::Bool => "BOOL",
Self::String => "STRING",
Self::Float8e4m3fn => "FLOAT8E4M3FN",
Self::Float8e5m2 => "FLOAT8E5M2",
Self::Float16 => "FLOAT16",
Self::Float32 => "FLOAT32",
Self::Float64 => "FLOAT64",
Self::Bfloat16 => "BFLOAT16",
Self::Int8 => "INT8",
Self::Int16 => "INT16",
Self::Int32 => "INT32",
Self::Int64 => "INT64",
Self::Int4 => "INT4",
Self::Uint8 => "UINT8",
Self::Uint16 => "UINT16",
Self::Uint32 => "UINT32",
Self::Uint64 => "UINT64",
Self::Uint4 => "UINT4",
Self::Uint2 => "UINT2",
Self::Uint1 => "UINT1",
Self::Uint6 => "UINT6",
Self::Uint3 => "UINT3",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"UNUSED_TYPE" => Some(Self::UnusedType),
"BOOL" => Some(Self::Bool),
"STRING" => Some(Self::String),
"FLOAT8E4M3FN" => Some(Self::Float8e4m3fn),
"FLOAT8E5M2" => Some(Self::Float8e5m2),
"FLOAT16" => Some(Self::Float16),
"FLOAT32" => Some(Self::Float32),
"FLOAT64" => Some(Self::Float64),
"BFLOAT16" => Some(Self::Bfloat16),
"INT8" => Some(Self::Int8),
"INT16" => Some(Self::Int16),
"INT32" => Some(Self::Int32),
"INT64" => Some(Self::Int64),
"INT4" => Some(Self::Int4),
"UINT8" => Some(Self::Uint8),
"UINT16" => Some(Self::Uint16),
"UINT32" => Some(Self::Uint32),
"UINT64" => Some(Self::Uint64),
"UINT4" => Some(Self::Uint4),
"UINT2" => Some(Self::Uint2),
"UINT1" => Some(Self::Uint1),
"UINT6" => Some(Self::Uint6),
"UINT3" => Some(Self::Uint3),
_ => None,
}
}
}