pub struct BertClassifier<T: Tensor + BertOps<T>> { /* private fields */ }Expand description
TODO
Implementations§
Source§impl<T: Tensor + BertOps<T> + TensorAttention<T>> BertClassifier<T>
impl<T: Tensor + BertOps<T> + TensorAttention<T>> BertClassifier<T>
Sourcepub fn new(bert: Bert<T>, pooler: BertPooler<T>, classifier: Linear<T>) -> Self
pub fn new(bert: Bert<T>, pooler: BertPooler<T>, classifier: Linear<T>) -> Self
TODO
Sourcepub fn forward(&self, ctx: &mut BertContext<T>) -> Result<(), SmeltError>
pub fn forward(&self, ctx: &mut BertContext<T>) -> Result<(), SmeltError>
TODO
Sourcepub fn new_context(
&self,
input_ids: Vec<usize>,
position_ids: Vec<usize>,
type_ids: Vec<usize>,
num_heads: usize,
) -> BertContext<T>
pub fn new_context( &self, input_ids: Vec<usize>, position_ids: Vec<usize>, type_ids: Vec<usize>, num_heads: usize, ) -> BertContext<T>
TODO
Auto Trait Implementations§
impl<T> Freeze for BertClassifier<T>where
T: Freeze,
impl<T> RefUnwindSafe for BertClassifier<T>where
T: RefUnwindSafe,
impl<T> Send for BertClassifier<T>where
T: Send,
impl<T> Sync for BertClassifier<T>where
T: Sync,
impl<T> Unpin for BertClassifier<T>where
T: Unpin,
impl<T> UnwindSafe for BertClassifier<T>where
T: UnwindSafe,
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