pub enum Error {
Json(Error),
Io(Error),
UnsupportedArchitecture(String),
UnsupportedActivation(String),
UnsupportedFeature(String),
WeightCountMismatch {
expected: usize,
found: usize,
},
ConfigTooLarge,
}Expand description
Errors produced when loading or building a NAM model.
Variants§
Json(Error)
The .nam JSON could not be parsed.
Io(Error)
The file was read but its contents are not a valid/supported model.
UnsupportedArchitecture(String)
The model’s architecture field is not one this crate can run.
UnsupportedActivation(String)
A layer’s activation field names a function this crate does not implement.
UnsupportedFeature(String)
A .nam config uses a feature this crate does not yet implement (e.g.
multi-channel input, a post-stack head with more than one output channel,
mixed gating modes within one layer array, or an empty container).
Rejected explicitly rather than silently mis-run — see the crate-level
docs for the full list of supported and rejected features.
WeightCountMismatch
The flat weights array did not contain the number of values the
config implies (corrupt file, or a config/weights mismatch).
Fields
ConfigTooLarge
The config’s declared dimensions are so large that the implied weight
count overflows usize, so the model cannot be built. Indicates a corrupt
or adversarial file rather than a real capture.
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)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()