Struct rust_bert::models::reformer::LayerState
source · pub struct LayerState {
pub prev_buckets: Option<Tensor>,
pub prev_states: Tensor,
}
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: Tensor
Cached states
Trait Implementations§
source§impl 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§
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