pub enum OutputMergeConfig {
Mean,
CatLinear,
}Expand description
Configuration / factory for OutputMerge.
Variants§
Implementations§
Source§impl OutputMergeConfig
impl OutputMergeConfig
Sourcepub fn mean(n_real_layers: usize) -> Vec<Self>
pub fn mean(n_real_layers: usize) -> Vec<Self>
A vector of n_real_layers / 2 Self::Mean configs (one per pair).
Sourcepub fn cat_linear(n_real_layers: usize) -> Vec<Self>
pub fn cat_linear(n_real_layers: usize) -> Vec<Self>
A vector of n_real_layers / 2 Self::CatLinear configs (one per pair).
Sourcepub fn init(&self, d_model: usize, device: &Device) -> OutputMerge
pub fn init(&self, d_model: usize, device: &Device) -> OutputMerge
Allocate the merge module on device for the given d_model.
Trait Implementations§
Source§impl Clone for OutputMergeConfig
impl Clone for OutputMergeConfig
Source§impl Config for OutputMergeConfig
impl Config for OutputMergeConfig
§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 OutputMergeConfig
impl Debug for OutputMergeConfig
Source§impl<'de> Deserialize<'de> for OutputMergeConfig
impl<'de> Deserialize<'de> for OutputMergeConfig
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 OutputMergeConfig
impl Display for OutputMergeConfig
Auto Trait Implementations§
impl Freeze for OutputMergeConfig
impl RefUnwindSafe for OutputMergeConfig
impl Send for OutputMergeConfig
impl Sync for OutputMergeConfig
impl Unpin for OutputMergeConfig
impl UnsafeUnpin for OutputMergeConfig
impl UnwindSafe for OutputMergeConfig
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