pub struct RlxBertModel { /* private fields */ }Expand description
RLX-compiled BERT model ready for inference.
Implementations§
Source§impl RlxBertModel
impl RlxBertModel
pub fn load_sized( config_path: &Path, weights_path: &str, batch: usize, seq: usize, ) -> Result<Self>
pub fn load_sized_on( config_path: &Path, weights_path: &str, batch: usize, seq: usize, device: Device, ) -> Result<Self>
pub fn load_sized_with_policy( config_path: &Path, weights_path: &str, batch: usize, seq: usize, device: Device, precision: Precision, policy: Option<PrecisionPolicy>, ) -> Result<Self>
pub fn load(config_path: &Path, weights_path: &str) -> Result<Self>
pub fn recompile(&mut self, batch: usize, seq: usize) -> Result<()>
pub fn forward( &mut self, input_ids: &[f32], attention_mask: &[f32], token_type_ids: &[f32], position_ids: &[f32], ) -> Vec<f32>
Auto Trait Implementations§
impl !RefUnwindSafe for RlxBertModel
impl !Sync for RlxBertModel
impl !UnwindSafe for RlxBertModel
impl Freeze for RlxBertModel
impl Send for RlxBertModel
impl Unpin for RlxBertModel
impl UnsafeUnpin for RlxBertModel
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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