[][src]Trait tract_hir::prelude::dsl::ModelDsl

pub trait ModelDsl<F, O> where
    F: Fact + Clone + 'static + Hash,
    O: Debug + Display + AsRef<dyn Op + 'static> + AsMut<dyn Op + 'static> + Clone + 'static + Hash
{ fn single_prec(
        &self,
        id: usize
    ) -> Result<Option<&BaseNode<F, O>>, TractError>;
fn single_prec_at(
        &self,
        id: usize,
        count: usize
    ) -> Result<Option<&BaseNode<F, O>>, TractError>;
fn single_succ(
        &self,
        id: usize
    ) -> Result<Option<&BaseNode<F, O>>, TractError>;
fn single_succ_at(
        &self,
        id: usize,
        count: usize
    ) -> Result<Option<&BaseNode<F, O>>, TractError>; }

Extensions on ModelImpl to explore and build graph models more easily.

Required methods

fn single_prec(&self, id: usize) -> Result<Option<&BaseNode<F, O>>, TractError>

Find the lone precursor of a node, if applicable.

fn single_prec_at(
    &self,
    id: usize,
    count: usize
) -> Result<Option<&BaseNode<F, O>>, TractError>

Find the count-th precursor of a node id in a chain of single tensor operation, if applicable.

fn single_succ(&self, id: usize) -> Result<Option<&BaseNode<F, O>>, TractError>

Find the lone succesor of a node, if applicable.

fn single_succ_at(
    &self,
    id: usize,
    count: usize
) -> Result<Option<&BaseNode<F, O>>, TractError>

Find the count-th successor of a node id in a chain of single tensor operation, if applicable.

Loading content...

Implementors

impl<F, O> ModelDsl<F, O> for ModelImpl<F, O> where
    F: Fact + Clone + 'static + Hash,
    O: Debug + Display + AsRef<dyn Op + 'static> + AsMut<dyn Op + 'static> + Clone + 'static + Hash
[src]

Loading content...