pub enum PatternKeyRead {
ScalarPeriod,
PerLayerBool,
ScalarThenArray,
}Expand description
Which get_key_or_arr overload an architecture’s load_arch_hparams
reads {arch}.attention.sliding_window_pattern through. See the
module doc for what each does with each shape.
Variants§
ScalarPeriod
get_key_or_arr(kid, uint32_t & swa_period, false): scalar
honoured as the period, array ignored.
PerLayerBool
get_key_or_arr(kid, hparams.is_swa_impl, n_layer()): array
honoured, scalar broadcast as a bool, key REQUIRED.
ScalarThenArray
The scalar overload first, the array on its false. The array
read is REQUIRED, so an absent key refuses.
Trait Implementations§
Source§impl Clone for PatternKeyRead
impl Clone for PatternKeyRead
impl Copy for PatternKeyRead
Source§impl Debug for PatternKeyRead
impl Debug for PatternKeyRead
impl Eq for PatternKeyRead
Source§impl PartialEq for PatternKeyRead
impl PartialEq for PatternKeyRead
impl StructuralPartialEq for PatternKeyRead
Auto Trait Implementations§
impl Freeze for PatternKeyRead
impl RefUnwindSafe for PatternKeyRead
impl Send for PatternKeyRead
impl Sync for PatternKeyRead
impl Unpin for PatternKeyRead
impl UnsafeUnpin for PatternKeyRead
impl UnwindSafe for PatternKeyRead
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