pub struct QParams { /* private fields */ }Expand description
Quantization parameters.
Implementations§
Source§impl QParams
impl QParams
Sourcepub fn new(scheme: QuantizationScheme) -> Self
pub fn new(scheme: QuantizationScheme) -> Self
Create a new quantization parameters instance.
pub fn __expand_new( context: &mut CubeContext, scheme: <QuantizationScheme as CubeType>::ExpandType, ) -> <Self as CubeType>::ExpandType
pub fn __expand_values( context: &mut CubeContext, this: <Self as CubeType>::ExpandType, tensor: <QTensor as CubeType>::ExpandType, ) -> <(f32, i32) as CubeType>::ExpandType
Trait Implementations§
Source§impl CubeType for QParams
impl CubeType for QParams
type ExpandType = QParamsExpand
Source§fn init(context: &mut CubeContext, expand: Self::ExpandType) -> Self::ExpandType
fn init(context: &mut CubeContext, expand: Self::ExpandType) -> Self::ExpandType
Wrapper around the init method, necessary to type inference.
Source§impl IntoRuntime for QParams
impl IntoRuntime for QParams
fn __expand_runtime_method(self, context: &mut CubeContext) -> Self::ExpandType
Source§fn runtime(self) -> Self
fn runtime(self) -> Self
Make sure a type is actually expanded into its runtime expand type.
Source§impl LaunchArg for QParams
impl LaunchArg for QParams
Source§type RuntimeArg<'a, R: Runtime> = QParamsLaunch<'a, R>
type RuntimeArg<'a, R: Runtime> = QParamsLaunch<'a, R>
The runtime argument for the kernel.
fn compilation_arg<'a, R: Runtime>( runtime_arg: &Self::RuntimeArg<'a, R>, ) -> Self::CompilationArg
Source§impl LaunchArgExpand for QParams
impl LaunchArgExpand for QParams
Source§type CompilationArg = QParamsCompilationArg
type CompilationArg = QParamsCompilationArg
Compilation argument.
Source§fn expand(
arg: &Self::CompilationArg,
builder: &mut KernelBuilder,
) -> <Self as CubeType>::ExpandType
fn expand( arg: &Self::CompilationArg, builder: &mut KernelBuilder, ) -> <Self as CubeType>::ExpandType
Register an input variable during compilation that fill the KernelBuilder.
Source§fn expand_output(
arg: &Self::CompilationArg,
builder: &mut KernelBuilder,
) -> <Self as CubeType>::ExpandType
fn expand_output( arg: &Self::CompilationArg, builder: &mut KernelBuilder, ) -> <Self as CubeType>::ExpandType
Register an output variable during compilation that fill the KernelBuilder.
Auto Trait Implementations§
impl Freeze for QParams
impl RefUnwindSafe for QParams
impl Send for QParams
impl Sync for QParams
impl Unpin for QParams
impl UnwindSafe for QParams
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
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>
Converts
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>
Converts
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