pub enum NeuralDecoderError {
Show 14 variants
InvalidSyndromeDimension {
expected: usize,
actual_rows: usize,
actual_cols: usize,
},
InvalidEmbeddingDimension {
expected: usize,
actual: usize,
},
InvalidHiddenDimension {
expected: usize,
actual: usize,
},
InvalidAttentionHeads {
embed_dim: usize,
num_heads: usize,
},
EmptyGraph,
InvalidDetector(usize),
InvalidBoundary(String),
DecodingFailed(String),
FusionError(String),
MinCutError(String),
ShapeMismatch {
expected: Vec<usize>,
actual: Vec<usize>,
},
NumericalInstability(String),
ConfigError(String),
InternalError(String),
}Expand description
Errors that can occur in neural decoder operations
Variants§
InvalidSyndromeDimension
Invalid syndrome dimensions
Fields
InvalidEmbeddingDimension
Invalid embedding dimension
InvalidHiddenDimension
Invalid hidden state dimension
InvalidAttentionHeads
Invalid attention heads configuration
EmptyGraph
Empty graph
InvalidDetector(usize)
Invalid detector index
InvalidBoundary(String)
Invalid boundary type
DecodingFailed(String)
Decoding failed
FusionError(String)
Fusion error
MinCutError(String)
MinCut integration error
ShapeMismatch
Shape mismatch
NumericalInstability(String)
Numerical instability
ConfigError(String)
Configuration error
InternalError(String)
Internal error
Implementations§
Source§impl NeuralDecoderError
impl NeuralDecoderError
Sourcepub fn syndrome_dim(expected: usize, rows: usize, cols: usize) -> Self
pub fn syndrome_dim(expected: usize, rows: usize, cols: usize) -> Self
Create a dimension mismatch error for syndromes
Create a hidden dimension error
Sourcepub fn attention_heads(embed_dim: usize, num_heads: usize) -> Self
pub fn attention_heads(embed_dim: usize, num_heads: usize) -> Self
Create an attention heads error
Sourcepub fn shape_mismatch(expected: Vec<usize>, actual: Vec<usize>) -> Self
pub fn shape_mismatch(expected: Vec<usize>, actual: Vec<usize>) -> Self
Create a shape mismatch error
Sourcepub fn is_recoverable(&self) -> bool
pub fn is_recoverable(&self) -> bool
Check if the error is recoverable
Sourcepub fn is_dimension_error(&self) -> bool
pub fn is_dimension_error(&self) -> bool
Check if the error is related to dimensions
Trait Implementations§
Source§impl Debug for NeuralDecoderError
impl Debug for NeuralDecoderError
Source§impl Display for NeuralDecoderError
impl Display for NeuralDecoderError
Source§impl Error for NeuralDecoderError
impl Error for NeuralDecoderError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Source§impl From<&str> for NeuralDecoderError
impl From<&str> for NeuralDecoderError
Source§impl From<MinCutError> for NeuralDecoderError
impl From<MinCutError> for NeuralDecoderError
Source§fn from(err: MinCutError) -> Self
fn from(err: MinCutError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for NeuralDecoderError
impl RefUnwindSafe for NeuralDecoderError
impl Send for NeuralDecoderError
impl Sync for NeuralDecoderError
impl Unpin for NeuralDecoderError
impl UnwindSafe for NeuralDecoderError
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> 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