[−][src]Trait tract_core::model::Model
Common methods for all variants of model.
Required methods
fn node_id_by_name(&self, name: &str) -> TractResult<usize>
Lookup node id by name
fn node_name(&self, id: usize) -> &str
Node name by id
fn node_op(&self, id: usize) -> &dyn Op
Node op by id
fn node_inputs(&self, id: usize) -> &[OutletId]
Node inputs by id
fn node_output_count(&self, id: usize) -> usize
Number of outputs for a node, by id.
fn node_control_inputs(&self, id: usize) -> &[usize]
Number of outputs for a node, by id.
fn nodes_len(&self) -> usize
Number nodes
fn node_format(&self, id: usize) -> String
Formatted node label
fn eval_order(&self) -> TractResult<Vec<usize>>
Eval order for the model
fn eval_order_for_io(
&self,
inputs: &[usize],
outputs: &[usize]
) -> TractResult<Vec<usize>>
&self,
inputs: &[usize],
outputs: &[usize]
) -> TractResult<Vec<usize>>
Eval order for the model overriding input and outputs node
fn input_outlets(&self) -> &[OutletId]
Inputs of the model
fn output_outlets(&self) -> &[OutletId]
Outputs of the model
fn outlet_tensorfact(&self, outlet: OutletId) -> InferenceFact
Tensorfact for an outlet
fn outlet_fact_format(&self, outlet: OutletId) -> String
Short outlet formatter (id plus fact)
fn outlet_label(&self, id: OutletId) -> Option<&str>
Labels for an outlet
fn outlet_successors(&self, outlet: OutletId) -> &[InletId]
List consumers of an outlet
Methods
impl dyn Model
pub fn is<__T: Model>(&self) -> bool
Returns true if the trait object wraps an object of type __T.
pub fn downcast<__T: Model>(self: Box<Self>) -> Result<Box<__T>, Box<Self>>
Returns a boxed object from a boxed trait object if the underlying object is of type
__T. Returns the original boxed trait if it isn't.
pub fn downcast_rc<__T: Model>(self: Rc<Self>) -> Result<Rc<__T>, Rc<Self>>
Returns an Rc-ed object from an Rc-ed trait object if the underlying object is of
type __T. Returns the original Rc-ed trait if it isn't.
pub fn downcast_ref<__T: Model>(&self) -> Option<&__T>
Returns a reference to the object within the trait object if it is of type __T, or
None if it isn't.
pub fn downcast_mut<__T: Model>(&mut self) -> Option<&mut __T>
Returns a mutable reference to the object within the trait object if it is of type
__T, or None if it isn't.
Implementors
impl<TI, O> Model for ModelImpl<TI, O> where
TI: Fact + Clone + 'static,
O: Debug + Display + AsRef<dyn Op> + AsMut<dyn Op> + Clone + 'static, [src]
TI: Fact + Clone + 'static,
O: Debug + Display + AsRef<dyn Op> + AsMut<dyn Op> + Clone + 'static,
fn node_id_by_name(&self, name: &str) -> TractResult<usize>[src]
fn node_name(&self, id: usize) -> &str[src]
fn node_inputs(&self, id: usize) -> &[OutletId][src]
fn node_output_count(&self, id: usize) -> usize[src]
fn node_control_inputs(&self, id: usize) -> &[usize][src]
fn nodes_len(&self) -> usize[src]
fn node_format(&self, id: usize) -> String[src]
fn eval_order(&self) -> TractResult<Vec<usize>>[src]
fn eval_order_for_io(
&self,
inputs: &[usize],
outputs: &[usize]
) -> TractResult<Vec<usize>>[src]
&self,
inputs: &[usize],
outputs: &[usize]
) -> TractResult<Vec<usize>>