pub struct StreamingTransformer { /* private fields */ }Implementations§
Source§impl StreamingTransformer
impl StreamingTransformer
pub fn new( batch_size: usize, cfg: &Config, vb: MaybeQuantizedVarBuilder<'_>, ) -> Result<Self>
pub fn forward(&mut self, xs: &Tensor, m: &StreamMask) -> Result<Tensor>
pub fn batch_size(&self) -> usize
pub fn forward_ca( &mut self, xs: &Tensor, ca_src: Option<&CaSrc>, m: &StreamMask, ) -> Result<Tensor>
pub fn maybe_precompute_ca_kv( &self, ca_src: Option<CaSrc>, ) -> Result<Option<CaSrc>>
pub fn copy_state(&mut self, from: &Self) -> Result<()>
pub fn reset_batch_idx(&mut self, batch_idx: usize) -> Result<()>
Trait Implementations§
Source§impl Clone for StreamingTransformer
impl Clone for StreamingTransformer
Source§fn clone(&self) -> StreamingTransformer
fn clone(&self) -> StreamingTransformer
Returns a duplicate of the value. Read more
1.0.0 · 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 StreamingTransformer
impl Debug for StreamingTransformer
Source§impl StreamingModule for StreamingTransformer
impl StreamingModule for StreamingTransformer
fn reset_state(&mut self)
fn step(&mut self, xs: &StreamTensor, m: &StreamMask) -> Result<StreamTensor>
Auto Trait Implementations§
impl Freeze for StreamingTransformer
impl !RefUnwindSafe for StreamingTransformer
impl Send for StreamingTransformer
impl Sync for StreamingTransformer
impl Unpin for StreamingTransformer
impl !UnwindSafe for StreamingTransformer
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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