[][src]Trait tract_hir::prelude::translator::Translate

pub trait Translate<TI1, O1, TI2, O2>: Debug where
    O1: Display + Debug + AsRef<dyn Op + 'static> + AsMut<dyn Op + 'static> + Clone + 'static + Hash,
    O2: Display + Debug + AsRef<dyn Op + 'static> + AsMut<dyn Op + 'static> + Clone + 'static + Hash,
    TI1: Fact + Hash + Clone + 'static,
    TI2: Fact + Hash + Clone + 'static, 
{ fn translate_node(
        &self,
        source: &Graph<TI1, O1>,
        node: &BaseNode<TI1, O1>,
        target: &mut Graph<TI2, O2>,
        mapping: &HashMap<OutletId, OutletId, RandomState>
    ) -> Result<SmallVec<[OutletId; 4]>, TractError>; fn translate_model(
        &self,
        source: &Graph<TI1, O1>
    ) -> Result<Graph<TI2, O2>, TractError> { ... }
fn translate_model_with_mappings(
        &self,
        source: &Graph<TI1, O1>
    ) -> Result<(Graph<TI2, O2>, HashMap<OutletId, OutletId, RandomState>), TractError> { ... } }

Required methods

fn translate_node(
    &self,
    source: &Graph<TI1, O1>,
    node: &BaseNode<TI1, O1>,
    target: &mut Graph<TI2, O2>,
    mapping: &HashMap<OutletId, OutletId, RandomState>
) -> Result<SmallVec<[OutletId; 4]>, TractError>

Loading content...

Provided methods

fn translate_model(
    &self,
    source: &Graph<TI1, O1>
) -> Result<Graph<TI2, O2>, TractError>

fn translate_model_with_mappings(
    &self,
    source: &Graph<TI1, O1>
) -> Result<(Graph<TI2, O2>, HashMap<OutletId, OutletId, RandomState>), TractError>

Loading content...

Implementors

impl<TI1, O1, TI2, O2, EO, ETI> Translate<TI1, O1, TI2, O2> for IntoTranslator where
    O1: Display + Debug + Clone + AsRef<dyn Op + 'static> + AsMut<dyn Op + 'static> + 'static + Hash,
    O2: Display + for<'a> TryFrom<&'a O1, Error = ETI> + Debug + AsRef<dyn Op + 'static> + AsMut<dyn Op + 'static> + Clone + Hash + 'static,
    TI1: Fact + Hash + Clone + 'static,
    TI2: Fact + Hash + for<'a> TryFrom<&'a TI1, Error = EO> + Clone + 'static,
    TractError: From<EO>,
    TractError: From<ETI>,
    Graph<TI2, O2>: SpecialOps<TI2, O2>, 
[src]

Loading content...