pub struct EncoderLayer {
pub attn_norm: Option<W>,
pub wqkv: W,
pub wo: W,
pub mlp_norm: W,
pub wi: W,
pub mlp_wo: W,
pub global: bool,
pub rope_theta: f64,
}Expand description
One encoder layer.
Fields§
§attn_norm: Option<W>None on layer 0, where ModernBERT skips the norm.
wqkv: W[3d, d], rows are q then k then v.
wo: W[d, d].
mlp_norm: W[d].
wi: W[2I, d], rows are the GELU input then the gate.
mlp_wo: W[d, I].
global: boolGlobal attention, or the sliding window.
rope_theta: f64RoPE base for this layer.
Trait Implementations§
Source§impl Clone for EncoderLayer
impl Clone for EncoderLayer
impl Copy for EncoderLayer
Source§impl Debug for EncoderLayer
impl Debug for EncoderLayer
Source§impl PartialEq for EncoderLayer
impl PartialEq for EncoderLayer
impl StructuralPartialEq for EncoderLayer
Auto Trait Implementations§
impl Freeze for EncoderLayer
impl RefUnwindSafe for EncoderLayer
impl Send for EncoderLayer
impl Sync for EncoderLayer
impl Unpin for EncoderLayer
impl UnsafeUnpin for EncoderLayer
impl UnwindSafe for EncoderLayer
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