pub struct WeightComponentSpec {
pub id: WeightId,
pub role: WeightComponentRole,
pub external_names: Vec<String>,
pub dimensions: Vec<u64>,
pub encoding: WeightEncoding,
pub required: bool,
}Fields§
§id: WeightId§role: WeightComponentRole§external_names: Vec<String>Ordered checkpoint tensors forming this physical component. Dense
multi-source components use [source_count, source_shape...] and stack
tensors in this exact order. Format adapters may instead define a typed
source recipe (for example values plus quantization sidecars), but must
validate every source identity, order, shape, and resulting byte count.
Aliases are resolved before the model family constructs this schema.
dimensions: Vec<u64>§encoding: WeightEncoding§required: boolImplementations§
Source§impl WeightComponentSpec
impl WeightComponentSpec
Sourcepub fn physical_bytes(&self) -> Result<u64, VNextError>
pub fn physical_bytes(&self) -> Result<u64, VNextError>
Exact bytes occupied by this physical component. Separate-component
quantized dimensions are byte dimensions. Block-quantized dimensions
are block-grid dimensions and are multiplied by the block ABI size.
Logical element counts live on WeightTensorSpec and are checked
against the corresponding physical layout contract.
pub fn dense_element_type(&self) -> Option<ElementType>
pub fn physical_element_type(&self) -> ElementType
Trait Implementations§
Source§impl Clone for WeightComponentSpec
impl Clone for WeightComponentSpec
Source§fn clone(&self) -> WeightComponentSpec
fn clone(&self) -> WeightComponentSpec
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 WeightComponentSpec
impl Debug for WeightComponentSpec
Source§impl<'de> Deserialize<'de> for WeightComponentSpec
impl<'de> Deserialize<'de> for WeightComponentSpec
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
impl Eq for WeightComponentSpec
Source§impl PartialEq for WeightComponentSpec
impl PartialEq for WeightComponentSpec
Source§impl Serialize for WeightComponentSpec
impl Serialize for WeightComponentSpec
impl StructuralPartialEq for WeightComponentSpec
Auto Trait Implementations§
impl Freeze for WeightComponentSpec
impl RefUnwindSafe for WeightComponentSpec
impl Send for WeightComponentSpec
impl Sync for WeightComponentSpec
impl Unpin for WeightComponentSpec
impl UnsafeUnpin for WeightComponentSpec
impl UnwindSafe for WeightComponentSpec
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