pub struct GraphEngram<'a> {
pub mem: &'a [f32],
pub on: &'a [bool],
pub mem_dim: usize,
pub value: GraphW<'a>,
pub value_b: &'a [f32],
pub keys: Vec<GraphW<'a>>,
pub key_b: Vec<&'a [f32]>,
pub norm_key: Vec<&'a [f32]>,
pub norm_query: Vec<&'a [f32]>,
pub gamma: &'a [f32],
pub hc_scales: &'a [f32],
pub eps: f32,
}Expand description
One Engram layer of a graph call (hy4::Engram::apply): the host’s
looked-up memory rows of the call, the value and per-stream key
projections over them (with biases), the norms (eps, torch’s bf16
default) and the per-stream scales.
Fields§
§mem: &'a [f32][rows][mem]: a row a call position; on[r] false = the position
adds nothing (an image or pad token).
on: &'a [bool]§mem_dim: usize§value: GraphW<'a>[hidden, mem], its bias.
value_b: &'a [f32]§keys: Vec<GraphW<'a>>One [hidden, mem] key projection, bias and two norms a stream.
key_b: Vec<&'a [f32]>§norm_key: Vec<&'a [f32]>§norm_query: Vec<&'a [f32]>§gamma: &'a [f32]§hc_scales: &'a [f32][ns, hidden].
eps: f32Auto Trait Implementations§
impl<'a> Forget for GraphEngram<'a>
impl<'a> Freeze for GraphEngram<'a>
impl<'a> Move for GraphEngram<'a>
impl<'a> RefUnwindSafe for GraphEngram<'a>
impl<'a> Send for GraphEngram<'a>
impl<'a> Sync for GraphEngram<'a>
impl<'a> Unpin for GraphEngram<'a>
impl<'a> UnsafeUnpin for GraphEngram<'a>
impl<'a> UnwindSafe for GraphEngram<'a>
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