pub struct BlrCore {
pub rows: usize,
pub cols: usize,
pub paths: usize,
pub rank: usize,
pub h: Vec<Vec<f32>>,
pub g: Vec<Vec<f32>>,
pub l: Vec<Vec<f32>>,
pub u_off: Vec<usize>,
pub v_off: Vec<usize>,
}Expand description
Parsed header + f32 scales of a blr payload; kernels take the bytes.
Fields§
§rows: usize§cols: usize§paths: usize§rank: usize§h: Vec<Vec<f32>>Per path: h (rows), g (cols), ℓ (rank), f32.
g: Vec<Vec<f32>>§l: Vec<Vec<f32>>§u_off: Vec<usize>Per path: byte offsets of U (rows × r/8) and V (r × cols/8) in the payload.
v_off: Vec<usize>Implementations§
Source§impl BlrCore
impl BlrCore
pub fn parse(shape: &[usize], bytes: &[u8]) -> Result<Self, String>
Sourcepub fn planes<'a>(&self, b: &'a [u8], p: usize) -> (&'a [u8], &'a [u8])
pub fn planes<'a>(&self, b: &'a [u8], p: usize) -> (&'a [u8], &'a [u8])
Sign bits of path p: (U, V) byte slices.
Sourcepub fn matvec(
&self,
bytes: &[u8],
x: &[f32],
out: &mut [f32],
pool: Option<&Pool>,
)
pub fn matvec( &self, bytes: &[u8], x: &[f32], out: &mut [f32], pool: Option<&Pool>, )
Single-vector product out[..rows] = W x.
Sourcepub fn matmat(
&self,
bytes: &[u8],
xs: &[f32],
b: usize,
out: &mut [f32],
pool: Option<&Pool>,
)
pub fn matmat( &self, bytes: &[u8], xs: &[f32], b: usize, out: &mut [f32], pool: Option<&Pool>, )
Batched product: out[b·rows] = xs[b·cols] · Wᵀ.
Auto Trait Implementations§
impl Freeze for BlrCore
impl RefUnwindSafe for BlrCore
impl Send for BlrCore
impl Sync for BlrCore
impl Unpin for BlrCore
impl UnsafeUnpin for BlrCore
impl UnwindSafe for BlrCore
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