pub struct NdArrayQTensor {
pub qtensor: NdArrayTensor,
pub scheme: QuantScheme,
pub qparams: Vec<f32>,
pub global: Option<f32>,
}burn-ndarray is deprecated and will be removed in a future release. Use burn-flex for pure-Rust CPU execution (std, no_std, WebAssembly), or one of the CubeCL backends (burn-cuda, burn-rocm, burn-wgpu, burn-cpu) for GPU acceleration.
Expand description
A quantized tensor for the ndarray backend.
Fields§
§qtensor: NdArrayTensorburn-ndarray is deprecated and will be removed in a future release. Use burn-flex for pure-Rust CPU execution (std, no_std, WebAssembly), or one of the CubeCL backends (burn-cuda, burn-rocm, burn-wgpu, burn-cpu) for GPU acceleration.
The quantized tensor.
scheme: QuantSchemeburn-ndarray is deprecated and will be removed in a future release. Use burn-flex for pure-Rust CPU execution (std, no_std, WebAssembly), or one of the CubeCL backends (burn-cuda, burn-rocm, burn-wgpu, burn-cpu) for GPU acceleration.
The quantization scheme.
qparams: Vec<f32>burn-ndarray is deprecated and will be removed in a future release. Use burn-flex for pure-Rust CPU execution (std, no_std, WebAssembly), or one of the CubeCL backends (burn-cuda, burn-rocm, burn-wgpu, burn-cpu) for GPU acceleration.
The block scales.
global: Option<f32>burn-ndarray is deprecated and will be removed in a future release. Use burn-flex for pure-Rust CPU execution (std, no_std, WebAssembly), or one of the CubeCL backends (burn-cuda, burn-rocm, burn-wgpu, burn-cpu) for GPU acceleration.
The per-tensor scale that qparams are expressed relative to, for a
two-level scheme.
Implementations§
Source§impl NdArrayQTensor
impl NdArrayQTensor
Sourcepub fn strategy(&self) -> QuantizationStrategy
👎Deprecated since 0.22.0: burn-ndarray is deprecated and will be removed in a future release. Use burn-flex for pure-Rust CPU execution (std, no_std, WebAssembly), or one of the CubeCL backends (burn-cuda, burn-rocm, burn-wgpu, burn-cpu) for GPU acceleration.
pub fn strategy(&self) -> QuantizationStrategy
burn-ndarray is deprecated and will be removed in a future release. Use burn-flex for pure-Rust CPU execution (std, no_std, WebAssembly), or one of the CubeCL backends (burn-cuda, burn-rocm, burn-wgpu, burn-cpu) for GPU acceleration.
Returns the quantization strategy, including quantization parameters, for the given tensor.
Trait Implementations§
Source§impl Clone for NdArrayQTensor
impl Clone for NdArrayQTensor
Source§fn clone(&self) -> NdArrayQTensor
fn clone(&self) -> NdArrayQTensor
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for NdArrayQTensor
impl Debug for NdArrayQTensor
Source§impl TensorMetadata for NdArrayQTensor
impl TensorMetadata for NdArrayQTensor
Source§type Device = NdArrayDevice
type Device = NdArrayDevice
Source§fn can_mut(&self) -> bool
fn can_mut(&self) -> bool
slice_assign, an inplace kernel)
writes the existing allocation instead of copying it first. Read moreSource§fn scheme(&self) -> QuantScheme
fn scheme(&self) -> QuantScheme
Auto Trait Implementations§
impl !RefUnwindSafe for NdArrayQTensor
impl !UnwindSafe for NdArrayQTensor
impl Freeze for NdArrayQTensor
impl Send for NdArrayQTensor
impl Sync for NdArrayQTensor
impl Unpin for NdArrayQTensor
impl UnsafeUnpin for NdArrayQTensor
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more