Skip to main content

BinMiniOp

Trait BinMiniOp 

Source
pub trait BinMiniOp:
    Debug
    + DynClone
    + DynEq
    + Send
    + Sync
    + 'static
    + Downcast {
Show 18 methods // Required methods fn name(&self) -> &'static str; fn result_datum_type( &self, a: DatumType, b: DatumType, ) -> TractResult<DatumType>; fn eval_in_a(&self, a: &mut Tensor, b: &Tensor) -> TractResult<()>; fn eval_out_of_place( &self, c: &mut Tensor, a: &Tensor, b: &Tensor, ) -> TractResult<()>; // Provided methods fn validation(&self) -> Validation { ... } fn operating_datum_type( &self, a: DatumType, b: DatumType, ) -> TractResult<DatumType> { ... } fn is_commutative(&self) -> bool { ... } fn neutral_element(&self) -> Option<i64> { ... } fn absorbing_element(&self) -> Option<i64> { ... } fn maybe_eval_qbinary_as_float_op( &self, a: &TValue, b: &TValue, c_dt: &DatumType, ) -> TractResult<Option<Tensor>> { ... } fn generic_eval( &self, a: TValue, b: TValue, c_dt: DatumType, ) -> TractResult<Tensor> { ... } fn eval(&self, a: TValue, b: TValue, c_dt: DatumType) -> TractResult<Tensor> { ... } fn declutter( &self, model: &TypedModel, node: &TypedNode, ) -> TractResult<Option<TypedModelPatch>> { ... } fn codegen( &self, model: &TypedModel, node: &TypedNode, ) -> TractResult<Option<TypedModelPatch>> { ... } fn cost_per_element(&self, dt: DatumType) -> TVec<(Cost, usize)> { ... } fn as_linalg_binop(&self) -> Option<BinOp> { ... } fn eval_symbolic( &self, session: &TurnState, inputs: TVec<TValue>, ) -> TractResult<Option<TVec<TValue>>> { ... } fn uniform_tdim_comparison(&self, a: &TDim, b: &TDim) -> Option<TDim> { ... }
}

Required Methods§

Source

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

Source

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

Source

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

Source

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

Provided Methods§

Source

fn validation(&self) -> Validation

Source

fn operating_datum_type( &self, a: DatumType, b: DatumType, ) -> TractResult<DatumType>

Source

fn is_commutative(&self) -> bool

Source

fn neutral_element(&self) -> Option<i64>

Source

fn absorbing_element(&self) -> Option<i64>

Source

fn maybe_eval_qbinary_as_float_op( &self, a: &TValue, b: &TValue, c_dt: &DatumType, ) -> TractResult<Option<Tensor>>

Source

fn generic_eval( &self, a: TValue, b: TValue, c_dt: DatumType, ) -> TractResult<Tensor>

Source

fn eval(&self, a: TValue, b: TValue, c_dt: DatumType) -> TractResult<Tensor>

Source

fn declutter( &self, model: &TypedModel, node: &TypedNode, ) -> TractResult<Option<TypedModelPatch>>

Source

fn codegen( &self, model: &TypedModel, node: &TypedNode, ) -> TractResult<Option<TypedModelPatch>>

Source

fn cost_per_element(&self, dt: DatumType) -> TVec<(Cost, usize)>

Source

fn as_linalg_binop(&self) -> Option<BinOp>

Source

fn eval_symbolic( &self, session: &TurnState, inputs: TVec<TValue>, ) -> TractResult<Option<TVec<TValue>>>

Override for ops that can evaluate symbolic TDim inputs (comparisons).

Source

fn uniform_tdim_comparison(&self, a: &TDim, b: &TDim) -> Option<TDim>

Override for ops that produce TDim-level comparison expressions (comparisons).

Implementations§

Source§

impl dyn BinMiniOp

Source

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

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

Source

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

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: BinMiniOp>(self: Rc<Self>) -> Result<Rc<__T>, Rc<Self>>

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: BinMiniOp>(&self) -> Option<&__T>

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: BinMiniOp>(&mut self) -> Option<&mut __T>

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<'eq> PartialEq<&Box<dyn BinMiniOp + 'eq>> for Box<dyn BinMiniOp + 'eq>

Source§

fn eq(&self, other: &&Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'eq> PartialEq<&Box<dyn BinMiniOp + Send + 'eq>> for Box<dyn BinMiniOp + Send + 'eq>

Source§

fn eq(&self, other: &&Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'eq> PartialEq<&Box<dyn BinMiniOp + Send + Sync + 'eq>> for Box<dyn BinMiniOp + Send + Sync + 'eq>

Source§

fn eq(&self, other: &&Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'eq> PartialEq<&Box<dyn BinMiniOp + Sync + 'eq>> for Box<dyn BinMiniOp + Sync + 'eq>

Source§

fn eq(&self, other: &&Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'eq> PartialEq for dyn BinMiniOp + 'eq

Source§

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'eq> PartialEq for dyn BinMiniOp + Send + 'eq

Source§

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'eq> PartialEq for dyn BinMiniOp + Send + Sync + 'eq

Source§

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'eq> PartialEq for dyn BinMiniOp + Sync + 'eq

Source§

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'eq> Eq for dyn BinMiniOp + 'eq

Source§

impl<'eq> Eq for dyn BinMiniOp + Send + 'eq

Source§

impl<'eq> Eq for dyn BinMiniOp + Send + Sync + 'eq

Source§

impl<'eq> Eq for dyn BinMiniOp + Sync + 'eq

Implementors§