pub struct GroundTruth { /* private fields */ }Expand description
Ground truth statistics for a tensor at a pipeline stage.
Implementations§
Source§impl GroundTruth
impl GroundTruth
Sourcepub fn from_stats(mean: f32, std: f32) -> Self
pub fn from_stats(mean: f32, std: f32) -> Self
Create ground truth from precomputed statistics.
§Arguments
mean- Expected mean valuestd- Expected standard deviation
Sourcepub fn from_slice(data: &[f32]) -> Self
pub fn from_slice(data: &[f32]) -> Self
Create ground truth from a data slice.
Computes mean, std, min, max from the data.
Sourcepub fn from_slice_with_shape(data: &[f32], shape: Vec<usize>) -> Self
pub fn from_slice_with_shape(data: &[f32], shape: Vec<usize>) -> Self
Create ground truth with shape information.
Sourcepub fn from_bin_file<P: AsRef<Path>>(path: P) -> Result<Self>
pub fn from_bin_file<P: AsRef<Path>>(path: P) -> Result<Self>
Load ground truth from a binary file.
Format: raw f32 values in little-endian byte order.
Sourcepub fn from_json_file<P: AsRef<Path>>(path: P) -> Result<Self>
pub fn from_json_file<P: AsRef<Path>>(path: P) -> Result<Self>
Load ground truth statistics from a JSON file.
Expected format: {"mean": f32, "std": f32, "min": f32, "max": f32}
Trait Implementations§
Source§impl Clone for GroundTruth
impl Clone for GroundTruth
Source§fn clone(&self) -> GroundTruth
fn clone(&self) -> GroundTruth
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for GroundTruth
impl Debug for GroundTruth
Auto Trait Implementations§
impl Freeze for GroundTruth
impl RefUnwindSafe for GroundTruth
impl Send for GroundTruth
impl Sync for GroundTruth
impl Unpin for GroundTruth
impl UnsafeUnpin for GroundTruth
impl UnwindSafe for GroundTruth
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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