pub struct QTensor {
pub shape: Vec<usize>,
pub byte_offset: u64,
pub is_quantized_q4_k: bool,
}Expand description
Represents a Q4_K Quantized or standard float Tensor mapped from a monolithic GGUF file.
Fields§
§shape: Vec<usize>§byte_offset: u64§is_quantized_q4_k: boolImplementations§
Source§impl QTensor
impl QTensor
Sourcepub fn new(shape: Vec<usize>, byte_offset: u64, is_quantized_q4_k: bool) -> Self
pub fn new(shape: Vec<usize>, byte_offset: u64, is_quantized_q4_k: bool) -> Self
Creates a tensor descriptor from shape, byte offset into the GGUF, and a Q4_K quantization flag.
Sourcepub fn map_from_pointer_with_index(
quin: &NQuin,
index: &GgufTensorIndex,
) -> Option<Self>
pub fn map_from_pointer_with_index( quin: &NQuin, index: &GgufTensorIndex, ) -> Option<Self>
Maps the tensor descriptor from a Quin pointer and a parsed GgufTensorIndex.
Resolves the genuine shape, quantization type, and payload offset by looking up
the tensor by its subject name hash or relative byte offset.
Sourcepub fn map_from_pointer(quin: &NQuin) -> Option<Self>
pub fn map_from_pointer(quin: &NQuin) -> Option<Self>
Maps the tensor’s byte offset from the GGUF via the 60-bit pointer.
Honestly resolves against the currently mounted resident model if available,
or fails closed (None) if no resident model is loaded or the tensor is not found.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for QTensor
impl RefUnwindSafe for QTensor
impl Send for QTensor
impl Sync for QTensor
impl Unpin for QTensor
impl UnsafeUnpin for QTensor
impl UnwindSafe for QTensor
Blanket Implementations§
§impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
Aggregate shares in an MPC protocol.
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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