pub struct OptMatMulState { /* private fields */ }Expand description
Per-execution state for OptMatMul: on the trivial path it caches each
micro-op’s Store OutputStore layout (strides fixed for the output
shape), so only the base pointer is refreshed per call. Constant operands
are baked into the op at fuse(), so they need no per-call state here. Pure
memoization: dropped on freeze and rebuilt lazily on next eval.
Trait Implementations§
Source§impl Clone for OptMatMulState
impl Clone for OptMatMulState
Source§fn clone(&self) -> OptMatMulState
fn clone(&self) -> OptMatMulState
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 OptMatMulState
impl Debug for OptMatMulState
Source§impl Default for OptMatMulState
impl Default for OptMatMulState
Source§fn default() -> OptMatMulState
fn default() -> OptMatMulState
Returns the “default value” for a type. Read more
Source§impl OpState for OptMatMulState
impl OpState for OptMatMulState
fn eval( &mut self, session: &mut TurnState, op: &dyn Op, inputs: TVec<TValue>, ) -> TractResult<TVec<TValue>>
fn load_from( &mut self, _: &mut TurnState, _: &mut dyn Iterator<Item = TValue>, ) -> TractResult<()>
fn save_to(&self, _: &mut Vec<TValue>) -> TractResult<()>
fn init_tensor_fact(&self) -> Option<(String, TypedFact)>
Source§fn has_init_tensor_fact(&self) -> bool
fn has_init_tensor_fact(&self) -> bool
Allocation-free predicate mirroring whether
OpState::init_tensor_fact
returns Some. The per-run symbol-resolution path queries this once for
every stateful op on every run, so it must not call init_tensor_fact
(which clones a String and a TypedFact) merely to test for presence.
Any impl that overrides init_tensor_fact to return Some must override
this to return true (and delegate it wherever init_tensor_fact is
delegated), or its resolve_symbols will not run.fn resolve_symbols(&mut self, _: &mut TurnState) -> TractResult<()>
Source§impl OpStateFreeze for OptMatMulState
impl OpStateFreeze for OptMatMulState
fn freeze(&self) -> Box<dyn FrozenOpState>
Source§fn freeze_into(self: Box<Self>) -> Box<dyn FrozenOpState>
fn freeze_into(self: Box<Self>) -> Box<dyn FrozenOpState>
Consuming freeze: moves data instead of cloning. Default delegates to freeze().
Auto Trait Implementations§
impl Freeze for OptMatMulState
impl RefUnwindSafe for OptMatMulState
impl Send for OptMatMulState
impl Sync for OptMatMulState
impl Unpin for OptMatMulState
impl UnsafeUnpin for OptMatMulState
impl UnwindSafe for OptMatMulState
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T> CloneAny for T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Converts
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn 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>
Converts
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which 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)
Converts
&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)
Converts
&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> DowncastSend for T
impl<T> DowncastSend for T
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