mlx_rs::quantization

Trait Quantizable

Source
pub trait Quantizable {
    type Quantized;
    type QuantizationError;

    const DEFAULT_GROUP_SIZE: i32 = 64i32;
    const DEFAULT_BITS: i32 = 4i32;

    // Required method
    fn try_into_quantized(
        self,
        group_size: i32,
        bits: i32,
    ) -> Result<Self::Quantized, Self::QuantizationError>;
}
Expand description

Trait for quantization of modules.

Provided Associated Constants§

Source

const DEFAULT_GROUP_SIZE: i32 = 64i32

The default group size for quantization.

Source

const DEFAULT_BITS: i32 = 4i32

The default number of bits for quantization.

Required Associated Types§

Source

type Quantized

The quantized type.

Source

type QuantizationError

The error type for quantization.

Required Methods§

Source

fn try_into_quantized( self, group_size: i32, bits: i32, ) -> Result<Self::Quantized, Self::QuantizationError>

Quantize the module with the specified group size and number of bits.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<M> Quantizable for Box<M>
where M: Quantizable,

Source§

impl<M> Quantizable for Vec<M>
where M: Quantizable,

Implementors§