pub enum MoeError {
EmptyExpertPool,
InvalidTopK {
k: usize,
num_experts: usize,
},
ShapeMismatch {
expected: usize,
got: usize,
},
InvalidCapacityFactor {
value: f64,
},
}Expand description
Errors that can be raised by the numerical Mixture-of-Experts layer.
Variants§
EmptyExpertPool
The caller tried to build a super::MoELayer with an empty
Vec<Box<dyn Expert>>.
InvalidTopK
The requested top-k value is outside 1..=num_experts.
ShapeMismatch
An input vector had the wrong length for the gate or expert pool.
InvalidCapacityFactor
capacity_factor must be strictly positive and finite.
Trait Implementations§
Source§impl Error for MoeError
impl Error for MoeError
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 From<MoeError> for TrustformerError
impl From<MoeError> for TrustformerError
impl StructuralPartialEq for MoeError
Auto Trait Implementations§
impl Freeze for MoeError
impl RefUnwindSafe for MoeError
impl Send for MoeError
impl Sync for MoeError
impl Unpin for MoeError
impl UnsafeUnpin for MoeError
impl UnwindSafe for MoeError
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> 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>
Converts
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>
Converts
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