pub struct Mamba1CacheConfig {
pub batch: usize,
pub d_state: usize,
pub d_conv: usize,
pub d_inner: usize,
}Fields§
§batch: usize§d_state: usizelatent state dimension (N in Algorithm 2 from the Mamba paper).
d_conv: usize§d_inner: usizeImplementations§
Source§impl Mamba1CacheConfig
impl Mamba1CacheConfig
Sourcepub fn with_d_state(self, d_state: usize) -> Self
pub fn with_d_state(self, d_state: usize) -> Self
Sets the value for the field d_state.
latent state dimension (N in Algorithm 2 from the Mamba paper).
- Defaults to
16
Sourcepub fn with_d_conv(self, d_conv: usize) -> Self
pub fn with_d_conv(self, d_conv: usize) -> Self
Sets the value for the field d_conv.
- Defaults to
4
Source§impl Mamba1CacheConfig
impl Mamba1CacheConfig
pub fn new_from_block_config(batch: usize, block_config: Mamba1Config) -> Self
Sourcepub fn init<B: Backend>(&self, device: &B::Device) -> Mamba1Cache<B>
pub fn init<B: Backend>(&self, device: &B::Device) -> Mamba1Cache<B>
Returns the initialized model.
Trait Implementations§
Source§impl Clone for Mamba1CacheConfig
impl Clone for Mamba1CacheConfig
Source§impl Config for Mamba1CacheConfig
impl Config for Mamba1CacheConfig
§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 Mamba1CacheConfig
impl Debug for Mamba1CacheConfig
Source§impl<'de> Deserialize<'de> for Mamba1CacheConfig
impl<'de> Deserialize<'de> for Mamba1CacheConfig
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 Mamba1CacheConfig
impl Display for Mamba1CacheConfig
Auto Trait Implementations§
impl Freeze for Mamba1CacheConfig
impl RefUnwindSafe for Mamba1CacheConfig
impl Send for Mamba1CacheConfig
impl Sync for Mamba1CacheConfig
impl Unpin for Mamba1CacheConfig
impl UnsafeUnpin for Mamba1CacheConfig
impl UnwindSafe for Mamba1CacheConfig
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