Skip to main content

KvCacheCodec

Trait KvCacheCodec 

Source
pub trait KvCacheCodec: VectorCodec {
    type EncodedCache;

    // Required methods
    fn encode_kv_cache(
        &self,
        tensors: &[f32],
        shape: KvTensorShape,
    ) -> Result<Self::EncodedCache, Self::Error>;
    fn decode_slice(
        &self,
        cache: &Self::EncodedCache,
        request: KvSliceRequest,
        out: &mut [f32],
    ) -> Result<(), Self::Error>;
}

Required Associated Types§

Required Methods§

Source

fn encode_kv_cache( &self, tensors: &[f32], shape: KvTensorShape, ) -> Result<Self::EncodedCache, Self::Error>

Source

fn decode_slice( &self, cache: &Self::EncodedCache, request: KvSliceRequest, out: &mut [f32], ) -> Result<(), Self::Error>

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§