pub enum AutodiffError {
ArityError {
operation: &'static str,
expected: usize,
actual: usize,
},
EmptyGraph,
IndexOutOfBounds {
index: usize,
max_index: usize,
},
}Expand description
Errors that can occur during automatic differentiation computations.
Variants§
ArityError
An operation received an incorrect number of arguments (specific arity error).
Fields
EmptyGraph
The computation graph is empty or invalid.
IndexOutOfBounds
An index references a non-existent value in the computation.
Implementations§
Source§impl AutodiffError
impl AutodiffError
Sourcepub fn arity(operation: &'static str, expected: usize, actual: usize) -> Self
pub fn arity(operation: &'static str, expected: usize, actual: usize) -> Self
Create an ArityError for an operation with incorrect argument count.
Sourcepub fn check_arity(
operation: &'static str,
expected: usize,
actual: usize,
) -> Result<(), AutodiffError>
pub fn check_arity( operation: &'static str, expected: usize, actual: usize, ) -> Result<(), AutodiffError>
Validate that an operation received the correct number of arguments.
Trait Implementations§
Source§impl Clone for AutodiffError
impl Clone for AutodiffError
Source§fn clone(&self) -> AutodiffError
fn clone(&self) -> AutodiffError
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 AutodiffError
impl Debug for AutodiffError
Source§impl Display for AutodiffError
impl Display for AutodiffError
Source§impl Error for AutodiffError
impl Error for AutodiffError
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 PartialEq for AutodiffError
impl PartialEq for AutodiffError
impl StructuralPartialEq for AutodiffError
Auto Trait Implementations§
impl Freeze for AutodiffError
impl RefUnwindSafe for AutodiffError
impl Send for AutodiffError
impl Sync for AutodiffError
impl Unpin for AutodiffError
impl UnwindSafe for AutodiffError
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