pub trait QuantLinearOp<B: Backend>: Send + Sync {
// Required methods
fn forward(&self, x: Tensor<B, 3>) -> Tensor<B, 3>;
fn dims(&self) -> [usize; 2];
fn vram_bytes(&self) -> usize;
}Expand description
A backend-specific quantized-linear forward. Boxed into Linear::Quant
at load time by try_quant_linear.
Required Methods§
Sourcefn forward(&self, x: Tensor<B, 3>) -> Tensor<B, 3>
fn forward(&self, x: Tensor<B, 3>) -> Tensor<B, 3>
y = x @ W^T for x: [batch, seq, k] → [batch, seq, n_out].
Sourcefn vram_bytes(&self) -> usize
fn vram_bytes(&self) -> usize
Bytes the packed weight occupies in VRAM.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".