Trait tract_core::model::translator::Translate

source ·
pub trait Translate<TI1, O1, TI2, O2>: Debug
where TI1: Fact + Clone + 'static, TI2: Fact + Clone + 'static, O1: Display + Debug + AsRef<dyn Op> + AsMut<dyn Op> + Clone + 'static, O2: Display + Debug + AsRef<dyn Op> + AsMut<dyn Op> + Clone + 'static,
{ // Required method fn translate_node( &self, source: &Graph<TI1, O1>, node: &Node<TI1, O1>, target: &mut Graph<TI2, O2>, mapping: &HashMap<OutletId, OutletId> ) -> TractResult<TVec<OutletId>>; // Provided methods fn translate_model( &self, source: &Graph<TI1, O1> ) -> TractResult<Graph<TI2, O2>> { ... } fn translate_model_with_mappings( &self, source: &Graph<TI1, O1> ) -> TractResult<(Graph<TI2, O2>, HashMap<OutletId, OutletId>)> { ... } }

Required Methods§

source

fn translate_node( &self, source: &Graph<TI1, O1>, node: &Node<TI1, O1>, target: &mut Graph<TI2, O2>, mapping: &HashMap<OutletId, OutletId> ) -> TractResult<TVec<OutletId>>

Provided Methods§

source

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

source

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

Implementors§

source§

impl Translate<TypedFact, Box<dyn TypedOp>, TypedFact, Box<dyn TypedOp>> for SymbolValues

source§

impl<T1: Datum + Float, T2: Datum + Float> Translate<TypedFact, Box<dyn TypedOp>, TypedFact, Box<dyn TypedOp>> for FloatPrecisionTranslator<T1, T2>

source§

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