Struct candle_transformers::models::trocr::TrOCRModel
source · pub struct TrOCRModel { /* private fields */ }
Implementations§
source§impl TrOCRModel
impl TrOCRModel
pub fn new( encoder_cfg: &Config, decoder_cfg: &TrOCRConfig, vb: VarBuilder<'_> ) -> Result<Self>
pub fn encoder(&mut self) -> &mut TrOCREncoder
pub fn decoder(&mut self) -> &mut TrOCRForCausalLM
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§
source§impl Clone for TrOCRModel
impl Clone for TrOCRModel
source§fn clone(&self) -> TrOCRModel
fn clone(&self) -> TrOCRModel
Returns a copy 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 moreAuto Trait Implementations§
impl Freeze for TrOCRModel
impl !RefUnwindSafe for TrOCRModel
impl Send for TrOCRModel
impl Sync for TrOCRModel
impl Unpin for TrOCRModel
impl !UnwindSafe for TrOCRModel
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