pub struct RnnLens {
pub x: usize,
pub w_ih: usize,
pub w_hh: usize,
pub bias: usize,
pub state: usize,
pub out: usize,
}Expand description
Expected packed-buffer element counts for the RNN-family ops, derived
purely from the op parameters. gates = 4 (LSTM), 3 (GRU), 1 (RNN).
The execute_{lstm,gru,rnn}_f32 kernels read their weights through raw
pointers sized from these same parameters, so a caller that supplies a
mis-shaped buffer (e.g. a w_hh missing the ×hidden factor) reads out of
bounds and returns silent garbage instead of erroring. Callers should
validate their buffers against this up front — see check_rnn_lens.
Fields§
§x: usizex: batch·seq·input_size.
w_ih: usizew_ih: Σ over layers of dirs·gates·hidden·in_l(l) (in_l grows to dirs·hidden).
w_hh: usizew_hh: layers·dirs·gates·hidden·hidden.
bias: usizeOne bias stream: layers·dirs·gates·hidden (LSTM/RNN merge into one; GRU has b_ih and b_hh).
state: usizePer-state carry buffer (h0 and, for LSTM, c0): layers·dirs·batch·hidden.
out: usizeOutput dst: batch·seq·dirs·hidden.
Trait Implementations§
impl Copy for RnnLens
impl Eq for RnnLens
impl StructuralPartialEq for RnnLens
Auto Trait Implementations§
impl Freeze for RnnLens
impl RefUnwindSafe for RnnLens
impl Send for RnnLens
impl Sync for RnnLens
impl Unpin for RnnLens
impl UnsafeUnpin for RnnLens
impl UnwindSafe for RnnLens
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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>
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