pub enum CnnError {
Show 25 variants
InvalidInput(String),
InvalidConfig(String),
ModelError(String),
DimensionMismatch(String),
SimdError(String),
QuantizationError(String),
InvalidShape {
expected: String,
got: String,
},
ShapeMismatch(String),
InvalidParameter(String),
AllocationError(String),
InvalidChannels {
expected: usize,
actual: usize,
},
InvalidConvParams(String),
WeightLoadError(String),
EmptyInput(String),
NumericalInstability(String),
UnsupportedBackbone(String),
BatchError(String),
ConvolutionError(String),
PoolingError(String),
NormalizationError(String),
InvalidKernel {
kernel_size: usize,
height: usize,
width: usize,
},
IoError(String),
ImageError(String),
IndexOutOfBounds {
index: usize,
size: usize,
},
Unsupported(String),
}Expand description
Errors that can occur during CNN operations.
Variants§
InvalidInput(String)
Invalid input data.
InvalidConfig(String)
Invalid configuration.
ModelError(String)
Model loading error.
DimensionMismatch(String)
Dimension mismatch (generic).
SimdError(String)
SIMD operation error.
QuantizationError(String)
Quantization error.
InvalidShape
Invalid tensor shape for the operation.
ShapeMismatch(String)
Shape mismatch between tensors.
InvalidParameter(String)
Invalid parameter value.
AllocationError(String)
Memory allocation error.
InvalidChannels
Invalid channel count.
InvalidConvParams(String)
Invalid convolution parameters.
WeightLoadError(String)
Weight loading error.
EmptyInput(String)
Empty input provided.
NumericalInstability(String)
Numerical instability detected.
UnsupportedBackbone(String)
Unsupported backbone type.
BatchError(String)
Batch processing error.
ConvolutionError(String)
Error during convolution computation.
PoolingError(String)
Error during pooling computation.
NormalizationError(String)
Error during normalization.
InvalidKernel
Invalid kernel configuration.
IoError(String)
IO error (for model loading).
ImageError(String)
Image processing error.
IndexOutOfBounds
Index out of bounds.
Unsupported(String)
Unsupported operation.
Implementations§
Source§impl CnnError
impl CnnError
Sourcepub fn dim_mismatch(expected: usize, actual: usize) -> Self
pub fn dim_mismatch(expected: usize, actual: usize) -> Self
Create a dimension mismatch error with expected and actual values.
Sourcepub fn invalid_shape(
expected: impl Into<String>,
got: impl Into<String>,
) -> Self
pub fn invalid_shape( expected: impl Into<String>, got: impl Into<String>, ) -> Self
Create an invalid shape error.
Sourcepub fn shape_mismatch(msg: impl Into<String>) -> Self
pub fn shape_mismatch(msg: impl Into<String>) -> Self
Create a shape mismatch error.
Sourcepub fn invalid_parameter(msg: impl Into<String>) -> Self
pub fn invalid_parameter(msg: impl Into<String>) -> Self
Create an invalid parameter error.
Sourcepub fn invalid_config(msg: impl Into<String>) -> Self
pub fn invalid_config(msg: impl Into<String>) -> Self
Create an invalid config error.
Sourcepub fn convolution_error(msg: impl Into<String>) -> Self
pub fn convolution_error(msg: impl Into<String>) -> Self
Create a convolution error.
Sourcepub fn pooling_error(msg: impl Into<String>) -> Self
pub fn pooling_error(msg: impl Into<String>) -> Self
Create a pooling error.
Trait Implementations§
Source§impl Error for CnnError
impl Error for CnnError
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()