pub struct RmsNormGatedConfig {
pub d_model: usize,
pub norm_before_gate: bool,
}Expand description
Configuration to create a RmsNormGated layer.
Fields§
§d_model: usizeThe size of the input features.
norm_before_gate: boolWhether to apply normalization before gating. Default: true
Implementations§
Source§impl RmsNormGatedConfig
impl RmsNormGatedConfig
Sourcepub fn with_norm_before_gate(self, norm_before_gate: bool) -> Self
pub fn with_norm_before_gate(self, norm_before_gate: bool) -> Self
Sets the value for the field norm_before_gate.
Whether to apply normalization before gating. Default: true
- Defaults to
true
Source§impl RmsNormGatedConfig
impl RmsNormGatedConfig
Sourcepub fn init<B: Backend>(&self, device: &B::Device) -> RmsNormGated<B>
pub fn init<B: Backend>(&self, device: &B::Device) -> RmsNormGated<B>
Initialize a new RmsNormGated module.
Trait Implementations§
Source§impl Clone for RmsNormGatedConfig
impl Clone for RmsNormGatedConfig
Source§impl Config for RmsNormGatedConfig
impl Config for RmsNormGatedConfig
§fn load_binary(data: &[u8]) -> Result<Self, ConfigError>
fn load_binary(data: &[u8]) -> Result<Self, ConfigError>
Loads the configuration from a binary buffer. Read more
Source§impl Debug for RmsNormGatedConfig
impl Debug for RmsNormGatedConfig
Source§impl<'de> Deserialize<'de> for RmsNormGatedConfig
impl<'de> Deserialize<'de> for RmsNormGatedConfig
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for RmsNormGatedConfig
impl Display for RmsNormGatedConfig
Auto Trait Implementations§
impl Freeze for RmsNormGatedConfig
impl RefUnwindSafe for RmsNormGatedConfig
impl Send for RmsNormGatedConfig
impl Sync for RmsNormGatedConfig
impl Unpin for RmsNormGatedConfig
impl UnsafeUnpin for RmsNormGatedConfig
impl UnwindSafe for RmsNormGatedConfig
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