IntRange

Struct IntRange 

Source
pub struct IntRange<T, const Q_MAX: u32, const MIN: i64, const MAX: i64>(/* private fields */);
Expand description

Quantizes/dequantizes to a value between 0 and Q_MAX stored in type T. The range for the unquantized value is between MIN and MAX. Values outside of this are clamped.

Trait Implementations§

Source§

impl<T, const Q_MAX: u32, const MIN: i64, const MAX: i64> Linear for IntRange<T, Q_MAX, MIN, MAX>
where T: 'static + Copy, u32: TryInto<T>,

Source§

type Type = T

Source§

fn range() -> Range<f64>

The minimum and maximum input values that can be quantized.
Source§

fn q_max() -> Self::Type

Maximum for the quantized value. The quantized value will be between 0 and this value (inclusive).

Auto Trait Implementations§

§

impl<T, const Q_MAX: u32, const MIN: i64, const MAX: i64> Freeze for IntRange<T, Q_MAX, MIN, MAX>

§

impl<T, const Q_MAX: u32, const MIN: i64, const MAX: i64> RefUnwindSafe for IntRange<T, Q_MAX, MIN, MAX>
where T: RefUnwindSafe,

§

impl<T, const Q_MAX: u32, const MIN: i64, const MAX: i64> Send for IntRange<T, Q_MAX, MIN, MAX>
where T: Send,

§

impl<T, const Q_MAX: u32, const MIN: i64, const MAX: i64> Sync for IntRange<T, Q_MAX, MIN, MAX>
where T: Sync,

§

impl<T, const Q_MAX: u32, const MIN: i64, const MAX: i64> Unpin for IntRange<T, Q_MAX, MIN, MAX>
where T: Unpin,

§

impl<T, const Q_MAX: u32, const MIN: i64, const MAX: i64> UnwindSafe for IntRange<T, Q_MAX, MIN, MAX>
where T: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.