pub(super) struct Source {
raw: ModelWeights,
pub tensors: HashMap<String, Tensor>,
pub config: Option<Value>,
}Fields§
§raw: ModelWeights§tensors: HashMap<String, Tensor>§config: Option<Value>Only BF16 import adjusts metadata; prequantized inputs remain unchanged.
Implementations§
Source§impl Source
impl Source
pub fn load(dir: &Path) -> Result<Self>
pub fn tensor(&self, name: &str) -> Result<&Tensor>
pub fn estimated_bytes(&self) -> u64
pub fn prefetch(&self, tensor: &Tensor)
pub fn bytes(&self, tensor: &Tensor) -> Result<&[u8]>
pub fn write( &self, tensor: &Tensor, range: Range<usize>, out: &mut impl Write, ) -> Result<()>
fn insert(&mut self, name: String, tensor: Tensor) -> Result<()>
fn import(&mut self, name: &str, info: &TensorInfo) -> Result<()>
fn fused_experts(&mut self, prefix: &str, info: &TensorInfo) -> Result<()>
fn quantized( &mut self, prefix: &str, info: &TensorInfo, shape: &[usize], half: usize, halves: usize, ) -> Result<()>
fn configure(&mut self, dir: &Path, cfg: &Qwen4ExpConfig) -> Result<()>
Auto Trait Implementations§
impl Freeze for Source
impl RefUnwindSafe for Source
impl Send for Source
impl Sync for Source
impl Unpin for Source
impl UnsafeUnpin for Source
impl UnwindSafe for Source
Blanket Implementations§
impl<T> AutoreleaseSafe for Twhere
T: ?Sized,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T> ErasedDestructor for Twhere
T: 'static,
§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more