Struct tract_core::ops::binary::TypedBinOp
source · pub struct TypedBinOp(pub Box<dyn BinMiniOp>, pub Option<DatumType>);
Tuple Fields§
§0: Box<dyn BinMiniOp>
§1: Option<DatumType>
Trait Implementations§
source§impl Clone for TypedBinOp
impl Clone for TypedBinOp
source§fn clone(&self) -> TypedBinOp
fn clone(&self) -> TypedBinOp
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for TypedBinOp
impl Debug for TypedBinOp
source§impl EvalOp for TypedBinOp
impl EvalOp for TypedBinOp
fn is_stateless(&self) -> bool
fn eval(&self, inputs: TVec<TValue>) -> TractResult<TVec<TValue>>
fn eval_with_session( &self, session: &SessionState, inputs: TVec<TValue> ) -> TractResult<TVec<TValue>>
fn state( &self, session: &mut SessionState, node_id: usize ) -> TractResult<Option<Box<dyn OpState>>>
source§impl Op for TypedBinOp
impl Op for TypedBinOp
source§impl TypedOp for TypedBinOp
impl TypedOp for TypedBinOp
source§fn output_facts(&self, inputs: &[&TypedFact]) -> TractResult<TVec<TypedFact>>
fn output_facts(&self, inputs: &[&TypedFact]) -> TractResult<TVec<TypedFact>>
Deduce output facts from input facts.
fn change_axes( &self, model: &TypedModel, node: &TypedNode, _io: InOut, change: &AxisOp ) -> TractResult<Option<AxisChangeConsequence>>
fn axes_mapping( &self, inputs: &[&TypedFact], outputs: &[&TypedFact] ) -> TractResult<AxesMapping>
source§fn cost(&self, inputs: &[&TypedFact]) -> TractResult<TVec<(Cost, TDim)>>
fn cost(&self, inputs: &[&TypedFact]) -> TractResult<TVec<(Cost, TDim)>>
Computes a cost hint of the operation. Read more
fn slice( &self, patch: &mut TypedModelPatch, prefix: &str, inputs: &[OutletId], _output_axis: usize, _start: usize, _end: usize ) -> TractResult<Option<TVec<OutletId>>>
source§fn declutter(
&self,
model: &TypedModel,
node: &TypedNode
) -> TractResult<Option<TypedModelPatch>>
fn declutter( &self, model: &TypedModel, node: &TypedNode ) -> TractResult<Option<TypedModelPatch>>
Declutter the op to the tract_core operator set as much as possible.
source§fn codegen(
&self,
model: &TypedModel,
node: &TypedNode
) -> TractResult<Option<TypedModelPatch>>
fn codegen( &self, model: &TypedModel, node: &TypedNode ) -> TractResult<Option<TypedModelPatch>>
Translate the op into the most efficient form possible for execution. Read more
source§fn fuse(
&self,
_model: &TypedModel,
_node: &TypedNode
) -> TractResult<Option<TypedModelPatch>>
fn fuse( &self, _model: &TypedModel, _node: &TypedNode ) -> TractResult<Option<TypedModelPatch>>
Fuse op after codegen to deal with local optimisations.
source§fn declutter_with_session(
&self,
session: &mut OptimizerSession<'_>,
model: &TypedModel,
node: &TypedNode
) -> TractResult<Option<TypedModelPatch>>
fn declutter_with_session( &self, session: &mut OptimizerSession<'_>, model: &TypedModel, node: &TypedNode ) -> TractResult<Option<TypedModelPatch>>
Declutter the op to the tract_core operator set as much as possible.
fn suggested_axis_changes(&self) -> TractResult<TVec<(InOut, AxisOp)>>
source§fn quantize(
&self,
model: &TypedModel,
node: &TypedNode,
dt: DatumType,
scale: f32,
zero_point: i32
) -> TractResult<Option<Box<dyn TypedOp>>>
fn quantize( &self, model: &TypedModel, node: &TypedNode, dt: DatumType, scale: f32, zero_point: i32 ) -> TractResult<Option<Box<dyn TypedOp>>>
Transforms the op in an equivalent one, operating on dt (i8 or u8). Read more
source§fn concretize_dims(
&self,
source: &TypedModel,
node: &TypedNode,
target: &mut TypedModel,
mapping: &HashMap<OutletId, OutletId>,
values: &SymbolValues
) -> TractResult<TVec<OutletId>>
fn concretize_dims( &self, source: &TypedModel, node: &TypedNode, target: &mut TypedModel, mapping: &HashMap<OutletId, OutletId>, values: &SymbolValues ) -> TractResult<TVec<OutletId>>
Transform the op into by providing a value to one or more symbols.
Auto Trait Implementations§
impl Freeze for TypedBinOp
impl !RefUnwindSafe for TypedBinOp
impl Send for TypedBinOp
impl Sync for TypedBinOp
impl Unpin for TypedBinOp
impl !UnwindSafe for TypedBinOp
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more