pub struct LstmState {
pub cell: Tensor,
pub hidden: Tensor,
}Expand description
The two things one LSTM timestep produces: the new cell state to carry to the next timestep, and the hidden output emitted at this one.
A named pair rather than a bare (Tensor, Tensor) so a recognizer driving
a sequence cannot silently swap the carried state and the emitted output —
the two have the same shape, so the compiler could not catch a mix-up.
Fields§
§cell: Tensorc', the cell state carried into the next timestep as cell_prev.
h, the hidden output this timestep emits (to a softmax/head, and as
the recurrent input feeding the next timestep’s gate pre-activations).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for LstmState
impl RefUnwindSafe for LstmState
impl Send for LstmState
impl Sync for LstmState
impl Unpin for LstmState
impl UnsafeUnpin for LstmState
impl UnwindSafe for LstmState
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