InferenceRulesOp

Trait InferenceRulesOp 

Source
pub trait InferenceRulesOp {
    // Required methods
    fn rules<'r, 'p: 'r, 's: 'r>(
        &'s self,
        solver: &mut Solver<'r>,
        inputs: &'p [TensorProxy],
        outputs: &'p [TensorProxy],
    ) -> InferenceResult;
    fn as_op(&self) -> &dyn Op;
    fn as_op_mut(&mut self) -> &mut dyn Op;

    // Provided methods
    fn to_typed(
        &self,
        source: &InferenceModel,
        node: &InferenceNode,
        target: &mut TypedModel,
        mapping: &HashMap<OutletId, OutletId>,
    ) -> TractResult<TVec<OutletId>> { ... }
    fn nboutputs(&self) -> TractResult<usize> { ... }
    fn incorporate(
        &self,
        model: &InferenceModel,
        node: &InferenceNode,
    ) -> TractResult<Option<InferenceModelPatch>> { ... }
}

Required Methods§

Source

fn rules<'r, 'p: 'r, 's: 'r>( &'s self, solver: &mut Solver<'r>, inputs: &'p [TensorProxy], outputs: &'p [TensorProxy], ) -> InferenceResult

Registers the inference rules of the operator.

Source

fn as_op(&self) -> &dyn Op

Source

fn as_op_mut(&mut self) -> &mut dyn Op

Provided Methods§

Implementations on Foreign Types§

Source§

impl InferenceRulesOp for DynSlice

Source§

fn rules<'r, 'p: 'r, 's: 'r>( &'s self, s: &mut Solver<'r>, inputs: &'p [TensorProxy], outputs: &'p [TensorProxy], ) -> InferenceResult

Source§

fn as_op(&self) -> &dyn Op

Source§

fn as_op_mut(&mut self) -> &mut dyn Op

Source§

fn to_typed( &self, _source: &InferenceModel, node: &InferenceNode, target: &mut TypedModel, mapping: &HashMap<OutletId, OutletId>, ) -> TractResult<TVec<OutletId>>

Source§

impl InferenceRulesOp for Cast

Source§

fn rules<'r, 'p: 'r, 's: 'r>( &'s self, s: &mut Solver<'r>, inputs: &'p [TensorProxy], outputs: &'p [TensorProxy], ) -> InferenceResult

Source§

fn as_op(&self) -> &dyn Op

Source§

fn as_op_mut(&mut self) -> &mut dyn Op

Source§

fn to_typed( &self, _source: &InferenceModel, node: &InferenceNode, target: &mut TypedModel, mapping: &HashMap<OutletId, OutletId>, ) -> TractResult<TVec<OutletId>>

Implementors§