Struct rust_bert::reformer::LayerState
source · [−]Expand description
Cache for Reformer attention layers
Stores the cached value of buckets and states to avoid recalculation (e.g. at each generation step)
Fields
prev_buckets: Option<Tensor>Cached buckets
prev_states: TensorCached states
Trait Implementations
sourceimpl Clone for LayerState
impl Clone for LayerState
Auto Trait Implementations
impl RefUnwindSafe for LayerState
impl Send for LayerState
impl !Sync for LayerState
impl Unpin for LayerState
impl UnwindSafe for LayerState
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Instruments this type with the provided Span, returning an
Instrumented wrapper. Read more