pub struct UnquantLinear { /* private fields */ }
Trait Implementations§
source§impl Debug for UnquantLinear
impl Debug for UnquantLinear
source§impl QuantMethod for UnquantLinear
impl QuantMethod for UnquantLinear
fn new(method: QuantMethodConfig) -> Result<Self>where
Self: Sized,
fn dequantize_w(&self, out_ty: DType) -> Result<Tensor>
source§fn forward(&self, a: &Tensor) -> Result<Tensor>
fn forward(&self, a: &Tensor) -> Result<Tensor>
Compute matmul of
self
and a
. self
should contain the weights.source§fn quantized_act_type(&self) -> Option<DType>
fn quantized_act_type(&self) -> Option<DType>
If a quantized method, return the activation dtype.
source§fn to_device(&self, dev: &Device) -> Result<Arc<dyn QuantMethod>>
fn to_device(&self, dev: &Device) -> Result<Arc<dyn QuantMethod>>
Cast this layer to the given device.
fn size_in_bytes(&self) -> Result<usize>
fn device(&self) -> Device
source§fn forward_autocast(&self, a: &Tensor) -> Result<Tensor>
fn forward_autocast(&self, a: &Tensor) -> Result<Tensor>
Compute matmul of
self
and a
. self
should contain the weights.
Automatically cast to required quantization actiation type and backsource§fn forward_via_half(&self, a: &Tensor) -> Result<Tensor>
fn forward_via_half(&self, a: &Tensor) -> Result<Tensor>
Compute matmul of
self
and a
. self
should contain the weights.
This may go via half precision if it is supported.Auto Trait Implementations§
impl Freeze for UnquantLinear
impl !RefUnwindSafe for UnquantLinear
impl Send for UnquantLinear
impl Sync for UnquantLinear
impl Unpin for UnquantLinear
impl !UnwindSafe for UnquantLinear
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
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