pub struct Mamba1CachesConfig {
pub n_real_caches: usize,
pub cache: Mamba1CacheConfig,
}Expand description
Configuration / factory for Mamba1Caches.
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: Mamba1CacheConfigShared configuration that determines the shape of each individual cache tensor.
Implementations§
Source§impl Mamba1CachesConfig
impl Mamba1CachesConfig
Sourcepub fn new(n_real_caches: usize, cache: Mamba1CacheConfig) -> Self
pub fn new(n_real_caches: usize, cache: Mamba1CacheConfig) -> Self
Source§impl Mamba1CachesConfig
impl Mamba1CachesConfig
Sourcepub fn new_from_block_config(
n_real_caches: usize,
batch: usize,
block_config: Mamba1Config,
) -> Self
pub fn new_from_block_config( n_real_caches: usize, batch: usize, block_config: Mamba1Config, ) -> Self
Convenience constructor that derives cache shapes directly from a
Mamba1Config block configuration.
Sourcepub fn init(&self, device: &Device) -> Mamba1Caches
pub fn init(&self, device: &Device) -> Mamba1Caches
Allocate all cache tensors (zero-initialised) on device.
Trait Implementations§
Source§impl Clone for Mamba1CachesConfig
impl Clone for Mamba1CachesConfig
Source§impl Config for Mamba1CachesConfig
impl Config for Mamba1CachesConfig
§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 Mamba1CachesConfig
impl Debug for Mamba1CachesConfig
Source§impl<'de> Deserialize<'de> for Mamba1CachesConfig
impl<'de> Deserialize<'de> for Mamba1CachesConfig
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 Mamba1CachesConfig
impl Display for Mamba1CachesConfig
Auto Trait Implementations§
impl Freeze for Mamba1CachesConfig
impl RefUnwindSafe for Mamba1CachesConfig
impl Send for Mamba1CachesConfig
impl Sync for Mamba1CachesConfig
impl Unpin for Mamba1CachesConfig
impl UnsafeUnpin for Mamba1CachesConfig
impl UnwindSafe for Mamba1CachesConfig
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