Struct rust_bert::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) -> NoNormwhere
P: Borrow<Path<'p>>,
pub fn new<'p, P>(p: P, hidden_size: i64) -> NoNormwhere
P: Borrow<Path<'p>>,
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);