pub trait ElementWiseMiniOp: Debug + DynClone + Send + Sync + 'static + Downcast {
    // Required method
    fn name(&self) -> String;

    // Provided methods
    fn prefix(&self) -> &'static str { ... }
    fn validation(&self) -> Validation { ... }
    fn output_type(&self, input_type: DatumType) -> Option<DatumType> { ... }
    fn eval_in_place(&self, t: &mut Tensor) -> Result<(), Error> { ... }
    fn eval_out_of_place(&self, t: &Tensor) -> Result<Tensor, Error> { ... }
    fn cost_per_element(&self, dt: DatumType) -> SmallVec<[(Cost, usize); 4]> { ... }
    fn operating_datum_type(&self, dt: DatumType) -> DatumType { ... }
    fn declutter(
        &self,
        model: &Graph<TypedFact, Box<dyn TypedOp>>,
        node: &Node<TypedFact, Box<dyn TypedOp>>
    ) -> Result<Option<ModelPatch<TypedFact, Box<dyn TypedOp>>>, Error> { ... }
    fn quantize(
        &self,
        dt: DatumType,
        scale: f32,
        zero_point: i32
    ) -> Result<Option<Box<dyn ElementWiseMiniOp>>, Error> { ... }
    fn info(&self) -> Result<Vec<String>, Error> { ... }
}

Required Methods§

fn name(&self) -> String

Provided Methods§

fn prefix(&self) -> &'static str

fn validation(&self) -> Validation

fn output_type(&self, input_type: DatumType) -> Option<DatumType>

fn eval_in_place(&self, t: &mut Tensor) -> Result<(), Error>

fn eval_out_of_place(&self, t: &Tensor) -> Result<Tensor, Error>

fn cost_per_element(&self, dt: DatumType) -> SmallVec<[(Cost, usize); 4]>

fn operating_datum_type(&self, dt: DatumType) -> DatumType

fn declutter( &self, model: &Graph<TypedFact, Box<dyn TypedOp>>, node: &Node<TypedFact, Box<dyn TypedOp>> ) -> Result<Option<ModelPatch<TypedFact, Box<dyn TypedOp>>>, Error>

fn quantize( &self, dt: DatumType, scale: f32, zero_point: i32 ) -> Result<Option<Box<dyn ElementWiseMiniOp>>, Error>

fn info(&self) -> Result<Vec<String>, Error>

Implementations§

§

impl dyn ElementWiseMiniOp

pub fn is<__T>(&self) -> bool
where __T: ElementWiseMiniOp,

Returns true if the trait object wraps an object of type __T.

pub fn downcast<__T>( self: Box<dyn ElementWiseMiniOp> ) -> Result<Box<__T>, Box<dyn ElementWiseMiniOp>>
where __T: ElementWiseMiniOp,

Returns a boxed object from a boxed trait object if the underlying object is of type __T. Returns the original boxed trait if it isn’t.

pub fn downcast_rc<__T>( self: Rc<dyn ElementWiseMiniOp> ) -> Result<Rc<__T>, Rc<dyn ElementWiseMiniOp>>
where __T: ElementWiseMiniOp,

Returns an Rc-ed object from an Rc-ed trait object if the underlying object is of type __T. Returns the original Rc-ed trait if it isn’t.

pub fn downcast_ref<__T>(&self) -> Option<&__T>
where __T: ElementWiseMiniOp,

Returns a reference to the object within the trait object if it is of type __T, or None if it isn’t.

pub fn downcast_mut<__T>(&mut self) -> Option<&mut __T>
where __T: ElementWiseMiniOp,

Returns a mutable reference to the object within the trait object if it is of type __T, or None if it isn’t.

Trait Implementations§

§

impl<'clone> Clone for Box<dyn ElementWiseMiniOp + 'clone>

§

fn clone(&self) -> Box<dyn ElementWiseMiniOp + 'clone>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl<'clone> Clone for Box<dyn ElementWiseMiniOp + Send + 'clone>

§

fn clone(&self) -> Box<dyn ElementWiseMiniOp + Send + 'clone>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl<'clone> Clone for Box<dyn ElementWiseMiniOp + Send + Sync + 'clone>

§

fn clone(&self) -> Box<dyn ElementWiseMiniOp + Send + Sync + 'clone>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl<'clone> Clone for Box<dyn ElementWiseMiniOp + Sync + 'clone>

§

fn clone(&self) -> Box<dyn ElementWiseMiniOp + Sync + 'clone>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Implementors§

§

impl ElementWiseMiniOp for BitNot

§

impl ElementWiseMiniOp for GreaterEqualThanZero

§

impl ElementWiseMiniOp for GreaterThanZero

§

impl ElementWiseMiniOp for LessEqualThanZero

§

impl ElementWiseMiniOp for LessThanZero

§

impl ElementWiseMiniOp for Not

§

impl ElementWiseMiniOp for Abs

§

impl ElementWiseMiniOp for Acos

§

impl ElementWiseMiniOp for Acosh

§

impl ElementWiseMiniOp for Asin

§

impl ElementWiseMiniOp for Asinh

§

impl ElementWiseMiniOp for Atan

§

impl ElementWiseMiniOp for Atanh

§

impl ElementWiseMiniOp for Ceil

§

impl ElementWiseMiniOp for Cos

§

impl ElementWiseMiniOp for Cosh

§

impl ElementWiseMiniOp for Cube

§

impl ElementWiseMiniOp for Erf

§

impl ElementWiseMiniOp for Exp

§

impl ElementWiseMiniOp for Floor

§

impl ElementWiseMiniOp for Ln

§

impl ElementWiseMiniOp for Neg

§

impl ElementWiseMiniOp for QScale

§

impl ElementWiseMiniOp for Recip

§

impl ElementWiseMiniOp for Round

§

impl ElementWiseMiniOp for RoundHalfToEven

§

impl ElementWiseMiniOp for Rsqrt

§

impl ElementWiseMiniOp for Sign

§

impl ElementWiseMiniOp for Sin

§

impl ElementWiseMiniOp for Sinh

§

impl ElementWiseMiniOp for Sqrt

§

impl ElementWiseMiniOp for Square

§

impl ElementWiseMiniOp for Tan

§

impl ElementWiseMiniOp for Tanh

§

impl ElementWiseMiniOp for LookupTable

§

impl ElementWiseMiniOp for OffsetI8asU8

§

impl ElementWiseMiniOp for OffsetU8asI8

§

impl ElementWiseMiniOp for QuantizeLinearI8

§

impl ElementWiseMiniOp for QuantizeLinearU8

§

impl ElementWiseMiniOp for HardSwish

§

impl ElementWiseMiniOp for LeakyRelu

§

impl ElementWiseMiniOp for Sigmoid