pub struct CapturedTensor {
pub name: String,
pub layer: Option<usize>,
pub ne0: usize,
pub ne1: usize,
pub data: Vec<f32>,
}Expand description
Information about a single captured tensor.
Fields§
§name: StringThe tensor name (e.g. "l_out-13").
layer: Option<usize>The layer index extracted from the name, or None if the name
doesn’t follow the "prefix-N" pattern.
ne0: usizeFirst dimension (typically n_embd / hidden dimension).
ne1: usizeSecond dimension (typically n_tokens).
data: Vec<f32>Flattened f32 data with ne0 * ne1 elements.
Layout (row-major from ggml’s perspective):
data[token_idx * ne0 + dim_idx]
This matches the ggml tensor layout where ne[0] is the
innermost (contiguous) dimension.
Implementations§
Source§impl CapturedTensor
impl CapturedTensor
Sourcepub fn token_embedding(&self, token_idx: usize) -> Option<&[f32]>
pub fn token_embedding(&self, token_idx: usize) -> Option<&[f32]>
Get the hidden state for a specific token.
Returns a slice of n_embd floats, or None if token_idx is
out of range.
Trait Implementations§
Source§impl Clone for CapturedTensor
impl Clone for CapturedTensor
Source§fn clone(&self) -> CapturedTensor
fn clone(&self) -> CapturedTensor
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for CapturedTensor
impl RefUnwindSafe for CapturedTensor
impl Send for CapturedTensor
impl Sync for CapturedTensor
impl Unpin for CapturedTensor
impl UnsafeUnpin for CapturedTensor
impl UnwindSafe for CapturedTensor
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