pub struct HoloTensorDecoder { /* private fields */ }Expand description
Holographic tensor decoder.
Reconstructs tensors from holographic fragments.
Implementations§
Source§impl HoloTensorDecoder
impl HoloTensorDecoder
Sourcepub fn new(header: HoloTensorHeader) -> Self
pub fn new(header: HoloTensorHeader) -> Self
Create decoder from header.
Flattens tensor shape to 2D the same way as the encoder:
- 0D: (1, 1)
- 1D
[N]: (1, N) - 2D
[M, N]: (M, N) - 3D+
[A, B, C, ...]: (A, BC…) - first dim x product of rest
Sourcepub fn add_fragment(&mut self, fragment: HoloFragment) -> Result<f32>
pub fn add_fragment(&mut self, fragment: HoloFragment) -> Result<f32>
Add a fragment to the reconstruction.
Sourcepub fn fragments_loaded(&self) -> u16
pub fn fragments_loaded(&self) -> u16
Number of fragments loaded.
Sourcepub fn can_reconstruct(&self) -> bool
pub fn can_reconstruct(&self) -> bool
Check if reconstruction is possible.
Sourcepub fn reconstruct(&self) -> Result<Vec<f32>>
pub fn reconstruct(&self) -> Result<Vec<f32>>
Reconstruct tensor from current fragments.
Sourcepub fn header(&self) -> &HoloTensorHeader
pub fn header(&self) -> &HoloTensorHeader
Get the header.
Auto Trait Implementations§
impl Freeze for HoloTensorDecoder
impl RefUnwindSafe for HoloTensorDecoder
impl Send for HoloTensorDecoder
impl Sync for HoloTensorDecoder
impl Unpin for HoloTensorDecoder
impl UnwindSafe for HoloTensorDecoder
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