pub struct Compact { /* private fields */ }Expand description
Owned, validated weights. Loading allocates; scoring does not.
Implementations§
Source§impl Compact
impl Compact
Sourcepub fn from_bytes(bytes: &[u8]) -> Result<Self, ArtifactError>
pub fn from_bytes(bytes: &[u8]) -> Result<Self, ArtifactError>
Validate lengths, versions, checksum, shapes and acyclic tree topology.
Sourcepub fn version(&self) -> ModelVersion
pub fn version(&self) -> ModelVersion
Artifact version.
Source§impl Compact
impl Compact
Sourcepub fn score_slices(&self, base: &[f32], edit: &[f32], cell: u32) -> Score
pub fn score_slices(&self, base: &[f32], edit: &[f32], cell: u32) -> Score
Score exactly 152 base slots and 96 edit slots. Invalid lengths abstain. Non-finite values use zero in dense nets, and the encoded missing branch in trees; either way success becomes NaN so the gate abstains. An empty support table means no support restriction.
Sourcepub fn score_in_cell(&self, input: &Input, cell: u32) -> Score
pub fn score_in_cell(&self, input: &Input, cell: u32) -> Score
Score an input with a known support cell, using only the base slots in use.
Trait Implementations§
Auto Trait Implementations§
impl Forget for Compact
impl Freeze for Compact
impl Move for Compact
impl RefUnwindSafe for Compact
impl Send for Compact
impl Sync for Compact
impl Unpin for Compact
impl UnsafeUnpin for Compact
impl UnwindSafe for Compact
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