pub enum HoduError {
Show 36 variants
DeviceMismatch {
expected: Device,
got: Device,
},
DeviceConflictInOp {
left: Device,
right: Device,
op: Op,
},
UnsupportedDevice(Device),
UnsupportedDeviceForCompiler(Device, Compiler),
DTypeMismatch {
expected: DType,
got: DType,
},
DTypeConflictInOp {
left: DType,
right: DType,
op: Op,
},
UnsupportedDType {
dtype: DType,
reason: String,
},
UnsupportedDTypeForOp {
dtype: DType,
op: Op,
},
UnsupportedDTypeForDevice {
dtype: DType,
device: Device,
},
UnsupportedDTypeForCompiler {
dtype: DType,
compiler: Compiler,
},
ShapeMismatch {
expected: Shape,
got: Shape,
},
SizeMismatch {
expected: u32,
got: u32,
},
IncompatibleShapes {
lhs: Shape,
rhs: Shape,
op: Op,
},
InvalidLayout {
reason: String,
},
InvalidAxis {
axis: i32,
ndim: u32,
},
TensorNotFound(TensorId),
StorageNotFound(TensorId),
StorageCorrupted(TensorId),
RequiresGradNotSet(TensorId),
BuilderNotActive,
BuilderNotFound(String),
CompilationError(String),
MissingFunction(String),
ExecutionError(String),
MissingInput(String),
MissingAttribute(String),
BackendError(String),
CpuKernelError(String),
VjpFunctionNotFound(String),
GradientTapeCorrupted,
GradientComputationFailed(String),
GradientNotComputed(TensorId),
IoError(String),
FileNotFound(String),
InternalError(String),
NotImplemented(String),
}Expand description
Main error type for hodu_core.
This enum covers all possible error conditions that can occur during tensor operations, compilation, and execution.
Variants§
DeviceMismatch
Device mismatch between expected and actual device.
DeviceConflictInOp
Device conflict in a binary operation.
UnsupportedDevice(Device)
Unsupported device type.
UnsupportedDeviceForCompiler(Device, Compiler)
Unsupported device type for a specific compiler
DTypeMismatch
Data type mismatch between expected and actual dtype.
DTypeConflictInOp
Data type conflict in a binary operation.
UnsupportedDType
Unsupported dtype with reason.
UnsupportedDTypeForOp
Unsupported dtype for a specific operation.
UnsupportedDTypeForDevice
Unsupported dtype for a specific device.
UnsupportedDTypeForCompiler
Unsupported dtype for a specific compiler.
ShapeMismatch
Shape mismatch between expected and actual shapes.
SizeMismatch
Size mismatch between expected and actual sizes.
IncompatibleShapes
Incompatible shapes in a binary operation.
InvalidLayout
Invalid layout configuration.
InvalidAxis
Invalid axis for the given shape.
TensorNotFound(TensorId)
Tensor not found in the global registry.
StorageNotFound(TensorId)
Storage not found for a tensor.
StorageCorrupted(TensorId)
Storage data is corrupted or inaccessible.
RequiresGradNotSet(TensorId)
Requires grad is not set for tensor (only float tensors can have gradients).
BuilderNotActive
Builder context is not active.
BuilderNotFound(String)
Builder not found with given ID
CompilationError(String)
Module compilation failed
MissingFunction(String)
Missing required function in module
ExecutionError(String)
Script execution failed
MissingInput(String)
Missing required input for execution
MissingAttribute(String)
Missing required attribute
BackendError(String)
Backend operation failed
CpuKernelError(String)
CPU kernel error
VjpFunctionNotFound(String)
VJP (Vector-Jacobian Product) function not found for operation.
GradientTapeCorrupted
Gradient tape is corrupted or inaccessible.
GradientComputationFailed(String)
Gradient computation failed.
GradientNotComputed(TensorId)
Gradient has not been computed for this tensor.
IoError(String)
I/O operation failed.
FileNotFound(String)
File not found.
InternalError(String)
Internal error with a descriptive message.
NotImplemented(String)
Not yet implemented feature.
Trait Implementations§
Source§impl Error for HoduError
Available on crate feature std only.
impl Error for HoduError
std only.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 From<CpuKernelError> for HoduError
impl From<CpuKernelError> for HoduError
Source§fn from(e: CpuKernelError) -> HoduError
fn from(e: CpuKernelError) -> HoduError
Source§impl From<DecodeError> for HoduError
Available on crate feature serde only.
impl From<DecodeError> for HoduError
serde only.Source§fn from(e: DecodeError) -> HoduError
fn from(e: DecodeError) -> HoduError
Source§impl From<EncodeError> for HoduError
Available on crate feature serde only.
impl From<EncodeError> for HoduError
serde only.Source§fn from(e: EncodeError) -> HoduError
fn from(e: EncodeError) -> HoduError
Source§impl From<FromUtf8Error> for HoduError
Available on crate feature std only.
impl From<FromUtf8Error> for HoduError
std only.Source§fn from(e: FromUtf8Error) -> HoduError
fn from(e: FromUtf8Error) -> HoduError
Source§impl<T> From<PoisonError<T>> for HoduError
Available on crate feature std only.
impl<T> From<PoisonError<T>> for HoduError
std only.Source§fn from(e: PoisonError<T>) -> HoduError
fn from(e: PoisonError<T>) -> HoduError
Auto Trait Implementations§
impl Freeze for HoduError
impl RefUnwindSafe for HoduError
impl Send for HoduError
impl Sync for HoduError
impl Unpin for HoduError
impl UnsafeUnpin for HoduError
impl UnwindSafe for HoduError
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> ⓘ
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> ⓘ
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