Trait tract_libcli::model::Model

source ·
pub trait Model: Downcast + Debug + DynClone + Send + Sync {
Show 26 methods fn node_id_by_name(&self, name: &str) -> TractResult<usize>; fn node_name(&self, id: usize) -> &str; fn node_op(&self, id: usize) -> &dyn Op; fn node_const(&self, id: usize) -> bool; fn node_op_name(&self, id: usize) -> Cow<'_, str>; fn node_inputs(&self, id: usize) -> &[OutletId]; fn node_output_count(&self, id: usize) -> usize; fn nodes_len(&self) -> usize; fn node_display(&self, id: usize) -> String; fn node_debug(&self, id: usize) -> String; fn eval_order(&self) -> TractResult<Vec<usize>>; fn eval_order_for_io(
        &self,
        inputs: &[usize],
        outputs: &[usize]
    ) -> TractResult<Vec<usize>>; fn input_outlets(&self) -> &[OutletId]; fn set_input_names(&mut self, names: &[&str]) -> TractResult<()>; fn set_output_names(&mut self, names: &[&str]) -> TractResult<()>; fn output_outlets(&self) -> &[OutletId]; fn outlet_typedfact(&self, outlet: OutletId) -> TractResult<TypedFact>; fn outlet_fact_format(&self, outlet: OutletId) -> String; fn outlet_label(&self, id: OutletId) -> Option<&str>; fn outlet_successors(&self, outlet: OutletId) -> &[InletId]; fn auto_outputs(&mut self) -> TractResult<()>; fn properties(&self) -> &HashMap<String, Arc<Tensor>>; fn get_or_intern_symbol(&self, name: &str) -> Symbol; fn rename_node(&mut self, id: usize, name: &str) -> TractResult<()>; fn nested_models(&self, id: usize) -> Vec<(String, &dyn Model)> { ... } fn nested_models_iters(
        &self,
        id: usize,
        input: &[&TypedFact]
    ) -> Vec<Option<TDim>> { ... }
}
Expand description

Common methods for all variants of model.

Required Methods§

Lookup node id by name

Node name by id

Node op by id

Node is const

Node op by id

Node inputs by id

Number of outputs for a node, by id.

Number nodes

Formatted node label

Formatted node label

Eval order for the model

Eval order for the model overriding input and outputs node

Inputs of the model

Outputs of the model

Tensorfact for an outlet

Short outlet formatter (id plus fact)

Labels for an outlet

List consumers of an outlet

Provided Methods§

Subnets of a node

Subnets of a node

Implementations§

Returns true if the trait object wraps an object of type __T.

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.

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.

Returns a reference to the object within the trait object if it is of type __T, or None if it isn’t.

Returns a mutable reference to the object within the trait object if it is of type __T, or None if it isn’t.

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Returns a copy of the value. Read more
Performs copy-assignment from source. Read more

Implementations on Foreign Types§

Implementors§