pub struct ArcCacheLoader<'a> { /* private fields */ }Expand description
WeightLoader view over a frozen HashMap of ArcF32Tensor.
Graph builders take tensors out of this view
(one Vec copy per weight into compile params) without cloning the
entire cache first.
Implementations§
Trait Implementations§
Source§impl WeightLoader for ArcCacheLoader<'_>
impl WeightLoader for ArcCacheLoader<'_>
Source§fn take(&mut self, key: &str) -> Result<(Vec<f32>, Vec<usize>), Error>
fn take(&mut self, key: &str) -> Result<(Vec<f32>, Vec<usize>), Error>
Take the named tensor as
(f32_data, shape). Removes from the
loader so callers can detect “weights I never used.”Source§fn take_transposed(
&mut self,
key: &str,
) -> Result<(Vec<f32>, Vec<usize>), Error>
fn take_transposed( &mut self, key: &str, ) -> Result<(Vec<f32>, Vec<usize>), Error>
Same as
take but transposed (last two dims swapped). Most
safetensors weights are stored row-major-of-PyTorch
convention, which RLX’s IR consumes column-major; this helper
is the convention-bridge.Source§fn remaining_keys(&self) -> Vec<String>
fn remaining_keys(&self) -> Vec<String>
Names that haven’t been taken yet — useful for “did the
model use every weight?” hygiene checks.
fn is_empty(&self) -> bool
Source§fn take_packed(
&mut self,
key: &str,
) -> Result<Option<(Vec<u8>, QuantScheme, Vec<usize>)>, Error>
fn take_packed( &mut self, key: &str, ) -> Result<Option<(Vec<u8>, QuantScheme, Vec<usize>)>, Error>
Take packed K-quant bytes when supported; default returns
None.Source§fn tensor_bytes_borrowed(&self, key: &str) -> Option<&[u8]>
fn tensor_bytes_borrowed(&self, key: &str) -> Option<&[u8]>
Borrow packed bytes without marking taken (GGUF mmap path).
Source§fn arch_hint(&self) -> Option<&str>
fn arch_hint(&self) -> Option<&str>
Architecture name from the underlying file (
general.architecture
for GGUF, None for safetensors). Drain-style consumers use this
to pick an arch-specific reverse name mapping when the canonical
HF name depends on the model family (e.g. Gemma 2’s 4 norms per
layer don’t share the Llama 2-norm reverse alias).Auto Trait Implementations§
impl<'a> Freeze for ArcCacheLoader<'a>
impl<'a> RefUnwindSafe for ArcCacheLoader<'a>
impl<'a> Send for ArcCacheLoader<'a>
impl<'a> Sync for ArcCacheLoader<'a>
impl<'a> Unpin for ArcCacheLoader<'a>
impl<'a> UnsafeUnpin for ArcCacheLoader<'a>
impl<'a> UnwindSafe for ArcCacheLoader<'a>
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
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,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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