pub struct Function {
pub inputs: Vec<NamedValueType>,
pub opset: String,
pub block_specializations: HashMap<String, Block>,
pub attributes: HashMap<String, Value>,
}Expand description
A program-level function.
Fields§
§inputs: Vec<NamedValueType>Function inputs are unordered (name, ValueType) pairs. Inputs intended to process images must be rank-4 Float32 tensors. Dimensions are interpreted as NCHW, with N == 1 and C being 1 for grayscale and 3 for RGB. Names must be valid identifiers as described above.
opset: StringThe active block is drawn from this named specialization.
This key must exist in block_specializations.
block_specializations: HashMap<String, Block>Named specializations of this function.
Specialization keys are the name of the opset that the function specialization is written in. They must be valid identifiers as described above.
Outputs from all blocks must match. They define the outputs of the function. Each block inherits the lexical scope from the function.
attributes: HashMap<String, Value>Any other attributes not described by other fields. Keys must be valid identifiers as described above.
Trait Implementations§
Source§impl Message for Function
impl Message for Function
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self. Read moreSource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self.