pub enum Error {
RuntimeNotConfigured,
Backend(Error),
Autodiff(AutodiffError),
InvalidTensorOperands {
message: String,
},
MixedReverseGraph {
expected: u64,
found: u64,
},
UnsupportedRuntimeOp {
op: &'static str,
runtime: &'static str,
},
UnsupportedAdOp {
op: &'static str,
},
UnsupportedStructuredLinalg {
op: &'static str,
},
}Expand description
Shared error type for dynamic tenferro surface crates.
§Examples
use tenferro_internal_error::{Error, Result};
fn maybe_fail(flag: bool) -> Result<()> {
if flag {
Ok(())
} else {
Err(Error::InvalidTensorOperands {
message: "demo".into(),
})
}
}
assert!(maybe_fail(true).is_ok());
assert!(maybe_fail(false).is_err());Variants§
RuntimeNotConfigured
The runtime used by builder .run() was not configured.
Backend(Error)
Wrapper for backend/linalg/einsum errors from tenferro crates.
Autodiff(AutodiffError)
Wrapper for AD-rule level errors from chainrules-core.
InvalidTensorOperands
Tensor operands are structurally invalid for the requested operation.
MixedReverseGraph
Reverse-mode operands belong to different value graphs.
UnsupportedRuntimeOp
Operation is not available for the currently selected runtime.
UnsupportedAdOp
AD operation is not available for the requested mode.
UnsupportedStructuredLinalg
Linalg operation is available only for dense tensor inputs.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
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()
Auto Trait Implementations§
impl Freeze for Error
impl RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnwindSafe for Error
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