Trait tract_pulse::internal::tract_core::internal::ElementWiseMiniOp [−]
pub trait ElementWiseMiniOp: 'static + Debug + DynClone + Send + Sync + Downcast + DynHash { fn name(&self) -> String; 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 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> { ... } fn quantize(
&self,
dt: DatumType,
scale: f32,
zero_point: i32
) -> Result<Option<Box<dyn ElementWiseMiniOp + 'static, Global>>, Error> { ... } fn info(&self) -> Result<Vec<String, Global>, Error> { ... } }
Required methods
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 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>
&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>
fn quantize(
&self,
dt: DatumType,
scale: f32,
zero_point: i32
) -> Result<Option<Box<dyn ElementWiseMiniOp + 'static, Global>>, Error>
&self,
dt: DatumType,
scale: f32,
zero_point: i32
) -> Result<Option<Box<dyn ElementWiseMiniOp + 'static, Global>>, Error>
fn info(&self) -> Result<Vec<String, Global>, Error>
Implementations
impl dyn ElementWiseMiniOp + 'static
impl dyn ElementWiseMiniOp + 'staticpub fn is<__T>(&self) -> bool where
__T: 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 + 'static, Global>
) -> Result<Box<__T, Global>, Box<dyn ElementWiseMiniOp + 'static, Global>> where
__T: ElementWiseMiniOp,
pub fn downcast<__T>(
self: Box<dyn ElementWiseMiniOp + 'static, Global>
) -> Result<Box<__T, Global>, Box<dyn ElementWiseMiniOp + 'static, Global>> 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 + 'static>
) -> Result<Rc<__T>, Rc<dyn ElementWiseMiniOp + 'static>> where
__T: ElementWiseMiniOp,
pub fn downcast_rc<__T>(
self: Rc<dyn ElementWiseMiniOp + 'static>
) -> Result<Rc<__T>, Rc<dyn ElementWiseMiniOp + 'static>> 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,
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,
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.
Implementors
impl ElementWiseMiniOp for Cast
impl ElementWiseMiniOp for Castpub fn name(&self) -> String
pub fn output_type(&self, _input_type: DatumType) -> Option<DatumType>
pub fn eval_out_of_place(&self, t: &Tensor) -> Result<Tensor, 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>
&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>
impl ElementWiseMiniOp for Not
impl ElementWiseMiniOp for Notimpl ElementWiseMiniOp for Abs
impl ElementWiseMiniOp for Absimpl ElementWiseMiniOp for Acos
impl ElementWiseMiniOp for Acosimpl ElementWiseMiniOp for Acosh
impl ElementWiseMiniOp for Acoshimpl ElementWiseMiniOp for Asin
impl ElementWiseMiniOp for Asinimpl ElementWiseMiniOp for Asinh
impl ElementWiseMiniOp for Asinhimpl ElementWiseMiniOp for Atan
impl ElementWiseMiniOp for Atanimpl ElementWiseMiniOp for Atanh
impl ElementWiseMiniOp for Atanhimpl ElementWiseMiniOp for Ceil
impl ElementWiseMiniOp for Ceilimpl ElementWiseMiniOp for Cos
impl ElementWiseMiniOp for Cosimpl ElementWiseMiniOp for Cosh
impl ElementWiseMiniOp for Coshimpl ElementWiseMiniOp for Exp
impl ElementWiseMiniOp for Exppub fn name(&self) -> String
pub fn eval_in_place(&self, t: &mut Tensor) -> Result<(), Error>
pub fn validation(&self) -> Validation
impl ElementWiseMiniOp for Floor
impl ElementWiseMiniOp for Floorimpl ElementWiseMiniOp for Ln
impl ElementWiseMiniOp for Lnpub fn name(&self) -> String
pub fn eval_in_place(&self, t: &mut Tensor) -> Result<(), Error>
pub fn validation(&self) -> Validation
impl ElementWiseMiniOp for Neg
impl ElementWiseMiniOp for Negimpl ElementWiseMiniOp for Recip
impl ElementWiseMiniOp for Recippub fn name(&self) -> String
pub fn eval_in_place(&self, t: &mut Tensor) -> Result<(), Error>
pub fn cost_per_element(&self, dt: DatumType) -> SmallVec<[(Cost, usize); 4]>
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>
&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 validation(&self) -> Validation
impl ElementWiseMiniOp for Round
impl ElementWiseMiniOp for Roundimpl ElementWiseMiniOp for RoundHalfToEven
impl ElementWiseMiniOp for RoundHalfToEvenimpl ElementWiseMiniOp for Rsqrt
impl ElementWiseMiniOp for Rsqrtpub fn name(&self) -> String
pub fn eval_in_place(&self, t: &mut Tensor) -> Result<(), Error>
pub fn validation(&self) -> Validation
impl ElementWiseMiniOp for Sign
impl ElementWiseMiniOp for Signimpl ElementWiseMiniOp for Sin
impl ElementWiseMiniOp for Sinimpl ElementWiseMiniOp for Sinh
impl ElementWiseMiniOp for Sinhimpl ElementWiseMiniOp for Sqrt
impl ElementWiseMiniOp for Sqrtpub fn name(&self) -> String
pub fn eval_in_place(&self, t: &mut Tensor) -> Result<(), Error>
pub fn validation(&self) -> Validation
impl ElementWiseMiniOp for Square
impl ElementWiseMiniOp for Squarepub fn name(&self) -> String
pub fn eval_in_place(&self, t: &mut Tensor) -> Result<(), Error>
pub fn validation(&self) -> Validation
impl ElementWiseMiniOp for Tan
impl ElementWiseMiniOp for Tanimpl ElementWiseMiniOp for Tanh
impl ElementWiseMiniOp for Tanhimpl ElementWiseMiniOp for Sigmoid
impl ElementWiseMiniOp for Sigmoidimpl ElementWiseMiniOp for LookupTable
impl ElementWiseMiniOp for LookupTableimpl ElementWiseMiniOp for QuantizeLinearI8
impl ElementWiseMiniOp for QuantizeLinearI8impl ElementWiseMiniOp for QuantizeLinearU8
impl ElementWiseMiniOp for QuantizeLinearU8