#[non_exhaustive]pub enum ModelError {
NotInitialized,
NotTrained,
InvalidModelConfig,
UnsupportedModel,
IncompatibleInput,
UnsupportedOperation,
InvalidBatchSize,
InvalidInputShape,
InvalidOutputShape,
TrainingError(TrainingError),
CoreError(Error),
}Expand description
The ModelError type is used to define the various errors encountered by the different
components of a neural network. It is designed to be comprehensive, covering a wide range of
potential issues that may arise during the operation of neural network components, such as
invalid configurations, training failures, and other runtime errors. This error type is
intended to provide a clear and consistent way to handle errors across the neural network
components, making it easier to debug and resolve issues that may occur during the development
and execution of neural network models.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
NotInitialized
The model is not initialized
NotTrained
The model is not trained
InvalidModelConfig
The model is not valid
UnsupportedModel
The model is not supported
IncompatibleInput
The model is not compatible with the given input
UnsupportedOperation
InvalidBatchSize
InvalidInputShape
InvalidOutputShape
TrainingError(TrainingError)
CoreError(Error)
Implementations§
Source§impl ModelError
impl ModelError
pub fn not_initialized() -> Self
pub fn not_trained() -> Self
pub fn invalid_model_config() -> Self
pub fn unsupported_model() -> Self
pub fn incompatible_input() -> Self
pub fn unsupported_operation() -> Self
pub fn invalid_batch_size() -> Self
pub fn invalid_input_shape() -> Self
pub fn invalid_output_shape() -> Self
pub fn training_error(field_0: TrainingError) -> Self
pub fn core_error(field_0: Error) -> Self
Trait Implementations§
Source§impl Debug for ModelError
impl Debug for ModelError
Source§impl Display for ModelError
impl Display for ModelError
Source§impl Error for ModelError
impl Error for ModelError
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<Error> for ModelError
impl From<Error> for ModelError
Source§impl From<ModelError> for Error
impl From<ModelError> for Error
Source§fn from(err: ModelError) -> Self
fn from(err: ModelError) -> Self
Converts to this type from the input type.
Source§impl From<TrainingError> for ModelError
impl From<TrainingError> for ModelError
Source§fn from(source: TrainingError) -> Self
fn from(source: TrainingError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for ModelError
impl !RefUnwindSafe for ModelError
impl Send for ModelError
impl Sync for ModelError
impl Unpin for ModelError
impl !UnwindSafe for ModelError
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> CallInPlace<T> for Twhere
T: CallInto<T>,
impl<T> CallInPlace<T> for Twhere
T: CallInto<T>,
Source§fn call_inplace<F>(&mut self, f: F) -> <T as CallInto<T>>::Output
fn call_inplace<F>(&mut self, f: F) -> <T as CallInto<T>>::Output
The
call_on_mut method allows an object to be passed onto a function that takes a mutable reference
to the object. This is useful for cases where you want to perform an operation on
an object and mutate it in the process.Source§impl<T> CallInto<T> for T
impl<T> CallInto<T> for T
Source§impl<T> CallOn<T> for Twhere
T: CallInto<T>,
impl<T> CallOn<T> for Twhere
T: CallInto<T>,
Source§fn call_on<F>(&self, f: F) -> <T as CallInto<T>>::Output
fn call_on<F>(&self, f: F) -> <T as CallInto<T>>::Output
The
call_on method allows an object to be passed onto a function that takes a reference
to the object. This is useful for cases where you want to perform an operation on
an object without needing to extract it from a container or context.