burn_tensor/tensor/quantization/
primitive.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
use super::{QuantizationScheme, QuantizationStrategy};

/// Quantized tensor primitive.
pub trait QTensorPrimitive {
    /// Returns the quantization scheme for the given tensor.
    fn scheme(&self) -> &QuantizationScheme;
    /// Returns the quantization strategy for the given tensor.
    ///
    /// # Remarks
    /// Retrieving the quantization strategy with its corresponding parameters might require
    /// synchronization on the backend.
    fn strategy(&self) -> QuantizationStrategy;
}