Trait BinMiniOp

Source
pub trait BinMiniOp:
    Debug
    + DynClone
    + Send
    + Sync
    + 'static
    + Downcast {
Show 16 methods // Required methods fn name(&self) -> &'static str; fn result_datum_type( &self, a: DatumType, b: DatumType, ) -> Result<DatumType, Error>; fn eval_in_a(&self, a: &mut Tensor, b: &Tensor) -> Result<(), Error>; fn eval_out_of_place( &self, c: &mut Tensor, a: &Tensor, b: &Tensor, ) -> Result<(), Error>; // Provided methods fn validation(&self) -> Validation { ... } fn operating_datum_type( &self, a: DatumType, b: DatumType, ) -> Result<DatumType, Error> { ... } fn is_commutative(&self) -> bool { ... } fn neutral_element(&self) -> Option<i64> { ... } fn maybe_eval_qbinary_as_float_op( &self, a: &TValue, b: &TValue, c_dt: &DatumType, ) -> Result<Option<Tensor>, Error> { ... } fn generic_eval( &self, a: TValue, b: TValue, c_dt: DatumType, ) -> Result<Tensor, Error> { ... } fn eval( &self, a: TValue, b: TValue, c_dt: DatumType, ) -> Result<Tensor, Error> { ... } fn declutter( &self, model: &Graph<TypedFact, Box<dyn TypedOp>>, node: &Node<TypedFact, Box<dyn TypedOp>>, ) -> Result<Option<ModelPatch<TypedFact, Box<dyn TypedOp>>>, Error> { ... } fn codegen( &self, model: &Graph<TypedFact, Box<dyn TypedOp>>, node: &Node<TypedFact, Box<dyn TypedOp>>, ) -> Result<Option<ModelPatch<TypedFact, Box<dyn TypedOp>>>, Error> { ... } fn cost_per_element(&self, dt: DatumType) -> SmallVec<[(Cost, usize); 4]> { ... } fn as_linalg_binop(&self) -> Option<BinOp> { ... } fn same_as(&self, other: &(dyn BinMiniOp + 'static)) -> bool { ... }
}

Required Methods§

Source

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

Source

fn result_datum_type( &self, a: DatumType, b: DatumType, ) -> Result<DatumType, Error>

Source

fn eval_in_a(&self, a: &mut Tensor, b: &Tensor) -> Result<(), Error>

Source

fn eval_out_of_place( &self, c: &mut Tensor, a: &Tensor, b: &Tensor, ) -> Result<(), Error>

Provided Methods§

Implementations§

Source§

impl dyn BinMiniOp

Source

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

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

Source

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

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 BinMiniOp>, ) -> Result<Rc<__T>, Rc<dyn BinMiniOp>>
where __T: BinMiniOp,

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: BinMiniOp,

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: BinMiniOp,

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 BinMiniOp + 'clone>

Source§

fn clone(&self) -> Box<dyn BinMiniOp + '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 BinMiniOp + Send + 'clone>

Source§

fn clone(&self) -> Box<dyn BinMiniOp + 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 BinMiniOp + Sync + Send + 'clone>

Source§

fn clone(&self) -> Box<dyn BinMiniOp + Sync + 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 BinMiniOp + Sync + 'clone>

Source§

fn clone(&self) -> Box<dyn BinMiniOp + 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§