Skip to main content

WeightBinding

Struct WeightBinding 

Source
pub struct WeightBinding { /* private fields */ }
Expand description

One named checkpoint selection within an atomic resident unit.

Implementations§

Source§

impl WeightBinding

Source

pub fn new( name: impl Into<String>, checkpoint_key: impl Into<String>, selection: TensorSelection, expected_bytes: u64, ) -> Result<Self, ResidencyDeclarationError>

Creates a direct binding with a stable local name and selected size.

Source

pub fn from_recipe( name: impl Into<String>, recipe: DerivedWeightRecipe, expected_bytes: u64, ) -> Result<Self, ResidencyDeclarationError>

Creates a binding backed by a composable derived-weight recipe.

Source

pub fn alias( name: impl Into<String>, owner: impl Into<String>, expected_bytes: u64, ) -> Result<Self, ResidencyDeclarationError>

Creates one logical destination that shares an already materialized owner binding in the same atomic unit.

Source

pub fn name(&self) -> &str

Returns the stable name used to look up a resident value.

Source

pub fn alias_of(&self) -> Option<&str>

Returns the logical owner when this binding is an alias.

Source

pub const fn is_alias(&self) -> bool

Returns whether this binding reuses another logical binding’s native materialization.

Source

pub fn with_name( self, name: impl Into<String>, ) -> Result<Self, ResidencyDeclarationError>

Replaces the stable name used to address this value inside its resident unit.

Source

pub fn logical_target(&self) -> Option<&str>

Returns the architecture-logical parameter destination.

Source

pub fn with_logical_target( self, target: impl Into<String>, ) -> Result<Self, ResidencyDeclarationError>

Attaches the architecture-logical parameter destination.

Source

pub fn with_quantization_companions( self, scales_binding: impl Into<String>, biases_binding: Option<String>, ) -> Result<Self, ResidencyDeclarationError>

Declares exact local companion names produced by load-time quantization.

Source

pub const fn quantization_companions( &self, ) -> Option<&QuantizationCompanionBindings>

Returns exact local scale and affine-bias bindings for load-time quantization.

Source

pub fn checkpoint_key(&self) -> &str

Returns the first physical checkpoint source.

Source

pub fn selection(&self) -> &TensorSelection

Returns the direct checkpoint selection.

Source

pub const fn recipe(&self) -> Option<&DerivedWeightRecipe>

Returns the derived recipe when this is not a direct binding.

Source

pub fn source_recipe(&self) -> DerivedWeightRecipe

Returns the complete source recipe represented by this binding.

Source

pub fn checkpoint_keys(&self) -> Vec<&str>

Returns every checkpoint key consumed by this binding.

Source

pub const fn expected_bytes(&self) -> u64

Returns the exact logical materialized byte length.

Source

pub fn with_source_recipe( self, recipe: DerivedWeightRecipe, expected_bytes: u64, ) -> Result<Self, ResidencyDeclarationError>

Replaces the physical source with an equivalent validated recipe.

Source

pub fn select_bounded_output<C: RecipeCatalog + ?Sized>( self, catalog: &C, selection: TensorSelection, ) -> Result<Self, WeightBindingSelectionError>

Rewrites one logical output selection into bounded physical sources.

Trait Implementations§

Source§

impl Clone for WeightBinding

Source§

fn clone(&self) -> WeightBinding

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for WeightBinding

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for WeightBinding

Source§

impl PartialEq for WeightBinding

Source§

fn eq(&self, other: &WeightBinding) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for WeightBinding

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.