Skip to main content

Scale

Trait Scale 

Source
pub trait Scale: Copy {
    // Required methods
    fn from_f32(v: f32) -> Self;
    fn to_f32(self) -> f32;
}
Expand description

A type that can serve as a per-block scale (or zero-point) factor.

Required Methods§

Source

fn from_f32(v: f32) -> Self

Convert from the working-precision f32 value.

Source

fn to_f32(self) -> f32

Convert back to f32 for arithmetic.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl Scale for bf16

Source§

fn from_f32(v: f32) -> Self

Source§

fn to_f32(self) -> f32

Source§

impl Scale for f16

Source§

fn from_f32(v: f32) -> Self

Source§

fn to_f32(self) -> f32

Source§

impl Scale for f32

Source§

fn from_f32(v: f32) -> Self

Source§

fn to_f32(self) -> f32

Implementors§