pub enum VisionError {
Show 15 variants
DimensionMismatch {
expected: usize,
got: usize,
},
ShapeMismatch {
lhs: Vec<usize>,
rhs: Vec<usize>,
},
EmptyInput(&'static str),
InvalidImageSize {
height: usize,
width: usize,
channels: usize,
},
InvalidPatchSize {
patch_size: usize,
img_size: usize,
},
InvalidEmbedDim(usize),
InvalidNumHeads(usize),
HeadDimMismatch {
n_heads: usize,
embed_dim: usize,
},
InvalidNumClasses(usize),
InvalidProjDim(usize),
NonPositiveTemperature(f32),
InvalidRoiBox {
x1: f32,
y1: f32,
x2: f32,
y2: f32,
},
WeightShapeMismatch {
name: &'static str,
expected: Vec<usize>,
got: Vec<usize>,
},
NonFinite(&'static str),
Internal(String),
}Expand description
Errors returned by oxicuda-vision operations.
Variants§
DimensionMismatch
Tensor dimension does not match the expected value.
ShapeMismatch
Shape mismatch between two tensors.
EmptyInput(&'static str)
The input slice or tensor is empty.
InvalidImageSize
Image spatial dimensions are zero or inconsistent.
InvalidPatchSize
Patch size is zero, negative, or does not divide the image dimension.
InvalidEmbedDim(usize)
Embedding dimension is zero or otherwise invalid.
InvalidNumHeads(usize)
Number of attention heads is zero or invalid.
HeadDimMismatch
Head dimension does not divide the embedding dimension.
InvalidNumClasses(usize)
Number of output classes is zero.
InvalidProjDim(usize)
Projection dimension is zero.
NonPositiveTemperature(f32)
Contrastive loss temperature is non-positive.
InvalidRoiBox
RoI box coordinates are invalid (e.g., x1 >= x2).
WeightShapeMismatch
Weight tensor has wrong shape.
NonFinite(&'static str)
NaN or infinity encountered in intermediate values.
Internal(String)
Internal logic error (should not occur in correct usage).
Trait Implementations§
Source§impl Clone for VisionError
impl Clone for VisionError
Source§fn clone(&self) -> VisionError
fn clone(&self) -> VisionError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for VisionError
impl Debug for VisionError
Source§impl Display for VisionError
impl Display for VisionError
Source§impl Error for VisionError
impl Error for VisionError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl PartialEq for VisionError
impl PartialEq for VisionError
Source§fn eq(&self, other: &VisionError) -> bool
fn eq(&self, other: &VisionError) -> bool
self and other values to be equal, and is used by ==.