pub enum TensorRole {
Input,
Output,
Param,
Activation,
State,
}Variants§
Input
Output
Param
Activation
Produced by one section of a program and consumed by a later one — stored AND loaded inside a
single program, which Input and Output each forbid. It starts a run EMPTY, like an output:
a section that reads it before its producer wrote it faults, which is what makes the section
barrier load-bearing rather than decorative.
State
Carried ACROSS steps (the GDN memory, the conv ring, the KV cache): read at the start of a step and written once at its end. It starts a run FILLED, like an input, and leaves it in the outputs, so two steps of the same program chain through it.
Implementations§
Source§impl TensorRole
impl TensorRole
Sourcepub fn starts_filled(self) -> bool
pub fn starts_filled(self) -> bool
Whether a run STARTS with this tensor’s data present. An activation does not: it is produced inside the run, so reading it early is a fault, not a stale value.
Sourcepub fn is_written(self) -> bool
pub fn is_written(self) -> bool
Whether a Store may write this tensor.
Sourcepub fn is_fully_covered(self) -> bool
pub fn is_fully_covered(self) -> bool
Whether EVERY tile of this tensor must be written exactly once by the run. A state tensor is the one role that may be updated in part (a ring that shifts, a cache row that is appended), so it is held to “at most once” instead.
Trait Implementations§
Source§impl Clone for TensorRole
impl Clone for TensorRole
Source§fn clone(&self) -> TensorRole
fn clone(&self) -> TensorRole
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for TensorRole
impl Debug for TensorRole
Source§impl<'de> Deserialize<'de> for TensorRole
impl<'de> Deserialize<'de> for TensorRole
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Hash for TensorRole
impl Hash for TensorRole
Source§impl PartialEq for TensorRole
impl PartialEq for TensorRole
Source§impl Serialize for TensorRole
impl Serialize for TensorRole
impl Copy for TensorRole
impl Eq for TensorRole
impl StructuralPartialEq for TensorRole
Auto Trait Implementations§
impl Freeze for TensorRole
impl RefUnwindSafe for TensorRole
impl Send for TensorRole
impl Sync for TensorRole
impl Unpin for TensorRole
impl UnsafeUnpin for TensorRole
impl UnwindSafe for TensorRole
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.