Skip to main content

QuantLinearOp

Trait QuantLinearOp 

Source
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§

Source

fn forward(&self, x: Tensor<B, 3>) -> Tensor<B, 3>

y = x @ W^T for x: [batch, seq, k][batch, seq, n_out].

Source

fn dims(&self) -> [usize; 2]

[n_out, k], matching a dense weight’s dims().

Source

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".

Implementors§