pub struct KvTensorShape {
pub layers: u32,
pub key_heads: u32,
pub value_heads: u32,
pub seq_len: u64,
pub head_dim: u32,
pub layout: KvLayout,
pub dtype: DType,
}Fields§
§layers: u32§key_heads: u32§value_heads: u32§seq_len: u64§head_dim: u32§layout: KvLayout§dtype: DTypeImplementations§
Source§impl KvTensorShape
impl KvTensorShape
pub fn gqa( layers: u32, key_heads: u32, value_heads: u32, seq_len: u64, head_dim: u32, layout: KvLayout, dtype: DType, ) -> Result<Self, QuantCodecError>
pub fn validate(&self) -> Result<(), QuantCodecError>
pub fn heads_for(&self, role: KvRole) -> u32
pub fn layer_element_count( &self, role: KvRole, ) -> Result<usize, QuantCodecError>
pub fn total_element_count( &self, role: KvRole, ) -> Result<usize, QuantCodecError>
pub fn validate_span(&self, span: TokenSpan) -> Result<(), QuantCodecError>
Trait Implementations§
Source§impl Clone for KvTensorShape
impl Clone for KvTensorShape
Source§fn clone(&self) -> KvTensorShape
fn clone(&self) -> KvTensorShape
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for KvTensorShape
impl Debug for KvTensorShape
Source§impl<'de> Deserialize<'de> for KvTensorShape
impl<'de> Deserialize<'de> for KvTensorShape
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 Hash for KvTensorShape
impl Hash for KvTensorShape
Source§impl PartialEq for KvTensorShape
impl PartialEq for KvTensorShape
Source§fn eq(&self, other: &KvTensorShape) -> bool
fn eq(&self, other: &KvTensorShape) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for KvTensorShape
impl Serialize for KvTensorShape
impl Eq for KvTensorShape
impl StructuralPartialEq for KvTensorShape
Auto Trait Implementations§
impl Freeze for KvTensorShape
impl RefUnwindSafe for KvTensorShape
impl Send for KvTensorShape
impl Sync for KvTensorShape
impl Unpin for KvTensorShape
impl UnsafeUnpin for KvTensorShape
impl UnwindSafe for KvTensorShape
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