pub struct WeightComponentSegments<'source> { /* private fields */ }Expand description
Validated physical bytes for one model weight component split into deterministic source-order segments.
Segment boundaries are transport metadata, not part of the component ABI:
their concatenated bytes must exactly match the component’s physical byte
length. This lets existing contiguous sources use one segment while
adapters for packed multi-tensor components expose one mmap-backed segment
per ordered checkpoint tensor without allocating an aggregate Vec.
Implementations§
Source§impl<'source> WeightComponentSegments<'source>
impl<'source> WeightComponentSegments<'source>
pub fn from_ordered_segments( component: &WeightComponentSpec, external_names: Vec<String>, source_files: Vec<String>, dimensions: Vec<u64>, element_type: ElementType, segments: Vec<WeightComponentSegment<'source>>, ) -> Result<Self, VNextError>
Sourcepub fn from_payload(payload: WeightComponentPayload<'source>) -> Self
pub fn from_payload(payload: WeightComponentPayload<'source>) -> Self
Wrap an already validated contiguous payload as one segment. This is
the compatibility path used by the default
WeightComponentSource::component_segments implementation.
pub fn component_id(&self) -> &WeightId
pub fn external_names(&self) -> &[String]
pub fn source_files(&self) -> &[String]
pub fn dimensions(&self) -> &[u64]
pub const fn element_type(&self) -> ElementType
pub fn segments(&self) -> &[WeightComponentSegment<'source>]
pub fn total_bytes(&self) -> u64
Auto Trait Implementations§
impl<'source> !RefUnwindSafe for WeightComponentSegments<'source>
impl<'source> !UnwindSafe for WeightComponentSegments<'source>
impl<'source> Freeze for WeightComponentSegments<'source>
impl<'source> Send for WeightComponentSegments<'source>
impl<'source> Sync for WeightComponentSegments<'source>
impl<'source> Unpin for WeightComponentSegments<'source>
impl<'source> UnsafeUnpin for WeightComponentSegments<'source>
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