Struct candle_transformers::models::marian::MTModel
source · pub struct MTModel { /* private fields */ }
Implementations§
source§impl MTModel
impl MTModel
pub fn new(cfg: &Config, vb: VarBuilder<'_>) -> Result<Self>
pub fn encoder(&mut self) -> &mut Encoder
pub fn decoder(&mut self) -> &mut Decoder
pub fn decode( &mut self, xs: &Tensor, encoder_xs: &Tensor, past_kv_len: usize ) -> Result<Tensor>
pub fn reset_kv_cache(&mut self)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for MTModel
impl !RefUnwindSafe for MTModel
impl Send for MTModel
impl Sync for MTModel
impl Unpin for MTModel
impl !UnwindSafe for MTModel
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