Enum Schedule
pub enum Schedule {
Cyclic,
Stretched,
Custom(Vec<usize>),
}Expand description
How a unidirectional layer stack maps virtual layer indices to real (weight-bearing) layer indices.
Variants§
Cyclic
Fills virtual positions by wrapping around the real schedule in a looping fashion.
§Example
- virtual len = 8, real len = 3:
→ → → → → → → →
(0⇒0, 1⇒1, 2⇒2), (3⇒0, 4⇒1, 5⇒2), (6⇒0, 7⇒1, ...)
Stretched
Fills virtual positions by stretching the real schedule.
§Example
- virtual len = 8, real len = 3:
→ → → → → → → →
(0⇒0, 1⇒0, 2⇒0), (3⇒1, 4⇒1, 5⇒1), (6⇒2, 7⇒2, ...)
Custom(Vec<usize>)
Fills virtual positions by referring to the index vector.
§Example
- virtual len = 8, real len = 3, custom =
[0, 1, 2, 2, 1, 0, 0, 0]:
→ → → → → → → →
(0⇒0, 1⇒1, 2⇒2, 3⇒2, 4⇒1, 5⇒0, 6⇒0, 7⇒0, ...)
Implementations§
Trait Implementations§
§impl<'de> Deserialize<'de> for Schedule
impl<'de> Deserialize<'de> for Schedule
§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Schedule, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Schedule, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
§impl Serialize for Schedule
impl Serialize for Schedule
§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for Schedule
impl RefUnwindSafe for Schedule
impl Send for Schedule
impl Sync for Schedule
impl Unpin for Schedule
impl UnsafeUnpin for Schedule
impl UnwindSafe for Schedule
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