Trait tract_hir::internal::ElementWiseMiniOp

source ·
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,
        out_dt: Option<DatumType>
    ) -> Result<(), Error> { ... }
    fn eval_out_of_place(
        &self,
        t: &Tensor,
        out_dt: Option<DatumType>
    ) -> 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> { ... }
    fn same_as(&self, other: &(dyn ElementWiseMiniOp + 'static)) -> bool { ... }
}

Required Methods§

source

fn name(&self) -> String

Provided Methods§

source

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

source

fn validation(&self) -> Validation

source

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

source

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

source

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

source

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

source

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

source

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

source

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

source

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

source

fn same_as(&self, other: &(dyn ElementWiseMiniOp + 'static)) -> bool

Implementations§

source§

impl dyn ElementWiseMiniOp

source

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

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

source

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.

source

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.

source

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.

source

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§

source§

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

source§

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
source§

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

source§

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
source§

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

source§

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
source§

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

source§

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§

source§

impl ElementWiseMiniOp for BitNot

source§

impl ElementWiseMiniOp for GreaterEqualThanZero

source§

impl ElementWiseMiniOp for GreaterThanZero

source§

impl ElementWiseMiniOp for LessEqualThanZero

source§

impl ElementWiseMiniOp for LessThanZero

source§

impl ElementWiseMiniOp for Not

source§

impl ElementWiseMiniOp for Abs

source§

impl ElementWiseMiniOp for Acos

source§

impl ElementWiseMiniOp for Acosh

source§

impl ElementWiseMiniOp for Asin

source§

impl ElementWiseMiniOp for Asinh

source§

impl ElementWiseMiniOp for Atan

source§

impl ElementWiseMiniOp for Atanh

source§

impl ElementWiseMiniOp for Ceil

source§

impl ElementWiseMiniOp for Cos

source§

impl ElementWiseMiniOp for Cosh

source§

impl ElementWiseMiniOp for Erf

source§

impl ElementWiseMiniOp for Exp

source§

impl ElementWiseMiniOp for Floor

source§

impl ElementWiseMiniOp for Ln

source§

impl ElementWiseMiniOp for Neg

source§

impl ElementWiseMiniOp for QScale

source§

impl ElementWiseMiniOp for Recip

source§

impl ElementWiseMiniOp for Round

source§

impl ElementWiseMiniOp for RoundHalfToEven

source§

impl ElementWiseMiniOp for Rsqrt

source§

impl ElementWiseMiniOp for Sign

source§

impl ElementWiseMiniOp for Sin

source§

impl ElementWiseMiniOp for Sinh

source§

impl ElementWiseMiniOp for Sqrt

source§

impl ElementWiseMiniOp for Square

source§

impl ElementWiseMiniOp for Tan

source§

impl ElementWiseMiniOp for Tanh

source§

impl ElementWiseMiniOp for LookupTable

source§

impl ElementWiseMiniOp for OffsetI8asU8

source§

impl ElementWiseMiniOp for OffsetU8asI8

source§

impl ElementWiseMiniOp for QuantizeLinearI8

source§

impl ElementWiseMiniOp for QuantizeLinearU8

source§

impl ElementWiseMiniOp for HardSwish

source§

impl ElementWiseMiniOp for LeakyRelu

source§

impl ElementWiseMiniOp for Sigmoid