Trait tract_nnef::internal::TypedOp[][src]

pub trait TypedOp: 'static + Op + Debug + DynClone + Send + Sync + Downcast + EvalOp + DynHash {
    pub fn as_op(&self) -> &(dyn Op + 'static);
pub fn as_op_mut(&mut self) -> &mut (dyn Op + 'static);
pub fn output_facts(
        &self,
        inputs: &[&TypedFact]
    ) -> Result<SmallVec<[TypedFact; 4]>, Error>; pub fn invariants(
        &self,
        model: &Graph<TypedFact, Box<dyn TypedOp + 'static, Global>>,
        node: &Node<TypedFact, Box<dyn TypedOp + 'static, Global>>
    ) -> Result<Invariants, Error> { ... }
pub fn fuse(
        &self,
        _model: &Graph<TypedFact, Box<dyn TypedOp + 'static, Global>>,
        _node: &Node<TypedFact, Box<dyn TypedOp + 'static, Global>>
    ) -> Result<Option<ModelPatch<TypedFact, Box<dyn TypedOp + 'static, Global>>>, Error> { ... }
pub fn declutter(
        &self,
        model: &Graph<TypedFact, Box<dyn TypedOp + 'static, Global>>,
        node: &Node<TypedFact, Box<dyn TypedOp + 'static, Global>>
    ) -> Result<Option<ModelPatch<TypedFact, Box<dyn TypedOp + 'static, Global>>>, Error> { ... }
pub fn cost(
        &self,
        _inputs: &[&TypedFact]
    ) -> Result<SmallVec<[(Cost, TDim); 4]>, Error> { ... }
pub fn suggested_axis_changes(
        &self
    ) -> Result<SmallVec<[(InOut, AxisOp); 4]>, Error> { ... }
pub fn change_axes(
        &self,
        model: &Graph<TypedFact, Box<dyn TypedOp + 'static, Global>>,
        node: &Node<TypedFact, Box<dyn TypedOp + 'static, Global>>,
        io: InOut,
        change: &AxisOp
    ) -> Result<Option<AxisChangeConsequence>, Error> { ... }
pub fn slice_output(
        &self,
        model: &Graph<TypedFact, Box<dyn TypedOp + 'static, Global>>,
        node: &Node<TypedFact, Box<dyn TypedOp + 'static, Global>>,
        patch: &mut ModelPatch<TypedFact, Box<dyn TypedOp + 'static, Global>>,
        output_slot: usize,
        axis: usize,
        start: usize,
        end: usize
    ) -> Result<Option<OutletId>, Error> { ... }
pub fn quantize(
        &self,
        model: &Graph<TypedFact, Box<dyn TypedOp + 'static, Global>>,
        node: &Node<TypedFact, Box<dyn TypedOp + 'static, Global>>,
        dt: DatumType,
        scale: f32,
        zero_point: i32
    ) -> Result<Option<Box<dyn TypedOp + 'static, Global>>, Error> { ... }
pub fn concretize_dims(
        &self,
        source: &Graph<TypedFact, Box<dyn TypedOp + 'static, Global>>,
        node: &Node<TypedFact, Box<dyn TypedOp + 'static, Global>>,
        target: &mut Graph<TypedFact, Box<dyn TypedOp + 'static, Global>>,
        mapping: &HashMap<OutletId, OutletId, RandomState>,
        values: &SymbolValues
    ) -> Result<SmallVec<[OutletId; 4]>, Error> { ... }
pub fn codegen(
        &self,
        model: &Graph<TypedFact, Box<dyn TypedOp + 'static, Global>>,
        node: &Node<TypedFact, Box<dyn TypedOp + 'static, Global>>
    ) -> Result<Option<ModelPatch<TypedFact, Box<dyn TypedOp + 'static, Global>>>, Error> { ... }
pub fn nested_model_multipliers(
        &self,
        inputs: &[&TypedFact]
    ) -> Vec<(Cow<'_, str>, f64), Global>

Notable traits for Vec<u8, A>

impl<A> Write for Vec<u8, A> where
    A: Allocator
{ ... } }

Required methods

pub fn as_op(&self) -> &(dyn Op + 'static)[src]

Reinterpret the TypedOp as an Op.

pub fn as_op_mut(&mut self) -> &mut (dyn Op + 'static)[src]

Reinterpret the TypedOp as an Op, mutably.

pub fn output_facts(
    &self,
    inputs: &[&TypedFact]
) -> Result<SmallVec<[TypedFact; 4]>, Error>
[src]

Deduce output facts from input facts.

Loading content...

Provided methods

pub fn invariants(
    &self,
    model: &Graph<TypedFact, Box<dyn TypedOp + 'static, Global>>,
    node: &Node<TypedFact, Box<dyn TypedOp + 'static, Global>>
) -> Result<Invariants, Error>
[src]

pub fn fuse(
    &self,
    _model: &Graph<TypedFact, Box<dyn TypedOp + 'static, Global>>,
    _node: &Node<TypedFact, Box<dyn TypedOp + 'static, Global>>
) -> Result<Option<ModelPatch<TypedFact, Box<dyn TypedOp + 'static, Global>>>, Error>
[src]

Fuse op after codegen to deal with local optimisations.

pub fn declutter(
    &self,
    model: &Graph<TypedFact, Box<dyn TypedOp + 'static, Global>>,
    node: &Node<TypedFact, Box<dyn TypedOp + 'static, Global>>
) -> Result<Option<ModelPatch<TypedFact, Box<dyn TypedOp + 'static, Global>>>, Error>
[src]

Declutter the op to the tract_core operator set as much as possible.

pub fn cost(
    &self,
    _inputs: &[&TypedFact]
) -> Result<SmallVec<[(Cost, TDim); 4]>, Error>
[src]

Computes a cost hint of the operation.

Each pair is a type of operation and a number per call on eval.

pub fn suggested_axis_changes(
    &self
) -> Result<SmallVec<[(InOut, AxisOp); 4]>, Error>
[src]

pub fn change_axes(
    &self,
    model: &Graph<TypedFact, Box<dyn TypedOp + 'static, Global>>,
    node: &Node<TypedFact, Box<dyn TypedOp + 'static, Global>>,
    io: InOut,
    change: &AxisOp
) -> Result<Option<AxisChangeConsequence>, Error>
[src]

pub fn slice_output(
    &self,
    model: &Graph<TypedFact, Box<dyn TypedOp + 'static, Global>>,
    node: &Node<TypedFact, Box<dyn TypedOp + 'static, Global>>,
    patch: &mut ModelPatch<TypedFact, Box<dyn TypedOp + 'static, Global>>,
    output_slot: usize,
    axis: usize,
    start: usize,
    end: usize
) -> Result<Option<OutletId>, Error>
[src]

pub fn quantize(
    &self,
    model: &Graph<TypedFact, Box<dyn TypedOp + 'static, Global>>,
    node: &Node<TypedFact, Box<dyn TypedOp + 'static, Global>>,
    dt: DatumType,
    scale: f32,
    zero_point: i32
) -> Result<Option<Box<dyn TypedOp + 'static, Global>>, Error>
[src]

Transforms the op in an equivalent one, operating on dt (i8 or u8).

Returns None if the op can not be translated.

pub fn concretize_dims(
    &self,
    source: &Graph<TypedFact, Box<dyn TypedOp + 'static, Global>>,
    node: &Node<TypedFact, Box<dyn TypedOp + 'static, Global>>,
    target: &mut Graph<TypedFact, Box<dyn TypedOp + 'static, Global>>,
    mapping: &HashMap<OutletId, OutletId, RandomState>,
    values: &SymbolValues
) -> Result<SmallVec<[OutletId; 4]>, Error>
[src]

Transform the op into by providing a value to one or more symbols.

pub fn codegen(
    &self,
    model: &Graph<TypedFact, Box<dyn TypedOp + 'static, Global>>,
    node: &Node<TypedFact, Box<dyn TypedOp + 'static, Global>>
) -> Result<Option<ModelPatch<TypedFact, Box<dyn TypedOp + 'static, Global>>>, Error>
[src]

Translate the op into the most efficient form possible for execution.

This transformation is supposed to be final, no more pass are expected to be run on the codegen networks.

pub fn nested_model_multipliers(
    &self,
    inputs: &[&TypedFact]
) -> Vec<(Cow<'_, str>, f64), Global>

Notable traits for Vec<u8, A>

impl<A> Write for Vec<u8, A> where
    A: Allocator
[src]

Nested model multipliers, with label (for profiling).

Loading content...

Trait Implementations

impl AsMut<dyn Op + 'static> for dyn TypedOp + 'static[src]

impl AsRef<dyn Op + 'static> for dyn TypedOp + 'static[src]

Implementations on Foreign Types

impl TypedOp for Iff[src]

impl TypedOp for TypedBinOp[src]

impl TypedOp for ConvUnary[src]

impl TypedOp for Gather[src]

impl TypedOp for LirMatMulUnary[src]

impl TypedOp for Const[src]

impl TypedOp for LirScan[src]

impl TypedOp for OneHot[src]

impl TypedOp for QMatMul[src]

impl TypedOp for Scan[src]

impl TypedOp for UnaryOp[src]

impl TypedOp for MatMulUnary[src]

impl TypedOp for Dummy[src]

impl TypedOp for Pad[src]

impl TypedOp for MergeOpUnicast[src]

impl TypedOp for MatMatMulPack[src]

impl TypedOp for TypedSource[src]

impl TypedOp for ElementWiseOp[src]

impl TypedOp for ConstantOfShape[src]

impl TypedOp for SumPool[src]

impl TypedOp for Reduce[src]

impl TypedOp for Slice[src]

impl TypedOp for FiniteReshape[src]

impl TypedOp for MultiBroadcastTo[src]

impl TypedOp for MatMul[src]

impl TypedOp for Identity[src]

impl TypedOp for DequantizeLinearF32[src]

impl TypedOp for MaxPool[src]

impl TypedOp for Downsample[src]

impl TypedOp for TypedConcat[src]

impl TypedOp for Im2Col[src]

impl TypedOp for Tile[src]

Loading content...

Implementors

impl TypedOp for AxisOp[src]

Loading content...