pub struct Mamba2CachesConfig {
pub n_real_caches: usize,
pub cache: Mamba2CacheConfig,
}Expand description
Configuration / factory for Mamba2Caches.
Fields§
§n_real_caches: usizeNumber of cache slots. Equals the number of virtual layers in the network (one cache per layer, even when layers share weights).
cache: Mamba2CacheConfigShared configuration that determines the shape of each individual cache tensor.
Implementations§
Source§impl Mamba2CachesConfig
impl Mamba2CachesConfig
Sourcepub fn new(n_real_caches: usize, cache: Mamba2CacheConfig) -> Self
pub fn new(n_real_caches: usize, cache: Mamba2CacheConfig) -> Self
Source§impl Mamba2CachesConfig
impl Mamba2CachesConfig
Sourcepub fn new_from_block_config(
n_real_caches: usize,
batch: usize,
block_config: Mamba2Config,
) -> Self
pub fn new_from_block_config( n_real_caches: usize, batch: usize, block_config: Mamba2Config, ) -> Self
Convenience constructor that derives cache shapes directly from a
Mamba2Config block configuration.
Sourcepub fn init<B: Backend>(&self, device: &B::Device) -> Mamba2Caches<B>
pub fn init<B: Backend>(&self, device: &B::Device) -> Mamba2Caches<B>
Allocate all cache tensors (zero-initialised) on device.
Trait Implementations§
Source§impl Clone for Mamba2CachesConfig
impl Clone for Mamba2CachesConfig
Source§impl Config for Mamba2CachesConfig
impl Config for Mamba2CachesConfig
§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 Mamba2CachesConfig
impl Debug for Mamba2CachesConfig
Source§impl<'de> Deserialize<'de> for Mamba2CachesConfig
impl<'de> Deserialize<'de> for Mamba2CachesConfig
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 Mamba2CachesConfig
impl Display for Mamba2CachesConfig
Auto Trait Implementations§
impl Freeze for Mamba2CachesConfig
impl RefUnwindSafe for Mamba2CachesConfig
impl Send for Mamba2CachesConfig
impl Sync for Mamba2CachesConfig
impl Unpin for Mamba2CachesConfig
impl UnsafeUnpin for Mamba2CachesConfig
impl UnwindSafe for Mamba2CachesConfig
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