pub struct TensorDiffEngine {
pub threshold: f32,
}Expand description
Engine that computes structural and numeric diffs between tensor snapshots.
Fields§
§threshold: f32Element-wise absolute difference threshold below which a value is considered unchanged.
Implementations§
Source§impl TensorDiffEngine
impl TensorDiffEngine
Sourcepub fn diff_tensors(
&self,
old: &TensorSnapshot,
new: &TensorSnapshot,
) -> TensorDiff
pub fn diff_tensors( &self, old: &TensorSnapshot, new: &TensorSnapshot, ) -> TensorDiff
Diff two individual tensors that share the same name.
Shape mismatch → ShapeChanged.
Element-wise: count elements where |new[i] - old[i]| > threshold,
accumulate max and sum. If count == 0 → Unchanged, else ValueChanged.
Sourcepub fn diff_snapshots(
&self,
old_set: &[TensorSnapshot],
new_set: &[TensorSnapshot],
) -> Vec<TensorDiff>
pub fn diff_snapshots( &self, old_set: &[TensorSnapshot], new_set: &[TensorSnapshot], ) -> Vec<TensorDiff>
Diff two full checkpoint snapshots (slices of tensors).
Results are sorted by name for deterministic output.
Sourcepub fn summarize(&self, diffs: &[TensorDiff]) -> DiffSummary
pub fn summarize(&self, diffs: &[TensorDiff]) -> DiffSummary
Aggregate a slice of diffs into a DiffSummary.
Sourcepub fn significant_diffs<'a>(
&self,
diffs: &'a [TensorDiff],
) -> Vec<&'a TensorDiff>
pub fn significant_diffs<'a>( &self, diffs: &'a [TensorDiff], ) -> Vec<&'a TensorDiff>
Filter diffs to only those that are significant at self.threshold.
Auto Trait Implementations§
impl Freeze for TensorDiffEngine
impl RefUnwindSafe for TensorDiffEngine
impl Send for TensorDiffEngine
impl Sync for TensorDiffEngine
impl Unpin for TensorDiffEngine
impl UnsafeUnpin for TensorDiffEngine
impl UnwindSafe for TensorDiffEngine
Blanket Implementations§
impl<T> Allocation for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more