Struct rust_bert::models::mobilebert::NoNorm
source · pub struct NoNorm { /* private fields */ }Expand description
No-normalization option for MobileBERT
Basic module performing a linear multiplication using trained coefficients and bias
Implementations§
source§impl NoNorm
impl NoNorm
sourcepub fn new<'p, P>(p: P, hidden_size: i64) -> NoNorm
pub fn new<'p, P>(p: P, hidden_size: i64) -> NoNorm
Creates a new NoNorm layer of given hidden size.
Arguments:
- hidden_size - input tensor’s hidden size
Example
use rust_bert::mobilebert::NoNorm;
use tch::{nn, Device};
let device = Device::Cpu;
let p = nn::VarStore::new(device);
let hidden_size = 512;
let no_norm = NoNorm::new(&p.root(), hidden_size);Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for NoNorm
impl Send for NoNorm
impl !Sync for NoNorm
impl Unpin for NoNorm
impl UnwindSafe for NoNorm
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