pub struct AudioCodebookLayout {
pub semantic_vq_size: usize,
pub acoustic_codebooks: usize,
pub fsq_levels: usize,
pub specials_per_codebook: usize,
}Expand description
Audio codebook embedding layout constants.
Fields§
§semantic_vq_size: usizeNumber of semantic VQ entries.
acoustic_codebooks: usizeNumber of acoustic FSQ dimensions (codebooks).
fsq_levels: usizeNumber of FSQ levels per acoustic codebook.
specials_per_codebook: usizeNumber of special tokens per codebook (EMPTY_AUDIO, END_AUDIO).
Implementations§
Source§impl AudioCodebookLayout
impl AudioCodebookLayout
Sourcepub fn acoustic_stride(&self) -> usize
pub fn acoustic_stride(&self) -> usize
Stride per acoustic codebook (specials + levels).
Sourcepub fn acoustic_region_start(&self) -> usize
pub fn acoustic_region_start(&self) -> usize
Start index of acoustic codebook region in the embedding table.
Sourcepub fn total_entries(&self) -> usize
pub fn total_entries(&self) -> usize
Total meaningful entries in the embedding table.
Sourcepub fn semantic_global_index(&self, raw_semantic_idx: usize) -> usize
pub fn semantic_global_index(&self, raw_semantic_idx: usize) -> usize
Global index for a semantic token value.
Sourcepub fn acoustic_global_index(&self, codebook: usize, level: usize) -> usize
pub fn acoustic_global_index(&self, codebook: usize, level: usize) -> usize
Global index for an acoustic codebook level.
Trait Implementations§
Source§impl Clone for AudioCodebookLayout
impl Clone for AudioCodebookLayout
impl Copy for AudioCodebookLayout
Source§impl Debug for AudioCodebookLayout
impl Debug for AudioCodebookLayout
Source§impl Default for AudioCodebookLayout
impl Default for AudioCodebookLayout
impl Eq for AudioCodebookLayout
Source§impl PartialEq for AudioCodebookLayout
impl PartialEq for AudioCodebookLayout
impl StructuralPartialEq for AudioCodebookLayout
Auto Trait Implementations§
impl Freeze for AudioCodebookLayout
impl RefUnwindSafe for AudioCodebookLayout
impl Send for AudioCodebookLayout
impl Sync for AudioCodebookLayout
impl Unpin for AudioCodebookLayout
impl UnsafeUnpin for AudioCodebookLayout
impl UnwindSafe for AudioCodebookLayout
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.