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