pub struct NeuralEncoder { /* private fields */ }Expand description
Neural encoder for model compression
Implementations§
Source§impl NeuralEncoder
impl NeuralEncoder
Sourcepub fn new(config: EncoderConfig, codebooks: LayerCodebook) -> Self
pub fn new(config: EncoderConfig, codebooks: LayerCodebook) -> Self
Create a new encoder with codebooks
Sourcepub fn encode_tensor(
&self,
name: &str,
data: &[f32],
shape: &[usize],
layer_type: LayerType,
) -> Result<EncodedTensor>
pub fn encode_tensor( &self, name: &str, data: &[f32], shape: &[usize], layer_type: LayerType, ) -> Result<EncodedTensor>
Encode a single tensor
Sourcepub fn encode_tensors(
&self,
tensors: &[(String, Vec<f32>, Vec<usize>, LayerType)],
) -> Result<Vec<EncodedTensor>>
pub fn encode_tensors( &self, tensors: &[(String, Vec<f32>, Vec<usize>, LayerType)], ) -> Result<Vec<EncodedTensor>>
Encode multiple tensors
Sourcepub fn config(&self) -> &EncoderConfig
pub fn config(&self) -> &EncoderConfig
Get encoder configuration
Trait Implementations§
Auto Trait Implementations§
impl Freeze for NeuralEncoder
impl RefUnwindSafe for NeuralEncoder
impl Send for NeuralEncoder
impl Sync for NeuralEncoder
impl Unpin for NeuralEncoder
impl UnsafeUnpin for NeuralEncoder
impl UnwindSafe for NeuralEncoder
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