pub struct HostQTensor { /* private fields */ }Expand description
Quantized tensor for the Flex backend.
Stores quantized i8 values in the tensor and keeps scales separately for efficient dequantization without reparsing bytes.
Implementations§
Source§impl HostQTensor
impl HostQTensor
Sourcepub fn new(tensor: HostTensor, scheme: QuantScheme, scales: Vec<f32>) -> Self
pub fn new(tensor: HostTensor, scheme: QuantScheme, scales: Vec<f32>) -> Self
Create a new quantized tensor.
The tensor must store i8 data and scales must match the quantization parameter shape.
Sourcepub fn tensor(&self) -> &HostTensor
pub fn tensor(&self) -> &HostTensor
Get the underlying tensor.
Trait Implementations§
Source§impl Clone for HostQTensor
impl Clone for HostQTensor
Source§impl Debug for HostQTensor
impl Debug for HostQTensor
Source§impl QTensorPrimitive for HostQTensor
impl QTensorPrimitive for HostQTensor
Source§fn scheme(&self) -> &QuantScheme
fn scheme(&self) -> &QuantScheme
Returns the quantization settings for the given tensor.
Source§fn default_scheme() -> QuantScheme
fn default_scheme() -> QuantScheme
Returns the default tensor quantization scheme.
Source§fn acc_precision(&self) -> QuantAcc
fn acc_precision(&self) -> QuantAcc
The precision used for the accumulation in various kernels.
Source§fn propagation(&self) -> QuantPropagation
fn propagation(&self) -> QuantPropagation
How quantization is propagated during computation.
Auto Trait Implementations§
impl !RefUnwindSafe for HostQTensor
impl !UnwindSafe for HostQTensor
impl Freeze for HostQTensor
impl Send for HostQTensor
impl Sync for HostQTensor
impl Unpin for HostQTensor
impl UnsafeUnpin for HostQTensor
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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